@memberjunction/ng-conversations 2.110.0 → 2.111.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/components/artifact/artifact-share-modal.component.d.ts +42 -0
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-share-modal.component.js +659 -0
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -0
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts +15 -3
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.js +89 -23
- package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +44 -6
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +321 -182
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +25 -0
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -0
- package/dist/lib/components/conversation/conversation-empty-state.component.js +233 -0
- package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -0
- package/dist/lib/components/mention/mention-dropdown.component.d.ts +2 -1
- package/dist/lib/components/mention/mention-dropdown.component.d.ts.map +1 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +8 -5
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -1
- package/dist/lib/components/message/message-input-box.component.d.ts +72 -0
- package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -0
- package/dist/lib/components/message/message-input-box.component.js +267 -0
- package/dist/lib/components/message/message-input-box.component.js.map +1 -0
- package/dist/lib/components/message/message-input.component.d.ts +13 -37
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +106 -190
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts +2 -1
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.js +12 -2
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +24 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +119 -33
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +55 -52
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +15 -3
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/services/artifact-permission.service.d.ts +94 -0
- package/dist/lib/services/artifact-permission.service.d.ts.map +1 -0
- package/dist/lib/services/artifact-permission.service.js +294 -0
- package/dist/lib/services/artifact-permission.service.js.map +1 -0
- package/dist/lib/services/artifact-state.service.d.ts +25 -2
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +55 -4
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/conversation-state.service.d.ts +1 -0
- package/dist/lib/services/conversation-state.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-state.service.js +2 -0
- package/dist/lib/services/conversation-state.service.js.map +1 -1
- package/dist/public-api.d.ts +5 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +5 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +19 -15
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { WindowModule } from '@progress/kendo-angular-dialog';
|
|
5
|
+
import { ButtonModule } from '@progress/kendo-angular-buttons';
|
|
6
|
+
import { UserPickerComponent } from '../shared/user-picker.component';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "../../services/artifact-permission.service";
|
|
9
|
+
import * as i2 from "@angular/forms";
|
|
10
|
+
import * as i3 from "@progress/kendo-angular-dialog";
|
|
11
|
+
import * as i4 from "@progress/kendo-angular-buttons";
|
|
12
|
+
const _forTrack0 = ($index, $item) => $item.id;
|
|
13
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_7_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
14
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
15
|
+
i0.ɵɵelementStart(0, "label", 26)(1, "input", 31);
|
|
16
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ArtifactShareModalComponent_Conditional_0_Conditional_7_Conditional_17_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r1.newPermissions.canShare, $event) || (ctx_r1.newPermissions.canShare = $event); return i0.ɵɵresetView($event); });
|
|
17
|
+
i0.ɵɵelementEnd();
|
|
18
|
+
i0.ɵɵelementStart(2, "span", 23);
|
|
19
|
+
i0.ɵɵelement(3, "i", 32);
|
|
20
|
+
i0.ɵɵtext(4, " Share ");
|
|
21
|
+
i0.ɵɵelementEnd();
|
|
22
|
+
i0.ɵɵelementStart(5, "span", 25);
|
|
23
|
+
i0.ɵɵtext(6, "Share with others");
|
|
24
|
+
i0.ɵɵelementEnd()();
|
|
25
|
+
} if (rf & 2) {
|
|
26
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
27
|
+
i0.ɵɵadvance();
|
|
28
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newPermissions.canShare);
|
|
29
|
+
} }
|
|
30
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_7_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
32
|
+
i0.ɵɵelementStart(0, "label", 26)(1, "input", 31);
|
|
33
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ArtifactShareModalComponent_Conditional_0_Conditional_7_Conditional_18_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r1.newPermissions.canEdit, $event) || (ctx_r1.newPermissions.canEdit = $event); return i0.ɵɵresetView($event); });
|
|
34
|
+
i0.ɵɵelementEnd();
|
|
35
|
+
i0.ɵɵelementStart(2, "span", 23);
|
|
36
|
+
i0.ɵɵelement(3, "i", 33);
|
|
37
|
+
i0.ɵɵtext(4, " Edit ");
|
|
38
|
+
i0.ɵɵelementEnd();
|
|
39
|
+
i0.ɵɵelementStart(5, "span", 25);
|
|
40
|
+
i0.ɵɵtext(6, "Edit and delete artifact");
|
|
41
|
+
i0.ɵɵelementEnd()();
|
|
42
|
+
} if (rf & 2) {
|
|
43
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
44
|
+
i0.ɵɵadvance();
|
|
45
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newPermissions.canEdit);
|
|
46
|
+
} }
|
|
47
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
48
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
49
|
+
i0.ɵɵelementStart(0, "div", 7)(1, "div", 14)(2, "div", 15);
|
|
50
|
+
i0.ɵɵelement(3, "i", 16);
|
|
51
|
+
i0.ɵɵelementEnd();
|
|
52
|
+
i0.ɵɵelementStart(4, "div", 17)(5, "div", 18);
|
|
53
|
+
i0.ɵɵtext(6);
|
|
54
|
+
i0.ɵɵelementEnd();
|
|
55
|
+
i0.ɵɵelementStart(7, "div", 19);
|
|
56
|
+
i0.ɵɵtext(8);
|
|
57
|
+
i0.ɵɵelementEnd()()();
|
|
58
|
+
i0.ɵɵelementStart(9, "div", 20)(10, "label", 21);
|
|
59
|
+
i0.ɵɵelement(11, "input", 22);
|
|
60
|
+
i0.ɵɵelementStart(12, "span", 23);
|
|
61
|
+
i0.ɵɵelement(13, "i", 24);
|
|
62
|
+
i0.ɵɵtext(14, " Read ");
|
|
63
|
+
i0.ɵɵelementEnd();
|
|
64
|
+
i0.ɵɵelementStart(15, "span", 25);
|
|
65
|
+
i0.ɵɵtext(16, "View artifact content");
|
|
66
|
+
i0.ɵɵelementEnd()();
|
|
67
|
+
i0.ɵɵtemplate(17, ArtifactShareModalComponent_Conditional_0_Conditional_7_Conditional_17_Template, 7, 1, "label", 26)(18, ArtifactShareModalComponent_Conditional_0_Conditional_7_Conditional_18_Template, 7, 1, "label", 26);
|
|
68
|
+
i0.ɵɵelementEnd();
|
|
69
|
+
i0.ɵɵelementStart(19, "div", 27)(20, "button", 28);
|
|
70
|
+
i0.ɵɵlistener("click", function ArtifactShareModalComponent_Conditional_0_Conditional_7_Template_button_click_20_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onAddUser()); });
|
|
71
|
+
i0.ɵɵelement(21, "i", 29);
|
|
72
|
+
i0.ɵɵtext(22, " Add User ");
|
|
73
|
+
i0.ɵɵelementEnd();
|
|
74
|
+
i0.ɵɵelementStart(23, "button", 30);
|
|
75
|
+
i0.ɵɵlistener("click", function ArtifactShareModalComponent_Conditional_0_Conditional_7_Template_button_click_23_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onClearSelection()); });
|
|
76
|
+
i0.ɵɵtext(24, " Cancel ");
|
|
77
|
+
i0.ɵɵelementEnd()()();
|
|
78
|
+
} if (rf & 2) {
|
|
79
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
80
|
+
i0.ɵɵadvance(6);
|
|
81
|
+
i0.ɵɵtextInterpolate(ctx_r1.selectedUser.name);
|
|
82
|
+
i0.ɵɵadvance(2);
|
|
83
|
+
i0.ɵɵtextInterpolate(ctx_r1.selectedUser.email);
|
|
84
|
+
i0.ɵɵadvance(3);
|
|
85
|
+
i0.ɵɵproperty("checked", true);
|
|
86
|
+
i0.ɵɵadvance(6);
|
|
87
|
+
i0.ɵɵconditional(ctx_r1.availablePermissions.includes("Share") ? 17 : -1);
|
|
88
|
+
i0.ɵɵadvance();
|
|
89
|
+
i0.ɵɵconditional(ctx_r1.availablePermissions.includes("Edit") ? 18 : -1);
|
|
90
|
+
i0.ɵɵadvance(2);
|
|
91
|
+
i0.ɵɵproperty("disabled", !ctx_r1.selectedUser);
|
|
92
|
+
} }
|
|
93
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
94
|
+
i0.ɵɵelementStart(0, "div", 10);
|
|
95
|
+
i0.ɵɵelement(1, "i", 34);
|
|
96
|
+
i0.ɵɵelementStart(2, "p");
|
|
97
|
+
i0.ɵɵtext(3, "Not shared with anyone yet");
|
|
98
|
+
i0.ɵɵelementEnd()();
|
|
99
|
+
} }
|
|
100
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
101
|
+
i0.ɵɵelementStart(0, "span", 38);
|
|
102
|
+
i0.ɵɵtext(1);
|
|
103
|
+
i0.ɵɵelementEnd();
|
|
104
|
+
} if (rf & 2) {
|
|
105
|
+
const permission_r6 = i0.ɵɵnextContext().$implicit;
|
|
106
|
+
i0.ɵɵadvance();
|
|
107
|
+
i0.ɵɵtextInterpolate1("shared by ", permission_r6.sharedByUserName, "");
|
|
108
|
+
} }
|
|
109
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_8_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
110
|
+
i0.ɵɵelementStart(0, "span", 42);
|
|
111
|
+
i0.ɵɵelement(1, "i", 32);
|
|
112
|
+
i0.ɵɵtext(2, " Share ");
|
|
113
|
+
i0.ɵɵelementEnd();
|
|
114
|
+
} }
|
|
115
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_8_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
116
|
+
i0.ɵɵelementStart(0, "span", 42);
|
|
117
|
+
i0.ɵɵelement(1, "i", 33);
|
|
118
|
+
i0.ɵɵtext(2, " Edit ");
|
|
119
|
+
i0.ɵɵelementEnd();
|
|
120
|
+
} }
|
|
121
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
122
|
+
i0.ɵɵelementStart(0, "div", 39)(1, "span", 42);
|
|
123
|
+
i0.ɵɵelement(2, "i", 24);
|
|
124
|
+
i0.ɵɵtext(3, " Read ");
|
|
125
|
+
i0.ɵɵelementEnd();
|
|
126
|
+
i0.ɵɵtemplate(4, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_8_Conditional_4_Template, 3, 0, "span", 42)(5, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_8_Conditional_5_Template, 3, 0, "span", 42);
|
|
127
|
+
i0.ɵɵelementEnd();
|
|
128
|
+
} if (rf & 2) {
|
|
129
|
+
const permission_r6 = i0.ɵɵnextContext().$implicit;
|
|
130
|
+
i0.ɵɵadvance(4);
|
|
131
|
+
i0.ɵɵconditional(permission_r6.canShare ? 4 : -1);
|
|
132
|
+
i0.ɵɵadvance();
|
|
133
|
+
i0.ɵɵconditional(permission_r6.canEdit ? 5 : -1);
|
|
134
|
+
} }
|
|
135
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
136
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
137
|
+
i0.ɵɵelementStart(0, "label", 44)(1, "input", 31);
|
|
138
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Conditional_5_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r7); const permission_r6 = i0.ɵɵnextContext(2).$implicit; i0.ɵɵtwoWayBindingSet(permission_r6.editingPermissions.canShare, $event) || (permission_r6.editingPermissions.canShare = $event); return i0.ɵɵresetView($event); });
|
|
139
|
+
i0.ɵɵelementEnd();
|
|
140
|
+
i0.ɵɵelementStart(2, "span");
|
|
141
|
+
i0.ɵɵtext(3, "Share");
|
|
142
|
+
i0.ɵɵelementEnd()();
|
|
143
|
+
} if (rf & 2) {
|
|
144
|
+
const permission_r6 = i0.ɵɵnextContext(2).$implicit;
|
|
145
|
+
i0.ɵɵadvance();
|
|
146
|
+
i0.ɵɵtwoWayProperty("ngModel", permission_r6.editingPermissions.canShare);
|
|
147
|
+
} }
|
|
148
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
149
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
150
|
+
i0.ɵɵelementStart(0, "label", 44)(1, "input", 31);
|
|
151
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Conditional_6_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r8); const permission_r6 = i0.ɵɵnextContext(2).$implicit; i0.ɵɵtwoWayBindingSet(permission_r6.editingPermissions.canEdit, $event) || (permission_r6.editingPermissions.canEdit = $event); return i0.ɵɵresetView($event); });
|
|
152
|
+
i0.ɵɵelementEnd();
|
|
153
|
+
i0.ɵɵelementStart(2, "span");
|
|
154
|
+
i0.ɵɵtext(3, "Edit");
|
|
155
|
+
i0.ɵɵelementEnd()();
|
|
156
|
+
} if (rf & 2) {
|
|
157
|
+
const permission_r6 = i0.ɵɵnextContext(2).$implicit;
|
|
158
|
+
i0.ɵɵadvance();
|
|
159
|
+
i0.ɵɵtwoWayProperty("ngModel", permission_r6.editingPermissions.canEdit);
|
|
160
|
+
} }
|
|
161
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
162
|
+
i0.ɵɵelementStart(0, "div", 40)(1, "label", 43);
|
|
163
|
+
i0.ɵɵelement(2, "input", 22);
|
|
164
|
+
i0.ɵɵelementStart(3, "span");
|
|
165
|
+
i0.ɵɵtext(4, "Read");
|
|
166
|
+
i0.ɵɵelementEnd()();
|
|
167
|
+
i0.ɵɵtemplate(5, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Conditional_5_Template, 4, 1, "label", 44)(6, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Conditional_6_Template, 4, 1, "label", 44);
|
|
168
|
+
i0.ɵɵelementEnd();
|
|
169
|
+
} if (rf & 2) {
|
|
170
|
+
const ctx_r1 = i0.ɵɵnextContext(4);
|
|
171
|
+
i0.ɵɵadvance(2);
|
|
172
|
+
i0.ɵɵproperty("checked", true);
|
|
173
|
+
i0.ɵɵadvance(3);
|
|
174
|
+
i0.ɵɵconditional(ctx_r1.availablePermissions.includes("Share") ? 5 : -1);
|
|
175
|
+
i0.ɵɵadvance();
|
|
176
|
+
i0.ɵɵconditional(ctx_r1.availablePermissions.includes("Edit") ? 6 : -1);
|
|
177
|
+
} }
|
|
178
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
179
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
|
180
|
+
i0.ɵɵelementStart(0, "button", 45);
|
|
181
|
+
i0.ɵɵlistener("click", function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r9); const permission_r6 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onEditPermission(permission_r6)); });
|
|
182
|
+
i0.ɵɵelement(1, "i", 46);
|
|
183
|
+
i0.ɵɵelementEnd();
|
|
184
|
+
i0.ɵɵelementStart(2, "button", 47);
|
|
185
|
+
i0.ɵɵlistener("click", function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_1_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r9); const permission_r6 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onRevokePermission(permission_r6)); });
|
|
186
|
+
i0.ɵɵelement(3, "i", 48);
|
|
187
|
+
i0.ɵɵelementEnd();
|
|
188
|
+
} }
|
|
189
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
190
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
191
|
+
i0.ɵɵelementStart(0, "button", 49);
|
|
192
|
+
i0.ɵɵlistener("click", function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r10); const permission_r6 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onSavePermission(permission_r6)); });
|
|
193
|
+
i0.ɵɵelement(1, "i", 50);
|
|
194
|
+
i0.ɵɵelementEnd();
|
|
195
|
+
i0.ɵɵelementStart(2, "button", 51);
|
|
196
|
+
i0.ɵɵlistener("click", function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_2_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r10); const permission_r6 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCancelEdit(permission_r6)); });
|
|
197
|
+
i0.ɵɵelement(3, "i", 48);
|
|
198
|
+
i0.ɵɵelementEnd();
|
|
199
|
+
} }
|
|
200
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
201
|
+
i0.ɵɵelementStart(0, "div", 41);
|
|
202
|
+
i0.ɵɵtemplate(1, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_1_Template, 4, 0)(2, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Conditional_2_Template, 4, 0);
|
|
203
|
+
i0.ɵɵelementEnd();
|
|
204
|
+
} if (rf & 2) {
|
|
205
|
+
const permission_r6 = i0.ɵɵnextContext().$implicit;
|
|
206
|
+
i0.ɵɵadvance();
|
|
207
|
+
i0.ɵɵconditional(!permission_r6.isEditing ? 1 : 2);
|
|
208
|
+
} }
|
|
209
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
210
|
+
i0.ɵɵelementStart(0, "div", 35)(1, "div", 15);
|
|
211
|
+
i0.ɵɵelement(2, "i", 16);
|
|
212
|
+
i0.ɵɵelementEnd();
|
|
213
|
+
i0.ɵɵelementStart(3, "div", 36)(4, "div", 37)(5, "span", 18);
|
|
214
|
+
i0.ɵɵtext(6);
|
|
215
|
+
i0.ɵɵelementEnd();
|
|
216
|
+
i0.ɵɵtemplate(7, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_7_Template, 2, 1, "span", 38);
|
|
217
|
+
i0.ɵɵelementEnd();
|
|
218
|
+
i0.ɵɵtemplate(8, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_8_Template, 6, 2, "div", 39)(9, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_9_Template, 7, 3, "div", 40);
|
|
219
|
+
i0.ɵɵelementEnd();
|
|
220
|
+
i0.ɵɵtemplate(10, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Conditional_10_Template, 3, 1, "div", 41);
|
|
221
|
+
i0.ɵɵelementEnd();
|
|
222
|
+
} if (rf & 2) {
|
|
223
|
+
const permission_r6 = ctx.$implicit;
|
|
224
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
225
|
+
i0.ɵɵadvance(6);
|
|
226
|
+
i0.ɵɵtextInterpolate(permission_r6.userName);
|
|
227
|
+
i0.ɵɵadvance();
|
|
228
|
+
i0.ɵɵconditional(permission_r6.sharedByUserName ? 7 : -1);
|
|
229
|
+
i0.ɵɵadvance();
|
|
230
|
+
i0.ɵɵconditional(!permission_r6.isEditing ? 8 : 9);
|
|
231
|
+
i0.ɵɵadvance(2);
|
|
232
|
+
i0.ɵɵconditional(ctx_r1.canModifyPermissions ? 10 : -1);
|
|
233
|
+
} }
|
|
234
|
+
function ArtifactShareModalComponent_Conditional_0_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
235
|
+
i0.ɵɵelementStart(0, "div", 11);
|
|
236
|
+
i0.ɵɵrepeaterCreate(1, ArtifactShareModalComponent_Conditional_0_Conditional_13_For_2_Template, 11, 4, "div", 35, _forTrack0);
|
|
237
|
+
i0.ɵɵelementEnd();
|
|
238
|
+
} if (rf & 2) {
|
|
239
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
240
|
+
i0.ɵɵadvance();
|
|
241
|
+
i0.ɵɵrepeater(ctx_r1.permissions);
|
|
242
|
+
} }
|
|
243
|
+
function ArtifactShareModalComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
244
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
245
|
+
i0.ɵɵelementStart(0, "kendo-window", 1);
|
|
246
|
+
i0.ɵɵlistener("close", function ArtifactShareModalComponent_Conditional_0_Template_kendo_window_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCancel()); });
|
|
247
|
+
i0.ɵɵelementStart(1, "div", 2)(2, "div", 3)(3, "h3", 4);
|
|
248
|
+
i0.ɵɵelement(4, "i", 5);
|
|
249
|
+
i0.ɵɵtext(5, " Share with User ");
|
|
250
|
+
i0.ɵɵelementEnd();
|
|
251
|
+
i0.ɵɵelementStart(6, "mj-user-picker", 6);
|
|
252
|
+
i0.ɵɵlistener("userSelected", function ArtifactShareModalComponent_Conditional_0_Template_mj_user_picker_userSelected_6_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onUserSelected($event)); });
|
|
253
|
+
i0.ɵɵelementEnd();
|
|
254
|
+
i0.ɵɵtemplate(7, ArtifactShareModalComponent_Conditional_0_Conditional_7_Template, 25, 6, "div", 7);
|
|
255
|
+
i0.ɵɵelementEnd();
|
|
256
|
+
i0.ɵɵelementStart(8, "div", 8)(9, "h3", 4);
|
|
257
|
+
i0.ɵɵelement(10, "i", 9);
|
|
258
|
+
i0.ɵɵtext(11);
|
|
259
|
+
i0.ɵɵelementEnd();
|
|
260
|
+
i0.ɵɵtemplate(12, ArtifactShareModalComponent_Conditional_0_Conditional_12_Template, 4, 0, "div", 10)(13, ArtifactShareModalComponent_Conditional_0_Conditional_13_Template, 3, 0, "div", 11);
|
|
261
|
+
i0.ɵɵelementEnd()();
|
|
262
|
+
i0.ɵɵelementStart(14, "div", 12)(15, "button", 13);
|
|
263
|
+
i0.ɵɵlistener("click", function ArtifactShareModalComponent_Conditional_0_Template_button_click_15_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCancel()); });
|
|
264
|
+
i0.ɵɵtext(16, "Close");
|
|
265
|
+
i0.ɵɵelementEnd()()();
|
|
266
|
+
} if (rf & 2) {
|
|
267
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
268
|
+
i0.ɵɵproperty("title", "Share: " + ctx_r1.artifact.Name)("width", 600)("height", 500)("minWidth", 400)("minHeight", 400);
|
|
269
|
+
i0.ɵɵadvance(6);
|
|
270
|
+
i0.ɵɵproperty("currentUser", ctx_r1.currentUser)("excludeUserIds", ctx_r1.getExcludedUserIds());
|
|
271
|
+
i0.ɵɵadvance();
|
|
272
|
+
i0.ɵɵconditional(ctx_r1.selectedUser ? 7 : -1);
|
|
273
|
+
i0.ɵɵadvance(4);
|
|
274
|
+
i0.ɵɵtextInterpolate1(" Shared With (", ctx_r1.permissions.length, ") ");
|
|
275
|
+
i0.ɵɵadvance();
|
|
276
|
+
i0.ɵɵconditional(ctx_r1.permissions.length === 0 ? 12 : 13);
|
|
277
|
+
} }
|
|
278
|
+
export class ArtifactShareModalComponent {
|
|
279
|
+
permissionService;
|
|
280
|
+
cdr;
|
|
281
|
+
isOpen = false;
|
|
282
|
+
artifact = null;
|
|
283
|
+
currentUser;
|
|
284
|
+
saved = new EventEmitter();
|
|
285
|
+
cancelled = new EventEmitter();
|
|
286
|
+
permissions = [];
|
|
287
|
+
selectedUser = null;
|
|
288
|
+
availablePermissions = [];
|
|
289
|
+
canModifyPermissions = false;
|
|
290
|
+
newPermissions = {
|
|
291
|
+
canRead: true,
|
|
292
|
+
canShare: false,
|
|
293
|
+
canEdit: false
|
|
294
|
+
};
|
|
295
|
+
constructor(permissionService, cdr) {
|
|
296
|
+
this.permissionService = permissionService;
|
|
297
|
+
this.cdr = cdr;
|
|
298
|
+
}
|
|
299
|
+
async ngOnInit() {
|
|
300
|
+
if (this.artifact) {
|
|
301
|
+
await this.loadPermissions();
|
|
302
|
+
await this.updateAvailablePermissions();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
async ngOnChanges(changes) {
|
|
306
|
+
// Reload permissions when modal opens or artifact changes
|
|
307
|
+
const modalOpened = changes['isOpen']?.currentValue === true && changes['isOpen']?.previousValue === false;
|
|
308
|
+
const artifactChanged = changes['artifact'] && !changes['artifact'].isFirstChange();
|
|
309
|
+
if ((modalOpened || artifactChanged) && this.artifact) {
|
|
310
|
+
await this.loadPermissions();
|
|
311
|
+
await this.updateAvailablePermissions();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
async loadPermissions() {
|
|
315
|
+
if (!this.artifact)
|
|
316
|
+
return;
|
|
317
|
+
const perms = await this.permissionService.loadPermissions(this.artifact.ID, this.currentUser);
|
|
318
|
+
this.permissions = perms.map(p => ({
|
|
319
|
+
...p,
|
|
320
|
+
isEditing: false,
|
|
321
|
+
editingPermissions: {
|
|
322
|
+
canRead: p.canRead,
|
|
323
|
+
canShare: p.canShare,
|
|
324
|
+
canEdit: p.canEdit
|
|
325
|
+
}
|
|
326
|
+
}));
|
|
327
|
+
this.cdr.detectChanges();
|
|
328
|
+
}
|
|
329
|
+
async updateAvailablePermissions() {
|
|
330
|
+
if (!this.artifact)
|
|
331
|
+
return;
|
|
332
|
+
// Check if current user is owner
|
|
333
|
+
const isOwner = await this.permissionService.isOwner(this.artifact.ID, this.currentUser.ID, this.currentUser);
|
|
334
|
+
// Check if user has share permission
|
|
335
|
+
const hasSharePermission = await this.permissionService.checkPermission(this.artifact.ID, this.currentUser.ID, 'share', this.currentUser);
|
|
336
|
+
// Allow modification if user is owner OR has Share permission
|
|
337
|
+
this.canModifyPermissions = isOwner || hasSharePermission;
|
|
338
|
+
// Get user's current permissions
|
|
339
|
+
const userPerms = {
|
|
340
|
+
canRead: true,
|
|
341
|
+
canShare: hasSharePermission,
|
|
342
|
+
canEdit: await this.permissionService.checkPermission(this.artifact.ID, this.currentUser.ID, 'edit', this.currentUser)
|
|
343
|
+
};
|
|
344
|
+
this.availablePermissions = this.permissionService.getAvailablePermissions(userPerms, isOwner);
|
|
345
|
+
console.log('Share modal permissions:', {
|
|
346
|
+
artifactId: this.artifact?.ID,
|
|
347
|
+
userId: this.artifact?.UserID,
|
|
348
|
+
currentUserId: this.currentUser.ID,
|
|
349
|
+
isOwner,
|
|
350
|
+
availablePermissions: this.availablePermissions
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
getExcludedUserIds() {
|
|
354
|
+
const ids = this.permissions.map(p => p.userId);
|
|
355
|
+
ids.push(this.currentUser.ID); // Can't share with yourself
|
|
356
|
+
if (this.artifact?.UserID) {
|
|
357
|
+
ids.push(this.artifact.UserID); // Owner already has all permissions
|
|
358
|
+
}
|
|
359
|
+
return ids;
|
|
360
|
+
}
|
|
361
|
+
onUserSelected(user) {
|
|
362
|
+
this.selectedUser = user;
|
|
363
|
+
this.cdr.detectChanges();
|
|
364
|
+
}
|
|
365
|
+
onClearSelection() {
|
|
366
|
+
this.selectedUser = null;
|
|
367
|
+
this.newPermissions = {
|
|
368
|
+
canRead: true,
|
|
369
|
+
canShare: false,
|
|
370
|
+
canEdit: false
|
|
371
|
+
};
|
|
372
|
+
this.cdr.detectChanges();
|
|
373
|
+
}
|
|
374
|
+
async onAddUser() {
|
|
375
|
+
if (!this.selectedUser || !this.artifact)
|
|
376
|
+
return;
|
|
377
|
+
try {
|
|
378
|
+
// Check if user is owner
|
|
379
|
+
const isOwner = await this.permissionService.isOwner(this.artifact.ID, this.currentUser.ID, this.currentUser);
|
|
380
|
+
// Get current user's permissions
|
|
381
|
+
const userPerms = {
|
|
382
|
+
canRead: true,
|
|
383
|
+
canShare: await this.permissionService.checkPermission(this.artifact.ID, this.currentUser.ID, 'share', this.currentUser),
|
|
384
|
+
canEdit: await this.permissionService.checkPermission(this.artifact.ID, this.currentUser.ID, 'edit', this.currentUser)
|
|
385
|
+
};
|
|
386
|
+
// Validate permissions
|
|
387
|
+
if (!this.permissionService.validatePermissions(this.newPermissions, userPerms, isOwner)) {
|
|
388
|
+
alert('You cannot grant permissions you do not have');
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
// Grant permission
|
|
392
|
+
await this.permissionService.grantPermission(this.artifact.ID, this.selectedUser.id, this.newPermissions, this.currentUser.ID, this.currentUser);
|
|
393
|
+
await this.loadPermissions();
|
|
394
|
+
this.onClearSelection();
|
|
395
|
+
this.saved.emit();
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
console.error('Error adding user:', error);
|
|
399
|
+
alert('Failed to add user. Please try again.');
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
onEditPermission(permission) {
|
|
403
|
+
permission.isEditing = true;
|
|
404
|
+
this.cdr.detectChanges();
|
|
405
|
+
}
|
|
406
|
+
onCancelEdit(permission) {
|
|
407
|
+
permission.isEditing = false;
|
|
408
|
+
permission.editingPermissions = {
|
|
409
|
+
canRead: permission.canRead,
|
|
410
|
+
canShare: permission.canShare,
|
|
411
|
+
canEdit: permission.canEdit
|
|
412
|
+
};
|
|
413
|
+
this.cdr.detectChanges();
|
|
414
|
+
}
|
|
415
|
+
async onSavePermission(permission) {
|
|
416
|
+
if (!this.artifact)
|
|
417
|
+
return;
|
|
418
|
+
try {
|
|
419
|
+
// Check if user is owner
|
|
420
|
+
const isOwner = await this.permissionService.isOwner(this.artifact.ID, this.currentUser.ID, this.currentUser);
|
|
421
|
+
// Get current user's permissions
|
|
422
|
+
const userPerms = {
|
|
423
|
+
canRead: true,
|
|
424
|
+
canShare: await this.permissionService.checkPermission(this.artifact.ID, this.currentUser.ID, 'share', this.currentUser),
|
|
425
|
+
canEdit: await this.permissionService.checkPermission(this.artifact.ID, this.currentUser.ID, 'edit', this.currentUser)
|
|
426
|
+
};
|
|
427
|
+
// Validate permissions
|
|
428
|
+
if (!this.permissionService.validatePermissions(permission.editingPermissions, userPerms, isOwner)) {
|
|
429
|
+
alert('You cannot grant permissions you do not have');
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
// Update permission
|
|
433
|
+
await this.permissionService.updatePermission(permission.id, permission.editingPermissions, this.currentUser);
|
|
434
|
+
await this.loadPermissions();
|
|
435
|
+
this.saved.emit();
|
|
436
|
+
}
|
|
437
|
+
catch (error) {
|
|
438
|
+
console.error('Error updating permission:', error);
|
|
439
|
+
alert('Failed to update permissions. Please try again.');
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
async onRevokePermission(permission) {
|
|
443
|
+
if (!confirm(`Remove ${permission.userName}'s access to this artifact?`)) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
try {
|
|
447
|
+
await this.permissionService.revokePermission(permission.id, this.currentUser);
|
|
448
|
+
await this.loadPermissions();
|
|
449
|
+
this.saved.emit();
|
|
450
|
+
}
|
|
451
|
+
catch (error) {
|
|
452
|
+
console.error('Error revoking permission:', error);
|
|
453
|
+
alert('Failed to revoke permission. Please try again.');
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
onCancel() {
|
|
457
|
+
this.cancelled.emit();
|
|
458
|
+
}
|
|
459
|
+
static ɵfac = function ArtifactShareModalComponent_Factory(t) { return new (t || ArtifactShareModalComponent)(i0.ɵɵdirectiveInject(i1.ArtifactPermissionService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
460
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactShareModalComponent, selectors: [["mj-artifact-share-modal"]], inputs: { isOpen: "isOpen", artifact: "artifact", currentUser: "currentUser" }, outputs: { saved: "saved", cancelled: "cancelled" }, standalone: true, features: [i0.ɵɵNgOnChangesFeature, i0.ɵɵStandaloneFeature], decls: 1, vars: 1, consts: [[3, "title", "width", "height", "minWidth", "minHeight"], [3, "close", "title", "width", "height", "minWidth", "minHeight"], [1, "share-modal-content"], [1, "add-user-section"], [1, "section-title"], [1, "fa-solid", "fa-user-plus"], [3, "userSelected", "currentUser", "excludeUserIds"], [1, "permissions-form"], [1, "permissions-list-section"], [1, "fa-solid", "fa-users"], [1, "empty-state"], [1, "permissions-list"], [1, "modal-actions"], ["kendoButton", "", 3, "click"], [1, "selected-user-info"], [1, "user-avatar"], [1, "fa-solid", "fa-user"], [1, "user-details"], [1, "user-name"], [1, "user-email"], [1, "permissions-grid"], [1, "permission-checkbox", "disabled"], ["type", "checkbox", "disabled", "", 3, "checked"], [1, "permission-label"], [1, "fa-solid", "fa-eye"], [1, "permission-desc"], [1, "permission-checkbox"], [1, "form-actions"], ["kendoButton", "", 1, "btn-primary", 3, "click", "disabled"], [1, "fa-solid", "fa-plus"], ["kendoButton", "", 1, "btn-secondary", 3, "click"], ["type", "checkbox", 3, "ngModelChange", "ngModel"], [1, "fa-solid", "fa-share-nodes"], [1, "fa-solid", "fa-pen-to-square"], [1, "fa-solid", "fa-user-slash"], [1, "permission-item"], [1, "permission-details"], [1, "permission-user"], [1, "shared-by"], [1, "permission-badges"], [1, "permissions-edit-grid"], [1, "permission-actions"], [1, "permission-badge"], [1, "permission-checkbox-small", "disabled"], [1, "permission-checkbox-small"], ["kendoButton", "", "title", "Edit", 1, "btn-icon", 3, "click"], [1, "fa-solid", "fa-pen"], ["kendoButton", "", "title", "Remove", 1, "btn-icon", "btn-danger", 3, "click"], [1, "fa-solid", "fa-xmark"], ["kendoButton", "", "title", "Save", 1, "btn-icon", "btn-success", 3, "click"], [1, "fa-solid", "fa-check"], ["kendoButton", "", "title", "Cancel", 1, "btn-icon", 3, "click"]], template: function ArtifactShareModalComponent_Template(rf, ctx) { if (rf & 1) {
|
|
461
|
+
i0.ɵɵtemplate(0, ArtifactShareModalComponent_Conditional_0_Template, 17, 10, "kendo-window", 0);
|
|
462
|
+
} if (rf & 2) {
|
|
463
|
+
i0.ɵɵconditional(ctx.isOpen && ctx.artifact ? 0 : -1);
|
|
464
|
+
} }, dependencies: [CommonModule, FormsModule, i2.CheckboxControlValueAccessor, i2.NgControlStatus, i2.NgModel, WindowModule, i3.WindowComponent, ButtonModule, i4.ButtonComponent, UserPickerComponent], styles: [".share-modal-content[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 20px;\n height: 100%;\n overflow-y: auto;\n}\n\n.section-title[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 16px;\n font-weight: 600;\n color: #1F2937;\n margin: 0 0 16px 0;\n\n i {\n color: #6366F1;\n }\n}\n\n//[_ngcontent-%COMP%] Add[_ngcontent-%COMP%] User[_ngcontent-%COMP%] Section\n.add-user-section[_ngcontent-%COMP%] {\n border-bottom: 1px solid #E5E7EB;\n padding-bottom: 24px;\n}\n\n.selected-user-info[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n margin: 16px 0;\n padding: 12px;\n background: #F9FAFB;\n border-radius: 8px;\n}\n\n.user-avatar[_ngcontent-%COMP%] {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-size: 16px;\n flex-shrink: 0;\n}\n\n.user-details[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n\n .user-name {\n font-size: 14px;\n font-weight: 500;\n color: #1F2937;\n }\n\n .user-email {\n font-size: 12px;\n color: #6B7280;\n margin-top: 2px;\n }\n}\n\n.permissions-form[_ngcontent-%COMP%] {\n margin-top: 16px;\n}\n\n.permissions-grid[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: 12px;\n margin: 16px 0;\n}\n\n.permission-checkbox[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 12px;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.2s;\n\n &:hover:not(.disabled) {\n border-color: #6366F1;\n background: #F9FAFB;\n }\n\n &.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n background: #F3F4F6;\n }\n\n input[type=\"checkbox\"] {\n margin-right: 8px;\n }\n\n .permission-label {\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 500;\n color: #1F2937;\n font-size: 14px;\n\n i {\n color: #6366F1;\n font-size: 12px;\n }\n }\n\n .permission-desc {\n font-size: 12px;\n color: #6B7280;\n margin-left: 28px;\n }\n}\n\n.form-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n margin-top: 16px;\n}\n\n//[_ngcontent-%COMP%] Permissions[_ngcontent-%COMP%] List[_ngcontent-%COMP%] Section\n.permissions-list-section[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.permissions-list[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.permission-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px;\n border: 1px solid #E5E7EB;\n border-radius: 8px;\n transition: background 0.2s;\n\n &:hover {\n background: #F9FAFB;\n }\n}\n\n.permission-details[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n}\n\n.permission-user[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n\n .user-name {\n font-weight: 500;\n color: #1F2937;\n font-size: 14px;\n }\n\n .shared-by {\n font-size: 12px;\n color: #6B7280;\n }\n}\n\n.permission-badges[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.permission-badge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 4px 8px;\n background: #EEF2FF;\n color: #6366F1;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n\n i {\n font-size: 10px;\n }\n}\n\n.permissions-edit-grid[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n}\n\n.permission-checkbox-small[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n cursor: pointer;\n\n &.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n input[type=\"checkbox\"] {\n margin: 0;\n }\n\n span {\n color: #1F2937;\n }\n}\n\n.permission-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 4px;\n}\n\n//[_ngcontent-%COMP%] Empty[_ngcontent-%COMP%] State\n.empty-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px 20px;\n color: #9CA3AF;\n\n i {\n font-size: 48px;\n margin-bottom: 12px;\n }\n\n p {\n margin: 0;\n font-size: 14px;\n }\n}\n\n//[_ngcontent-%COMP%] Button[_ngcontent-%COMP%] Styles\n.btn-primary[_ngcontent-%COMP%] {\n background: #6366F1 !important;\n color: white !important;\n border: none !important;\n padding: 8px 16px;\n border-radius: 6px;\n font-weight: 500;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 6px;\n\n &:hover:not(:disabled) {\n background: #5558E3 !important;\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n i {\n font-size: 12px;\n }\n}\n\n.btn-secondary[_ngcontent-%COMP%] {\n background: white !important;\n color: #6B7280 !important;\n border: 1px solid #E5E7EB !important;\n padding: 8px 16px;\n border-radius: 6px;\n font-weight: 500;\n cursor: pointer;\n\n &:hover {\n background: #F9FAFB !important;\n border-color: #D1D5DB !important;\n }\n}\n\n.btn-icon[_ngcontent-%COMP%] {\n width: 32px;\n height: 32px;\n padding: 0;\n border-radius: 6px;\n border: 1px solid #E5E7EB;\n background: white;\n color: #6B7280;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s;\n\n &:hover {\n background: #F9FAFB;\n border-color: #D1D5DB;\n }\n\n &.btn-success {\n color: #10B981;\n border-color: #10B981;\n\n &:hover {\n background: #ECFDF5;\n }\n }\n\n &.btn-danger {\n color: #EF4444;\n border-color: #EF4444;\n\n &:hover {\n background: #FEF2F2;\n }\n }\n\n i {\n font-size: 14px;\n }\n}\n\n.modal-actions[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n padding: 16px 20px;\n border-top: 1px solid #E5E7EB;\n background: #F9FAFB;\n}"] });
|
|
465
|
+
}
|
|
466
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactShareModalComponent, [{
|
|
467
|
+
type: Component,
|
|
468
|
+
args: [{ selector: 'mj-artifact-share-modal', standalone: true, imports: [CommonModule, FormsModule, WindowModule, ButtonModule, UserPickerComponent], template: `
|
|
469
|
+
@if (isOpen && artifact) {
|
|
470
|
+
<kendo-window
|
|
471
|
+
[title]="'Share: ' + artifact.Name"
|
|
472
|
+
[width]="600"
|
|
473
|
+
[height]="500"
|
|
474
|
+
[minWidth]="400"
|
|
475
|
+
[minHeight]="400"
|
|
476
|
+
(close)="onCancel()"
|
|
477
|
+
>
|
|
478
|
+
<div class="share-modal-content">
|
|
479
|
+
<!-- Add User Section -->
|
|
480
|
+
<div class="add-user-section">
|
|
481
|
+
<h3 class="section-title">
|
|
482
|
+
<i class="fa-solid fa-user-plus"></i>
|
|
483
|
+
Share with User
|
|
484
|
+
</h3>
|
|
485
|
+
|
|
486
|
+
<mj-user-picker
|
|
487
|
+
[currentUser]="currentUser"
|
|
488
|
+
[excludeUserIds]="getExcludedUserIds()"
|
|
489
|
+
(userSelected)="onUserSelected($event)"
|
|
490
|
+
></mj-user-picker>
|
|
491
|
+
|
|
492
|
+
@if (selectedUser) {
|
|
493
|
+
<div class="permissions-form">
|
|
494
|
+
<div class="selected-user-info">
|
|
495
|
+
<div class="user-avatar">
|
|
496
|
+
<i class="fa-solid fa-user"></i>
|
|
497
|
+
</div>
|
|
498
|
+
<div class="user-details">
|
|
499
|
+
<div class="user-name">{{ selectedUser.name }}</div>
|
|
500
|
+
<div class="user-email">{{ selectedUser.email }}</div>
|
|
501
|
+
</div>
|
|
502
|
+
</div>
|
|
503
|
+
|
|
504
|
+
<div class="permissions-grid">
|
|
505
|
+
<label class="permission-checkbox disabled">
|
|
506
|
+
<input type="checkbox" [checked]="true" disabled>
|
|
507
|
+
<span class="permission-label">
|
|
508
|
+
<i class="fa-solid fa-eye"></i>
|
|
509
|
+
Read
|
|
510
|
+
</span>
|
|
511
|
+
<span class="permission-desc">View artifact content</span>
|
|
512
|
+
</label>
|
|
513
|
+
|
|
514
|
+
@if (availablePermissions.includes('Share')) {
|
|
515
|
+
<label class="permission-checkbox">
|
|
516
|
+
<input type="checkbox" [(ngModel)]="newPermissions.canShare">
|
|
517
|
+
<span class="permission-label">
|
|
518
|
+
<i class="fa-solid fa-share-nodes"></i>
|
|
519
|
+
Share
|
|
520
|
+
</span>
|
|
521
|
+
<span class="permission-desc">Share with others</span>
|
|
522
|
+
</label>
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
@if (availablePermissions.includes('Edit')) {
|
|
526
|
+
<label class="permission-checkbox">
|
|
527
|
+
<input type="checkbox" [(ngModel)]="newPermissions.canEdit">
|
|
528
|
+
<span class="permission-label">
|
|
529
|
+
<i class="fa-solid fa-pen-to-square"></i>
|
|
530
|
+
Edit
|
|
531
|
+
</span>
|
|
532
|
+
<span class="permission-desc">Edit and delete artifact</span>
|
|
533
|
+
</label>
|
|
534
|
+
}
|
|
535
|
+
</div>
|
|
536
|
+
|
|
537
|
+
<div class="form-actions">
|
|
538
|
+
<button kendoButton (click)="onAddUser()" [disabled]="!selectedUser" class="btn-primary">
|
|
539
|
+
<i class="fa-solid fa-plus"></i>
|
|
540
|
+
Add User
|
|
541
|
+
</button>
|
|
542
|
+
<button kendoButton (click)="onClearSelection()" class="btn-secondary">
|
|
543
|
+
Cancel
|
|
544
|
+
</button>
|
|
545
|
+
</div>
|
|
546
|
+
</div>
|
|
547
|
+
}
|
|
548
|
+
</div>
|
|
549
|
+
|
|
550
|
+
<!-- Current Permissions Section -->
|
|
551
|
+
<div class="permissions-list-section">
|
|
552
|
+
<h3 class="section-title">
|
|
553
|
+
<i class="fa-solid fa-users"></i>
|
|
554
|
+
Shared With ({{ permissions.length }})
|
|
555
|
+
</h3>
|
|
556
|
+
|
|
557
|
+
@if (permissions.length === 0) {
|
|
558
|
+
<div class="empty-state">
|
|
559
|
+
<i class="fa-solid fa-user-slash"></i>
|
|
560
|
+
<p>Not shared with anyone yet</p>
|
|
561
|
+
</div>
|
|
562
|
+
} @else {
|
|
563
|
+
<div class="permissions-list">
|
|
564
|
+
@for (permission of permissions; track permission.id) {
|
|
565
|
+
<div class="permission-item">
|
|
566
|
+
<div class="user-avatar">
|
|
567
|
+
<i class="fa-solid fa-user"></i>
|
|
568
|
+
</div>
|
|
569
|
+
<div class="permission-details">
|
|
570
|
+
<div class="permission-user">
|
|
571
|
+
<span class="user-name">{{ permission.userName }}</span>
|
|
572
|
+
@if (permission.sharedByUserName) {
|
|
573
|
+
<span class="shared-by">shared by {{ permission.sharedByUserName }}</span>
|
|
574
|
+
}
|
|
575
|
+
</div>
|
|
576
|
+
|
|
577
|
+
@if (!permission.isEditing) {
|
|
578
|
+
<div class="permission-badges">
|
|
579
|
+
<span class="permission-badge">
|
|
580
|
+
<i class="fa-solid fa-eye"></i> Read
|
|
581
|
+
</span>
|
|
582
|
+
@if (permission.canShare) {
|
|
583
|
+
<span class="permission-badge">
|
|
584
|
+
<i class="fa-solid fa-share-nodes"></i> Share
|
|
585
|
+
</span>
|
|
586
|
+
}
|
|
587
|
+
@if (permission.canEdit) {
|
|
588
|
+
<span class="permission-badge">
|
|
589
|
+
<i class="fa-solid fa-pen-to-square"></i> Edit
|
|
590
|
+
</span>
|
|
591
|
+
}
|
|
592
|
+
</div>
|
|
593
|
+
} @else {
|
|
594
|
+
<div class="permissions-edit-grid">
|
|
595
|
+
<label class="permission-checkbox-small disabled">
|
|
596
|
+
<input type="checkbox" [checked]="true" disabled>
|
|
597
|
+
<span>Read</span>
|
|
598
|
+
</label>
|
|
599
|
+
@if (availablePermissions.includes('Share')) {
|
|
600
|
+
<label class="permission-checkbox-small">
|
|
601
|
+
<input type="checkbox" [(ngModel)]="permission.editingPermissions.canShare">
|
|
602
|
+
<span>Share</span>
|
|
603
|
+
</label>
|
|
604
|
+
}
|
|
605
|
+
@if (availablePermissions.includes('Edit')) {
|
|
606
|
+
<label class="permission-checkbox-small">
|
|
607
|
+
<input type="checkbox" [(ngModel)]="permission.editingPermissions.canEdit">
|
|
608
|
+
<span>Edit</span>
|
|
609
|
+
</label>
|
|
610
|
+
}
|
|
611
|
+
</div>
|
|
612
|
+
}
|
|
613
|
+
</div>
|
|
614
|
+
|
|
615
|
+
@if (canModifyPermissions) {
|
|
616
|
+
<div class="permission-actions">
|
|
617
|
+
@if (!permission.isEditing) {
|
|
618
|
+
<button kendoButton class="btn-icon" (click)="onEditPermission(permission)" title="Edit">
|
|
619
|
+
<i class="fa-solid fa-pen"></i>
|
|
620
|
+
</button>
|
|
621
|
+
<button kendoButton class="btn-icon btn-danger" (click)="onRevokePermission(permission)" title="Remove">
|
|
622
|
+
<i class="fa-solid fa-xmark"></i>
|
|
623
|
+
</button>
|
|
624
|
+
} @else {
|
|
625
|
+
<button kendoButton class="btn-icon btn-success" (click)="onSavePermission(permission)" title="Save">
|
|
626
|
+
<i class="fa-solid fa-check"></i>
|
|
627
|
+
</button>
|
|
628
|
+
<button kendoButton class="btn-icon" (click)="onCancelEdit(permission)" title="Cancel">
|
|
629
|
+
<i class="fa-solid fa-xmark"></i>
|
|
630
|
+
</button>
|
|
631
|
+
}
|
|
632
|
+
</div>
|
|
633
|
+
}
|
|
634
|
+
</div>
|
|
635
|
+
}
|
|
636
|
+
</div>
|
|
637
|
+
}
|
|
638
|
+
</div>
|
|
639
|
+
</div>
|
|
640
|
+
|
|
641
|
+
<div class="modal-actions">
|
|
642
|
+
<button kendoButton (click)="onCancel()">Close</button>
|
|
643
|
+
</div>
|
|
644
|
+
</kendo-window>
|
|
645
|
+
}
|
|
646
|
+
`, styles: [".share-modal-content {\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 20px;\n height: 100%;\n overflow-y: auto;\n}\n\n.section-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 16px;\n font-weight: 600;\n color: #1F2937;\n margin: 0 0 16px 0;\n\n i {\n color: #6366F1;\n }\n}\n\n// Add User Section\n.add-user-section {\n border-bottom: 1px solid #E5E7EB;\n padding-bottom: 24px;\n}\n\n.selected-user-info {\n display: flex;\n align-items: center;\n gap: 12px;\n margin: 16px 0;\n padding: 12px;\n background: #F9FAFB;\n border-radius: 8px;\n}\n\n.user-avatar {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-size: 16px;\n flex-shrink: 0;\n}\n\n.user-details {\n flex: 1;\n min-width: 0;\n\n .user-name {\n font-size: 14px;\n font-weight: 500;\n color: #1F2937;\n }\n\n .user-email {\n font-size: 12px;\n color: #6B7280;\n margin-top: 2px;\n }\n}\n\n.permissions-form {\n margin-top: 16px;\n}\n\n.permissions-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: 12px;\n margin: 16px 0;\n}\n\n.permission-checkbox {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 12px;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.2s;\n\n &:hover:not(.disabled) {\n border-color: #6366F1;\n background: #F9FAFB;\n }\n\n &.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n background: #F3F4F6;\n }\n\n input[type=\"checkbox\"] {\n margin-right: 8px;\n }\n\n .permission-label {\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 500;\n color: #1F2937;\n font-size: 14px;\n\n i {\n color: #6366F1;\n font-size: 12px;\n }\n }\n\n .permission-desc {\n font-size: 12px;\n color: #6B7280;\n margin-left: 28px;\n }\n}\n\n.form-actions {\n display: flex;\n gap: 8px;\n margin-top: 16px;\n}\n\n// Permissions List Section\n.permissions-list-section {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.permissions-list {\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.permission-item {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px;\n border: 1px solid #E5E7EB;\n border-radius: 8px;\n transition: background 0.2s;\n\n &:hover {\n background: #F9FAFB;\n }\n}\n\n.permission-details {\n flex: 1;\n min-width: 0;\n}\n\n.permission-user {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n\n .user-name {\n font-weight: 500;\n color: #1F2937;\n font-size: 14px;\n }\n\n .shared-by {\n font-size: 12px;\n color: #6B7280;\n }\n}\n\n.permission-badges {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.permission-badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 4px 8px;\n background: #EEF2FF;\n color: #6366F1;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n\n i {\n font-size: 10px;\n }\n}\n\n.permissions-edit-grid {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n}\n\n.permission-checkbox-small {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 13px;\n cursor: pointer;\n\n &.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n input[type=\"checkbox\"] {\n margin: 0;\n }\n\n span {\n color: #1F2937;\n }\n}\n\n.permission-actions {\n display: flex;\n gap: 4px;\n}\n\n// Empty State\n.empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px 20px;\n color: #9CA3AF;\n\n i {\n font-size: 48px;\n margin-bottom: 12px;\n }\n\n p {\n margin: 0;\n font-size: 14px;\n }\n}\n\n// Button Styles\n.btn-primary {\n background: #6366F1 !important;\n color: white !important;\n border: none !important;\n padding: 8px 16px;\n border-radius: 6px;\n font-weight: 500;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 6px;\n\n &:hover:not(:disabled) {\n background: #5558E3 !important;\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n i {\n font-size: 12px;\n }\n}\n\n.btn-secondary {\n background: white !important;\n color: #6B7280 !important;\n border: 1px solid #E5E7EB !important;\n padding: 8px 16px;\n border-radius: 6px;\n font-weight: 500;\n cursor: pointer;\n\n &:hover {\n background: #F9FAFB !important;\n border-color: #D1D5DB !important;\n }\n}\n\n.btn-icon {\n width: 32px;\n height: 32px;\n padding: 0;\n border-radius: 6px;\n border: 1px solid #E5E7EB;\n background: white;\n color: #6B7280;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s;\n\n &:hover {\n background: #F9FAFB;\n border-color: #D1D5DB;\n }\n\n &.btn-success {\n color: #10B981;\n border-color: #10B981;\n\n &:hover {\n background: #ECFDF5;\n }\n }\n\n &.btn-danger {\n color: #EF4444;\n border-color: #EF4444;\n\n &:hover {\n background: #FEF2F2;\n }\n }\n\n i {\n font-size: 14px;\n }\n}\n\n.modal-actions {\n display: flex;\n justify-content: flex-end;\n padding: 16px 20px;\n border-top: 1px solid #E5E7EB;\n background: #F9FAFB;\n}\n"] }]
|
|
647
|
+
}], () => [{ type: i1.ArtifactPermissionService }, { type: i0.ChangeDetectorRef }], { isOpen: [{
|
|
648
|
+
type: Input
|
|
649
|
+
}], artifact: [{
|
|
650
|
+
type: Input
|
|
651
|
+
}], currentUser: [{
|
|
652
|
+
type: Input
|
|
653
|
+
}], saved: [{
|
|
654
|
+
type: Output
|
|
655
|
+
}], cancelled: [{
|
|
656
|
+
type: Output
|
|
657
|
+
}] }); })();
|
|
658
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactShareModalComponent, { className: "ArtifactShareModalComponent", filePath: "src/lib/components/artifact/artifact-share-modal.component.ts", lineNumber: 201 }); })();
|
|
659
|
+
//# sourceMappingURL=artifact-share-modal.component.js.map
|