@memberjunction/ng-core-entity-forms 2.103.0 → 2.105.0
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/custom/AIAgents/agent-permissions-dialog.component.d.ts +60 -0
- package/dist/lib/custom/AIAgents/agent-permissions-dialog.component.d.ts.map +1 -0
- package/dist/lib/custom/AIAgents/agent-permissions-dialog.component.js +790 -0
- package/dist/lib/custom/AIAgents/agent-permissions-dialog.component.js.map +1 -0
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +5 -0
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +457 -433
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +218 -190
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
- package/dist/lib/custom/custom-forms.module.d.ts +45 -44
- package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
- package/dist/lib/custom/custom-forms.module.js +3 -0
- package/dist/lib/custom/custom-forms.module.js.map +1 -1
- package/dist/lib/generated/Entities/AIAgent/aiagent.form.component.js +46 -16
- package/dist/lib/generated/Entities/AIAgent/aiagent.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIAgent/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIAgent/sections/details.component.js +53 -4
- package/dist/lib/generated/Entities/AIAgent/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIAgentArtifactType/aiagentartifacttype.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/AIAgentArtifactType/aiagentartifacttype.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/AIAgentArtifactType/aiagentartifacttype.form.component.js +59 -0
- package/dist/lib/generated/Entities/AIAgentArtifactType/aiagentartifacttype.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/AIAgentArtifactType/sections/details.component.d.ts +11 -0
- package/dist/lib/generated/Entities/AIAgentArtifactType/sections/details.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/AIAgentArtifactType/sections/details.component.js +120 -0
- package/dist/lib/generated/Entities/AIAgentArtifactType/sections/details.component.js.map +1 -0
- package/dist/lib/generated/Entities/AIAgentPermission/aiagentpermission.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/AIAgentPermission/aiagentpermission.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/AIAgentPermission/aiagentpermission.form.component.js +59 -0
- package/dist/lib/generated/Entities/AIAgentPermission/aiagentpermission.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/AIAgentPermission/sections/details.component.d.ts +11 -0
- package/dist/lib/generated/Entities/AIAgentPermission/sections/details.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/AIAgentPermission/sections/details.component.js +176 -0
- package/dist/lib/generated/Entities/AIAgentPermission/sections/details.component.js.map +1 -0
- package/dist/lib/generated/Entities/AIAgentRun/aiagentrun.form.component.js +6 -6
- package/dist/lib/generated/Entities/AIAgentRun/aiagentrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIAgentRun/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIAgentRun/sections/details.component.js +22 -4
- package/dist/lib/generated/Entities/AIAgentRun/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIAgentRunStep/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIAgentRunStep/sections/details.component.js +14 -5
- package/dist/lib/generated/Entities/AIAgentRunStep/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIConfiguration/aiconfiguration.form.component.js +6 -6
- package/dist/lib/generated/Entities/AIConfiguration/aiconfiguration.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIPrompt/aiprompt.form.component.js +6 -6
- package/dist/lib/generated/Entities/AIPrompt/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIPrompt/sections/details.component.js +16 -7
- package/dist/lib/generated/Entities/AIPrompt/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIPromptCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIPromptCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/AIPromptCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIPromptRun/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIPromptRun/sections/details.component.js +22 -4
- package/dist/lib/generated/Entities/AIPromptRun/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIVendor/aivendor.form.component.js +6 -6
- package/dist/lib/generated/Entities/AIVendor/aivendor.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/Action/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/Action/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/Action/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ActionCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ActionCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/ActionCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ArtifactType/artifacttype.form.component.js +34 -4
- package/dist/lib/generated/Entities/ArtifactType/artifacttype.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/ArtifactType/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ArtifactType/sections/details.component.js +51 -4
- package/dist/lib/generated/Entities/ArtifactType/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ArtifactVersion/artifactversion.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ArtifactVersion/artifactversion.form.component.js +29 -8
- package/dist/lib/generated/Entities/ArtifactVersion/artifactversion.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/ArtifactVersion/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ArtifactVersion/sections/details.component.js +31 -4
- package/dist/lib/generated/Entities/ArtifactVersion/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/artifactversionattribute.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/artifactversionattribute.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/artifactversionattribute.form.component.js +59 -0
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/artifactversionattribute.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/sections/details.component.d.ts +11 -0
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/sections/details.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/sections/details.component.js +127 -0
- package/dist/lib/generated/Entities/ArtifactVersionAttribute/sections/details.component.js.map +1 -0
- package/dist/lib/generated/Entities/AuditLogType/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AuditLogType/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/AuditLogType/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/Authorization/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/Authorization/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/Authorization/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/Collection/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/Collection/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/Collection/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ConversationDetail/conversationdetail.form.component.js +25 -5
- package/dist/lib/generated/Entities/ConversationDetail/conversationdetail.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/ConversationDetail/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ConversationDetail/sections/details.component.js +53 -4
- package/dist/lib/generated/Entities/ConversationDetail/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ConversationDetailArtifact/conversationdetailartifact.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/ConversationDetailArtifact/conversationdetailartifact.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/ConversationDetailArtifact/conversationdetailartifact.form.component.js +59 -0
- package/dist/lib/generated/Entities/ConversationDetailArtifact/conversationdetailartifact.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/ConversationDetailArtifact/sections/details.component.d.ts +11 -0
- package/dist/lib/generated/Entities/ConversationDetailArtifact/sections/details.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/ConversationDetailArtifact/sections/details.component.js +111 -0
- package/dist/lib/generated/Entities/ConversationDetailArtifact/sections/details.component.js.map +1 -0
- package/dist/lib/generated/Entities/DashboardCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/DashboardCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/DashboardCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/Entity/entity.form.component.js +7 -7
- package/dist/lib/generated/Entities/Entity/entity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/FileCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/FileCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/FileCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/GeneratedCodeCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/GeneratedCodeCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/GeneratedCodeCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ListCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ListCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/ListCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/Project/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/Project/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/Project/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/QueryCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/QueryCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/QueryCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/ReportCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ReportCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/ReportCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/Role/role.form.component.js +13 -3
- package/dist/lib/generated/Entities/Role/role.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/Skill/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/Skill/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/Skill/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/Tag/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/Tag/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/Tag/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/Task/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/Task/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/Task/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/TemplateCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/TemplateCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/TemplateCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/User/user.form.component.js +32 -12
- package/dist/lib/generated/Entities/User/user.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/UserViewCategory/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/UserViewCategory/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/UserViewCategory/sections/details.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +342 -329
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +287 -198
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/package.json +15 -15
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
import { Component, ViewChild } from '@angular/core';
|
|
2
|
+
import { Metadata, RunView } from '@memberjunction/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@progress/kendo-angular-dialog";
|
|
5
|
+
import * as i2 from "@memberjunction/ng-shared";
|
|
6
|
+
import * as i3 from "@angular/common";
|
|
7
|
+
import * as i4 from "@angular/forms";
|
|
8
|
+
import * as i5 from "@progress/kendo-angular-grid";
|
|
9
|
+
import * as i6 from "@progress/kendo-angular-inputs";
|
|
10
|
+
import * as i7 from "@progress/kendo-angular-dropdowns";
|
|
11
|
+
import * as i8 from "@progress/kendo-angular-buttons";
|
|
12
|
+
const _c0 = ["grid"];
|
|
13
|
+
function AgentPermissionsDialogComponent_p_6_Template(rf, ctx) { if (rf & 1) {
|
|
14
|
+
i0.ɵɵelementStart(0, "p", 19);
|
|
15
|
+
i0.ɵɵtext(1);
|
|
16
|
+
i0.ɵɵelementEnd();
|
|
17
|
+
} if (rf & 2) {
|
|
18
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
19
|
+
i0.ɵɵadvance();
|
|
20
|
+
i0.ɵɵtextInterpolate(ctx_r1.agent.Description);
|
|
21
|
+
} }
|
|
22
|
+
function AgentPermissionsDialogComponent_div_14_div_14_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
24
|
+
i0.ɵɵelementStart(0, "div", 22)(1, "label");
|
|
25
|
+
i0.ɵɵtext(2, "User:");
|
|
26
|
+
i0.ɵɵelementEnd();
|
|
27
|
+
i0.ɵɵelementStart(3, "kendo-dropdownlist", 40);
|
|
28
|
+
i0.ɵɵtwoWayListener("valueChange", function AgentPermissionsDialogComponent_div_14_div_14_Template_kendo_dropdownlist_valueChange_3_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedUserId, $event) || (ctx_r1.selectedUserId = $event); return i0.ɵɵresetView($event); });
|
|
29
|
+
i0.ɵɵelementEnd()();
|
|
30
|
+
} if (rf & 2) {
|
|
31
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
32
|
+
i0.ɵɵadvance(3);
|
|
33
|
+
i0.ɵɵproperty("data", ctx_r1.users)("textField", "Name")("valueField", "ID");
|
|
34
|
+
i0.ɵɵtwoWayProperty("value", ctx_r1.selectedUserId);
|
|
35
|
+
i0.ɵɵproperty("filterable", true)("loading", ctx_r1.loadingUsers);
|
|
36
|
+
} }
|
|
37
|
+
function AgentPermissionsDialogComponent_div_14_div_15_Template(rf, ctx) { if (rf & 1) {
|
|
38
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
39
|
+
i0.ɵɵelementStart(0, "div", 22)(1, "label");
|
|
40
|
+
i0.ɵɵtext(2, "Role:");
|
|
41
|
+
i0.ɵɵelementEnd();
|
|
42
|
+
i0.ɵɵelementStart(3, "kendo-dropdownlist", 41);
|
|
43
|
+
i0.ɵɵtwoWayListener("valueChange", function AgentPermissionsDialogComponent_div_14_div_15_Template_kendo_dropdownlist_valueChange_3_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedRoleId, $event) || (ctx_r1.selectedRoleId = $event); return i0.ɵɵresetView($event); });
|
|
44
|
+
i0.ɵɵelementEnd()();
|
|
45
|
+
} if (rf & 2) {
|
|
46
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
47
|
+
i0.ɵɵadvance(3);
|
|
48
|
+
i0.ɵɵproperty("data", ctx_r1.roles)("textField", "Name")("valueField", "ID");
|
|
49
|
+
i0.ɵɵtwoWayProperty("value", ctx_r1.selectedRoleId);
|
|
50
|
+
i0.ɵɵproperty("filterable", true)("loading", ctx_r1.loadingRoles);
|
|
51
|
+
} }
|
|
52
|
+
function AgentPermissionsDialogComponent_div_14_Template(rf, ctx) { if (rf & 1) {
|
|
53
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
54
|
+
i0.ɵɵelementStart(0, "div", 20)(1, "h4");
|
|
55
|
+
i0.ɵɵtext(2);
|
|
56
|
+
i0.ɵɵelementEnd();
|
|
57
|
+
i0.ɵɵelementStart(3, "div", 21)(4, "div", 22)(5, "label");
|
|
58
|
+
i0.ɵɵtext(6, "Grant To:");
|
|
59
|
+
i0.ɵɵelementEnd();
|
|
60
|
+
i0.ɵɵelementStart(7, "kendo-buttongroup", 23)(8, "button", 24);
|
|
61
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_div_14_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); ctx_r1.grantType = "user"; ctx_r1.selectedRoleId = null; return i0.ɵɵresetView(ctx_r1.selectedUserId = null); });
|
|
62
|
+
i0.ɵɵelement(9, "i", 25);
|
|
63
|
+
i0.ɵɵtext(10, " User ");
|
|
64
|
+
i0.ɵɵelementEnd();
|
|
65
|
+
i0.ɵɵelementStart(11, "button", 24);
|
|
66
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_div_14_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); ctx_r1.grantType = "role"; ctx_r1.selectedRoleId = null; return i0.ɵɵresetView(ctx_r1.selectedUserId = null); });
|
|
67
|
+
i0.ɵɵelement(12, "i", 26);
|
|
68
|
+
i0.ɵɵtext(13, " Role ");
|
|
69
|
+
i0.ɵɵelementEnd()()();
|
|
70
|
+
i0.ɵɵtemplate(14, AgentPermissionsDialogComponent_div_14_div_14_Template, 4, 6, "div", 27)(15, AgentPermissionsDialogComponent_div_14_div_15_Template, 4, 6, "div", 27);
|
|
71
|
+
i0.ɵɵelementEnd();
|
|
72
|
+
i0.ɵɵelementStart(16, "div", 21)(17, "div", 28)(18, "label", 29)(19, "input", 30);
|
|
73
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AgentPermissionsDialogComponent_div_14_Template_input_ngModelChange_19_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.newPermission.CanView, $event) || (ctx_r1.newPermission.CanView = $event); return i0.ɵɵresetView($event); });
|
|
74
|
+
i0.ɵɵelementEnd();
|
|
75
|
+
i0.ɵɵelementStart(20, "span");
|
|
76
|
+
i0.ɵɵelement(21, "i", 31);
|
|
77
|
+
i0.ɵɵtext(22, " View ");
|
|
78
|
+
i0.ɵɵelementStart(23, "small");
|
|
79
|
+
i0.ɵɵtext(24, "See agent configuration");
|
|
80
|
+
i0.ɵɵelementEnd()()();
|
|
81
|
+
i0.ɵɵelementStart(25, "label", 29)(26, "input", 32);
|
|
82
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AgentPermissionsDialogComponent_div_14_Template_input_ngModelChange_26_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.newPermission.CanRun, $event) || (ctx_r1.newPermission.CanRun = $event); return i0.ɵɵresetView($event); });
|
|
83
|
+
i0.ɵɵlistener("change", function AgentPermissionsDialogComponent_div_14_Template_input_change_26_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onPermissionChange("run")); });
|
|
84
|
+
i0.ɵɵelementEnd();
|
|
85
|
+
i0.ɵɵelementStart(27, "span");
|
|
86
|
+
i0.ɵɵelement(28, "i", 33);
|
|
87
|
+
i0.ɵɵtext(29, " Run ");
|
|
88
|
+
i0.ɵɵelementStart(30, "small");
|
|
89
|
+
i0.ɵɵtext(31, "Execute the agent");
|
|
90
|
+
i0.ɵɵelementEnd()()();
|
|
91
|
+
i0.ɵɵelementStart(32, "label", 29)(33, "input", 32);
|
|
92
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AgentPermissionsDialogComponent_div_14_Template_input_ngModelChange_33_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.newPermission.CanEdit, $event) || (ctx_r1.newPermission.CanEdit = $event); return i0.ɵɵresetView($event); });
|
|
93
|
+
i0.ɵɵlistener("change", function AgentPermissionsDialogComponent_div_14_Template_input_change_33_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onPermissionChange("edit")); });
|
|
94
|
+
i0.ɵɵelementEnd();
|
|
95
|
+
i0.ɵɵelementStart(34, "span");
|
|
96
|
+
i0.ɵɵelement(35, "i", 34);
|
|
97
|
+
i0.ɵɵtext(36, " Edit ");
|
|
98
|
+
i0.ɵɵelementStart(37, "small");
|
|
99
|
+
i0.ɵɵtext(38, "Modify configuration");
|
|
100
|
+
i0.ɵɵelementEnd()()();
|
|
101
|
+
i0.ɵɵelementStart(39, "label", 29)(40, "input", 35);
|
|
102
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AgentPermissionsDialogComponent_div_14_Template_input_ngModelChange_40_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.newPermission.CanDelete, $event) || (ctx_r1.newPermission.CanDelete = $event); return i0.ɵɵresetView($event); });
|
|
103
|
+
i0.ɵɵlistener("change", function AgentPermissionsDialogComponent_div_14_Template_input_change_40_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onPermissionChange("delete")); });
|
|
104
|
+
i0.ɵɵelementEnd();
|
|
105
|
+
i0.ɵɵelementStart(41, "span");
|
|
106
|
+
i0.ɵɵelement(42, "i", 36);
|
|
107
|
+
i0.ɵɵtext(43, " Delete ");
|
|
108
|
+
i0.ɵɵelementStart(44, "small");
|
|
109
|
+
i0.ɵɵtext(45, "Remove the agent");
|
|
110
|
+
i0.ɵɵelementEnd()()()()();
|
|
111
|
+
i0.ɵɵelementStart(46, "div", 21)(47, "div", 37)(48, "label");
|
|
112
|
+
i0.ɵɵtext(49, "Comments (optional):");
|
|
113
|
+
i0.ɵɵelementEnd();
|
|
114
|
+
i0.ɵɵelementStart(50, "textarea", 38);
|
|
115
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AgentPermissionsDialogComponent_div_14_Template_textarea_ngModelChange_50_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.newPermission.Comments, $event) || (ctx_r1.newPermission.Comments = $event); return i0.ɵɵresetView($event); });
|
|
116
|
+
i0.ɵɵtext(51, " ");
|
|
117
|
+
i0.ɵɵelementEnd()()();
|
|
118
|
+
i0.ɵɵelementStart(52, "div", 39)(53, "button", 18);
|
|
119
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_div_14_Template_button_click_53_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.cancelEdit()); });
|
|
120
|
+
i0.ɵɵtext(54, "Cancel");
|
|
121
|
+
i0.ɵɵelementEnd();
|
|
122
|
+
i0.ɵɵelementStart(55, "button", 8);
|
|
123
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_div_14_Template_button_click_55_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.savePermission()); });
|
|
124
|
+
i0.ɵɵtext(56);
|
|
125
|
+
i0.ɵɵelementEnd()()();
|
|
126
|
+
} if (rf & 2) {
|
|
127
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
128
|
+
i0.ɵɵadvance(2);
|
|
129
|
+
i0.ɵɵtextInterpolate(ctx_r1.editingPermission ? "Edit Permission" : "Add New Permission");
|
|
130
|
+
i0.ɵɵadvance(5);
|
|
131
|
+
i0.ɵɵproperty("selection", "single");
|
|
132
|
+
i0.ɵɵadvance();
|
|
133
|
+
i0.ɵɵproperty("toggleable", true)("selected", ctx_r1.grantType === "user");
|
|
134
|
+
i0.ɵɵadvance(3);
|
|
135
|
+
i0.ɵɵproperty("toggleable", true)("selected", ctx_r1.grantType === "role");
|
|
136
|
+
i0.ɵɵadvance(3);
|
|
137
|
+
i0.ɵɵproperty("ngIf", ctx_r1.grantType === "user");
|
|
138
|
+
i0.ɵɵadvance();
|
|
139
|
+
i0.ɵɵproperty("ngIf", ctx_r1.grantType === "role");
|
|
140
|
+
i0.ɵɵadvance(4);
|
|
141
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newPermission.CanView);
|
|
142
|
+
i0.ɵɵproperty("disabled", ctx_r1.newPermission.CanRun || ctx_r1.newPermission.CanEdit || ctx_r1.newPermission.CanDelete);
|
|
143
|
+
i0.ɵɵadvance(7);
|
|
144
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newPermission.CanRun);
|
|
145
|
+
i0.ɵɵproperty("disabled", ctx_r1.newPermission.CanEdit || ctx_r1.newPermission.CanDelete);
|
|
146
|
+
i0.ɵɵadvance(7);
|
|
147
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newPermission.CanEdit);
|
|
148
|
+
i0.ɵɵproperty("disabled", ctx_r1.newPermission.CanDelete);
|
|
149
|
+
i0.ɵɵadvance(7);
|
|
150
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newPermission.CanDelete);
|
|
151
|
+
i0.ɵɵadvance(10);
|
|
152
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newPermission.Comments);
|
|
153
|
+
i0.ɵɵadvance(5);
|
|
154
|
+
i0.ɵɵproperty("disabled", !ctx_r1.canSavePermission());
|
|
155
|
+
i0.ɵɵadvance();
|
|
156
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.editingPermission ? "Update" : "Add", " ");
|
|
157
|
+
} }
|
|
158
|
+
function AgentPermissionsDialogComponent_ng_template_18_Template(rf, ctx) { if (rf & 1) {
|
|
159
|
+
i0.ɵɵelementStart(0, "div", 42);
|
|
160
|
+
i0.ɵɵelement(1, "i", 43);
|
|
161
|
+
i0.ɵɵelementStart(2, "span");
|
|
162
|
+
i0.ɵɵtext(3);
|
|
163
|
+
i0.ɵɵelementEnd()();
|
|
164
|
+
} if (rf & 2) {
|
|
165
|
+
const dataItem_r6 = ctx.$implicit;
|
|
166
|
+
i0.ɵɵadvance();
|
|
167
|
+
i0.ɵɵclassProp("fa-user", dataItem_r6.UserID)("fa-users", dataItem_r6.RoleID);
|
|
168
|
+
i0.ɵɵadvance(2);
|
|
169
|
+
i0.ɵɵtextInterpolate(dataItem_r6.GrantedToName);
|
|
170
|
+
} }
|
|
171
|
+
function AgentPermissionsDialogComponent_ng_template_20_Template(rf, ctx) { if (rf & 1) {
|
|
172
|
+
i0.ɵɵelementStart(0, "span", 44);
|
|
173
|
+
i0.ɵɵtext(1);
|
|
174
|
+
i0.ɵɵelementEnd();
|
|
175
|
+
} if (rf & 2) {
|
|
176
|
+
const dataItem_r7 = ctx.$implicit;
|
|
177
|
+
i0.ɵɵclassProp("user", dataItem_r7.UserID)("role", dataItem_r7.RoleID);
|
|
178
|
+
i0.ɵɵadvance();
|
|
179
|
+
i0.ɵɵtextInterpolate1(" ", dataItem_r7.UserID ? "User" : "Role", " ");
|
|
180
|
+
} }
|
|
181
|
+
function AgentPermissionsDialogComponent_ng_template_22_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
182
|
+
i0.ɵɵelementStart(0, "span", 50);
|
|
183
|
+
i0.ɵɵelement(1, "i", 31);
|
|
184
|
+
i0.ɵɵtext(2, " View ");
|
|
185
|
+
i0.ɵɵelementEnd();
|
|
186
|
+
} }
|
|
187
|
+
function AgentPermissionsDialogComponent_ng_template_22_span_2_Template(rf, ctx) { if (rf & 1) {
|
|
188
|
+
i0.ɵɵelementStart(0, "span", 51);
|
|
189
|
+
i0.ɵɵelement(1, "i", 33);
|
|
190
|
+
i0.ɵɵtext(2, " Run ");
|
|
191
|
+
i0.ɵɵelementEnd();
|
|
192
|
+
} }
|
|
193
|
+
function AgentPermissionsDialogComponent_ng_template_22_span_3_Template(rf, ctx) { if (rf & 1) {
|
|
194
|
+
i0.ɵɵelementStart(0, "span", 52);
|
|
195
|
+
i0.ɵɵelement(1, "i", 34);
|
|
196
|
+
i0.ɵɵtext(2, " Edit ");
|
|
197
|
+
i0.ɵɵelementEnd();
|
|
198
|
+
} }
|
|
199
|
+
function AgentPermissionsDialogComponent_ng_template_22_span_4_Template(rf, ctx) { if (rf & 1) {
|
|
200
|
+
i0.ɵɵelementStart(0, "span", 53);
|
|
201
|
+
i0.ɵɵelement(1, "i", 36);
|
|
202
|
+
i0.ɵɵtext(2, " Delete ");
|
|
203
|
+
i0.ɵɵelementEnd();
|
|
204
|
+
} }
|
|
205
|
+
function AgentPermissionsDialogComponent_ng_template_22_Template(rf, ctx) { if (rf & 1) {
|
|
206
|
+
i0.ɵɵelementStart(0, "div", 45);
|
|
207
|
+
i0.ɵɵtemplate(1, AgentPermissionsDialogComponent_ng_template_22_span_1_Template, 3, 0, "span", 46)(2, AgentPermissionsDialogComponent_ng_template_22_span_2_Template, 3, 0, "span", 47)(3, AgentPermissionsDialogComponent_ng_template_22_span_3_Template, 3, 0, "span", 48)(4, AgentPermissionsDialogComponent_ng_template_22_span_4_Template, 3, 0, "span", 49);
|
|
208
|
+
i0.ɵɵelementEnd();
|
|
209
|
+
} if (rf & 2) {
|
|
210
|
+
const dataItem_r8 = ctx.$implicit;
|
|
211
|
+
i0.ɵɵadvance();
|
|
212
|
+
i0.ɵɵproperty("ngIf", dataItem_r8.EffectiveCanView);
|
|
213
|
+
i0.ɵɵadvance();
|
|
214
|
+
i0.ɵɵproperty("ngIf", dataItem_r8.EffectiveCanRun);
|
|
215
|
+
i0.ɵɵadvance();
|
|
216
|
+
i0.ɵɵproperty("ngIf", dataItem_r8.EffectiveCanEdit);
|
|
217
|
+
i0.ɵɵadvance();
|
|
218
|
+
i0.ɵɵproperty("ngIf", dataItem_r8.EffectiveCanDelete);
|
|
219
|
+
} }
|
|
220
|
+
function AgentPermissionsDialogComponent_ng_template_24_Template(rf, ctx) { if (rf & 1) {
|
|
221
|
+
i0.ɵɵelementStart(0, "span", 54);
|
|
222
|
+
i0.ɵɵtext(1);
|
|
223
|
+
i0.ɵɵelementEnd();
|
|
224
|
+
} if (rf & 2) {
|
|
225
|
+
const dataItem_r9 = ctx.$implicit;
|
|
226
|
+
i0.ɵɵadvance();
|
|
227
|
+
i0.ɵɵtextInterpolate(dataItem_r9.Comments || "-");
|
|
228
|
+
} }
|
|
229
|
+
function AgentPermissionsDialogComponent_ng_template_26_Template(rf, ctx) { if (rf & 1) {
|
|
230
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
231
|
+
i0.ɵɵelementStart(0, "div", 55)(1, "button", 56);
|
|
232
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_ng_template_26_Template_button_click_1_listener() { const dataItem_r11 = i0.ɵɵrestoreView(_r10).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.editPermission(dataItem_r11)); });
|
|
233
|
+
i0.ɵɵelement(2, "i", 34);
|
|
234
|
+
i0.ɵɵelementEnd();
|
|
235
|
+
i0.ɵɵelementStart(3, "button", 57);
|
|
236
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_ng_template_26_Template_button_click_3_listener() { const dataItem_r11 = i0.ɵɵrestoreView(_r10).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.deletePermission(dataItem_r11)); });
|
|
237
|
+
i0.ɵɵelement(4, "i", 36);
|
|
238
|
+
i0.ɵɵelementEnd()();
|
|
239
|
+
} }
|
|
240
|
+
/**
|
|
241
|
+
* Dialog component for managing AI Agent permissions.
|
|
242
|
+
* Allows viewing, adding, editing, and removing permission records for an agent.
|
|
243
|
+
*/
|
|
244
|
+
export class AgentPermissionsDialogComponent {
|
|
245
|
+
get dialogTitle() {
|
|
246
|
+
return `Manage Permissions: ${this.agent?.Name || 'Agent'}`;
|
|
247
|
+
}
|
|
248
|
+
constructor(dialogRef, sharedService) {
|
|
249
|
+
this.dialogRef = dialogRef;
|
|
250
|
+
this.sharedService = sharedService;
|
|
251
|
+
this.permissions = [];
|
|
252
|
+
this.users = [];
|
|
253
|
+
this.roles = [];
|
|
254
|
+
this.gridData = { data: [], total: 0 };
|
|
255
|
+
this.pageSize = 10;
|
|
256
|
+
this.skip = 0;
|
|
257
|
+
this.loading = false;
|
|
258
|
+
this.loadingUsers = false;
|
|
259
|
+
this.loadingRoles = false;
|
|
260
|
+
this.isAddingPermission = false;
|
|
261
|
+
this.editingPermission = null;
|
|
262
|
+
this.grantType = 'user';
|
|
263
|
+
this.selectedUserId = null;
|
|
264
|
+
this.selectedRoleId = null;
|
|
265
|
+
this.ownerName = null;
|
|
266
|
+
this.newPermission = {
|
|
267
|
+
CanView: false,
|
|
268
|
+
CanRun: false,
|
|
269
|
+
CanEdit: false,
|
|
270
|
+
CanDelete: false,
|
|
271
|
+
Comments: ''
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
async ngOnInit() {
|
|
275
|
+
await this.loadData();
|
|
276
|
+
}
|
|
277
|
+
async loadData() {
|
|
278
|
+
this.loading = true;
|
|
279
|
+
try {
|
|
280
|
+
await Promise.all([
|
|
281
|
+
this.loadPermissions(),
|
|
282
|
+
this.loadUsers(),
|
|
283
|
+
this.loadRoles(),
|
|
284
|
+
this.loadOwnerName()
|
|
285
|
+
]);
|
|
286
|
+
}
|
|
287
|
+
finally {
|
|
288
|
+
this.loading = false;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
async loadPermissions() {
|
|
292
|
+
const rv = new RunView();
|
|
293
|
+
const result = await rv.RunView({
|
|
294
|
+
EntityName: 'MJ: AI Agent Permissions',
|
|
295
|
+
ExtraFilter: `AgentID='${this.agent.ID}'`,
|
|
296
|
+
ResultType: 'entity_object'
|
|
297
|
+
});
|
|
298
|
+
if (result.Success && result.Results) {
|
|
299
|
+
this.permissions = result.Results;
|
|
300
|
+
this.updateGridData();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async loadUsers() {
|
|
304
|
+
this.loadingUsers = true;
|
|
305
|
+
try {
|
|
306
|
+
const rv = new RunView();
|
|
307
|
+
const result = await rv.RunView({
|
|
308
|
+
EntityName: 'Users',
|
|
309
|
+
ExtraFilter: 'IsActive=1',
|
|
310
|
+
OrderBy: 'Name',
|
|
311
|
+
ResultType: 'entity_object'
|
|
312
|
+
});
|
|
313
|
+
if (result.Success && result.Results) {
|
|
314
|
+
this.users = result.Results;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
finally {
|
|
318
|
+
this.loadingUsers = false;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
async loadRoles() {
|
|
322
|
+
this.loadingRoles = true;
|
|
323
|
+
try {
|
|
324
|
+
const md = new Metadata();
|
|
325
|
+
this.roles = md.Roles;
|
|
326
|
+
}
|
|
327
|
+
finally {
|
|
328
|
+
this.loadingRoles = false;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
async loadOwnerName() {
|
|
332
|
+
if (!this.agent.OwnerUserID) {
|
|
333
|
+
this.ownerName = 'Not Set';
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
const user = this.users.find(u => u.ID === this.agent.OwnerUserID);
|
|
337
|
+
if (user) {
|
|
338
|
+
this.ownerName = user.Name;
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
// User might not be in the active users list, load separately
|
|
342
|
+
const md = new Metadata();
|
|
343
|
+
const userEntity = await md.GetEntityObject('Users');
|
|
344
|
+
const loaded = await userEntity.Load(this.agent.OwnerUserID);
|
|
345
|
+
this.ownerName = loaded ? userEntity.Name : 'Unknown';
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
updateGridData() {
|
|
349
|
+
// Enrich permissions with display data
|
|
350
|
+
const enrichedData = this.permissions.map(p => {
|
|
351
|
+
const grantedToName = p.UserID
|
|
352
|
+
? this.users.find(u => u.ID === p.UserID)?.Name || 'Unknown User'
|
|
353
|
+
: this.roles.find(r => r.ID === p.RoleID)?.Name || 'Unknown Role';
|
|
354
|
+
// Calculate effective permissions with hierarchy
|
|
355
|
+
const effectiveCanDelete = p.CanDelete;
|
|
356
|
+
const effectiveCanEdit = p.CanDelete || p.CanEdit;
|
|
357
|
+
const effectiveCanRun = p.CanDelete || p.CanEdit || p.CanRun;
|
|
358
|
+
const effectiveCanView = p.CanDelete || p.CanEdit || p.CanRun || p.CanView;
|
|
359
|
+
return {
|
|
360
|
+
...p.GetAll(),
|
|
361
|
+
GrantedToName: grantedToName,
|
|
362
|
+
EffectiveCanView: effectiveCanView,
|
|
363
|
+
EffectiveCanRun: effectiveCanRun,
|
|
364
|
+
EffectiveCanEdit: effectiveCanEdit,
|
|
365
|
+
EffectiveCanDelete: effectiveCanDelete
|
|
366
|
+
};
|
|
367
|
+
});
|
|
368
|
+
this.gridData = {
|
|
369
|
+
data: enrichedData.slice(this.skip, this.skip + this.pageSize),
|
|
370
|
+
total: enrichedData.length
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
dataStateChange(state) {
|
|
374
|
+
this.skip = state.skip;
|
|
375
|
+
this.pageSize = state.take;
|
|
376
|
+
this.updateGridData();
|
|
377
|
+
}
|
|
378
|
+
addPermission() {
|
|
379
|
+
this.isAddingPermission = true;
|
|
380
|
+
this.editingPermission = null;
|
|
381
|
+
this.grantType = 'user';
|
|
382
|
+
this.selectedUserId = null;
|
|
383
|
+
this.selectedRoleId = null;
|
|
384
|
+
this.newPermission = {
|
|
385
|
+
CanView: false,
|
|
386
|
+
CanRun: false,
|
|
387
|
+
CanEdit: false,
|
|
388
|
+
CanDelete: false,
|
|
389
|
+
Comments: ''
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
editPermission(permission) {
|
|
393
|
+
this.editingPermission = this.permissions.find(p => p.ID === permission.ID) || null;
|
|
394
|
+
if (!this.editingPermission)
|
|
395
|
+
return;
|
|
396
|
+
this.isAddingPermission = true;
|
|
397
|
+
this.grantType = this.editingPermission.UserID ? 'user' : 'role';
|
|
398
|
+
this.selectedUserId = this.editingPermission.UserID || null;
|
|
399
|
+
this.selectedRoleId = this.editingPermission.RoleID || null;
|
|
400
|
+
this.newPermission = {
|
|
401
|
+
CanView: this.editingPermission.CanView || false,
|
|
402
|
+
CanRun: this.editingPermission.CanRun || false,
|
|
403
|
+
CanEdit: this.editingPermission.CanEdit || false,
|
|
404
|
+
CanDelete: this.editingPermission.CanDelete || false,
|
|
405
|
+
Comments: this.editingPermission.Comments || ''
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
async deletePermission(permission) {
|
|
409
|
+
if (!confirm('Are you sure you want to remove this permission?')) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const entity = this.permissions.find(p => p.ID === permission.ID);
|
|
413
|
+
if (!entity)
|
|
414
|
+
return;
|
|
415
|
+
const deleted = await entity.Delete();
|
|
416
|
+
if (deleted) {
|
|
417
|
+
await this.loadPermissions();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
cancelEdit() {
|
|
421
|
+
this.isAddingPermission = false;
|
|
422
|
+
this.editingPermission = null;
|
|
423
|
+
}
|
|
424
|
+
onPermissionChange(level) {
|
|
425
|
+
// Apply hierarchical logic
|
|
426
|
+
if (level === 'delete' && this.newPermission.CanDelete) {
|
|
427
|
+
this.newPermission.CanEdit = true;
|
|
428
|
+
this.newPermission.CanRun = true;
|
|
429
|
+
this.newPermission.CanView = true;
|
|
430
|
+
}
|
|
431
|
+
else if (level === 'edit' && this.newPermission.CanEdit) {
|
|
432
|
+
this.newPermission.CanRun = true;
|
|
433
|
+
this.newPermission.CanView = true;
|
|
434
|
+
}
|
|
435
|
+
else if (level === 'run' && this.newPermission.CanRun) {
|
|
436
|
+
this.newPermission.CanView = true;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
canSavePermission() {
|
|
440
|
+
// Must have selected user or role
|
|
441
|
+
if (this.grantType === 'user' && !this.selectedUserId)
|
|
442
|
+
return false;
|
|
443
|
+
if (this.grantType === 'role' && !this.selectedRoleId)
|
|
444
|
+
return false;
|
|
445
|
+
// Must have at least one permission checked
|
|
446
|
+
return this.newPermission.CanView || this.newPermission.CanRun ||
|
|
447
|
+
this.newPermission.CanEdit || this.newPermission.CanDelete;
|
|
448
|
+
}
|
|
449
|
+
async savePermission() {
|
|
450
|
+
if (!this.canSavePermission())
|
|
451
|
+
return;
|
|
452
|
+
try {
|
|
453
|
+
const md = new Metadata();
|
|
454
|
+
const entity = this.editingPermission ||
|
|
455
|
+
await md.GetEntityObject('MJ: AI Agent Permissions');
|
|
456
|
+
entity.AgentID = this.agent.ID;
|
|
457
|
+
entity.UserID = this.grantType === 'user' ? this.selectedUserId : null;
|
|
458
|
+
entity.RoleID = this.grantType === 'role' ? this.selectedRoleId : null;
|
|
459
|
+
entity.CanView = this.newPermission.CanView;
|
|
460
|
+
entity.CanRun = this.newPermission.CanRun;
|
|
461
|
+
entity.CanEdit = this.newPermission.CanEdit;
|
|
462
|
+
entity.CanDelete = this.newPermission.CanDelete;
|
|
463
|
+
entity.Comments = this.newPermission.Comments || null;
|
|
464
|
+
const saved = await entity.Save();
|
|
465
|
+
if (saved) {
|
|
466
|
+
this.isAddingPermission = false;
|
|
467
|
+
this.editingPermission = null;
|
|
468
|
+
await this.loadPermissions();
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
console.error('Failed to save permission');
|
|
472
|
+
alert('Failed to save permission. Please try again.');
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
catch (error) {
|
|
476
|
+
console.error('Error saving permission:', error);
|
|
477
|
+
alert('Error saving permission: ' + error.message);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
onCancel() {
|
|
481
|
+
this.dialogRef.close();
|
|
482
|
+
}
|
|
483
|
+
static { this.ɵfac = function AgentPermissionsDialogComponent_Factory(t) { return new (t || AgentPermissionsDialogComponent)(i0.ɵɵdirectiveInject(i1.DialogRef), i0.ɵɵdirectiveInject(i2.SharedService)); }; }
|
|
484
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AgentPermissionsDialogComponent, selectors: [["mj-agent-permissions-dialog"]], viewQuery: function AgentPermissionsDialogComponent_Query(rf, ctx) { if (rf & 1) {
|
|
485
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
486
|
+
} if (rf & 2) {
|
|
487
|
+
let _t;
|
|
488
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.grid = _t.first);
|
|
489
|
+
} }, decls: 30, vars: 21, consts: [["grid", ""], [3, "close", "title", "width", "height"], [1, "permissions-dialog-content"], [1, "dialog-header"], [1, "agent-info"], ["class", "agent-description", 4, "ngIf"], [1, "owner-info"], [1, "fas", "fa-crown"], ["kendoButton", "", "themeColor", "primary", 3, "click", "disabled"], [1, "fas", "fa-plus"], ["class", "permission-form", 4, "ngIf"], [3, "dataStateChange", "data", "pageSize", "skip", "pageable", "sortable", "filterable", "loading", "height"], ["field", "GrantedTo", "title", "Granted To", 3, "width"], ["kendoGridCellTemplate", ""], ["field", "Type", "title", "Type", 3, "width"], ["title", "Permissions", 3, "width"], ["field", "Comments", "title", "Comments", 3, "width"], ["title", "Actions", 3, "width"], ["kendoButton", "", 3, "click"], [1, "agent-description"], [1, "permission-form"], [1, "form-row"], [1, "form-field"], [3, "selection"], ["kendoButton", "", 3, "click", "toggleable", "selected"], [1, "fas", "fa-user"], [1, "fas", "fa-users"], ["class", "form-field", 4, "ngIf"], [1, "permissions-checkboxes"], [1, "permission-checkbox"], ["type", "checkbox", 3, "ngModelChange", "ngModel", "disabled"], [1, "fas", "fa-eye"], ["type", "checkbox", 3, "ngModelChange", "change", "ngModel", "disabled"], [1, "fas", "fa-play"], [1, "fas", "fa-edit"], ["type", "checkbox", 3, "ngModelChange", "change", "ngModel"], [1, "fas", "fa-trash"], [1, "form-field", "full-width"], ["kendoTextArea", "", "placeholder", "Why is this permission being granted?", "rows", "2", 3, "ngModelChange", "ngModel"], [1, "form-actions"], ["placeholder", "Select a user...", 3, "valueChange", "data", "textField", "valueField", "value", "filterable", "loading"], ["placeholder", "Select a role...", 3, "valueChange", "data", "textField", "valueField", "value", "filterable", "loading"], [1, "granted-to-cell"], [1, "fas"], [1, "type-badge"], [1, "permission-badges"], ["class", "permission-badge view", 4, "ngIf"], ["class", "permission-badge run", 4, "ngIf"], ["class", "permission-badge edit", 4, "ngIf"], ["class", "permission-badge delete", 4, "ngIf"], [1, "permission-badge", "view"], [1, "permission-badge", "run"], [1, "permission-badge", "edit"], [1, "permission-badge", "delete"], [1, "description-text"], [1, "grid-actions"], ["kendoButton", "", "fillMode", "flat", "size", "small", "title", "Edit", 3, "click"], ["kendoButton", "", "fillMode", "flat", "themeColor", "error", "size", "small", "title", "Delete", 3, "click"]], template: function AgentPermissionsDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
490
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
491
|
+
i0.ɵɵelementStart(0, "kendo-dialog", 1);
|
|
492
|
+
i0.ɵɵlistener("close", function AgentPermissionsDialogComponent_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onCancel()); });
|
|
493
|
+
i0.ɵɵelementStart(1, "div", 2)(2, "div", 3)(3, "div", 4)(4, "h3");
|
|
494
|
+
i0.ɵɵtext(5);
|
|
495
|
+
i0.ɵɵelementEnd();
|
|
496
|
+
i0.ɵɵtemplate(6, AgentPermissionsDialogComponent_p_6_Template, 2, 1, "p", 5);
|
|
497
|
+
i0.ɵɵelementStart(7, "div", 6);
|
|
498
|
+
i0.ɵɵelement(8, "i", 7);
|
|
499
|
+
i0.ɵɵelementStart(9, "span");
|
|
500
|
+
i0.ɵɵtext(10);
|
|
501
|
+
i0.ɵɵelementEnd()()();
|
|
502
|
+
i0.ɵɵelementStart(11, "button", 8);
|
|
503
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.addPermission()); });
|
|
504
|
+
i0.ɵɵelement(12, "i", 9);
|
|
505
|
+
i0.ɵɵtext(13, " Add Permission ");
|
|
506
|
+
i0.ɵɵelementEnd()();
|
|
507
|
+
i0.ɵɵtemplate(14, AgentPermissionsDialogComponent_div_14_Template, 57, 18, "div", 10);
|
|
508
|
+
i0.ɵɵelementStart(15, "kendo-grid", 11, 0);
|
|
509
|
+
i0.ɵɵlistener("dataStateChange", function AgentPermissionsDialogComponent_Template_kendo_grid_dataStateChange_15_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.dataStateChange($event)); });
|
|
510
|
+
i0.ɵɵelementStart(17, "kendo-grid-column", 12);
|
|
511
|
+
i0.ɵɵtemplate(18, AgentPermissionsDialogComponent_ng_template_18_Template, 4, 5, "ng-template", 13);
|
|
512
|
+
i0.ɵɵelementEnd();
|
|
513
|
+
i0.ɵɵelementStart(19, "kendo-grid-column", 14);
|
|
514
|
+
i0.ɵɵtemplate(20, AgentPermissionsDialogComponent_ng_template_20_Template, 2, 5, "ng-template", 13);
|
|
515
|
+
i0.ɵɵelementEnd();
|
|
516
|
+
i0.ɵɵelementStart(21, "kendo-grid-column", 15);
|
|
517
|
+
i0.ɵɵtemplate(22, AgentPermissionsDialogComponent_ng_template_22_Template, 5, 4, "ng-template", 13);
|
|
518
|
+
i0.ɵɵelementEnd();
|
|
519
|
+
i0.ɵɵelementStart(23, "kendo-grid-column", 16);
|
|
520
|
+
i0.ɵɵtemplate(24, AgentPermissionsDialogComponent_ng_template_24_Template, 2, 1, "ng-template", 13);
|
|
521
|
+
i0.ɵɵelementEnd();
|
|
522
|
+
i0.ɵɵelementStart(25, "kendo-grid-column", 17);
|
|
523
|
+
i0.ɵɵtemplate(26, AgentPermissionsDialogComponent_ng_template_26_Template, 5, 0, "ng-template", 13);
|
|
524
|
+
i0.ɵɵelementEnd()()();
|
|
525
|
+
i0.ɵɵelementStart(27, "kendo-dialog-actions")(28, "button", 18);
|
|
526
|
+
i0.ɵɵlistener("click", function AgentPermissionsDialogComponent_Template_button_click_28_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onCancel()); });
|
|
527
|
+
i0.ɵɵtext(29, "Close");
|
|
528
|
+
i0.ɵɵelementEnd()()();
|
|
529
|
+
} if (rf & 2) {
|
|
530
|
+
i0.ɵɵproperty("title", ctx.dialogTitle)("width", 900)("height", 600);
|
|
531
|
+
i0.ɵɵadvance(5);
|
|
532
|
+
i0.ɵɵtextInterpolate(ctx.agent.Name);
|
|
533
|
+
i0.ɵɵadvance();
|
|
534
|
+
i0.ɵɵproperty("ngIf", ctx.agent == null ? null : ctx.agent.Description);
|
|
535
|
+
i0.ɵɵadvance(4);
|
|
536
|
+
i0.ɵɵtextInterpolate1("Owner: ", ctx.ownerName || "Not Set", "");
|
|
537
|
+
i0.ɵɵadvance();
|
|
538
|
+
i0.ɵɵproperty("disabled", ctx.isAddingPermission);
|
|
539
|
+
i0.ɵɵadvance(3);
|
|
540
|
+
i0.ɵɵproperty("ngIf", ctx.isAddingPermission || ctx.editingPermission);
|
|
541
|
+
i0.ɵɵadvance();
|
|
542
|
+
i0.ɵɵproperty("data", ctx.gridData)("pageSize", ctx.pageSize)("skip", ctx.skip)("pageable", true)("sortable", true)("filterable", false)("loading", ctx.loading)("height", 400);
|
|
543
|
+
i0.ɵɵadvance(2);
|
|
544
|
+
i0.ɵɵproperty("width", 200);
|
|
545
|
+
i0.ɵɵadvance(2);
|
|
546
|
+
i0.ɵɵproperty("width", 80);
|
|
547
|
+
i0.ɵɵadvance(2);
|
|
548
|
+
i0.ɵɵproperty("width", 300);
|
|
549
|
+
i0.ɵɵadvance(2);
|
|
550
|
+
i0.ɵɵproperty("width", 150);
|
|
551
|
+
i0.ɵɵadvance(2);
|
|
552
|
+
i0.ɵɵproperty("width", 100);
|
|
553
|
+
} }, dependencies: [i3.NgIf, i4.DefaultValueAccessor, i4.CheckboxControlValueAccessor, i4.NgControlStatus, i4.NgModel, i1.DialogComponent, i1.DialogActionsComponent, i5.GridComponent, i5.ColumnComponent, i5.CellTemplateDirective, i6.TextAreaDirective, i7.DropDownListComponent, i8.ButtonGroupComponent, i8.ButtonComponent], styles: [".permissions-dialog-content[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 20px;\n }\n\n .dialog-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n padding-bottom: 15px;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .agent-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n color: #333;\n }\n\n .agent-description[_ngcontent-%COMP%] {\n margin: 0 0 8px 0;\n color: #666;\n font-size: 13px;\n }\n\n .owner-info[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n color: #666;\n font-size: 12px;\n }\n\n .owner-info[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #fbbf24;\n }\n\n .permission-form[_ngcontent-%COMP%] {\n background: #f9fafb;\n padding: 16px;\n border-radius: 6px;\n border: 1px solid #e0e0e0;\n }\n\n .permission-form[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] {\n margin: 0 0 16px 0;\n color: #333;\n }\n\n .form-row[_ngcontent-%COMP%] {\n display: flex;\n gap: 16px;\n margin-bottom: 16px;\n }\n\n .form-field[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 6px;\n }\n\n .form-field.full-width[_ngcontent-%COMP%] {\n flex: 1 1 100%;\n }\n\n .form-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-weight: 500;\n font-size: 13px;\n color: #555;\n }\n\n .permissions-checkboxes[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 12px;\n width: 100%;\n }\n\n .permission-checkbox[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n cursor: pointer;\n padding: 8px;\n border-radius: 4px;\n border: 1px solid #e0e0e0;\n background: white;\n }\n\n .permission-checkbox[_ngcontent-%COMP%]:hover {\n background: #f5f5f5;\n }\n\n .permission-checkbox[_ngcontent-%COMP%] input[type=\"checkbox\"][_ngcontent-%COMP%] {\n margin-top: 2px;\n }\n\n .permission-checkbox[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .permission-checkbox[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n margin-right: 4px;\n }\n\n .permission-checkbox[_ngcontent-%COMP%] small[_ngcontent-%COMP%] {\n color: #999;\n font-size: 11px;\n }\n\n .form-actions[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 8px;\n }\n\n .granted-to-cell[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .type-badge[_ngcontent-%COMP%] {\n display: inline-block;\n padding: 2px 8px;\n border-radius: 4px;\n font-size: 11px;\n font-weight: 500;\n text-transform: uppercase;\n }\n\n .type-badge.user[_ngcontent-%COMP%] {\n background: #dbeafe;\n color: #1e40af;\n }\n\n .type-badge.role[_ngcontent-%COMP%] {\n background: #f3e8ff;\n color: #6b21a8;\n }\n\n .permission-badges[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n }\n\n .permission-badge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 11px;\n font-weight: 500;\n }\n\n .permission-badge.view[_ngcontent-%COMP%] {\n background: #e0f2fe;\n color: #0369a1;\n }\n\n .permission-badge.run[_ngcontent-%COMP%] {\n background: #d1fae5;\n color: #065f46;\n }\n\n .permission-badge.edit[_ngcontent-%COMP%] {\n background: #fef3c7;\n color: #92400e;\n }\n\n .permission-badge.delete[_ngcontent-%COMP%] {\n background: #fee2e2;\n color: #991b1b;\n }\n\n .description-text[_ngcontent-%COMP%] {\n font-size: 12px;\n color: #666;\n }\n\n .grid-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 4px;\n }"] }); }
|
|
554
|
+
}
|
|
555
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AgentPermissionsDialogComponent, [{
|
|
556
|
+
type: Component,
|
|
557
|
+
args: [{ selector: 'mj-agent-permissions-dialog', template: `
|
|
558
|
+
<kendo-dialog
|
|
559
|
+
[title]="dialogTitle"
|
|
560
|
+
[width]="900"
|
|
561
|
+
[height]="600"
|
|
562
|
+
(close)="onCancel()">
|
|
563
|
+
|
|
564
|
+
<div class="permissions-dialog-content">
|
|
565
|
+
<!-- Header with agent info and add button -->
|
|
566
|
+
<div class="dialog-header">
|
|
567
|
+
<div class="agent-info">
|
|
568
|
+
<h3>{{ agent.Name }}</h3>
|
|
569
|
+
<p class="agent-description" *ngIf="agent?.Description">{{ agent.Description }}</p>
|
|
570
|
+
<div class="owner-info">
|
|
571
|
+
<i class="fas fa-crown"></i>
|
|
572
|
+
<span>Owner: {{ ownerName || 'Not Set' }}</span>
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
<button kendoButton
|
|
576
|
+
themeColor="primary"
|
|
577
|
+
[disabled]="isAddingPermission"
|
|
578
|
+
(click)="addPermission()">
|
|
579
|
+
<i class="fas fa-plus"></i> Add Permission
|
|
580
|
+
</button>
|
|
581
|
+
</div>
|
|
582
|
+
|
|
583
|
+
<!-- Add/Edit Permission Form -->
|
|
584
|
+
<div class="permission-form" *ngIf="isAddingPermission || editingPermission">
|
|
585
|
+
<h4>{{ editingPermission ? 'Edit Permission' : 'Add New Permission' }}</h4>
|
|
586
|
+
|
|
587
|
+
<div class="form-row">
|
|
588
|
+
<div class="form-field">
|
|
589
|
+
<label>Grant To:</label>
|
|
590
|
+
<kendo-buttongroup [selection]="'single'">
|
|
591
|
+
<button kendoButton
|
|
592
|
+
[toggleable]="true"
|
|
593
|
+
[selected]="grantType === 'user'"
|
|
594
|
+
(click)="grantType = 'user'; selectedRoleId = null; selectedUserId = null">
|
|
595
|
+
<i class="fas fa-user"></i> User
|
|
596
|
+
</button>
|
|
597
|
+
<button kendoButton
|
|
598
|
+
[toggleable]="true"
|
|
599
|
+
[selected]="grantType === 'role'"
|
|
600
|
+
(click)="grantType = 'role'; selectedRoleId = null; selectedUserId = null">
|
|
601
|
+
<i class="fas fa-users"></i> Role
|
|
602
|
+
</button>
|
|
603
|
+
</kendo-buttongroup>
|
|
604
|
+
</div>
|
|
605
|
+
|
|
606
|
+
<div class="form-field" *ngIf="grantType === 'user'">
|
|
607
|
+
<label>User:</label>
|
|
608
|
+
<kendo-dropdownlist
|
|
609
|
+
[data]="users"
|
|
610
|
+
[textField]="'Name'"
|
|
611
|
+
[valueField]="'ID'"
|
|
612
|
+
[(value)]="selectedUserId"
|
|
613
|
+
[filterable]="true"
|
|
614
|
+
[loading]="loadingUsers"
|
|
615
|
+
placeholder="Select a user...">
|
|
616
|
+
</kendo-dropdownlist>
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
<div class="form-field" *ngIf="grantType === 'role'">
|
|
620
|
+
<label>Role:</label>
|
|
621
|
+
<kendo-dropdownlist
|
|
622
|
+
[data]="roles"
|
|
623
|
+
[textField]="'Name'"
|
|
624
|
+
[valueField]="'ID'"
|
|
625
|
+
[(value)]="selectedRoleId"
|
|
626
|
+
[filterable]="true"
|
|
627
|
+
[loading]="loadingRoles"
|
|
628
|
+
placeholder="Select a role...">
|
|
629
|
+
</kendo-dropdownlist>
|
|
630
|
+
</div>
|
|
631
|
+
</div>
|
|
632
|
+
|
|
633
|
+
<div class="form-row">
|
|
634
|
+
<div class="permissions-checkboxes">
|
|
635
|
+
<label class="permission-checkbox">
|
|
636
|
+
<input type="checkbox"
|
|
637
|
+
[(ngModel)]="newPermission.CanView"
|
|
638
|
+
[disabled]="newPermission.CanRun || newPermission.CanEdit || newPermission.CanDelete">
|
|
639
|
+
<span>
|
|
640
|
+
<i class="fas fa-eye"></i> View
|
|
641
|
+
<small>See agent configuration</small>
|
|
642
|
+
</span>
|
|
643
|
+
</label>
|
|
644
|
+
|
|
645
|
+
<label class="permission-checkbox">
|
|
646
|
+
<input type="checkbox"
|
|
647
|
+
[(ngModel)]="newPermission.CanRun"
|
|
648
|
+
(change)="onPermissionChange('run')"
|
|
649
|
+
[disabled]="newPermission.CanEdit || newPermission.CanDelete">
|
|
650
|
+
<span>
|
|
651
|
+
<i class="fas fa-play"></i> Run
|
|
652
|
+
<small>Execute the agent</small>
|
|
653
|
+
</span>
|
|
654
|
+
</label>
|
|
655
|
+
|
|
656
|
+
<label class="permission-checkbox">
|
|
657
|
+
<input type="checkbox"
|
|
658
|
+
[(ngModel)]="newPermission.CanEdit"
|
|
659
|
+
(change)="onPermissionChange('edit')"
|
|
660
|
+
[disabled]="newPermission.CanDelete">
|
|
661
|
+
<span>
|
|
662
|
+
<i class="fas fa-edit"></i> Edit
|
|
663
|
+
<small>Modify configuration</small>
|
|
664
|
+
</span>
|
|
665
|
+
</label>
|
|
666
|
+
|
|
667
|
+
<label class="permission-checkbox">
|
|
668
|
+
<input type="checkbox"
|
|
669
|
+
[(ngModel)]="newPermission.CanDelete"
|
|
670
|
+
(change)="onPermissionChange('delete')">
|
|
671
|
+
<span>
|
|
672
|
+
<i class="fas fa-trash"></i> Delete
|
|
673
|
+
<small>Remove the agent</small>
|
|
674
|
+
</span>
|
|
675
|
+
</label>
|
|
676
|
+
</div>
|
|
677
|
+
</div>
|
|
678
|
+
|
|
679
|
+
<div class="form-row">
|
|
680
|
+
<div class="form-field full-width">
|
|
681
|
+
<label>Comments (optional):</label>
|
|
682
|
+
<textarea kendoTextArea
|
|
683
|
+
[(ngModel)]="newPermission.Comments"
|
|
684
|
+
placeholder="Why is this permission being granted?"
|
|
685
|
+
rows="2">
|
|
686
|
+
</textarea>
|
|
687
|
+
</div>
|
|
688
|
+
</div>
|
|
689
|
+
|
|
690
|
+
<div class="form-actions">
|
|
691
|
+
<button kendoButton (click)="cancelEdit()">Cancel</button>
|
|
692
|
+
<button kendoButton
|
|
693
|
+
themeColor="primary"
|
|
694
|
+
[disabled]="!canSavePermission()"
|
|
695
|
+
(click)="savePermission()">
|
|
696
|
+
{{ editingPermission ? 'Update' : 'Add' }}
|
|
697
|
+
</button>
|
|
698
|
+
</div>
|
|
699
|
+
</div>
|
|
700
|
+
|
|
701
|
+
<!-- Permissions Grid -->
|
|
702
|
+
<kendo-grid
|
|
703
|
+
#grid
|
|
704
|
+
[data]="gridData"
|
|
705
|
+
[pageSize]="pageSize"
|
|
706
|
+
[skip]="skip"
|
|
707
|
+
[pageable]="true"
|
|
708
|
+
[sortable]="true"
|
|
709
|
+
[filterable]="false"
|
|
710
|
+
[loading]="loading"
|
|
711
|
+
(dataStateChange)="dataStateChange($event)"
|
|
712
|
+
[height]="400">
|
|
713
|
+
|
|
714
|
+
<kendo-grid-column field="GrantedTo" title="Granted To" [width]="200">
|
|
715
|
+
<ng-template kendoGridCellTemplate let-dataItem>
|
|
716
|
+
<div class="granted-to-cell">
|
|
717
|
+
<i class="fas" [class.fa-user]="dataItem.UserID" [class.fa-users]="dataItem.RoleID"></i>
|
|
718
|
+
<span>{{ dataItem.GrantedToName }}</span>
|
|
719
|
+
</div>
|
|
720
|
+
</ng-template>
|
|
721
|
+
</kendo-grid-column>
|
|
722
|
+
|
|
723
|
+
<kendo-grid-column field="Type" title="Type" [width]="80">
|
|
724
|
+
<ng-template kendoGridCellTemplate let-dataItem>
|
|
725
|
+
<span class="type-badge" [class.user]="dataItem.UserID" [class.role]="dataItem.RoleID">
|
|
726
|
+
{{ dataItem.UserID ? 'User' : 'Role' }}
|
|
727
|
+
</span>
|
|
728
|
+
</ng-template>
|
|
729
|
+
</kendo-grid-column>
|
|
730
|
+
|
|
731
|
+
<kendo-grid-column title="Permissions" [width]="300">
|
|
732
|
+
<ng-template kendoGridCellTemplate let-dataItem>
|
|
733
|
+
<div class="permission-badges">
|
|
734
|
+
<span class="permission-badge view" *ngIf="dataItem.EffectiveCanView">
|
|
735
|
+
<i class="fas fa-eye"></i> View
|
|
736
|
+
</span>
|
|
737
|
+
<span class="permission-badge run" *ngIf="dataItem.EffectiveCanRun">
|
|
738
|
+
<i class="fas fa-play"></i> Run
|
|
739
|
+
</span>
|
|
740
|
+
<span class="permission-badge edit" *ngIf="dataItem.EffectiveCanEdit">
|
|
741
|
+
<i class="fas fa-edit"></i> Edit
|
|
742
|
+
</span>
|
|
743
|
+
<span class="permission-badge delete" *ngIf="dataItem.EffectiveCanDelete">
|
|
744
|
+
<i class="fas fa-trash"></i> Delete
|
|
745
|
+
</span>
|
|
746
|
+
</div>
|
|
747
|
+
</ng-template>
|
|
748
|
+
</kendo-grid-column>
|
|
749
|
+
|
|
750
|
+
<kendo-grid-column field="Comments" title="Comments" [width]="150">
|
|
751
|
+
<ng-template kendoGridCellTemplate let-dataItem>
|
|
752
|
+
<span class="description-text">{{ dataItem.Comments || '-' }}</span>
|
|
753
|
+
</ng-template>
|
|
754
|
+
</kendo-grid-column>
|
|
755
|
+
|
|
756
|
+
<kendo-grid-column title="Actions" [width]="100">
|
|
757
|
+
<ng-template kendoGridCellTemplate let-dataItem>
|
|
758
|
+
<div class="grid-actions">
|
|
759
|
+
<button kendoButton
|
|
760
|
+
fillMode="flat"
|
|
761
|
+
size="small"
|
|
762
|
+
title="Edit"
|
|
763
|
+
(click)="editPermission(dataItem)">
|
|
764
|
+
<i class="fas fa-edit"></i>
|
|
765
|
+
</button>
|
|
766
|
+
<button kendoButton
|
|
767
|
+
fillMode="flat"
|
|
768
|
+
themeColor="error"
|
|
769
|
+
size="small"
|
|
770
|
+
title="Delete"
|
|
771
|
+
(click)="deletePermission(dataItem)">
|
|
772
|
+
<i class="fas fa-trash"></i>
|
|
773
|
+
</button>
|
|
774
|
+
</div>
|
|
775
|
+
</ng-template>
|
|
776
|
+
</kendo-grid-column>
|
|
777
|
+
</kendo-grid>
|
|
778
|
+
</div>
|
|
779
|
+
|
|
780
|
+
<kendo-dialog-actions>
|
|
781
|
+
<button kendoButton (click)="onCancel()">Close</button>
|
|
782
|
+
</kendo-dialog-actions>
|
|
783
|
+
</kendo-dialog>
|
|
784
|
+
`, styles: ["\n .permissions-dialog-content {\n display: flex;\n flex-direction: column;\n gap: 20px;\n padding: 20px;\n }\n\n .dialog-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n padding-bottom: 15px;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .agent-info h3 {\n margin: 0 0 8px 0;\n color: #333;\n }\n\n .agent-description {\n margin: 0 0 8px 0;\n color: #666;\n font-size: 13px;\n }\n\n .owner-info {\n display: flex;\n align-items: center;\n gap: 6px;\n color: #666;\n font-size: 12px;\n }\n\n .owner-info i {\n color: #fbbf24;\n }\n\n .permission-form {\n background: #f9fafb;\n padding: 16px;\n border-radius: 6px;\n border: 1px solid #e0e0e0;\n }\n\n .permission-form h4 {\n margin: 0 0 16px 0;\n color: #333;\n }\n\n .form-row {\n display: flex;\n gap: 16px;\n margin-bottom: 16px;\n }\n\n .form-field {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 6px;\n }\n\n .form-field.full-width {\n flex: 1 1 100%;\n }\n\n .form-field label {\n font-weight: 500;\n font-size: 13px;\n color: #555;\n }\n\n .permissions-checkboxes {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 12px;\n width: 100%;\n }\n\n .permission-checkbox {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n cursor: pointer;\n padding: 8px;\n border-radius: 4px;\n border: 1px solid #e0e0e0;\n background: white;\n }\n\n .permission-checkbox:hover {\n background: #f5f5f5;\n }\n\n .permission-checkbox input[type=\"checkbox\"] {\n margin-top: 2px;\n }\n\n .permission-checkbox span {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .permission-checkbox span i {\n margin-right: 4px;\n }\n\n .permission-checkbox small {\n color: #999;\n font-size: 11px;\n }\n\n .form-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 8px;\n }\n\n .granted-to-cell {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .type-badge {\n display: inline-block;\n padding: 2px 8px;\n border-radius: 4px;\n font-size: 11px;\n font-weight: 500;\n text-transform: uppercase;\n }\n\n .type-badge.user {\n background: #dbeafe;\n color: #1e40af;\n }\n\n .type-badge.role {\n background: #f3e8ff;\n color: #6b21a8;\n }\n\n .permission-badges {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n }\n\n .permission-badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 11px;\n font-weight: 500;\n }\n\n .permission-badge.view {\n background: #e0f2fe;\n color: #0369a1;\n }\n\n .permission-badge.run {\n background: #d1fae5;\n color: #065f46;\n }\n\n .permission-badge.edit {\n background: #fef3c7;\n color: #92400e;\n }\n\n .permission-badge.delete {\n background: #fee2e2;\n color: #991b1b;\n }\n\n .description-text {\n font-size: 12px;\n color: #666;\n }\n\n .grid-actions {\n display: flex;\n gap: 4px;\n }\n "] }]
|
|
785
|
+
}], () => [{ type: i1.DialogRef }, { type: i2.SharedService }], { grid: [{
|
|
786
|
+
type: ViewChild,
|
|
787
|
+
args: ['grid']
|
|
788
|
+
}] }); })();
|
|
789
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AgentPermissionsDialogComponent, { className: "AgentPermissionsDialogComponent", filePath: "src/lib/custom/AIAgents/agent-permissions-dialog.component.ts", lineNumber: 437 }); })();
|
|
790
|
+
//# sourceMappingURL=agent-permissions-dialog.component.js.map
|