@memberjunction/ng-conversations 6.2.2 → 6.3.0-edge.1
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/README.md +49 -24
- package/dist/assets/edge-ai.worker.js +32515 -0
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +39 -6
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +620 -74
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.js +4 -4
- package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.js +3 -3
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.js +19 -18
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts +6 -4
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +35 -17
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +1 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +109 -107
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +76 -11
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +236 -50
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts +49 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.js +151 -41
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts +11 -3
- package/dist/lib/components/conversation/conversation-remote-browser-controller.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-remote-browser-controller.js +40 -4
- package/dist/lib/components/conversation/conversation-remote-browser-controller.js.map +1 -1
- package/dist/lib/components/export/export-modal.component.d.ts +7 -2
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
- package/dist/lib/components/export/export-modal.component.js +13 -2
- package/dist/lib/components/export/export-modal.component.js.map +1 -1
- package/dist/lib/components/library/library-create-dialog.component.d.ts +136 -0
- package/dist/lib/components/library/library-create-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-create-dialog.component.js +1620 -0
- package/dist/lib/components/library/library-create-dialog.component.js.map +1 -0
- package/dist/lib/components/library/library-full-view.component.d.ts +10 -4
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/library/library-full-view.component.js +216 -40
- package/dist/lib/components/library/library-full-view.component.js.map +1 -1
- package/dist/lib/components/library/library-remote-drive-pane.component.d.ts +97 -0
- package/dist/lib/components/library/library-remote-drive-pane.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-remote-drive-pane.component.js +1229 -0
- package/dist/lib/components/library/library-remote-drive-pane.component.js.map +1 -0
- package/dist/lib/components/library/library-workspace.component.d.ts +265 -0
- package/dist/lib/components/library/library-workspace.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-workspace.component.js +4420 -0
- package/dist/lib/components/library/library-workspace.component.js.map +1 -0
- package/dist/lib/components/library/library.models.d.ts +162 -0
- package/dist/lib/components/library/library.models.d.ts.map +1 -0
- package/dist/lib/components/library/library.models.js +2 -0
- package/dist/lib/components/library/library.models.js.map +1 -0
- package/dist/lib/components/message/conversation-message-rating.component.d.ts +5 -0
- package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.js +72 -16
- package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +26 -14
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +91 -56
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +35 -1
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +583 -392
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +2 -0
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.js +9 -9
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +94 -6
- package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +249 -59
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.d.ts +6 -0
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +81 -61
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/project/project-selector.component.d.ts +5 -0
- package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-selector.component.js +11 -4
- package/dist/lib/components/project/project-selector.component.js.map +1 -1
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.d.ts +55 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.js +944 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-channel.js.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.d.ts +66 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.js +253 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-engine.js.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.d.ts +80 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.js +49 -0
- package/dist/lib/components/realtime/artifact-workspace/artifact-workspace-types.js.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.d.ts +54 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.d.ts.map +1 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.js +386 -0
- package/dist/lib/components/realtime/artifact-workspace/realtime-artifact-workspace-surface.component.js.map +1 -0
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +20 -4
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js +62 -8
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts +1 -0
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js +15 -2
- package/dist/lib/components/realtime/interactive-component/interactive-component-channel.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js +2 -2
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-picker.component.js +3 -3
- package/dist/lib/components/realtime/realtime-agent-picker.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +5 -3
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +81 -32
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +506 -185
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.js +89 -4
- package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-stage.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-stage.model.js +2 -1
- package/dist/lib/components/realtime/realtime-surface-stage.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts +4 -4
- package/dist/lib/components/realtime/realtime-surface-tab-style.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tab-style.js +5 -5
- package/dist/lib/components/realtime/realtime-surface-tab-style.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +7 -9
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +12 -13
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +27 -0
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +141 -2
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts +101 -3
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js +503 -55
- package/dist/lib/components/realtime/remote-browser/remote-browser-surface.component.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js +2 -2
- package/dist/lib/components/realtime/remote-browser/remote-browser-tools.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.d.ts +48 -5
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.js +249 -53
- package/dist/lib/components/realtime/whiteboard/whiteboard-artifact-viewer.component.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
- package/dist/lib/components/search/search-panel.component.d.ts +10 -0
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
- package/dist/lib/components/search/search-panel.component.js +25 -3
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +28 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +51 -6
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.d.ts +31 -8
- package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.js +692 -497
- package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +15 -2
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +66 -61
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +60 -1
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/events/chat-events.d.ts +45 -0
- package/dist/lib/events/chat-events.d.ts.map +1 -1
- package/dist/lib/events/chat-events.js +64 -0
- package/dist/lib/events/chat-events.js.map +1 -1
- package/dist/lib/models/agent-turn.model.d.ts +7 -1
- package/dist/lib/models/agent-turn.model.d.ts.map +1 -1
- package/dist/lib/models/agent-turn.model.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +14 -3
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-permission.service.js +14 -3
- package/dist/lib/services/artifact-permission.service.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +43 -11
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +8 -3
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +9 -3
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-tasks-filter.d.ts +59 -2
- package/dist/lib/services/conversation-tasks-filter.d.ts.map +1 -1
- package/dist/lib/services/conversation-tasks-filter.js +222 -18
- package/dist/lib/services/conversation-tasks-filter.js.map +1 -1
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.d.ts +85 -0
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.js +257 -0
- package/dist/lib/services/edge-ai/edge-agent-pre-discovery.service.js.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.d.ts +85 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.js +10 -0
- package/dist/lib/services/edge-ai/edge-ai-protocol.js.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.d.ts +90 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.js +386 -0
- package/dist/lib/services/edge-ai/edge-ai-worker-host.js.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.d.ts +13 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.d.ts.map +1 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.js +201 -0
- package/dist/lib/services/edge-ai/edge-ai.worker.js.map +1 -0
- package/dist/lib/services/export.service.d.ts +64 -0
- package/dist/lib/services/export.service.d.ts.map +1 -1
- package/dist/lib/services/export.service.js +185 -6
- package/dist/lib/services/export.service.js.map +1 -1
- package/dist/lib/services/library-creation.service.d.ts +304 -0
- package/dist/lib/services/library-creation.service.d.ts.map +1 -0
- package/dist/lib/services/library-creation.service.js +1244 -0
- package/dist/lib/services/library-creation.service.js.map +1 -0
- package/dist/lib/services/realtime-audio-recorder.d.ts +10 -8
- package/dist/lib/services/realtime-audio-recorder.d.ts.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.js +28 -12
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
- package/dist/lib/services/realtime-pairing.d.ts +3 -3
- package/dist/lib/services/realtime-pairing.js +4 -4
- package/dist/lib/services/realtime-pairing.js.map +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts +14 -0
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +46 -4
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +10 -3
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +8 -3
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/search.service.d.ts +19 -2
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +99 -36
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/utils/agent-artifact-summary.d.ts +1 -1
- package/dist/lib/utils/agent-artifact-summary.d.ts.map +1 -1
- package/dist/lib/utils/agent-artifact-summary.js +1 -1
- package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
- package/dist/lib/utils/decision-routing.d.ts +5 -2
- package/dist/lib/utils/decision-routing.d.ts.map +1 -1
- package/dist/lib/utils/decision-routing.js +9 -4
- package/dist/lib/utils/decision-routing.js.map +1 -1
- package/dist/public-api.d.ts +13 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +15 -1
- package/dist/public-api.js.map +1 -1
- package/package.json +42 -37
|
@@ -2,6 +2,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
|
2
2
|
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
3
|
import { RunView, LogError } from '@memberjunction/core';
|
|
4
4
|
import { UUIDsEqual } from '@memberjunction/global';
|
|
5
|
+
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
import * as i1 from "../../services/collection-permission.service";
|
|
7
8
|
import * as i2 from "@memberjunction/ng-ui-components";
|
|
@@ -340,7 +341,7 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
340
341
|
if (parentCollection.OwnerID && !UUIDsEqual(parentCollection.OwnerID, this.CurrentUser.ID)) {
|
|
341
342
|
const permission = await this.permissionService.checkPermission(parentId, this.CurrentUser.ID, this.CurrentUser);
|
|
342
343
|
if (!permission?.canEdit) {
|
|
343
|
-
|
|
344
|
+
MJNotificationService.Instance.CreateSimpleNotification('You do not have Edit permission to create a sub-collection.', 'warning', 4000);
|
|
344
345
|
return;
|
|
345
346
|
}
|
|
346
347
|
}
|
|
@@ -372,7 +373,7 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
372
373
|
}
|
|
373
374
|
catch (error) {
|
|
374
375
|
console.error('Error creating collection:', error);
|
|
375
|
-
|
|
376
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to create collection', 'error', 4000);
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
379
|
/** @deprecated Use {@link OnCreateCollection}. */
|
|
@@ -384,7 +385,7 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
384
385
|
if (collection.OwnerID && !UUIDsEqual(collection.OwnerID, this.CurrentUser.ID)) {
|
|
385
386
|
const permission = await this.permissionService.checkPermission(collection.ID, this.CurrentUser.ID, this.CurrentUser);
|
|
386
387
|
if (!permission?.canDelete) {
|
|
387
|
-
|
|
388
|
+
MJNotificationService.Instance.CreateSimpleNotification('You do not have Delete permission for this collection.', 'warning', 4000);
|
|
388
389
|
return;
|
|
389
390
|
}
|
|
390
391
|
}
|
|
@@ -399,7 +400,7 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
399
400
|
}
|
|
400
401
|
catch (error) {
|
|
401
402
|
console.error('Error deleting collection:', error);
|
|
402
|
-
|
|
403
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to delete collection', 'error', 4000);
|
|
403
404
|
}
|
|
404
405
|
}
|
|
405
406
|
/** @deprecated Use {@link OnDeleteCollection}. */
|
|
@@ -471,7 +472,7 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
471
472
|
}
|
|
472
473
|
// Check if trying to drop into a descendant
|
|
473
474
|
if (this.isDescendant(targetNode, this.DraggedNode)) {
|
|
474
|
-
|
|
475
|
+
MJNotificationService.Instance.CreateSimpleNotification('Cannot move a collection into its own descendant', 'warning', 4000);
|
|
475
476
|
this.DragOverNodeId = null;
|
|
476
477
|
return;
|
|
477
478
|
}
|
|
@@ -486,12 +487,12 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
486
487
|
await this.loadCollections();
|
|
487
488
|
}
|
|
488
489
|
else {
|
|
489
|
-
|
|
490
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to move collection', 'error', 4000);
|
|
490
491
|
}
|
|
491
492
|
}
|
|
492
493
|
catch (error) {
|
|
493
494
|
LogError(error);
|
|
494
|
-
|
|
495
|
+
MJNotificationService.Instance.CreateSimpleNotification('Error moving collection', 'error', 4000);
|
|
495
496
|
}
|
|
496
497
|
finally {
|
|
497
498
|
this.DragOverNodeId = null;
|
|
@@ -529,12 +530,12 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
529
530
|
await this.loadCollections();
|
|
530
531
|
}
|
|
531
532
|
else {
|
|
532
|
-
|
|
533
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to move collection to root', 'error', 4000);
|
|
533
534
|
}
|
|
534
535
|
}
|
|
535
536
|
catch (error) {
|
|
536
537
|
LogError(error);
|
|
537
|
-
|
|
538
|
+
MJNotificationService.Instance.CreateSimpleNotification('Error moving collection to root', 'error', 4000);
|
|
538
539
|
}
|
|
539
540
|
finally {
|
|
540
541
|
this.DragOverNodeId = null;
|
|
@@ -583,7 +584,7 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
583
584
|
return this.CanCreateAtRoot();
|
|
584
585
|
}
|
|
585
586
|
static ɵfac = function CollectionTreeComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CollectionTreeComponent)(i0.ɵɵdirectiveInject(i1.CollectionPermissionService), i0.ɵɵdirectiveInject(i2.MJConfirmService)); };
|
|
586
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CollectionTreeComponent, selectors: [["mj-collection-tree"]], inputs: { EnvironmentId: "EnvironmentId", environmentId: "environmentId", CurrentUser: "CurrentUser", currentUser: "currentUser", SelectedCollectionId: "SelectedCollectionId", selectedCollectionId: "selectedCollectionId", UserPermissions: "UserPermissions", userPermissions: "userPermissions" }, outputs: { CollectionSelected: "CollectionSelected", collectionSelected: "collectionSelected", CollectionCreated: "CollectionCreated", collectionCreated: "collectionCreated", CollectionDeleted: "CollectionDeleted", collectionDeleted: "collectionDeleted" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 3, consts: [["recursiveTree", ""], [1, "collection-tree"], [1, "tree-header"], ["title", "New Collection", 1, "btn-new"], [1, "tree-content", 3, "dragover", "drop"], [1, "tree-node-wrapper"], ["title", "New Collection", 1, "btn-new", 3, "click"], [1, "
|
|
587
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CollectionTreeComponent, selectors: [["mj-collection-tree"]], inputs: { EnvironmentId: "EnvironmentId", environmentId: "environmentId", CurrentUser: "CurrentUser", currentUser: "currentUser", SelectedCollectionId: "SelectedCollectionId", selectedCollectionId: "selectedCollectionId", UserPermissions: "UserPermissions", userPermissions: "userPermissions" }, outputs: { CollectionSelected: "CollectionSelected", collectionSelected: "collectionSelected", CollectionCreated: "CollectionCreated", collectionCreated: "collectionCreated", CollectionDeleted: "CollectionDeleted", collectionDeleted: "collectionDeleted" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 3, consts: [["recursiveTree", ""], [1, "collection-tree"], [1, "tree-header"], ["title", "New Collection", 1, "btn-new"], [1, "tree-content", 3, "dragover", "drop"], [1, "tree-node-wrapper"], ["title", "New Collection", 1, "btn-new", 3, "click"], [1, "fa-solid", "fa-plus"], [1, "tree-node", 3, "click", "dragstart", "dragend", "dragover", "dragleave", "drop", "draggable"], [1, "fas", "toggle-icon", 3, "ngClass"], [1, "fa-solid", "fa-folder", "collection-icon"], [1, "collection-name"], [1, "node-actions", 3, "click"], ["title", "Add sub-collection", 1, "node-action-btn"], ["title", "Delete", 1, "node-action-btn"], [1, "fas", "toggle-icon", 3, "click", "ngClass"], ["title", "Add sub-collection", 1, "node-action-btn", 3, "click"], ["title", "Delete", 1, "node-action-btn", 3, "click"], [1, "fa-solid", "fa-trash"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"]], template: function CollectionTreeComponent_Template(rf, ctx) { if (rf & 1) {
|
|
587
588
|
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h3");
|
|
588
589
|
i0.ɵɵtext(3, "Collections");
|
|
589
590
|
i0.ɵɵelementEnd();
|
|
@@ -611,7 +612,7 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
611
612
|
<h3>Collections</h3>
|
|
612
613
|
@if (canCreateAtRoot()) {
|
|
613
614
|
<button class="btn-new" (click)="onCreateCollection(null)" title="New Collection">
|
|
614
|
-
<i class="
|
|
615
|
+
<i class="fa-solid fa-plus"></i>
|
|
615
616
|
</button>
|
|
616
617
|
}
|
|
617
618
|
</div>
|
|
@@ -643,17 +644,17 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
643
644
|
(click)="toggleNode(node, $event)">
|
|
644
645
|
</i>
|
|
645
646
|
}
|
|
646
|
-
<i class="
|
|
647
|
+
<i class="fa-solid fa-folder collection-icon" [style.color]="node.collection.Color || '#0076B6'"></i>
|
|
647
648
|
<span class="collection-name">{{ node.collection.Name }}</span>
|
|
648
649
|
<div class="node-actions" (click)="$event.stopPropagation()">
|
|
649
650
|
@if (canEdit(node.collection)) {
|
|
650
651
|
<button class="node-action-btn" (click)="onCreateCollection(node.collection.ID)" title="Add sub-collection">
|
|
651
|
-
<i class="
|
|
652
|
+
<i class="fa-solid fa-plus"></i>
|
|
652
653
|
</button>
|
|
653
654
|
}
|
|
654
655
|
@if (canDelete(node.collection)) {
|
|
655
656
|
<button class="node-action-btn" (click)="onDeleteCollection(node.collection)" title="Delete">
|
|
656
|
-
<i class="
|
|
657
|
+
<i class="fa-solid fa-trash"></i>
|
|
657
658
|
</button>
|
|
658
659
|
}
|
|
659
660
|
</div>
|
|
@@ -691,17 +692,17 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
691
692
|
(click)="toggleNode(node, $event)">
|
|
692
693
|
</i>
|
|
693
694
|
}
|
|
694
|
-
<i class="
|
|
695
|
+
<i class="fa-solid fa-folder collection-icon" [style.color]="node.collection.Color || '#0076B6'"></i>
|
|
695
696
|
<span class="collection-name">{{ node.collection.Name }}</span>
|
|
696
697
|
<div class="node-actions" (click)="$event.stopPropagation()">
|
|
697
698
|
@if (canEdit(node.collection)) {
|
|
698
699
|
<button class="node-action-btn" (click)="onCreateCollection(node.collection.ID)" title="Add sub-collection">
|
|
699
|
-
<i class="
|
|
700
|
+
<i class="fa-solid fa-plus"></i>
|
|
700
701
|
</button>
|
|
701
702
|
}
|
|
702
703
|
@if (canDelete(node.collection)) {
|
|
703
704
|
<button class="node-action-btn" (click)="onDeleteCollection(node.collection)" title="Delete">
|
|
704
|
-
<i class="
|
|
705
|
+
<i class="fa-solid fa-trash"></i>
|
|
705
706
|
</button>
|
|
706
707
|
}
|
|
707
708
|
</div>
|
|
@@ -744,5 +745,5 @@ export class CollectionTreeComponent extends BaseAngularComponent {
|
|
|
744
745
|
}], collectionDeleted: [{
|
|
745
746
|
type: Output
|
|
746
747
|
}] }); })();
|
|
747
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CollectionTreeComponent, { className: "CollectionTreeComponent", filePath: "src/lib/components/collection/collection-tree.component.ts", lineNumber:
|
|
748
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CollectionTreeComponent, { className: "CollectionTreeComponent", filePath: "src/lib/components/collection/collection-tree.component.ts", lineNumber: 173 }); })();
|
|
748
749
|
//# sourceMappingURL=collection-tree.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-tree.component.js","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-tree.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAY,OAAO,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;IAuB1C,iCAAkF;IAA1D,2LAAS,0BAAmB,IAAI,CAAC,KAAC;IACxD,uBAA2B;IAC7B,iBAAS;;;;IAyBH,6BAGqC;IAAnC,g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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GT;;kBAwCA,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAQL,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kFAvEI,uBAAuB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCollectionEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView, Metadata, LogError } from '@memberjunction/core';\nimport { CollectionPermission, CollectionPermissionService } from '../../services/collection-permission.service';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\n\ninterface TreeNode {\n collection: MJCollectionEntity;\n children: TreeNode[];\n expanded: boolean;\n level: number;\n}\n\ninterface DragData {\n collectionId: string;\n parentId: string | null;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-collection-tree',\n template: `\n <div class=\"collection-tree\">\n <div class=\"tree-header\">\n <h3>Collections</h3>\n @if (canCreateAtRoot()) {\n <button class=\"btn-new\" (click)=\"onCreateCollection(null)\" title=\"New Collection\">\n <i class=\"fas fa-plus\"></i>\n </button>\n }\n </div>\n\n <div\n class=\"tree-content\"\n [class.drag-over-root]=\"dragOverNodeId === 'root'\"\n (dragover)=\"onDragOverRoot($event)\"\n (drop)=\"onDropRoot($event)\">\n @for (node of treeNodes; track node.collection.ID) {\n <div class=\"tree-node-wrapper\">\n <div\n class=\"tree-node\"\n [class.selected]=\"IsCollectionSelected(node)\"\n [class.drag-over]=\"dragOverNodeId === node.collection.ID\"\n [class.dragging]=\"IsCollectionDragging(node)\"\n [style.padding-left.px]=\"node.level * 20\"\n [draggable]=\"true\"\n (click)=\"onSelectCollection(node.collection)\"\n (dragstart)=\"onDragStart($event, node)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event, node)\"\n (dragleave)=\"onDragLeave($event, node)\"\n (drop)=\"onDrop($event, node)\">\n @if (node.children.length > 0) {\n <i\n class=\"fas toggle-icon\"\n [ngClass]=\"node.expanded ? 'fa-chevron-down' : 'fa-chevron-right'\"\n (click)=\"toggleNode(node, $event)\">\n </i>\n }\n <i class=\"fas fa-folder collection-icon\" [style.color]=\"node.collection.Color || '#0076B6'\"></i>\n <span class=\"collection-name\">{{ node.collection.Name }}</span>\n <div class=\"node-actions\" (click)=\"$event.stopPropagation()\">\n @if (canEdit(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onCreateCollection(node.collection.ID)\" title=\"Add sub-collection\">\n <i class=\"fas fa-plus\"></i>\n </button>\n }\n @if (canDelete(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onDeleteCollection(node.collection)\" title=\"Delete\">\n <i class=\"fas fa-trash\"></i>\n </button>\n }\n </div>\n </div>\n\n @if (node.expanded) {\n @for (child of node.children; track child.collection.ID) {\n <ng-container *ngTemplateOutlet=\"recursiveTree; context: { node: child }\"></ng-container>\n }\n }\n </div>\n }\n </div>\n </div>\n\n <ng-template #recursiveTree let-node=\"node\">\n <div class=\"tree-node-wrapper\">\n <div\n class=\"tree-node\"\n [class.selected]=\"IsCollectionSelected(node)\"\n [class.drag-over]=\"dragOverNodeId === node.collection.ID\"\n [class.dragging]=\"IsCollectionDragging(node)\"\n [style.padding-left.px]=\"node.level * 20\"\n [draggable]=\"true\"\n (click)=\"onSelectCollection(node.collection)\"\n (dragstart)=\"onDragStart($event, node)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event, node)\"\n (dragleave)=\"onDragLeave($event, node)\"\n (drop)=\"onDrop($event, node)\">\n @if (node.children.length > 0) {\n <i\n class=\"fas toggle-icon\"\n [ngClass]=\"node.expanded ? 'fa-chevron-down' : 'fa-chevron-right'\"\n (click)=\"toggleNode(node, $event)\">\n </i>\n }\n <i class=\"fas fa-folder collection-icon\" [style.color]=\"node.collection.Color || '#0076B6'\"></i>\n <span class=\"collection-name\">{{ node.collection.Name }}</span>\n <div class=\"node-actions\" (click)=\"$event.stopPropagation()\">\n @if (canEdit(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onCreateCollection(node.collection.ID)\" title=\"Add sub-collection\">\n <i class=\"fas fa-plus\"></i>\n </button>\n }\n @if (canDelete(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onDeleteCollection(node.collection)\" title=\"Delete\">\n <i class=\"fas fa-trash\"></i>\n </button>\n }\n </div>\n </div>\n\n @if (node.expanded) {\n @for (child of node.children; track child.collection.ID) {\n <ng-container *ngTemplateOutlet=\"recursiveTree; context: { node: child }\"></ng-container>\n }\n }\n </div>\n </ng-template>\n `,\n styles: [`\n .collection-tree { display: flex; flex-direction: column; height: 100%; }\n .tree-header { padding: 16px; border-bottom: 1px solid var(--mj-border-default); display: flex; justify-content: space-between; align-items: center; }\n .tree-header h3 { margin: 0; font-size: 16px; }\n .btn-new { padding: 6px 10px; background: var(--mj-brand-primary); color: var(--mj-text-inverse); border: none; border-radius: 4px; cursor: pointer; }\n .btn-new:hover { background: var(--mj-brand-primary-hover); }\n .tree-content { flex: 1; overflow-y: auto; position: relative; }\n .tree-content.drag-over-root { background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface)); }\n .tree-node {\n padding: 8px 12px;\n cursor: move;\n display: flex;\n align-items: center;\n gap: 8px;\n position: relative;\n transition: all 0.2s ease;\n border: 2px solid transparent;\n }\n .tree-node:hover { background: var(--mj-bg-surface-sunken); }\n .tree-node.selected { background: var(--mj-brand-accent); }\n .tree-node.dragging {\n opacity: 0.4;\n cursor: grabbing;\n }\n .tree-node.drag-over {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n border: 2px dashed var(--mj-brand-primary);\n border-radius: 4px;\n }\n .toggle-icon { font-size: 10px; color: var(--mj-text-disabled); cursor: pointer; width: 12px; }\n .collection-icon { font-size: 14px; }\n .collection-name { flex: 1; font-size: 14px; user-select: none; }\n .node-actions { display: none; gap: 4px; }\n .tree-node:hover .node-actions { display: flex; }\n .node-action-btn { padding: 4px 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: var(--mj-text-muted); }\n .node-action-btn:hover { background: var(--mj-bg-surface-sunken); }\n `]\n})\nexport class CollectionTreeComponent extends BaseAngularComponent implements OnInit {\n @Input() EnvironmentId!: string;\n\n /** @deprecated Use {@link EnvironmentId}. */\n @Input() set environmentId(value: string) {\n this.EnvironmentId = value;\n }\n /** @deprecated Use {@link EnvironmentId}. */\n get environmentId(): string {\n return this.EnvironmentId;\n }\n @Input() CurrentUser!: UserInfo;\n\n /** @deprecated Use {@link CurrentUser}. */\n @Input() set currentUser(value: UserInfo) {\n this.CurrentUser = value;\n }\n /** @deprecated Use {@link CurrentUser}. */\n get currentUser(): UserInfo {\n return this.CurrentUser;\n }\n @Input() SelectedCollectionId: string | null = null;\n\n /** @deprecated Use {@link SelectedCollectionId}. */\n @Input() set selectedCollectionId(value: string | null) {\n this.SelectedCollectionId = value;\n }\n /** @deprecated Use {@link SelectedCollectionId}. */\n get selectedCollectionId(): string | null {\n return this.SelectedCollectionId;\n }\n @Input() UserPermissions: Map<string, CollectionPermission> = new Map();\n\n /** @deprecated Use {@link UserPermissions}. */\n @Input() set userPermissions(value: Map<string, CollectionPermission>) {\n this.UserPermissions = value;\n }\n /** @deprecated Use {@link UserPermissions}. */\n get userPermissions(): Map<string, CollectionPermission> {\n return this.UserPermissions;\n }\n\n @Output() CollectionSelected = new EventEmitter<MJCollectionEntity>();\n\n /**\n * @deprecated Use {@link CollectionSelected}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (collectionSelected) keeps working. Must stay AFTER CollectionSelected: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() collectionSelected = this.CollectionSelected;\n @Output() CollectionCreated = new EventEmitter<MJCollectionEntity>();\n\n /**\n * @deprecated Use {@link CollectionCreated}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (collectionCreated) keeps working. Must stay AFTER CollectionCreated: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() collectionCreated = this.CollectionCreated;\n @Output() CollectionDeleted = new EventEmitter<MJCollectionEntity>();\n\n /**\n * @deprecated Use {@link CollectionDeleted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (collectionDeleted) keeps working. Must stay AFTER CollectionDeleted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() collectionDeleted = this.CollectionDeleted;\n\n public Collections: MJCollectionEntity[] = [];\n\n /** @deprecated Use {@link Collections}. */\n public get collections(): MJCollectionEntity[] {\n return this.Collections;\n }\n /** @deprecated Use {@link Collections}. */\n public set collections(value: MJCollectionEntity[]) {\n this.Collections = value;\n }\n public TreeNodes: TreeNode[] = [];\n\n /** @deprecated Use {@link TreeNodes}. */\n public get treeNodes(): TreeNode[] {\n return this.TreeNodes;\n }\n /** @deprecated Use {@link TreeNodes}. */\n public set treeNodes(value: TreeNode[]) {\n this.TreeNodes = value;\n }\n public DraggedNode: TreeNode | null = null;\n\n /** @deprecated Use {@link DraggedNode}. */\n public get draggedNode(): TreeNode | null {\n return this.DraggedNode;\n }\n /** @deprecated Use {@link DraggedNode}. */\n public set draggedNode(value: TreeNode | null) {\n this.DraggedNode = value;\n }\n public DragOverNodeId: string | null = null;\n\n /** @deprecated Use {@link DragOverNodeId}. */\n public get dragOverNodeId(): string | null {\n return this.DragOverNodeId;\n }\n /** @deprecated Use {@link DragOverNodeId}. */\n public set dragOverNodeId(value: string | null) {\n this.DragOverNodeId = value;\n }\n\n constructor(private permissionService: CollectionPermissionService, private confirmService: MJConfirmService) {\n super();}\n\n ngOnInit() {\n this.permissionService.Provider = this.ProviderToUse;\n this.loadCollections();\n }\n\n private async loadCollections(): Promise<void> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCollectionEntity>({\n EntityName: 'MJ: Collections',\n ExtraFilter: `EnvironmentID='${this.EnvironmentId}'`,\n OrderBy: 'Sequence ASC, Name ASC',\n ResultType: 'entity_object'\n }, this.CurrentUser);\n\n if (result.Success) {\n this.Collections = result.Results || [];\n this.buildTree();\n }\n } catch (error) {\n console.error('Error loading collections:', error);\n }\n }\n\n private buildTree(): void {\n const rootCollections = this.Collections.filter(c => !c.ParentID);\n this.TreeNodes = rootCollections.map(c => this.buildNode(c, 0));\n }\n\n private buildNode(collection: MJCollectionEntity, level: number): TreeNode {\n const children = this.Collections.filter(c => UUIDsEqual(c.ParentID, collection.ID));\n return {\n collection,\n children: children.map(c => this.buildNode(c, level + 1)),\n expanded: level === 0,\n level\n };\n }\n\n ToggleNode(node: TreeNode, event: Event): void {\n event.stopPropagation();\n node.expanded = !node.expanded;\n }\n\n /** @deprecated Use {@link ToggleNode}. */\n toggleNode(node: TreeNode, event: Event): void {\n return this.ToggleNode(node, event);\n }\n\n IsCollectionSelected(node: TreeNode): boolean {\n return UUIDsEqual(node.collection.ID, this.SelectedCollectionId);\n }\n\n IsCollectionDragging(node: TreeNode): boolean {\n return UUIDsEqual(this.DraggedNode?.collection?.ID, node.collection.ID);\n }\n\n OnSelectCollection(collection: MJCollectionEntity): void {\n this.SelectedCollectionId = collection.ID;\n this.CollectionSelected.emit(collection);\n }\n\n /** @deprecated Use {@link OnSelectCollection}. */\n onSelectCollection(collection: MJCollectionEntity): void {\n return this.OnSelectCollection(collection);\n }\n\n async OnCreateCollection(parentId: string | null): Promise<void> {\n // Validate permission if creating child collection\n if (parentId) {\n const parentCollection = this.Collections.find(c => UUIDsEqual(c.ID, parentId));\n if (parentCollection) {\n // Check if user has Edit permission on parent\n if (parentCollection.OwnerID && !UUIDsEqual(parentCollection.OwnerID, this.CurrentUser.ID)) {\n const permission = await this.permissionService.checkPermission(\n parentId,\n this.CurrentUser.ID,\n this.CurrentUser\n );\n\n if (!permission?.canEdit) {\n alert('You do not have Edit permission to create a sub-collection.');\n return;\n }\n }\n }\n }\n\n const name = prompt('Enter collection name:');\n if (!name) return;\n\n try {\n const md = this.ProviderToUse;\n const collection = await md.GetEntityObject<MJCollectionEntity>('MJ: Collections', this.CurrentUser);\n\n collection.Name = name;\n collection.EnvironmentID = this.EnvironmentId;\n\n if (parentId) {\n // Child collection - inherit parent's owner and set parent\n const parentCollection = this.Collections.find(c => UUIDsEqual(c.ID, parentId));\n collection.ParentID = parentId;\n collection.OwnerID = parentCollection?.OwnerID || this.CurrentUser.ID;\n } else {\n // Root collection - current user becomes owner\n collection.OwnerID = this.CurrentUser.ID;\n }\n\n const saved = await collection.Save();\n if (saved) {\n this.CollectionCreated.emit(collection);\n await this.loadCollections();\n }\n } catch (error) {\n console.error('Error creating collection:', error);\n alert('Failed to create collection');\n }\n }\n\n /** @deprecated Use {@link OnCreateCollection}. */\n async onCreateCollection(parentId: string | null): Promise<void> {\n return this.OnCreateCollection(parentId);\n }\n\n async OnDeleteCollection(collection: MJCollectionEntity): Promise<void> {\n // Validate Delete permission\n if (collection.OwnerID && !UUIDsEqual(collection.OwnerID, this.CurrentUser.ID)) {\n const permission = await this.permissionService.checkPermission(\n collection.ID,\n this.CurrentUser.ID,\n this.CurrentUser\n );\n\n if (!permission?.canDelete) {\n alert('You do not have Delete permission for this collection.');\n return;\n }\n }\n\n if (!(await this.confirmService.ConfirmDelete({ title: 'Delete Collection', message: `Delete collection \"${collection.Name}\"?` }))) return;\n\n try {\n const deleted = await collection.Delete();\n if (deleted) {\n this.CollectionDeleted.emit(collection);\n await this.loadCollections();\n }\n } catch (error) {\n console.error('Error deleting collection:', error);\n alert('Failed to delete collection');\n }\n }\n\n /** @deprecated Use {@link OnDeleteCollection}. */\n async onDeleteCollection(collection: MJCollectionEntity): Promise<void> {\n return this.OnDeleteCollection(collection);\n }\n\n OnDragStart(event: DragEvent, node: TreeNode): void {\n this.DraggedNode = node;\n const dragData: DragData = {\n collectionId: node.collection.ID,\n parentId: node.collection.ParentID || null\n };\n event.dataTransfer!.effectAllowed = 'move';\n event.dataTransfer!.setData('application/json', JSON.stringify(dragData));\n\n // Add visual feedback\n (event.target as HTMLElement).style.opacity = '0.4';\n }\n\n /** @deprecated Use {@link OnDragStart}. */\n onDragStart(event: DragEvent, node: TreeNode): void {\n return this.OnDragStart(event, node);\n }\n\n OnDragEnd(event: DragEvent): void {\n // Clean up visual feedback\n (event.target as HTMLElement).style.opacity = '1';\n this.DraggedNode = null;\n this.DragOverNodeId = null;\n }\n\n /** @deprecated Use {@link OnDragEnd}. */\n onDragEnd(event: DragEvent): void {\n return this.OnDragEnd(event);\n }\n\n OnDragOver(event: DragEvent, targetNode: TreeNode): void {\n event.preventDefault(); // Required to allow drop\n\n if (!this.DraggedNode || UUIDsEqual(this.DraggedNode.collection.ID, targetNode.collection.ID)) {\n event.dataTransfer!.dropEffect = 'none';\n return;\n }\n\n // Check if trying to drop into a descendant\n if (this.isDescendant(targetNode, this.DraggedNode)) {\n event.dataTransfer!.dropEffect = 'none';\n return;\n }\n\n event.dataTransfer!.dropEffect = 'move';\n this.DragOverNodeId = targetNode.collection.ID;\n }\n\n /** @deprecated Use {@link OnDragOver}. */\n onDragOver(event: DragEvent, targetNode: TreeNode): void {\n return this.OnDragOver(event, targetNode);\n }\n\n OnDragLeave(event: DragEvent, targetNode: TreeNode): void {\n if (this.DragOverNodeId === targetNode.collection.ID) {\n this.DragOverNodeId = null;\n }\n }\n\n /** @deprecated Use {@link OnDragLeave}. */\n onDragLeave(event: DragEvent, targetNode: TreeNode): void {\n return this.OnDragLeave(event, targetNode);\n }\n\n async OnDrop(event: DragEvent, targetNode: TreeNode): Promise<void> {\n event.preventDefault();\n event.stopPropagation();\n\n if (!this.DraggedNode) {\n return;\n }\n\n // Don't allow dropping on itself\n if (UUIDsEqual(this.DraggedNode.collection.ID, targetNode.collection.ID)) {\n this.DragOverNodeId = null;\n return;\n }\n\n // Check if trying to drop into a descendant\n if (this.isDescendant(targetNode, this.DraggedNode)) {\n alert('Cannot move a collection into its own descendant');\n this.DragOverNodeId = null;\n return;\n }\n\n try {\n const collection = this.DraggedNode.collection;\n const newParentId = targetNode.collection.ID;\n\n // Update the collection's parent\n collection.ParentID = newParentId;\n\n const saved = await collection.Save();\n if (saved) {\n // Reload the tree to reflect changes\n await this.loadCollections();\n } else {\n alert('Failed to move collection');\n }\n } catch (error) {\n LogError(error);\n alert('Error moving collection');\n } finally {\n this.DragOverNodeId = null;\n }\n }\n\n /** @deprecated Use {@link OnDrop}. */\n async onDrop(event: DragEvent, targetNode: TreeNode): Promise<void> {\n return this.OnDrop(event, targetNode);\n }\n\n OnDragOverRoot(event: DragEvent): void {\n event.preventDefault();\n\n if (!this.DraggedNode) {\n event.dataTransfer!.dropEffect = 'none';\n return;\n }\n\n event.dataTransfer!.dropEffect = 'move';\n this.DragOverNodeId = 'root';\n }\n\n /** @deprecated Use {@link OnDragOverRoot}. */\n onDragOverRoot(event: DragEvent): void {\n return this.OnDragOverRoot(event);\n }\n\n async OnDropRoot(event: DragEvent): Promise<void> {\n event.preventDefault();\n event.stopPropagation();\n\n if (!this.DraggedNode) {\n return;\n }\n\n try {\n const collection = this.DraggedNode.collection;\n\n // Move to root level\n collection.ParentID = null;\n\n const saved = await collection.Save();\n if (saved) {\n await this.loadCollections();\n } else {\n alert('Failed to move collection to root');\n }\n } catch (error) {\n LogError(error);\n alert('Error moving collection to root');\n } finally {\n this.DragOverNodeId = null;\n }\n }\n\n /** @deprecated Use {@link OnDropRoot}. */\n async onDropRoot(event: DragEvent): Promise<void> {\n return this.OnDropRoot(event);\n }\n\n private isDescendant(potentialDescendant: TreeNode, ancestor: TreeNode): boolean {\n if (UUIDsEqual(potentialDescendant.collection.ParentID, ancestor.collection.ID)) {\n return true;\n }\n\n for (const child of ancestor.children) {\n if (this.isDescendant(potentialDescendant, child)) {\n return true;\n }\n }\n\n return false;\n }\n\n // Permission checking methods\n canEdit(collection: MJCollectionEntity): boolean {\n // Backwards compatibility: treat null OwnerID as owned by current user\n if (!collection.OwnerID || UUIDsEqual(collection.OwnerID, this.CurrentUser.ID)) {\n return true;\n }\n\n // Check permission record\n const permission = this.UserPermissions.get(collection.ID);\n return permission?.canEdit || false;\n }\n\n canDelete(collection: MJCollectionEntity): boolean {\n // Backwards compatibility: treat null OwnerID as owned by current user\n if (!collection.OwnerID || UUIDsEqual(collection.OwnerID, this.CurrentUser.ID)) {\n return true;\n }\n\n // Check permission record\n const permission = this.UserPermissions.get(collection.ID);\n return permission?.canDelete || false;\n }\n\n CanCreateAtRoot(): boolean {\n // Anyone can create at root level\n return true;\n }\n\n /** @deprecated Use {@link CanCreateAtRoot}. */\n canCreateAtRoot(): boolean {\n return this.CanCreateAtRoot();\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"collection-tree.component.js","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-tree.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAY,OAAO,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;IAsB/D,iCAAkF;IAA1D,2LAAS,0BAAmB,IAAI,CAAC,KAAC;IACxD,uBAAgC;IAClC,iBAAS;;;;IAyBH,6BAGqC;IAAnC,gPAAS,kCAAwB,KAAC;IACpC,iBAAI;;;IAFF,mFAAkE;;;;IAQlE,kCAA4G;IAA5E,+OAAS,gDAAsC,KAAC;IAC9E,uBAAgC;IAClC,iBAAS;;;;IAGT,kCAA6F;IAA7D,+OAAS,6CAAmC,KAAC;IAC3E,wBAAiC;IACnC,iBAAS;;;IAOX,wBAAyF;;;IAAzF,qH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4CC;YAEL,AADE,iBAAM,EACF;YAEN,2HAA4C;;YA5DxC,eAIC;YAJD,gDAIC;YAKD,cAAkD;YAAlD,+DAAkD;YAGlD,cA4CC;YA5CD,4BA4CC;;;iFAwFI,uBAAuB;cAvJnC,SAAS;6BACI,KAAK,YACP,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GT;;kBAwCA,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAQL,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kBACN,MAAM;;kBASN,MAAM;;kFAvEI,uBAAuB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCollectionEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView, Metadata, LogError } from '@memberjunction/core';\nimport { CollectionPermission, CollectionPermissionService } from '../../services/collection-permission.service';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\n\ninterface TreeNode {\n collection: MJCollectionEntity;\n children: TreeNode[];\n expanded: boolean;\n level: number;\n}\n\ninterface DragData {\n collectionId: string;\n parentId: string | null;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-collection-tree',\n template: `\n <div class=\"collection-tree\">\n <div class=\"tree-header\">\n <h3>Collections</h3>\n @if (canCreateAtRoot()) {\n <button class=\"btn-new\" (click)=\"onCreateCollection(null)\" title=\"New Collection\">\n <i class=\"fa-solid fa-plus\"></i>\n </button>\n }\n </div>\n\n <div\n class=\"tree-content\"\n [class.drag-over-root]=\"dragOverNodeId === 'root'\"\n (dragover)=\"onDragOverRoot($event)\"\n (drop)=\"onDropRoot($event)\">\n @for (node of treeNodes; track node.collection.ID) {\n <div class=\"tree-node-wrapper\">\n <div\n class=\"tree-node\"\n [class.selected]=\"IsCollectionSelected(node)\"\n [class.drag-over]=\"dragOverNodeId === node.collection.ID\"\n [class.dragging]=\"IsCollectionDragging(node)\"\n [style.padding-left.px]=\"node.level * 20\"\n [draggable]=\"true\"\n (click)=\"onSelectCollection(node.collection)\"\n (dragstart)=\"onDragStart($event, node)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event, node)\"\n (dragleave)=\"onDragLeave($event, node)\"\n (drop)=\"onDrop($event, node)\">\n @if (node.children.length > 0) {\n <i\n class=\"fas toggle-icon\"\n [ngClass]=\"node.expanded ? 'fa-chevron-down' : 'fa-chevron-right'\"\n (click)=\"toggleNode(node, $event)\">\n </i>\n }\n <i class=\"fa-solid fa-folder collection-icon\" [style.color]=\"node.collection.Color || '#0076B6'\"></i>\n <span class=\"collection-name\">{{ node.collection.Name }}</span>\n <div class=\"node-actions\" (click)=\"$event.stopPropagation()\">\n @if (canEdit(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onCreateCollection(node.collection.ID)\" title=\"Add sub-collection\">\n <i class=\"fa-solid fa-plus\"></i>\n </button>\n }\n @if (canDelete(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onDeleteCollection(node.collection)\" title=\"Delete\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n }\n </div>\n </div>\n\n @if (node.expanded) {\n @for (child of node.children; track child.collection.ID) {\n <ng-container *ngTemplateOutlet=\"recursiveTree; context: { node: child }\"></ng-container>\n }\n }\n </div>\n }\n </div>\n </div>\n\n <ng-template #recursiveTree let-node=\"node\">\n <div class=\"tree-node-wrapper\">\n <div\n class=\"tree-node\"\n [class.selected]=\"IsCollectionSelected(node)\"\n [class.drag-over]=\"dragOverNodeId === node.collection.ID\"\n [class.dragging]=\"IsCollectionDragging(node)\"\n [style.padding-left.px]=\"node.level * 20\"\n [draggable]=\"true\"\n (click)=\"onSelectCollection(node.collection)\"\n (dragstart)=\"onDragStart($event, node)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event, node)\"\n (dragleave)=\"onDragLeave($event, node)\"\n (drop)=\"onDrop($event, node)\">\n @if (node.children.length > 0) {\n <i\n class=\"fas toggle-icon\"\n [ngClass]=\"node.expanded ? 'fa-chevron-down' : 'fa-chevron-right'\"\n (click)=\"toggleNode(node, $event)\">\n </i>\n }\n <i class=\"fa-solid fa-folder collection-icon\" [style.color]=\"node.collection.Color || '#0076B6'\"></i>\n <span class=\"collection-name\">{{ node.collection.Name }}</span>\n <div class=\"node-actions\" (click)=\"$event.stopPropagation()\">\n @if (canEdit(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onCreateCollection(node.collection.ID)\" title=\"Add sub-collection\">\n <i class=\"fa-solid fa-plus\"></i>\n </button>\n }\n @if (canDelete(node.collection)) {\n <button class=\"node-action-btn\" (click)=\"onDeleteCollection(node.collection)\" title=\"Delete\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n }\n </div>\n </div>\n\n @if (node.expanded) {\n @for (child of node.children; track child.collection.ID) {\n <ng-container *ngTemplateOutlet=\"recursiveTree; context: { node: child }\"></ng-container>\n }\n }\n </div>\n </ng-template>\n `,\n styles: [`\n .collection-tree { display: flex; flex-direction: column; height: 100%; }\n .tree-header { padding: 16px; border-bottom: 1px solid var(--mj-border-default); display: flex; justify-content: space-between; align-items: center; }\n .tree-header h3 { margin: 0; font-size: 16px; }\n .btn-new { padding: 6px 10px; background: var(--mj-brand-primary); color: var(--mj-text-inverse); border: none; border-radius: 4px; cursor: pointer; }\n .btn-new:hover { background: var(--mj-brand-primary-hover); }\n .tree-content { flex: 1; overflow-y: auto; position: relative; }\n .tree-content.drag-over-root { background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface)); }\n .tree-node {\n padding: 8px 12px;\n cursor: move;\n display: flex;\n align-items: center;\n gap: 8px;\n position: relative;\n transition: all 0.2s ease;\n border: 2px solid transparent;\n }\n .tree-node:hover { background: var(--mj-bg-surface-sunken); }\n .tree-node.selected { background: var(--mj-brand-accent); }\n .tree-node.dragging {\n opacity: 0.4;\n cursor: grabbing;\n }\n .tree-node.drag-over {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n border: 2px dashed var(--mj-brand-primary);\n border-radius: 4px;\n }\n .toggle-icon { font-size: 10px; color: var(--mj-text-disabled); cursor: pointer; width: 12px; }\n .collection-icon { font-size: 14px; }\n .collection-name { flex: 1; font-size: 14px; user-select: none; }\n .node-actions { display: none; gap: 4px; }\n .tree-node:hover .node-actions { display: flex; }\n .node-action-btn { padding: 4px 6px; background: transparent; border: none; cursor: pointer; border-radius: 3px; color: var(--mj-text-muted); }\n .node-action-btn:hover { background: var(--mj-bg-surface-sunken); }\n `]\n})\nexport class CollectionTreeComponent extends BaseAngularComponent implements OnInit {\n @Input() EnvironmentId!: string;\n\n /** @deprecated Use {@link EnvironmentId}. */\n @Input() set environmentId(value: string) {\n this.EnvironmentId = value;\n }\n /** @deprecated Use {@link EnvironmentId}. */\n get environmentId(): string {\n return this.EnvironmentId;\n }\n @Input() CurrentUser!: UserInfo;\n\n /** @deprecated Use {@link CurrentUser}. */\n @Input() set currentUser(value: UserInfo) {\n this.CurrentUser = value;\n }\n /** @deprecated Use {@link CurrentUser}. */\n get currentUser(): UserInfo {\n return this.CurrentUser;\n }\n @Input() SelectedCollectionId: string | null = null;\n\n /** @deprecated Use {@link SelectedCollectionId}. */\n @Input() set selectedCollectionId(value: string | null) {\n this.SelectedCollectionId = value;\n }\n /** @deprecated Use {@link SelectedCollectionId}. */\n get selectedCollectionId(): string | null {\n return this.SelectedCollectionId;\n }\n @Input() UserPermissions: Map<string, CollectionPermission> = new Map();\n\n /** @deprecated Use {@link UserPermissions}. */\n @Input() set userPermissions(value: Map<string, CollectionPermission>) {\n this.UserPermissions = value;\n }\n /** @deprecated Use {@link UserPermissions}. */\n get userPermissions(): Map<string, CollectionPermission> {\n return this.UserPermissions;\n }\n\n @Output() CollectionSelected = new EventEmitter<MJCollectionEntity>();\n\n /**\n * @deprecated Use {@link CollectionSelected}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (collectionSelected) keeps working. Must stay AFTER CollectionSelected: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() collectionSelected = this.CollectionSelected;\n @Output() CollectionCreated = new EventEmitter<MJCollectionEntity>();\n\n /**\n * @deprecated Use {@link CollectionCreated}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (collectionCreated) keeps working. Must stay AFTER CollectionCreated: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() collectionCreated = this.CollectionCreated;\n @Output() CollectionDeleted = new EventEmitter<MJCollectionEntity>();\n\n /**\n * @deprecated Use {@link CollectionDeleted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (collectionDeleted) keeps working. Must stay AFTER CollectionDeleted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() collectionDeleted = this.CollectionDeleted;\n\n public Collections: MJCollectionEntity[] = [];\n\n /** @deprecated Use {@link Collections}. */\n public get collections(): MJCollectionEntity[] {\n return this.Collections;\n }\n /** @deprecated Use {@link Collections}. */\n public set collections(value: MJCollectionEntity[]) {\n this.Collections = value;\n }\n public TreeNodes: TreeNode[] = [];\n\n /** @deprecated Use {@link TreeNodes}. */\n public get treeNodes(): TreeNode[] {\n return this.TreeNodes;\n }\n /** @deprecated Use {@link TreeNodes}. */\n public set treeNodes(value: TreeNode[]) {\n this.TreeNodes = value;\n }\n public DraggedNode: TreeNode | null = null;\n\n /** @deprecated Use {@link DraggedNode}. */\n public get draggedNode(): TreeNode | null {\n return this.DraggedNode;\n }\n /** @deprecated Use {@link DraggedNode}. */\n public set draggedNode(value: TreeNode | null) {\n this.DraggedNode = value;\n }\n public DragOverNodeId: string | null = null;\n\n /** @deprecated Use {@link DragOverNodeId}. */\n public get dragOverNodeId(): string | null {\n return this.DragOverNodeId;\n }\n /** @deprecated Use {@link DragOverNodeId}. */\n public set dragOverNodeId(value: string | null) {\n this.DragOverNodeId = value;\n }\n\n constructor(private permissionService: CollectionPermissionService, private confirmService: MJConfirmService) {\n super();}\n\n ngOnInit() {\n this.permissionService.Provider = this.ProviderToUse;\n this.loadCollections();\n }\n\n private async loadCollections(): Promise<void> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCollectionEntity>({\n EntityName: 'MJ: Collections',\n ExtraFilter: `EnvironmentID='${this.EnvironmentId}'`,\n OrderBy: 'Sequence ASC, Name ASC',\n ResultType: 'entity_object'\n }, this.CurrentUser);\n\n if (result.Success) {\n this.Collections = result.Results || [];\n this.buildTree();\n }\n } catch (error) {\n console.error('Error loading collections:', error);\n }\n }\n\n private buildTree(): void {\n const rootCollections = this.Collections.filter(c => !c.ParentID);\n this.TreeNodes = rootCollections.map(c => this.buildNode(c, 0));\n }\n\n private buildNode(collection: MJCollectionEntity, level: number): TreeNode {\n const children = this.Collections.filter(c => UUIDsEqual(c.ParentID, collection.ID));\n return {\n collection,\n children: children.map(c => this.buildNode(c, level + 1)),\n expanded: level === 0,\n level\n };\n }\n\n ToggleNode(node: TreeNode, event: Event): void {\n event.stopPropagation();\n node.expanded = !node.expanded;\n }\n\n /** @deprecated Use {@link ToggleNode}. */\n toggleNode(node: TreeNode, event: Event): void {\n return this.ToggleNode(node, event);\n }\n\n IsCollectionSelected(node: TreeNode): boolean {\n return UUIDsEqual(node.collection.ID, this.SelectedCollectionId);\n }\n\n IsCollectionDragging(node: TreeNode): boolean {\n return UUIDsEqual(this.DraggedNode?.collection?.ID, node.collection.ID);\n }\n\n OnSelectCollection(collection: MJCollectionEntity): void {\n this.SelectedCollectionId = collection.ID;\n this.CollectionSelected.emit(collection);\n }\n\n /** @deprecated Use {@link OnSelectCollection}. */\n onSelectCollection(collection: MJCollectionEntity): void {\n return this.OnSelectCollection(collection);\n }\n\n async OnCreateCollection(parentId: string | null): Promise<void> {\n // Validate permission if creating child collection\n if (parentId) {\n const parentCollection = this.Collections.find(c => UUIDsEqual(c.ID, parentId));\n if (parentCollection) {\n // Check if user has Edit permission on parent\n if (parentCollection.OwnerID && !UUIDsEqual(parentCollection.OwnerID, this.CurrentUser.ID)) {\n const permission = await this.permissionService.checkPermission(\n parentId,\n this.CurrentUser.ID,\n this.CurrentUser\n );\n\n if (!permission?.canEdit) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'You do not have Edit permission to create a sub-collection.',\n 'warning',\n 4000\n );\n return;\n }\n }\n }\n }\n\n const name = prompt('Enter collection name:');\n if (!name) return;\n\n try {\n const md = this.ProviderToUse;\n const collection = await md.GetEntityObject<MJCollectionEntity>('MJ: Collections', this.CurrentUser);\n\n collection.Name = name;\n collection.EnvironmentID = this.EnvironmentId;\n\n if (parentId) {\n // Child collection - inherit parent's owner and set parent\n const parentCollection = this.Collections.find(c => UUIDsEqual(c.ID, parentId));\n collection.ParentID = parentId;\n collection.OwnerID = parentCollection?.OwnerID || this.CurrentUser.ID;\n } else {\n // Root collection - current user becomes owner\n collection.OwnerID = this.CurrentUser.ID;\n }\n\n const saved = await collection.Save();\n if (saved) {\n this.CollectionCreated.emit(collection);\n await this.loadCollections();\n }\n } catch (error) {\n console.error('Error creating collection:', error);\n MJNotificationService.Instance.CreateSimpleNotification('Failed to create collection', 'error', 4000);\n }\n }\n\n /** @deprecated Use {@link OnCreateCollection}. */\n async onCreateCollection(parentId: string | null): Promise<void> {\n return this.OnCreateCollection(parentId);\n }\n\n async OnDeleteCollection(collection: MJCollectionEntity): Promise<void> {\n // Validate Delete permission\n if (collection.OwnerID && !UUIDsEqual(collection.OwnerID, this.CurrentUser.ID)) {\n const permission = await this.permissionService.checkPermission(\n collection.ID,\n this.CurrentUser.ID,\n this.CurrentUser\n );\n\n if (!permission?.canDelete) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'You do not have Delete permission for this collection.',\n 'warning',\n 4000\n );\n return;\n }\n }\n\n if (!(await this.confirmService.ConfirmDelete({ title: 'Delete Collection', message: `Delete collection \"${collection.Name}\"?` }))) return;\n\n try {\n const deleted = await collection.Delete();\n if (deleted) {\n this.CollectionDeleted.emit(collection);\n await this.loadCollections();\n }\n } catch (error) {\n console.error('Error deleting collection:', error);\n MJNotificationService.Instance.CreateSimpleNotification('Failed to delete collection', 'error', 4000);\n }\n }\n\n /** @deprecated Use {@link OnDeleteCollection}. */\n async onDeleteCollection(collection: MJCollectionEntity): Promise<void> {\n return this.OnDeleteCollection(collection);\n }\n\n OnDragStart(event: DragEvent, node: TreeNode): void {\n this.DraggedNode = node;\n const dragData: DragData = {\n collectionId: node.collection.ID,\n parentId: node.collection.ParentID || null\n };\n event.dataTransfer!.effectAllowed = 'move';\n event.dataTransfer!.setData('application/json', JSON.stringify(dragData));\n\n // Add visual feedback\n (event.target as HTMLElement).style.opacity = '0.4';\n }\n\n /** @deprecated Use {@link OnDragStart}. */\n onDragStart(event: DragEvent, node: TreeNode): void {\n return this.OnDragStart(event, node);\n }\n\n OnDragEnd(event: DragEvent): void {\n // Clean up visual feedback\n (event.target as HTMLElement).style.opacity = '1';\n this.DraggedNode = null;\n this.DragOverNodeId = null;\n }\n\n /** @deprecated Use {@link OnDragEnd}. */\n onDragEnd(event: DragEvent): void {\n return this.OnDragEnd(event);\n }\n\n OnDragOver(event: DragEvent, targetNode: TreeNode): void {\n event.preventDefault(); // Required to allow drop\n\n if (!this.DraggedNode || UUIDsEqual(this.DraggedNode.collection.ID, targetNode.collection.ID)) {\n event.dataTransfer!.dropEffect = 'none';\n return;\n }\n\n // Check if trying to drop into a descendant\n if (this.isDescendant(targetNode, this.DraggedNode)) {\n event.dataTransfer!.dropEffect = 'none';\n return;\n }\n\n event.dataTransfer!.dropEffect = 'move';\n this.DragOverNodeId = targetNode.collection.ID;\n }\n\n /** @deprecated Use {@link OnDragOver}. */\n onDragOver(event: DragEvent, targetNode: TreeNode): void {\n return this.OnDragOver(event, targetNode);\n }\n\n OnDragLeave(event: DragEvent, targetNode: TreeNode): void {\n if (this.DragOverNodeId === targetNode.collection.ID) {\n this.DragOverNodeId = null;\n }\n }\n\n /** @deprecated Use {@link OnDragLeave}. */\n onDragLeave(event: DragEvent, targetNode: TreeNode): void {\n return this.OnDragLeave(event, targetNode);\n }\n\n async OnDrop(event: DragEvent, targetNode: TreeNode): Promise<void> {\n event.preventDefault();\n event.stopPropagation();\n\n if (!this.DraggedNode) {\n return;\n }\n\n // Don't allow dropping on itself\n if (UUIDsEqual(this.DraggedNode.collection.ID, targetNode.collection.ID)) {\n this.DragOverNodeId = null;\n return;\n }\n\n // Check if trying to drop into a descendant\n if (this.isDescendant(targetNode, this.DraggedNode)) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Cannot move a collection into its own descendant',\n 'warning',\n 4000\n );\n this.DragOverNodeId = null;\n return;\n }\n\n try {\n const collection = this.DraggedNode.collection;\n const newParentId = targetNode.collection.ID;\n\n // Update the collection's parent\n collection.ParentID = newParentId;\n\n const saved = await collection.Save();\n if (saved) {\n // Reload the tree to reflect changes\n await this.loadCollections();\n } else {\n MJNotificationService.Instance.CreateSimpleNotification('Failed to move collection', 'error', 4000);\n }\n } catch (error) {\n LogError(error);\n MJNotificationService.Instance.CreateSimpleNotification('Error moving collection', 'error', 4000);\n } finally {\n this.DragOverNodeId = null;\n }\n }\n\n /** @deprecated Use {@link OnDrop}. */\n async onDrop(event: DragEvent, targetNode: TreeNode): Promise<void> {\n return this.OnDrop(event, targetNode);\n }\n\n OnDragOverRoot(event: DragEvent): void {\n event.preventDefault();\n\n if (!this.DraggedNode) {\n event.dataTransfer!.dropEffect = 'none';\n return;\n }\n\n event.dataTransfer!.dropEffect = 'move';\n this.DragOverNodeId = 'root';\n }\n\n /** @deprecated Use {@link OnDragOverRoot}. */\n onDragOverRoot(event: DragEvent): void {\n return this.OnDragOverRoot(event);\n }\n\n async OnDropRoot(event: DragEvent): Promise<void> {\n event.preventDefault();\n event.stopPropagation();\n\n if (!this.DraggedNode) {\n return;\n }\n\n try {\n const collection = this.DraggedNode.collection;\n\n // Move to root level\n collection.ParentID = null;\n\n const saved = await collection.Save();\n if (saved) {\n await this.loadCollections();\n } else {\n MJNotificationService.Instance.CreateSimpleNotification('Failed to move collection to root', 'error', 4000);\n }\n } catch (error) {\n LogError(error);\n MJNotificationService.Instance.CreateSimpleNotification('Error moving collection to root', 'error', 4000);\n } finally {\n this.DragOverNodeId = null;\n }\n }\n\n /** @deprecated Use {@link OnDropRoot}. */\n async onDropRoot(event: DragEvent): Promise<void> {\n return this.OnDropRoot(event);\n }\n\n private isDescendant(potentialDescendant: TreeNode, ancestor: TreeNode): boolean {\n if (UUIDsEqual(potentialDescendant.collection.ParentID, ancestor.collection.ID)) {\n return true;\n }\n\n for (const child of ancestor.children) {\n if (this.isDescendant(potentialDescendant, child)) {\n return true;\n }\n }\n\n return false;\n }\n\n // Permission checking methods\n canEdit(collection: MJCollectionEntity): boolean {\n // Backwards compatibility: treat null OwnerID as owned by current user\n if (!collection.OwnerID || UUIDsEqual(collection.OwnerID, this.CurrentUser.ID)) {\n return true;\n }\n\n // Check permission record\n const permission = this.UserPermissions.get(collection.ID);\n return permission?.canEdit || false;\n }\n\n canDelete(collection: MJCollectionEntity): boolean {\n // Backwards compatibility: treat null OwnerID as owned by current user\n if (!collection.OwnerID || UUIDsEqual(collection.OwnerID, this.CurrentUser.ID)) {\n return true;\n }\n\n // Check permission record\n const permission = this.UserPermissions.get(collection.ID);\n return permission?.canDelete || false;\n }\n\n CanCreateAtRoot(): boolean {\n // Anyone can create at root level\n return true;\n }\n\n /** @deprecated Use {@link CanCreateAtRoot}. */\n canCreateAtRoot(): boolean {\n return this.CanCreateAtRoot();\n }\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit,
|
|
1
|
+
import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
3
|
import { MJCollectionEntity, MJArtifactEntity, MJArtifactVersionEntity } from '@memberjunction/core-entities';
|
|
4
4
|
import { UserInfo } from '@memberjunction/core';
|
|
@@ -6,10 +6,13 @@ import { MJConfirmService } from '@memberjunction/ng-ui-components';
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
type ViewMode = 'grid' | 'list';
|
|
8
8
|
type SortBy = 'name' | 'date' | 'type';
|
|
9
|
-
export declare class CollectionViewComponent extends BaseAngularComponent implements OnInit,
|
|
9
|
+
export declare class CollectionViewComponent extends BaseAngularComponent implements OnInit, OnDestroy {
|
|
10
10
|
private cdr;
|
|
11
11
|
private confirmService;
|
|
12
|
-
|
|
12
|
+
private _collection;
|
|
13
|
+
private isInitialized;
|
|
14
|
+
set Collection(value: MJCollectionEntity);
|
|
15
|
+
get Collection(): MJCollectionEntity;
|
|
13
16
|
/** @deprecated Use {@link Collection}. */
|
|
14
17
|
set collection(value: MJCollectionEntity);
|
|
15
18
|
/** @deprecated Use {@link Collection}. */
|
|
@@ -80,7 +83,6 @@ export declare class CollectionViewComponent extends BaseAngularComponent implem
|
|
|
80
83
|
}[]);
|
|
81
84
|
constructor(cdr: ChangeDetectorRef, confirmService: MJConfirmService);
|
|
82
85
|
ngOnInit(): void;
|
|
83
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
84
86
|
ngOnDestroy(): void;
|
|
85
87
|
private loadArtifacts;
|
|
86
88
|
private getVersionOrderBy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-view.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"collection-view.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EA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A;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAgDpC,6CAA6C;IACvC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;yCA7XzB,uBAAuB;2CAAvB,uBAAuB;CAgYnC"}
|
|
@@ -62,7 +62,18 @@ function CollectionViewComponent_Conditional_18_Template(rf, ctx) { if (rf & 1)
|
|
|
62
62
|
export class CollectionViewComponent extends BaseAngularComponent {
|
|
63
63
|
cdr;
|
|
64
64
|
confirmService;
|
|
65
|
-
|
|
65
|
+
_collection;
|
|
66
|
+
isInitialized = false;
|
|
67
|
+
set Collection(value) {
|
|
68
|
+
const prev = this._collection;
|
|
69
|
+
this._collection = value;
|
|
70
|
+
if (this.isInitialized && value !== prev) {
|
|
71
|
+
this.loadArtifacts();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
get Collection() {
|
|
75
|
+
return this._collection;
|
|
76
|
+
}
|
|
66
77
|
/** @deprecated Use {@link Collection}. */
|
|
67
78
|
set collection(value) {
|
|
68
79
|
this.Collection = value;
|
|
@@ -164,13 +175,9 @@ export class CollectionViewComponent extends BaseAngularComponent {
|
|
|
164
175
|
this.confirmService = confirmService;
|
|
165
176
|
}
|
|
166
177
|
ngOnInit() {
|
|
178
|
+
this.isInitialized = true;
|
|
167
179
|
this.loadArtifacts();
|
|
168
180
|
}
|
|
169
|
-
ngOnChanges(changes) {
|
|
170
|
-
if (changes['collection'] && !changes['collection'].firstChange) {
|
|
171
|
-
this.loadArtifacts();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
181
|
ngOnDestroy() {
|
|
175
182
|
// Close artifact viewer when navigating away from collection
|
|
176
183
|
if (this.ShowArtifactViewer) {
|
|
@@ -183,14 +190,25 @@ export class CollectionViewComponent extends BaseAngularComponent {
|
|
|
183
190
|
try {
|
|
184
191
|
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
185
192
|
const md = this.ProviderToUse;
|
|
193
|
+
// Resolve version IDs from Collection Artifacts first (no protected subquery)
|
|
194
|
+
const colArtifactsRes = await rv.RunView({
|
|
195
|
+
EntityName: 'MJ: Collection Artifacts',
|
|
196
|
+
ExtraFilter: `CollectionID='${this.Collection.ID}'`,
|
|
197
|
+
Fields: ['ArtifactVersionID'],
|
|
198
|
+
ResultType: 'simple'
|
|
199
|
+
}, this.CurrentUser);
|
|
200
|
+
const versionIds = Array.from(new Set((colArtifactsRes.Success && colArtifactsRes.Results ? colArtifactsRes.Results : [])
|
|
201
|
+
.map((row) => (row.ArtifactVersionID ?? '').trim())
|
|
202
|
+
.filter((id) => id.length > 0)));
|
|
203
|
+
if (versionIds.length === 0) {
|
|
204
|
+
this.ArtifactVersions = [];
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const quotedVersionIds = versionIds.map((id) => `'${id.replace(/'/g, "''")}'`).join(', ');
|
|
186
208
|
// Load ALL VERSIONS in this collection (no DISTINCT - each version is separate)
|
|
187
209
|
const versionResult = await rv.RunView({
|
|
188
210
|
EntityName: 'MJ: Artifact Versions',
|
|
189
|
-
ExtraFilter: `ID IN (
|
|
190
|
-
SELECT ca.ArtifactVersionID
|
|
191
|
-
FROM [__mj].[vwCollectionArtifacts] ca
|
|
192
|
-
WHERE ca.CollectionID='${this.Collection.ID}'
|
|
193
|
-
)`,
|
|
211
|
+
ExtraFilter: `ID IN (${quotedVersionIds})`,
|
|
194
212
|
OrderBy: this.getVersionOrderBy(),
|
|
195
213
|
ResultType: 'entity_object'
|
|
196
214
|
}, this.CurrentUser);
|
|
@@ -346,7 +364,7 @@ export class CollectionViewComponent extends BaseAngularComponent {
|
|
|
346
364
|
ResultType: 'entity_object'
|
|
347
365
|
}, this.CurrentUser);
|
|
348
366
|
if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {
|
|
349
|
-
|
|
367
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to get artifact version', 'error', 4000);
|
|
350
368
|
return;
|
|
351
369
|
}
|
|
352
370
|
// Add to collection via join table using version ID
|
|
@@ -359,7 +377,7 @@ export class CollectionViewComponent extends BaseAngularComponent {
|
|
|
359
377
|
}
|
|
360
378
|
catch (error) {
|
|
361
379
|
console.error('Failed to add artifact:', error);
|
|
362
|
-
|
|
380
|
+
MJNotificationService.Instance.CreateSimpleNotification('Failed to add artifact', 'error', 4000);
|
|
363
381
|
}
|
|
364
382
|
}
|
|
365
383
|
/** @deprecated Use {@link OnAddArtifact}. */
|
|
@@ -367,7 +385,7 @@ export class CollectionViewComponent extends BaseAngularComponent {
|
|
|
367
385
|
return this.OnAddArtifact();
|
|
368
386
|
}
|
|
369
387
|
static ɵfac = function CollectionViewComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CollectionViewComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.MJConfirmService)); };
|
|
370
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CollectionViewComponent, selectors: [["mj-collection-view"]], inputs: { Collection: "Collection", collection: "collection", CurrentUser: "CurrentUser", currentUser: "currentUser", EnvironmentId: "EnvironmentId", environmentId: "environmentId", canEdit: "canEdit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature
|
|
388
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CollectionViewComponent, selectors: [["mj-collection-view"]], inputs: { Collection: "Collection", collection: "collection", CurrentUser: "CurrentUser", currentUser: "currentUser", EnvironmentId: "EnvironmentId", environmentId: "environmentId", canEdit: "canEdit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 13, consts: [[1, "collection-view"], [1, "view-header"], [1, "header-actions"], [1, "view-mode-toggle"], ["title", "Grid View", 1, "mode-btn", 3, "click"], [1, "fa-solid", "fa-grid"], ["title", "List View", 1, "mode-btn", 3, "click"], [1, "fa-solid", "fa-list"], [1, "mj-select", 2, "width", "150px", 3, "ngModelChange", "ngModel"], [3, "value"], ["title", "Add Artifact", 1, "btn-add"], [1, "view-content"], ["Icon", "fa-solid fa-folder-open", "Title", "This collection is empty", "ActionIcon", "fa-solid fa-plus", 3, "ActionText"], [3, "artifact", "version"], [1, "artifact-viewer-overlay"], ["title", "Add Artifact", 1, "btn-add", 3, "click"], [1, "fa-solid", "fa-plus"], ["Icon", "fa-solid fa-folder-open", "Title", "This collection is empty", "ActionIcon", "fa-solid fa-plus", 3, "Action", "ActionText"], [3, "selected", "viewed", "edited", "removed", "artifact", "version"], [1, "artifact-viewer-overlay", 3, "click"], [1, "artifact-viewer-container", 3, "click"], [3, "closed", "artifactId", "versionNumber", "currentUser", "environmentId", "viewContext", "contextCollectionId"]], template: function CollectionViewComponent_Template(rf, ctx) { if (rf & 1) {
|
|
371
389
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2");
|
|
372
390
|
i0.ɵɵtext(3);
|
|
373
391
|
i0.ɵɵelementEnd();
|
|
@@ -427,14 +445,14 @@ export class CollectionViewComponent extends BaseAngularComponent {
|
|
|
427
445
|
[class.active]="viewMode === 'grid'"
|
|
428
446
|
(click)="viewMode = 'grid'"
|
|
429
447
|
title="Grid View">
|
|
430
|
-
<i class="
|
|
448
|
+
<i class="fa-solid fa-grid"></i>
|
|
431
449
|
</button>
|
|
432
450
|
<button
|
|
433
451
|
class="mode-btn"
|
|
434
452
|
[class.active]="viewMode === 'list'"
|
|
435
453
|
(click)="viewMode = 'list'"
|
|
436
454
|
title="List View">
|
|
437
|
-
<i class="
|
|
455
|
+
<i class="fa-solid fa-list"></i>
|
|
438
456
|
</button>
|
|
439
457
|
</div>
|
|
440
458
|
|
|
@@ -450,7 +468,7 @@ export class CollectionViewComponent extends BaseAngularComponent {
|
|
|
450
468
|
|
|
451
469
|
@if (canEdit) {
|
|
452
470
|
<button class="btn-add" (click)="onAddArtifact()" title="Add Artifact">
|
|
453
|
-
<i class="
|
|
471
|
+
<i class="fa-solid fa-plus"></i> Add
|
|
454
472
|
</button>
|
|
455
473
|
}
|
|
456
474
|
</div>
|