@memberjunction/ng-dashboard-viewer 5.21.0 → 5.22.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/dashboard-viewer/dashboard-viewer.component.d.ts.map +1 -1
- package/dist/lib/dashboard-viewer/dashboard-viewer.component.js +4 -4
- package/dist/lib/dashboard-viewer/dashboard-viewer.component.js.map +1 -1
- package/dist/lib/dialogs/add-panel-dialog/add-panel-dialog.component.d.ts.map +1 -1
- package/dist/lib/dialogs/add-panel-dialog/add-panel-dialog.component.js +2 -2
- package/dist/lib/dialogs/add-panel-dialog/add-panel-dialog.component.js.map +1 -1
- package/dist/lib/dialogs/edit-part-dialog/edit-part-dialog.component.d.ts.map +1 -1
- package/dist/lib/dialogs/edit-part-dialog/edit-part-dialog.component.js +2 -2
- package/dist/lib/dialogs/edit-part-dialog/edit-part-dialog.component.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-viewer.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dashboard-viewer/dashboard-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EACZ,SAAS,EAET,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,QAAQ,EAGR,mBAAmB,EAGtB,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAmB,iBAAiB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACzI,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EACH,eAAe,EACf,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,2BAA2B,EAE3B,wBAAwB,EAK3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAA8B,cAAc,EAAE,MAAM,2CAA2C,CAAC;;AAGvG;;;;;;GAMG;AACH,qBAOa,wBAAyB,YAAW,SAAS;IAgKlD,OAAO,CAAC,QAAQ,CAA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E,MAAM,GAAG,cAAc,GAAG,IAAI;IAIvD;;OAEG;IACI,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI;IAM7E;;;;OAIG;IACI,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAiBtG;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAqC3B;;OAEG;IACI,eAAe,IAAI,IAAI;IAU9B;;OAEG;IACI,gBAAgB,IAAI,IAAI;IAS/B;;OAEG;IACI,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI;YAQnD,aAAa;YASb,iBAAiB;YAwBjB,kBAAkB;IAgBhC,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,gBAAgB;IAyCxB,yDAAyD;IACzD,OAAO,CAAC,iBAAiB,CAAS;IAElC,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,uBAAuB;IAsB/B,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,eAAe;IAQvB;;;OAGG;
|
|
1
|
+
{"version":3,"file":"dashboard-viewer.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dashboard-viewer/dashboard-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EACZ,SAAS,EAET,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,QAAQ,EAGR,mBAAmB,EAGtB,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAmB,iBAAiB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACzI,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EACH,eAAe,EACf,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,2BAA2B,EAE3B,wBAAwB,EAK3B,MAAM,2BAA2B,CAAC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AIhD,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,oBAAoB;IA0B5B,OAAO,CAAC,SAAS;yCA9iCR,wBAAwB;2CAAxB,wBAAwB;CAqjCpC"}
|
|
@@ -664,7 +664,7 @@ export class DashboardViewerComponent {
|
|
|
664
664
|
* Create a panel component from the DashboardPanel data.
|
|
665
665
|
* Panel comes directly from GL's componentState - no lookup needed.
|
|
666
666
|
*/
|
|
667
|
-
createPanelComponent(panel, container) {
|
|
667
|
+
async createPanelComponent(panel, container) {
|
|
668
668
|
const partType = this.partTypes.find(pt => UUIDsEqual(pt.ID, panel.partTypeId));
|
|
669
669
|
// Create the panel wrapper with header and content
|
|
670
670
|
const wrapper = document.createElement('div');
|
|
@@ -680,7 +680,7 @@ export class DashboardViewerComponent {
|
|
|
680
680
|
content.className = 'dashboard-part-content';
|
|
681
681
|
content.style.cssText = 'flex: 1; overflow: auto; min-height: 0;';
|
|
682
682
|
// Try to create dynamic component via ClassFactory
|
|
683
|
-
const componentRef = this.createDynamicPartComponent(panel, partType, content);
|
|
683
|
+
const componentRef = await this.createDynamicPartComponent(panel, partType, content);
|
|
684
684
|
if (!componentRef) {
|
|
685
685
|
// Fallback to static rendering if no DriverClass or component creation failed
|
|
686
686
|
this.renderPartContent(panel, content, partType);
|
|
@@ -693,13 +693,13 @@ export class DashboardViewerComponent {
|
|
|
693
693
|
/**
|
|
694
694
|
* Create a dynamic part component using ClassFactory
|
|
695
695
|
*/
|
|
696
|
-
createDynamicPartComponent(panel, partType, container) {
|
|
696
|
+
async createDynamicPartComponent(panel, partType, container) {
|
|
697
697
|
if (!partType?.DriverClass) {
|
|
698
698
|
return null;
|
|
699
699
|
}
|
|
700
700
|
try {
|
|
701
701
|
// Use ClassFactory to create instance and get the component class
|
|
702
|
-
const partInstance = MJGlobal.Instance.ClassFactory.
|
|
702
|
+
const partInstance = await MJGlobal.Instance.ClassFactory.CreateInstanceAsync(BaseDashboardPart, partType.DriverClass);
|
|
703
703
|
if (!partInstance) {
|
|
704
704
|
return null;
|
|
705
705
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-viewer.component.js","sourceRoot":"","sources":["../../../src/lib/dashboard-viewer/dashboard-viewer.component.ts","../../../src/lib/dashboard-viewer/dashboard-viewer.component.html"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EAEZ,SAAS,EAMT,eAAe,EAGf,iBAAiB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAA2E,MAAM,+BAA+B,CAAC;AAGzI,OAAO,EAQH,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAkB,MAAM,2CAA2C,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;;;;;;;IClC7D,kDAS4C;IAA1C,yNAAY,mCAA4B,KAAC;IAC3C,iBAA0B;;;IALxB,AADA,AADA,AADA,AADA,8CAAyB,kDACiB,sCACZ,2BACJ,wBACH;;;IAanB,+BAA8B;IAC5B,wBAAsC;IACtC,YACF;IAAA,iBAAO;;;IADL,eACF;IADE,sDACF;;;IAKA,gCAAgC;IAC9B,wBAAkC;IAClC,iCACF;IAAA,iBAAO;;;;IAMP,kCAG8B;IAD5B,2MAAS,yBAAkB,KAAC;IAE5B,wBAAgD;IAChD,6BACF;IAAA,iBAAS;;;;IAGT,kCAE8B;IAA5B,2MAAS,wBAAiB,KAAC;IAC3B,wBAAgC;IAChC,0BACF;IAAA,iBA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C,0BAA0B;IAC1B,2CAA2C;IAEnC,SAAS;QACb,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAE9B,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC;IACL,CAAC;kHApjCQ,wBAAwB;6DAAxB,wBAAwB;;;;;;YCrDrC,8BAAkG;YAEhG,8GAAiD;YAejD,2FAAyB;YA2DzB,0FAAiB;YAOjB,4BAEM;YAGN,0FAAgC;YAelC,iBAAM;;YAvGoD,AAA5B,wCAA2B,sCAAwC;YAE/F,cAYC;YAZD,gFAYC;YAGD,cAwDC;YAxDD,gDAwDC;YAGD,cAIC;YAJD,wCAIC;YAQD,eAcC;YAdD,2DAcC;;;iFDjDU,wBAAwB;cAPpC,SAAS;6BACI,KAAK,YACL,qBAAqB,iBAGhB,iBAAiB,CAAC,IAAI;;kBAWpC,KAAK;;kBAaL,KAAK;;kBAeL,KAAK;;kBAiBL,KAAK;;kBAWL,KAAK;;kBASL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAmBL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAMN,SAAS;mBAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAjIrC,wBAAwB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n OnDestroy,\n ViewChild,\n ElementRef,\n ChangeDetectorRef,\n ApplicationRef,\n Injector,\n ComponentRef,\n createComponent,\n EnvironmentInjector,\n Type,\n ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJGlobal, UUIDsEqual } from '@memberjunction/global';\nimport { DashboardEngine, MJDashboardEntity, MJDashboardPartTypeEntity, MJDashboardCategoryEntity } from '@memberjunction/core-entities';\nimport { BreadcrumbNavigateEvent } from '../breadcrumb/dashboard-breadcrumb.component';\nimport { ResolvedLayoutConfig } from 'golden-layout';\nimport {\n DashboardConfig,\n DashboardPanel,\n PanelConfig,\n PanelInteractionEvent,\n DashboardConfigChangedEvent,\n LayoutChangedEvent,\n DashboardNavRequestEvent,\n createDefaultDashboardConfig,\n generatePanelId,\n extractPanelsFromLayout,\n findPanelInLayout\n} from '../models/dashboard-types';\nimport { GoldenLayoutWrapperService, LayoutLocation } from '../services/golden-layout-wrapper.service';\nimport { BaseDashboardPart } from '../parts/base-dashboard-part';\n\n/**\n * Main dashboard viewer component.\n * Renders a configurable dashboard with draggable/resizable panels using Golden Layout.\n *\n * This component is GENERIC and has no routing dependencies.\n * Navigation events are bubbled up for the parent component to handle.\n */\n@Component({\n standalone: false,\n selector: 'mj-dashboard-viewer',\n templateUrl: './dashboard-viewer.component.html',\n styleUrls: ['./dashboard-viewer.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class DashboardViewerComponent implements OnDestroy {\n // ========================================\n // Inputs\n // ========================================\n\n private _dashboard: MJDashboardEntity | null = null;\n private _dashboardId: string | null = null;\n\n /** The dashboard entity to display */\n @Input()\n set dashboard(value: MJDashboardEntity | null) {\n const previous = this._dashboard;\n this._dashboard = value;\n if (value && value !== previous) {\n this.onDashboardChanged();\n }\n }\n get dashboard(): MJDashboardEntity | null {\n return this._dashboard;\n }\n\n /** Alternative: Load dashboard by ID */\n @Input()\n set dashboardId(value: string | null) {\n const previous = this._dashboardId;\n this._dashboardId = value;\n if (value && value !== previous) {\n this.loadDashboardById(value);\n }\n }\n get dashboardId(): string | null {\n return this._dashboardId;\n }\n\n /** Whether the dashboard is in edit mode */\n private _isEditing = false;\n\n @Input()\n set isEditing(value: boolean) {\n const previous = this._isEditing;\n this._isEditing = value;\n // When isEditing changes (and layout exists), reinitialize to apply GL settings\n if (value !== previous && this._glService) {\n console.log('[DashboardViewer] isEditing changed from', previous, 'to', value);\n this.updatePanelEditModes();\n }\n }\n get isEditing(): boolean {\n return this._isEditing;\n }\n\n /** Whether to show the toolbar */\n private _showToolbar = true;\n\n @Input()\n set showToolbar(value: boolean) {\n this._showToolbar = value;\n }\n get showToolbar(): boolean {\n return this._showToolbar;\n }\n\n /** Whether to auto-save layout changes */\n private _autoSave = false;\n\n @Input()\n set autoSave(value: boolean) {\n this._autoSave = value;\n }\n get autoSave(): boolean {\n return this._autoSave;\n }\n\n /** Whether to show the breadcrumb navigation */\n @Input() showBreadcrumb = true;\n\n /** Whether to show the \"Open in Tab\" button (for embedded dashboards) */\n @Input() showOpenInTabButton = false;\n\n /** Whether to show the Edit button */\n @Input() showEditButton = true;\n\n /** All categories for breadcrumb path resolution */\n @Input() Categories: MJDashboardCategoryEntity[] = [];\n\n /**\n * Computed: Should the toolbar be visible?\n * Auto-hides when showToolbar=false OR when all toolbar elements are disabled\n */\n public get shouldShowToolbar(): boolean {\n if (!this._showToolbar) {\n return false;\n }\n // If all elements are hidden, hide the toolbar entirely\n return this.showBreadcrumb || this.showOpenInTabButton || this.showEditButton;\n }\n\n // ========================================\n // Outputs\n // ========================================\n\n /** Emitted when dashboard configuration changes */\n @Output() configChanged = new EventEmitter<DashboardConfigChangedEvent>();\n\n /** Emitted when a panel requests navigation to another resource */\n @Output() navigationRequested = new EventEmitter<DashboardNavRequestEvent>();\n\n /** Emitted when a panel interaction occurs */\n @Output() panelInteraction = new EventEmitter<PanelInteractionEvent>();\n\n /** Emitted when the dashboard is saved */\n @Output() dashboardSaved = new EventEmitter<MJDashboardEntity>();\n\n /** Emitted when an error occurs */\n @Output() error = new EventEmitter<{ message: string; error?: Error }>();\n\n /** Emitted when edit mode changes */\n @Output() editModeChanged = new EventEmitter<boolean>();\n\n /** Emitted when user navigates via breadcrumb */\n @Output() breadcrumbNavigate = new EventEmitter<BreadcrumbNavigateEvent>();\n\n /** Emitted when user clicks \"Open in Tab\" button */\n @Output() openInTab = new EventEmitter<{ dashboardId: string; dashboardName: string }>();\n\n // ========================================\n // View Children\n // ========================================\n\n @ViewChild('layoutContainer', { static: true }) layoutContainer!: ElementRef<HTMLElement>;\n\n // ========================================\n // State\n // ========================================\n\n public isLoading = false;\n public config: DashboardConfig | null = null;\n public partTypes: MJDashboardPartTypeEntity[] = [];\n public hasUnsavedChanges = false;\n\n /**\n * Helper to check if layout has any panels (for template use).\n * Panels are stored in componentState within the layout tree.\n */\n public get hasPanels(): boolean {\n return extractPanelsFromLayout(this.config?.layout ?? null).length > 0;\n }\n\n private readonly _destroy$ = new Subject<void>();\n private readonly _panelComponents = new Map<string, { wrapper: HTMLElement; componentRef?: ComponentRef<BaseDashboardPart> }>();\n private _glService: GoldenLayoutWrapperService | null = null;\n\n /** Promise that resolves when part types are loaded - used to ensure layout waits for part types */\n private _partTypesLoaded: Promise<void> | null = null;\n\n // ========================================\n // Constructor\n // ========================================\n\n constructor(\n private readonly cdr: ChangeDetectorRef,\n private readonly appRef: ApplicationRef,\n private readonly injector: Injector,\n private readonly environmentInjector: EnvironmentInjector\n ) {\n // Store the promise so layout initialization can wait for it\n this._partTypesLoaded = this.loadPartTypes();\n }\n\n // ========================================\n // Lifecycle\n // ========================================\n\n ngOnDestroy(): void {\n this._destroy$.next();\n this._destroy$.complete();\n this.destroyLayout();\n }\n\n // ========================================\n // Public Methods\n // ========================================\n\n /**\n * Toggle edit mode\n */\n public toggleEditMode(): void {\n this.isEditing = !this.isEditing;\n this.editModeChanged.emit(this.isEditing);\n this.updatePanelEditModes();\n }\n\n /**\n * Add a new panel to the dashboard.\n * The panel is stored in GL's componentState - no separate panels array.\n */\n public async addPanel(\n partTypeId: string,\n panelConfig: PanelConfig,\n title: string,\n icon?: string,\n location?: LayoutLocation\n ): Promise<void> {\n if (!this.config || !this._glService) {\n return;\n }\n\n const partType = this.partTypes.find(pt => UUIDsEqual(pt.ID, partTypeId));\n if (!partType) {\n this.error.emit({ message: `Unknown panel type: ${partTypeId}` });\n return;\n }\n\n const panel: DashboardPanel = {\n id: generatePanelId(),\n partTypeId,\n title,\n icon: icon || partType.Icon || 'fa-solid fa-window-maximize',\n config: panelConfig\n };\n\n // Add to Golden Layout - panel data stored in componentState\n this._glService.addPanel(panel, location);\n\n // Sync the layout config from Golden Layout to capture the new panel\n // The layout IS the source of truth - it contains the panel in componentState\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n\n this.markDirty();\n }\n\n /**\n * Remove a panel from the dashboard.\n * Panels live in GL's componentState, so removing from GL removes the panel.\n */\n public removePanel(panelId: string): void {\n if (!this.config || !this._glService) return;\n\n // Remove from layout (panel data is in componentState)\n this._glService.removePanel(panelId);\n\n // Sync layout config to persist the removal\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n\n // Destroy component\n this.destroyPanelComponent(panelId);\n\n this.markDirty();\n }\n\n /**\n * Save the current dashboard configuration\n */\n public async save(): Promise<boolean> {\n if (!this._dashboard || !this.config) return false;\n\n try {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n // Update the layout config from Golden Layout\n if (this._glService) {\n const glConfig = this._glService.getLayoutConfig();\n if (glConfig) {\n this.config.layout = glConfig;\n }\n }\n\n // Save to UIConfigDetails\n this._dashboard.UIConfigDetails = JSON.stringify(this.config);\n const saved = await this._dashboard.Save();\n\n if (saved) {\n this.hasUnsavedChanges = false;\n this.dashboardSaved.emit(this._dashboard);\n }\n\n return saved;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n this.error.emit({ message: 'Failed to save dashboard', error });\n return false;\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Refresh all panels\n */\n public async refreshAllPanels(): Promise<void> {\n // For placeholder implementation, reinitialize the layout\n if (this._glService) {\n await this.initializeLayout();\n }\n }\n\n /**\n * Get the current configuration\n */\n public getConfig(): DashboardConfig | null {\n return this.config;\n }\n\n /**\n * Get available part types\n */\n public getPartTypes(): MJDashboardPartTypeEntity[] {\n return this.partTypes;\n }\n\n /**\n * Get a panel by ID.\n * Extracts panel from the layout's componentState (single source of truth).\n */\n public getPanel(panelId: string): DashboardPanel | null {\n return findPanelInLayout(this.config?.layout ?? null, panelId);\n }\n\n /**\n * Get the part type for a panel\n */\n public getPartTypeForPanel(panelId: string): MJDashboardPartTypeEntity | null {\n const panel = this.getPanel(panelId);\n if (!panel) return null;\n return this.partTypes.find(pt => UUIDsEqual(pt.ID, panel.partTypeId)) ?? null;\n }\n\n /**\n * Update a panel's configuration.\n * Since panels live in componentState within the layout, we need to\n * update the layout tree directly or reinitialize with updated data.\n */\n public updatePanelConfig(panelId: string, newConfig: PanelConfig, title?: string, icon?: string): void {\n if (!this.config || !this._glService) return;\n\n // Get current layout which contains all panel data\n const currentLayout = this._glService.getLayoutConfig();\n if (!currentLayout) return;\n\n // Update panel in the layout tree\n this.updatePanelInLayout(currentLayout, panelId, newConfig, title, icon);\n this.config.layout = currentLayout;\n\n this.markDirty();\n\n // Reinitialize layout to reflect the updated panel\n this.initializeLayout();\n }\n\n /**\n * Recursively update a panel's config within the layout tree\n */\n private updatePanelInLayout(\n layout: ResolvedLayoutConfig,\n panelId: string,\n newConfig: PanelConfig,\n title?: string,\n icon?: string\n ): void {\n if (!layout.root) return;\n\n const updateNode = (node: ResolvedLayoutConfig['root']): void => {\n if (!node) return;\n\n // If this is a component with matching panelId\n if (node.type === 'component') {\n const componentNode = node as unknown as { componentState?: DashboardPanel; title?: string };\n if (componentNode.componentState?.id === panelId) {\n componentNode.componentState.config = newConfig;\n if (title) {\n componentNode.componentState.title = title;\n componentNode.title = title;\n }\n if (icon) componentNode.componentState.icon = icon;\n }\n }\n\n // Recursively process children\n const containerNode = node as unknown as { content?: ResolvedLayoutConfig['root'][] };\n if (containerNode.content && Array.isArray(containerNode.content)) {\n for (const child of containerNode.content) {\n updateNode(child);\n }\n }\n };\n\n updateNode(layout.root);\n }\n\n /**\n * Handle add panel button click - emits event for parent to show dialog\n */\n public onAddPanelClick(): void {\n // Emit interaction event for parent to handle\n // Parent should show AddPanelDialog and call addPanel() with result\n this.panelInteraction.emit({\n panelId: '',\n interactionType: 'custom',\n payload: { action: 'add-panel-requested', partTypes: this.partTypes }\n });\n }\n\n /**\n * Handle \"Open in Tab\" button click - emits event for parent to open dashboard in its own tab\n */\n public onOpenInTabClick(): void {\n if (this._dashboard) {\n this.openInTab.emit({\n dashboardId: this._dashboard.ID,\n dashboardName: this._dashboard.Name\n });\n }\n }\n\n /**\n * Handle breadcrumb navigation\n */\n public onBreadcrumbNavigate(event: BreadcrumbNavigateEvent): void {\n this.breadcrumbNavigate.emit(event);\n }\n\n // ========================================\n // Private Methods - Initialization\n // ========================================\n\n private async loadPartTypes(): Promise<void> {\n try {\n await DashboardEngine.Instance.Config(false);\n this.partTypes = DashboardEngine.Instance.DashboardPartTypes;\n } catch (err) {\n console.error('Failed to load dashboard part types:', err);\n }\n }\n\n private async loadDashboardById(id: string): Promise<void> {\n try {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n const md = new Metadata();\n const dashboard = await md.GetEntityObject<MJDashboardEntity>('MJ: Dashboards');\n const loaded = await dashboard.Load(id);\n\n if (loaded) {\n this._dashboard = dashboard;\n this.onDashboardChanged();\n } else {\n this.error.emit({ message: `Dashboard not found: ${id}` });\n }\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n this.error.emit({ message: 'Failed to load dashboard', error });\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n }\n }\n\n private async onDashboardChanged(): Promise<void> {\n if (!this._dashboard) return;\n\n // Parse or create config\n this.config = this.parseOrCreateConfig();\n\n // Wait for part types to be loaded before initializing layout\n // This ensures partTypes array is populated when createPanelComponent is called\n if (this._partTypesLoaded) {\n await this._partTypesLoaded;\n }\n\n // Initialize layout\n this.initializeLayout();\n }\n\n private parseOrCreateConfig(): DashboardConfig {\n if (!this._dashboard?.UIConfigDetails) {\n return createDefaultDashboardConfig();\n }\n\n try {\n const parsed = JSON.parse(this._dashboard.UIConfigDetails);\n\n // Validate it has the expected structure (layout + settings)\n if (parsed.layout !== undefined && parsed.settings) {\n return parsed as DashboardConfig;\n }\n\n // Invalid format, return default\n console.warn('[DashboardViewer] Invalid config format, using default');\n return createDefaultDashboardConfig();\n } catch {\n return createDefaultDashboardConfig();\n }\n }\n\n // ========================================\n // Private Methods - Layout\n // ========================================\n\n private initializeLayout(): void {\n if (!this.config || !this.layoutContainer?.nativeElement) {\n return;\n }\n\n // Destroy existing layout\n this.destroyLayout();\n\n // Create new Golden Layout service\n this._glService = new GoldenLayoutWrapperService();\n\n // Subscribe to layout events\n this.subscribeToLayoutEvents();\n\n // Panel factory - called by GL when it binds a component\n // The panel comes directly from GL's componentState (single source of truth)\n const panelFactory = (panel: DashboardPanel, container: HTMLElement) => {\n this.createPanelComponent(panel, container);\n };\n\n // Initialize with saved layout (or null for empty dashboard)\n // Golden Layout's native ResolvedLayoutConfig is the source of truth\n // Panel data is embedded in each component's componentState\n this._glService.initialize(\n this.layoutContainer.nativeElement,\n this.config.layout,\n panelFactory,\n this.isEditing\n );\n\n // After GL.initialize() completes, all components from the saved layout\n // have been synchronously bound via the panelFactory callback.\n // However, Angular needs time to complete change detection and render\n // the dynamic components. A single delayed updateSize() ensures GL\n // recalculates dimensions after Angular has finished rendering.\n setTimeout(() => {\n this._glService?.updateSize();\n this.cdr.detectChanges();\n }, 100);\n }\n\n /** Flag to prevent panel removal during layout reinit */\n private _isReinitializing = false;\n\n private destroyLayout(): void {\n // Set flag to prevent onPanelClosed from removing panels during reinit\n this._isReinitializing = true;\n\n // Destroy all panel components\n this._panelComponents.forEach((entry, panelId) => {\n this.destroyPanelComponent(panelId);\n });\n this._panelComponents.clear();\n\n // Destroy Golden Layout\n if (this._glService) {\n this._glService.destroy();\n this._glService = null;\n }\n\n this._isReinitializing = false;\n }\n\n private subscribeToLayoutEvents(): void {\n if (!this._glService) return;\n\n this._glService.onLayoutChanged\n .pipe(takeUntil(this._destroy$))\n .subscribe((event: LayoutChangedEvent) => {\n this.onLayoutChanged(event);\n });\n\n this._glService.onPanelClosed\n .pipe(takeUntil(this._destroy$))\n .subscribe((panelId: string) => {\n this.onPanelClosed(panelId);\n });\n\n this._glService.onPanelSelected\n .pipe(takeUntil(this._destroy$))\n .subscribe((panelId: string) => {\n this.onPanelSelected(panelId);\n });\n }\n\n private onLayoutChanged(event: LayoutChangedEvent): void {\n if (this.config) {\n this.config.layout = event.layout;\n this.markDirty();\n\n // Map layout change types to config change types\n const changeType = event.changeType === 'close' ? 'panel-removed' : 'layout';\n this.configChanged.emit({\n config: this.config,\n changeType\n });\n }\n }\n\n private onPanelClosed(panelId: string): void {\n // Skip panel removal during layout reinit (panels are being recreated, not actually closed)\n if (this._isReinitializing) {\n return;\n }\n\n // Sync layout config - panel was removed from GL's tree\n if (this.config && this._glService) {\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n }\n\n // Destroy component\n this.destroyPanelComponent(panelId);\n this.markDirty();\n }\n\n private onPanelSelected(panelId: string): void {\n // Could be used to highlight selected panel in edit mode\n }\n\n // ========================================\n // Private Methods - Panel Components\n // ========================================\n\n /**\n * Create a panel component from the DashboardPanel data.\n * Panel comes directly from GL's componentState - no lookup needed.\n */\n private createPanelComponent(panel: DashboardPanel, container: HTMLElement): void {\n const partType = this.partTypes.find(pt => UUIDsEqual(pt.ID, panel.partTypeId));\n\n // Create the panel wrapper with header and content\n const wrapper = document.createElement('div');\n wrapper.className = 'dashboard-part-wrapper';\n wrapper.style.cssText = 'display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);';\n\n // Only show header in edit mode - GL tabs already display the title in view mode\n if (this.isEditing) {\n const header = this.createPartHeader(panel, panel.id);\n wrapper.appendChild(header);\n }\n\n // Create content area\n const content = document.createElement('div');\n content.className = 'dashboard-part-content';\n content.style.cssText = 'flex: 1; overflow: auto; min-height: 0;';\n\n // Try to create dynamic component via ClassFactory\n const componentRef = this.createDynamicPartComponent(panel, partType, content);\n\n if (!componentRef) {\n // Fallback to static rendering if no DriverClass or component creation failed\n this.renderPartContent(panel, content, partType);\n }\n\n wrapper.appendChild(content);\n container.appendChild(wrapper);\n\n // Store reference for cleanup\n this._panelComponents.set(panel.id, { wrapper, componentRef: componentRef || undefined });\n }\n\n /**\n * Create a dynamic part component using ClassFactory\n */\n private createDynamicPartComponent(\n panel: DashboardPanel,\n partType: MJDashboardPartTypeEntity | undefined,\n container: HTMLElement\n ): ComponentRef<BaseDashboardPart> | null {\n if (!partType?.DriverClass) {\n return null;\n }\n\n try {\n // Use ClassFactory to create instance and get the component class\n const partInstance = MJGlobal.Instance.ClassFactory.CreateInstance<BaseDashboardPart>(\n BaseDashboardPart,\n partType.DriverClass\n );\n\n if (!partInstance) {\n return null;\n }\n\n // Get the Angular component class from the instance\n // The constructor is a concrete class that extends BaseDashboardPart\n const componentClass = (partInstance as object).constructor as Type<BaseDashboardPart>;\n\n // Create the component dynamically\n const componentRef = createComponent(componentClass, {\n environmentInjector: this.environmentInjector,\n elementInjector: this.injector\n });\n\n // Set inputs on the component\n const instance = componentRef.instance;\n instance.Panel = panel;\n instance.PartType = partType;\n instance.IsEditing = this.isEditing;\n\n // Subscribe to events\n instance.ConfigureRequested.subscribe(() => {\n this.onConfigurePart(panel.id);\n });\n instance.RemoveRequested.subscribe(() => {\n this.onRemovePart(panel.id);\n });\n instance.NavigationRequested.subscribe((event: DashboardNavRequestEvent) => {\n this.navigationRequested.emit(event);\n });\n\n // Attach component to DOM\n container.appendChild(componentRef.location.nativeElement);\n\n // Attach to Angular's change detection\n this.appRef.attachView(componentRef.hostView);\n\n return componentRef;\n } catch (error) {\n console.error('[DashboardViewer] Failed to create dynamic component:', error);\n return null;\n }\n }\n\n private createPartHeader(panel: DashboardPanel, panelId: string): HTMLElement {\n const header = document.createElement('div');\n header.className = 'dashboard-part-header';\n header.style.cssText = `\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 12px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n min-height: 40px;\n `;\n\n // Icon and title\n const titleSection = document.createElement('div');\n titleSection.style.cssText = 'display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;';\n titleSection.innerHTML = `\n <i class=\"${panel.icon || 'fa-solid fa-puzzle-piece'}\" style=\"color: var(--mj-brand-primary); font-size: 14px;\"></i>\n <span style=\"font-weight: 500; font-size: 14px; color: var(--mj-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\">${panel.title}</span>\n `;\n header.appendChild(titleSection);\n\n // Action buttons (only in edit mode)\n if (this.isEditing) {\n const actions = document.createElement('div');\n actions.style.cssText = 'display: flex; gap: 4px;';\n\n // Configure button\n const configBtn = document.createElement('button');\n configBtn.className = 'part-action-btn';\n configBtn.title = 'Configure';\n configBtn.style.cssText = `\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.15s;\n `;\n configBtn.innerHTML = '<i class=\"fa-solid fa-cog\" style=\"font-size: 12px;\"></i>';\n configBtn.addEventListener('click', () => this.onConfigurePart(panelId));\n configBtn.addEventListener('mouseenter', () => {\n configBtn.style.background = 'var(--mj-border-default)';\n configBtn.style.color = 'var(--mj-text-primary)';\n });\n configBtn.addEventListener('mouseleave', () => {\n configBtn.style.background = 'transparent';\n configBtn.style.color = 'var(--mj-text-secondary)';\n });\n\n // Remove button\n const removeBtn = document.createElement('button');\n removeBtn.className = 'part-action-btn';\n removeBtn.title = 'Remove';\n removeBtn.style.cssText = `\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.15s;\n `;\n removeBtn.innerHTML = '<i class=\"fa-solid fa-times\" style=\"font-size: 12px;\"></i>';\n removeBtn.addEventListener('click', () => this.onRemovePart(panelId));\n removeBtn.addEventListener('mouseenter', () => {\n removeBtn.style.background = 'color-mix(in srgb, var(--mj-status-error) 10%, transparent)';\n removeBtn.style.color = 'var(--mj-status-error)';\n });\n removeBtn.addEventListener('mouseleave', () => {\n removeBtn.style.background = 'transparent';\n removeBtn.style.color = 'var(--mj-text-secondary)';\n });\n\n actions.appendChild(configBtn);\n actions.appendChild(removeBtn);\n header.appendChild(actions);\n }\n\n return header;\n }\n\n private renderPartContent(panel: DashboardPanel, container: HTMLElement, partType: MJDashboardPartTypeEntity | undefined): void {\n const config = panel.config;\n\n switch (config?.type) {\n case 'WebURL':\n this.renderWebURLPart(panel, container, config);\n break;\n case 'View':\n this.renderViewPart(panel, container, config);\n break;\n case 'Query':\n this.renderQueryPart(panel, container, config);\n break;\n case 'Artifact':\n this.renderArtifactPart(panel, container, config);\n break;\n default:\n this.renderPlaceholderPart(panel, container, partType);\n }\n }\n\n private renderWebURLPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const url = config['url'] as string | undefined;\n if (!url) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-globe\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No URL Configured</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click the configure button to set a URL for this part.</p>\n </div>\n `;\n return;\n }\n\n const sandboxMode = config['sandboxMode'] as string | undefined;\n // Determine sandbox permissions based on mode\n let sandbox = 'allow-scripts allow-same-origin allow-forms allow-popups';\n if (sandboxMode === 'strict') {\n sandbox = 'allow-scripts';\n } else if (sandboxMode === 'permissive') {\n sandbox = 'allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-top-navigation';\n }\n\n const iframe = document.createElement('iframe');\n iframe.src = url;\n iframe.style.cssText = 'width: 100%; height: 100%; border: none;';\n iframe.sandbox.value = sandbox;\n if (config['allowFullscreen'] !== false) {\n iframe.allowFullscreen = true;\n }\n iframe.title = panel.title;\n\n container.appendChild(iframe);\n }\n\n private renderViewPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const viewId = config['viewId'] as string | undefined;\n const entityName = config['entityName'] as string | undefined;\n if (!viewId && !entityName) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-table\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No View Selected</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click configure to select a view for this part.</p>\n </div>\n `;\n return;\n }\n\n const viewInfo = viewId ? viewId.substring(0, 8) + '...' : entityName;\n const displayModeValue = config['displayMode'] as string | undefined;\n const displayMode = displayModeValue === 'grid' ? 'Grid View' : displayModeValue === 'cards' ? 'Card View' : 'Timeline View';\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);\">\n <div style=\"padding: 16px 20px; border-bottom: 1px solid var(--mj-border-default); background: var(--mj-bg-surface-card);\">\n <div style=\"display: flex; align-items: center; gap: 12px;\">\n <i class=\"fa-solid fa-table\" style=\"font-size: 20px; color: var(--mj-brand-primary);\"></i>\n <div>\n <div style=\"font-weight: 500; color: var(--mj-text-primary); font-size: 14px;\">Entity View</div>\n <div style=\"font-size: 12px; color: var(--mj-text-secondary);\">${entityName || 'View ' + viewInfo}</div>\n </div>\n <span style=\"margin-left: auto; padding: 4px 10px; background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent); color: var(--mj-brand-primary); border-radius: 12px; font-size: 11px; font-weight: 500;\">${displayMode}</span>\n </div>\n </div>\n <div style=\"flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--mj-text-muted); padding: 24px;\">\n <i class=\"fa-solid fa-spinner fa-spin\" style=\"font-size: 24px; margin-bottom: 12px;\"></i>\n <p style=\"margin: 0; font-size: 13px;\">Entity grid loading...</p>\n <p style=\"margin: 8px 0 0 0; font-size: 11px; color: var(--mj-text-muted);\">Full implementation pending Angular integration</p>\n </div>\n </div>\n `;\n }\n\n private renderQueryPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const queryId = config['queryId'] as string | undefined;\n const queryName = config['queryName'] as string | undefined;\n if (!queryId && !queryName) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-database\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No Query Selected</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click configure to select a query for this part.</p>\n </div>\n `;\n return;\n }\n\n const autoRefreshSeconds = (config['autoRefreshSeconds'] as number) || 0;\n const queryInfo = queryName || (queryId ? queryId.substring(0, 8) + '...' : 'Unknown');\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);\">\n <div style=\"padding: 16px 20px; border-bottom: 1px solid var(--mj-border-default); background: var(--mj-bg-surface-card);\">\n <div style=\"display: flex; align-items: center; gap: 12px;\">\n <i class=\"fa-solid fa-database\" style=\"font-size: 20px; color: var(--mj-brand-primary);\"></i>\n <div>\n <div style=\"font-weight: 500; color: var(--mj-text-primary); font-size: 14px;\">Query Results</div>\n <div style=\"font-size: 12px; color: var(--mj-text-secondary);\">${queryInfo}</div>\n </div>\n <span style=\"margin-left: auto; padding: 4px 10px; background: color-mix(in srgb, var(--mj-status-success) 10%, transparent); color: var(--mj-status-success); border-radius: 12px; font-size: 11px; font-weight: 500;\">${autoRefreshSeconds > 0 ? 'Refresh: ' + autoRefreshSeconds + 's' : 'Manual refresh'}</span>\n </div>\n </div>\n <div style=\"flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--mj-text-muted); padding: 24px;\">\n <i class=\"fa-solid fa-spinner fa-spin\" style=\"font-size: 24px; margin-bottom: 12px;\"></i>\n <p style=\"margin: 0; font-size: 13px;\">Query grid loading...</p>\n <p style=\"margin: 8px 0 0 0; font-size: 11px; color: var(--mj-text-muted);\">Full implementation pending Angular integration</p>\n </div>\n </div>\n `;\n }\n\n private renderArtifactPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const artifactId = config['artifactId'] as string | undefined;\n if (!artifactId) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-cube\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No Artifact Selected</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click configure to select an artifact for this part.</p>\n </div>\n `;\n return;\n }\n\n const versionNumber = config['versionNumber'] as number | undefined;\n const artifactInfo = artifactId.substring(0, 8) + '...';\n const versionInfo = versionNumber ? `v${versionNumber}` : 'Latest';\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);\">\n <div style=\"padding: 16px 20px; border-bottom: 1px solid var(--mj-border-default); background: var(--mj-bg-surface-card);\">\n <div style=\"display: flex; align-items: center; gap: 12px;\">\n <i class=\"fa-solid fa-cube\" style=\"font-size: 20px; color: var(--mj-brand-primary);\"></i>\n <div>\n <div style=\"font-weight: 500; color: var(--mj-text-primary); font-size: 14px;\">Artifact</div>\n <div style=\"font-size: 12px; color: var(--mj-text-secondary);\">ID: ${artifactInfo}</div>\n </div>\n <span style=\"margin-left: auto; padding: 4px 10px; background: color-mix(in srgb, var(--mj-status-error) 10%, transparent); color: var(--mj-status-error); border-radius: 12px; font-size: 11px; font-weight: 500;\">${versionInfo}</span>\n </div>\n </div>\n <div style=\"flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--mj-text-muted); padding: 24px;\">\n <i class=\"fa-solid fa-spinner fa-spin\" style=\"font-size: 24px; margin-bottom: 12px;\"></i>\n <p style=\"margin: 0; font-size: 13px;\">Artifact viewer loading...</p>\n <p style=\"margin: 8px 0 0 0; font-size: 11px; color: var(--mj-text-muted);\">Full implementation pending Angular integration</p>\n </div>\n </div>\n `;\n }\n\n private renderPlaceholderPart(panel: DashboardPanel, container: HTMLElement, partType: MJDashboardPartTypeEntity | undefined): void {\n const partTypeName = partType?.Name || 'Custom';\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-puzzle-piece\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">${partTypeName} Part</h4>\n <p style=\"margin: 0; font-size: 13px;\">This part type is not yet fully implemented.</p>\n </div>\n `;\n }\n\n private onConfigurePart(panelId: string): void {\n // Emit event for parent to handle configuration\n this.panelInteraction.emit({\n panelId,\n interactionType: 'custom',\n payload: { action: 'configure-part-requested' }\n });\n }\n\n private onRemovePart(panelId: string): void {\n // Emit event for parent to show confirmation dialog\n const panel = findPanelInLayout(this.config?.layout ?? null, panelId);\n this.panelInteraction.emit({\n panelId,\n interactionType: 'custom',\n payload: {\n action: 'remove-part-requested',\n panelTitle: panel?.title || 'this part'\n }\n });\n }\n\n /**\n * Confirm removal of a panel (called by parent after confirmation dialog)\n */\n public confirmRemovePanel(panelId: string): void {\n this.removePanel(panelId);\n }\n\n private destroyPanelComponent(panelId: string): void {\n const entry = this._panelComponents.get(panelId);\n if (entry) {\n // Destroy the Angular component if present\n if (entry.componentRef) {\n this.appRef.detachView(entry.componentRef.hostView);\n entry.componentRef.destroy();\n }\n this._panelComponents.delete(panelId);\n }\n }\n\n private updatePanelEditModes(): void {\n // Update IsEditing on all dynamic components\n this._panelComponents.forEach((entry) => {\n if (entry.componentRef) {\n entry.componentRef.instance.IsEditing = this.isEditing;\n }\n });\n\n // Save current layout before reinitializing (preserves user's arrangement)\n if (this._glService && this.config) {\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n }\n\n // Reinitialize layout to apply new Golden Layout settings (edit mode lock/unlock)\n if (this._glService) {\n this.initializeLayout();\n }\n }\n\n // ========================================\n // Private Methods - State\n // ========================================\n\n private markDirty(): void {\n this.hasUnsavedChanges = true;\n\n if (this.autoSave && this.config) {\n this.save();\n }\n }\n}\n","<!-- Dashboard Viewer Component -->\n<div class=\"dashboard-viewer\" [class.editing]=\"isEditing\" [class.has-toolbar]=\"shouldShowToolbar\">\n <!-- Breadcrumb Navigation (hidden in edit mode) -->\n @if (showBreadcrumb && !isEditing && dashboard) {\n <mj-dashboard-breadcrumb\n [Categories]=\"Categories\"\n [CurrentCategoryId]=\"dashboard.CategoryID\"\n [CurrentDashboard]=\"dashboard\"\n [ShowDashboardName]=\"true\"\n [AllowDragDrop]=\"false\"\n Size=\"large\"\n RootIcon=\"fa-solid fa-gauge-high\"\n RootLabel=\"Dashboards\"\n (Navigate)=\"onBreadcrumbNavigate($event)\">\n </mj-dashboard-breadcrumb>\n }\n\n <!-- Toolbar (auto-hides when all elements are disabled) -->\n @if (shouldShowToolbar) {\n <div class=\"dashboard-toolbar\">\n <div class=\"toolbar-left\">\n @if (dashboard && (isEditing || !showBreadcrumb)) {\n <span class=\"dashboard-title\">\n <i class=\"fa-solid fa-chart-line\"></i>\n {{ dashboard.Name }}\n </span>\n }\n </div>\n <div class=\"toolbar-center\">\n @if (hasUnsavedChanges && isEditing) {\n <span class=\"unsaved-indicator\">\n <i class=\"fa-solid fa-circle\"></i>\n Unsaved changes\n </span>\n }\n </div>\n <div class=\"toolbar-right\">\n <!-- Open in New Tab button (when embedded) -->\n @if (showOpenInTabButton && !isEditing) {\n <button\n class=\"toolbar-button\"\n (click)=\"onOpenInTabClick()\"\n title=\"Open in its own tab\">\n <i class=\"fa-solid fa-up-right-from-square\"></i>\n Open in Tab\n </button>\n }\n @if (isEditing) {\n <button\n class=\"toolbar-button\"\n (click)=\"onAddPanelClick()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Part\n </button>\n }\n @if (showEditButton) {\n <button\n class=\"toolbar-button\"\n [class.active]=\"isEditing\"\n (click)=\"toggleEditMode()\">\n <i class=\"fa-solid fa-edit\"></i>\n {{ isEditing ? 'Editing' : 'Edit' }}\n </button>\n }\n @if (isEditing && hasUnsavedChanges) {\n <button\n class=\"toolbar-button primary\"\n (click)=\"save()\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Loading Overlay -->\n @if (isLoading) {\n <div class=\"loading-overlay\">\n <mj-loading text=\"Loading dashboard...\"></mj-loading>\n </div>\n }\n\n <!-- Layout Container -->\n <div class=\"layout-container\" #layoutContainer>\n <!-- Golden Layout will render panels here -->\n </div>\n\n <!-- Empty State -->\n @if (!hasPanels && !isLoading) {\n <div class=\"empty-state\">\n <div class=\"empty-icon\">\n <i class=\"fa-solid fa-layer-group\"></i>\n </div>\n <h3>No parts configured</h3>\n <p>This dashboard has no parts yet. Add your first part to start visualizing your data.</p>\n @if (isEditing) {\n <button class=\"add-part-button\" (click)=\"onAddPanelClick()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Your First Part\n </button>\n }\n </div>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"dashboard-viewer.component.js","sourceRoot":"","sources":["../../../src/lib/dashboard-viewer/dashboard-viewer.component.ts","../../../src/lib/dashboard-viewer/dashboard-viewer.component.html"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,E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;kHApjCQ,wBAAwB;6DAAxB,wBAAwB;;;;;;YCrDrC,8BAAkG;YAEhG,8GAAiD;YAejD,2FAAyB;YA2DzB,0FAAiB;YAOjB,4BAEM;YAGN,0FAAgC;YAelC,iBAAM;;YAvGoD,AAA5B,wCAA2B,sCAAwC;YAE/F,cAYC;YAZD,gFAYC;YAGD,cAwDC;YAxDD,gDAwDC;YAGD,cAIC;YAJD,wCAIC;YAQD,eAcC;YAdD,2DAcC;;;iFDjDU,wBAAwB;cAPpC,SAAS;6BACI,KAAK,YACL,qBAAqB,iBAGhB,iBAAiB,CAAC,IAAI;;kBAWpC,KAAK;;kBAaL,KAAK;;kBAeL,KAAK;;kBAiBL,KAAK;;kBAWL,KAAK;;kBASL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAmBL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAMN,SAAS;mBAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAjIrC,wBAAwB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n OnDestroy,\n ViewChild,\n ElementRef,\n ChangeDetectorRef,\n ApplicationRef,\n Injector,\n ComponentRef,\n createComponent,\n EnvironmentInjector,\n Type,\n ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJGlobal, UUIDsEqual } from '@memberjunction/global';\nimport { DashboardEngine, MJDashboardEntity, MJDashboardPartTypeEntity, MJDashboardCategoryEntity } from '@memberjunction/core-entities';\nimport { BreadcrumbNavigateEvent } from '../breadcrumb/dashboard-breadcrumb.component';\nimport { ResolvedLayoutConfig } from 'golden-layout';\nimport {\n DashboardConfig,\n DashboardPanel,\n PanelConfig,\n PanelInteractionEvent,\n DashboardConfigChangedEvent,\n LayoutChangedEvent,\n DashboardNavRequestEvent,\n createDefaultDashboardConfig,\n generatePanelId,\n extractPanelsFromLayout,\n findPanelInLayout\n} from '../models/dashboard-types';\nimport { GoldenLayoutWrapperService, LayoutLocation } from '../services/golden-layout-wrapper.service';\nimport { BaseDashboardPart } from '../parts/base-dashboard-part';\n\n/**\n * Main dashboard viewer component.\n * Renders a configurable dashboard with draggable/resizable panels using Golden Layout.\n *\n * This component is GENERIC and has no routing dependencies.\n * Navigation events are bubbled up for the parent component to handle.\n */\n@Component({\n standalone: false,\n selector: 'mj-dashboard-viewer',\n templateUrl: './dashboard-viewer.component.html',\n styleUrls: ['./dashboard-viewer.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class DashboardViewerComponent implements OnDestroy {\n // ========================================\n // Inputs\n // ========================================\n\n private _dashboard: MJDashboardEntity | null = null;\n private _dashboardId: string | null = null;\n\n /** The dashboard entity to display */\n @Input()\n set dashboard(value: MJDashboardEntity | null) {\n const previous = this._dashboard;\n this._dashboard = value;\n if (value && value !== previous) {\n this.onDashboardChanged();\n }\n }\n get dashboard(): MJDashboardEntity | null {\n return this._dashboard;\n }\n\n /** Alternative: Load dashboard by ID */\n @Input()\n set dashboardId(value: string | null) {\n const previous = this._dashboardId;\n this._dashboardId = value;\n if (value && value !== previous) {\n this.loadDashboardById(value);\n }\n }\n get dashboardId(): string | null {\n return this._dashboardId;\n }\n\n /** Whether the dashboard is in edit mode */\n private _isEditing = false;\n\n @Input()\n set isEditing(value: boolean) {\n const previous = this._isEditing;\n this._isEditing = value;\n // When isEditing changes (and layout exists), reinitialize to apply GL settings\n if (value !== previous && this._glService) {\n console.log('[DashboardViewer] isEditing changed from', previous, 'to', value);\n this.updatePanelEditModes();\n }\n }\n get isEditing(): boolean {\n return this._isEditing;\n }\n\n /** Whether to show the toolbar */\n private _showToolbar = true;\n\n @Input()\n set showToolbar(value: boolean) {\n this._showToolbar = value;\n }\n get showToolbar(): boolean {\n return this._showToolbar;\n }\n\n /** Whether to auto-save layout changes */\n private _autoSave = false;\n\n @Input()\n set autoSave(value: boolean) {\n this._autoSave = value;\n }\n get autoSave(): boolean {\n return this._autoSave;\n }\n\n /** Whether to show the breadcrumb navigation */\n @Input() showBreadcrumb = true;\n\n /** Whether to show the \"Open in Tab\" button (for embedded dashboards) */\n @Input() showOpenInTabButton = false;\n\n /** Whether to show the Edit button */\n @Input() showEditButton = true;\n\n /** All categories for breadcrumb path resolution */\n @Input() Categories: MJDashboardCategoryEntity[] = [];\n\n /**\n * Computed: Should the toolbar be visible?\n * Auto-hides when showToolbar=false OR when all toolbar elements are disabled\n */\n public get shouldShowToolbar(): boolean {\n if (!this._showToolbar) {\n return false;\n }\n // If all elements are hidden, hide the toolbar entirely\n return this.showBreadcrumb || this.showOpenInTabButton || this.showEditButton;\n }\n\n // ========================================\n // Outputs\n // ========================================\n\n /** Emitted when dashboard configuration changes */\n @Output() configChanged = new EventEmitter<DashboardConfigChangedEvent>();\n\n /** Emitted when a panel requests navigation to another resource */\n @Output() navigationRequested = new EventEmitter<DashboardNavRequestEvent>();\n\n /** Emitted when a panel interaction occurs */\n @Output() panelInteraction = new EventEmitter<PanelInteractionEvent>();\n\n /** Emitted when the dashboard is saved */\n @Output() dashboardSaved = new EventEmitter<MJDashboardEntity>();\n\n /** Emitted when an error occurs */\n @Output() error = new EventEmitter<{ message: string; error?: Error }>();\n\n /** Emitted when edit mode changes */\n @Output() editModeChanged = new EventEmitter<boolean>();\n\n /** Emitted when user navigates via breadcrumb */\n @Output() breadcrumbNavigate = new EventEmitter<BreadcrumbNavigateEvent>();\n\n /** Emitted when user clicks \"Open in Tab\" button */\n @Output() openInTab = new EventEmitter<{ dashboardId: string; dashboardName: string }>();\n\n // ========================================\n // View Children\n // ========================================\n\n @ViewChild('layoutContainer', { static: true }) layoutContainer!: ElementRef<HTMLElement>;\n\n // ========================================\n // State\n // ========================================\n\n public isLoading = false;\n public config: DashboardConfig | null = null;\n public partTypes: MJDashboardPartTypeEntity[] = [];\n public hasUnsavedChanges = false;\n\n /**\n * Helper to check if layout has any panels (for template use).\n * Panels are stored in componentState within the layout tree.\n */\n public get hasPanels(): boolean {\n return extractPanelsFromLayout(this.config?.layout ?? null).length > 0;\n }\n\n private readonly _destroy$ = new Subject<void>();\n private readonly _panelComponents = new Map<string, { wrapper: HTMLElement; componentRef?: ComponentRef<BaseDashboardPart> }>();\n private _glService: GoldenLayoutWrapperService | null = null;\n\n /** Promise that resolves when part types are loaded - used to ensure layout waits for part types */\n private _partTypesLoaded: Promise<void> | null = null;\n\n // ========================================\n // Constructor\n // ========================================\n\n constructor(\n private readonly cdr: ChangeDetectorRef,\n private readonly appRef: ApplicationRef,\n private readonly injector: Injector,\n private readonly environmentInjector: EnvironmentInjector\n ) {\n // Store the promise so layout initialization can wait for it\n this._partTypesLoaded = this.loadPartTypes();\n }\n\n // ========================================\n // Lifecycle\n // ========================================\n\n ngOnDestroy(): void {\n this._destroy$.next();\n this._destroy$.complete();\n this.destroyLayout();\n }\n\n // ========================================\n // Public Methods\n // ========================================\n\n /**\n * Toggle edit mode\n */\n public toggleEditMode(): void {\n this.isEditing = !this.isEditing;\n this.editModeChanged.emit(this.isEditing);\n this.updatePanelEditModes();\n }\n\n /**\n * Add a new panel to the dashboard.\n * The panel is stored in GL's componentState - no separate panels array.\n */\n public async addPanel(\n partTypeId: string,\n panelConfig: PanelConfig,\n title: string,\n icon?: string,\n location?: LayoutLocation\n ): Promise<void> {\n if (!this.config || !this._glService) {\n return;\n }\n\n const partType = this.partTypes.find(pt => UUIDsEqual(pt.ID, partTypeId));\n if (!partType) {\n this.error.emit({ message: `Unknown panel type: ${partTypeId}` });\n return;\n }\n\n const panel: DashboardPanel = {\n id: generatePanelId(),\n partTypeId,\n title,\n icon: icon || partType.Icon || 'fa-solid fa-window-maximize',\n config: panelConfig\n };\n\n // Add to Golden Layout - panel data stored in componentState\n this._glService.addPanel(panel, location);\n\n // Sync the layout config from Golden Layout to capture the new panel\n // The layout IS the source of truth - it contains the panel in componentState\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n\n this.markDirty();\n }\n\n /**\n * Remove a panel from the dashboard.\n * Panels live in GL's componentState, so removing from GL removes the panel.\n */\n public removePanel(panelId: string): void {\n if (!this.config || !this._glService) return;\n\n // Remove from layout (panel data is in componentState)\n this._glService.removePanel(panelId);\n\n // Sync layout config to persist the removal\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n\n // Destroy component\n this.destroyPanelComponent(panelId);\n\n this.markDirty();\n }\n\n /**\n * Save the current dashboard configuration\n */\n public async save(): Promise<boolean> {\n if (!this._dashboard || !this.config) return false;\n\n try {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n // Update the layout config from Golden Layout\n if (this._glService) {\n const glConfig = this._glService.getLayoutConfig();\n if (glConfig) {\n this.config.layout = glConfig;\n }\n }\n\n // Save to UIConfigDetails\n this._dashboard.UIConfigDetails = JSON.stringify(this.config);\n const saved = await this._dashboard.Save();\n\n if (saved) {\n this.hasUnsavedChanges = false;\n this.dashboardSaved.emit(this._dashboard);\n }\n\n return saved;\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n this.error.emit({ message: 'Failed to save dashboard', error });\n return false;\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Refresh all panels\n */\n public async refreshAllPanels(): Promise<void> {\n // For placeholder implementation, reinitialize the layout\n if (this._glService) {\n await this.initializeLayout();\n }\n }\n\n /**\n * Get the current configuration\n */\n public getConfig(): DashboardConfig | null {\n return this.config;\n }\n\n /**\n * Get available part types\n */\n public getPartTypes(): MJDashboardPartTypeEntity[] {\n return this.partTypes;\n }\n\n /**\n * Get a panel by ID.\n * Extracts panel from the layout's componentState (single source of truth).\n */\n public getPanel(panelId: string): DashboardPanel | null {\n return findPanelInLayout(this.config?.layout ?? null, panelId);\n }\n\n /**\n * Get the part type for a panel\n */\n public getPartTypeForPanel(panelId: string): MJDashboardPartTypeEntity | null {\n const panel = this.getPanel(panelId);\n if (!panel) return null;\n return this.partTypes.find(pt => UUIDsEqual(pt.ID, panel.partTypeId)) ?? null;\n }\n\n /**\n * Update a panel's configuration.\n * Since panels live in componentState within the layout, we need to\n * update the layout tree directly or reinitialize with updated data.\n */\n public updatePanelConfig(panelId: string, newConfig: PanelConfig, title?: string, icon?: string): void {\n if (!this.config || !this._glService) return;\n\n // Get current layout which contains all panel data\n const currentLayout = this._glService.getLayoutConfig();\n if (!currentLayout) return;\n\n // Update panel in the layout tree\n this.updatePanelInLayout(currentLayout, panelId, newConfig, title, icon);\n this.config.layout = currentLayout;\n\n this.markDirty();\n\n // Reinitialize layout to reflect the updated panel\n this.initializeLayout();\n }\n\n /**\n * Recursively update a panel's config within the layout tree\n */\n private updatePanelInLayout(\n layout: ResolvedLayoutConfig,\n panelId: string,\n newConfig: PanelConfig,\n title?: string,\n icon?: string\n ): void {\n if (!layout.root) return;\n\n const updateNode = (node: ResolvedLayoutConfig['root']): void => {\n if (!node) return;\n\n // If this is a component with matching panelId\n if (node.type === 'component') {\n const componentNode = node as unknown as { componentState?: DashboardPanel; title?: string };\n if (componentNode.componentState?.id === panelId) {\n componentNode.componentState.config = newConfig;\n if (title) {\n componentNode.componentState.title = title;\n componentNode.title = title;\n }\n if (icon) componentNode.componentState.icon = icon;\n }\n }\n\n // Recursively process children\n const containerNode = node as unknown as { content?: ResolvedLayoutConfig['root'][] };\n if (containerNode.content && Array.isArray(containerNode.content)) {\n for (const child of containerNode.content) {\n updateNode(child);\n }\n }\n };\n\n updateNode(layout.root);\n }\n\n /**\n * Handle add panel button click - emits event for parent to show dialog\n */\n public onAddPanelClick(): void {\n // Emit interaction event for parent to handle\n // Parent should show AddPanelDialog and call addPanel() with result\n this.panelInteraction.emit({\n panelId: '',\n interactionType: 'custom',\n payload: { action: 'add-panel-requested', partTypes: this.partTypes }\n });\n }\n\n /**\n * Handle \"Open in Tab\" button click - emits event for parent to open dashboard in its own tab\n */\n public onOpenInTabClick(): void {\n if (this._dashboard) {\n this.openInTab.emit({\n dashboardId: this._dashboard.ID,\n dashboardName: this._dashboard.Name\n });\n }\n }\n\n /**\n * Handle breadcrumb navigation\n */\n public onBreadcrumbNavigate(event: BreadcrumbNavigateEvent): void {\n this.breadcrumbNavigate.emit(event);\n }\n\n // ========================================\n // Private Methods - Initialization\n // ========================================\n\n private async loadPartTypes(): Promise<void> {\n try {\n await DashboardEngine.Instance.Config(false);\n this.partTypes = DashboardEngine.Instance.DashboardPartTypes;\n } catch (err) {\n console.error('Failed to load dashboard part types:', err);\n }\n }\n\n private async loadDashboardById(id: string): Promise<void> {\n try {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n const md = new Metadata();\n const dashboard = await md.GetEntityObject<MJDashboardEntity>('MJ: Dashboards');\n const loaded = await dashboard.Load(id);\n\n if (loaded) {\n this._dashboard = dashboard;\n this.onDashboardChanged();\n } else {\n this.error.emit({ message: `Dashboard not found: ${id}` });\n }\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n this.error.emit({ message: 'Failed to load dashboard', error });\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n }\n }\n\n private async onDashboardChanged(): Promise<void> {\n if (!this._dashboard) return;\n\n // Parse or create config\n this.config = this.parseOrCreateConfig();\n\n // Wait for part types to be loaded before initializing layout\n // This ensures partTypes array is populated when createPanelComponent is called\n if (this._partTypesLoaded) {\n await this._partTypesLoaded;\n }\n\n // Initialize layout\n this.initializeLayout();\n }\n\n private parseOrCreateConfig(): DashboardConfig {\n if (!this._dashboard?.UIConfigDetails) {\n return createDefaultDashboardConfig();\n }\n\n try {\n const parsed = JSON.parse(this._dashboard.UIConfigDetails);\n\n // Validate it has the expected structure (layout + settings)\n if (parsed.layout !== undefined && parsed.settings) {\n return parsed as DashboardConfig;\n }\n\n // Invalid format, return default\n console.warn('[DashboardViewer] Invalid config format, using default');\n return createDefaultDashboardConfig();\n } catch {\n return createDefaultDashboardConfig();\n }\n }\n\n // ========================================\n // Private Methods - Layout\n // ========================================\n\n private initializeLayout(): void {\n if (!this.config || !this.layoutContainer?.nativeElement) {\n return;\n }\n\n // Destroy existing layout\n this.destroyLayout();\n\n // Create new Golden Layout service\n this._glService = new GoldenLayoutWrapperService();\n\n // Subscribe to layout events\n this.subscribeToLayoutEvents();\n\n // Panel factory - called by GL when it binds a component\n // The panel comes directly from GL's componentState (single source of truth)\n const panelFactory = (panel: DashboardPanel, container: HTMLElement) => {\n this.createPanelComponent(panel, container);\n };\n\n // Initialize with saved layout (or null for empty dashboard)\n // Golden Layout's native ResolvedLayoutConfig is the source of truth\n // Panel data is embedded in each component's componentState\n this._glService.initialize(\n this.layoutContainer.nativeElement,\n this.config.layout,\n panelFactory,\n this.isEditing\n );\n\n // After GL.initialize() completes, all components from the saved layout\n // have been synchronously bound via the panelFactory callback.\n // However, Angular needs time to complete change detection and render\n // the dynamic components. A single delayed updateSize() ensures GL\n // recalculates dimensions after Angular has finished rendering.\n setTimeout(() => {\n this._glService?.updateSize();\n this.cdr.detectChanges();\n }, 100);\n }\n\n /** Flag to prevent panel removal during layout reinit */\n private _isReinitializing = false;\n\n private destroyLayout(): void {\n // Set flag to prevent onPanelClosed from removing panels during reinit\n this._isReinitializing = true;\n\n // Destroy all panel components\n this._panelComponents.forEach((entry, panelId) => {\n this.destroyPanelComponent(panelId);\n });\n this._panelComponents.clear();\n\n // Destroy Golden Layout\n if (this._glService) {\n this._glService.destroy();\n this._glService = null;\n }\n\n this._isReinitializing = false;\n }\n\n private subscribeToLayoutEvents(): void {\n if (!this._glService) return;\n\n this._glService.onLayoutChanged\n .pipe(takeUntil(this._destroy$))\n .subscribe((event: LayoutChangedEvent) => {\n this.onLayoutChanged(event);\n });\n\n this._glService.onPanelClosed\n .pipe(takeUntil(this._destroy$))\n .subscribe((panelId: string) => {\n this.onPanelClosed(panelId);\n });\n\n this._glService.onPanelSelected\n .pipe(takeUntil(this._destroy$))\n .subscribe((panelId: string) => {\n this.onPanelSelected(panelId);\n });\n }\n\n private onLayoutChanged(event: LayoutChangedEvent): void {\n if (this.config) {\n this.config.layout = event.layout;\n this.markDirty();\n\n // Map layout change types to config change types\n const changeType = event.changeType === 'close' ? 'panel-removed' : 'layout';\n this.configChanged.emit({\n config: this.config,\n changeType\n });\n }\n }\n\n private onPanelClosed(panelId: string): void {\n // Skip panel removal during layout reinit (panels are being recreated, not actually closed)\n if (this._isReinitializing) {\n return;\n }\n\n // Sync layout config - panel was removed from GL's tree\n if (this.config && this._glService) {\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n }\n\n // Destroy component\n this.destroyPanelComponent(panelId);\n this.markDirty();\n }\n\n private onPanelSelected(panelId: string): void {\n // Could be used to highlight selected panel in edit mode\n }\n\n // ========================================\n // Private Methods - Panel Components\n // ========================================\n\n /**\n * Create a panel component from the DashboardPanel data.\n * Panel comes directly from GL's componentState - no lookup needed.\n */\n private async createPanelComponent(panel: DashboardPanel, container: HTMLElement): Promise<void> {\n const partType = this.partTypes.find(pt => UUIDsEqual(pt.ID, panel.partTypeId));\n\n // Create the panel wrapper with header and content\n const wrapper = document.createElement('div');\n wrapper.className = 'dashboard-part-wrapper';\n wrapper.style.cssText = 'display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);';\n\n // Only show header in edit mode - GL tabs already display the title in view mode\n if (this.isEditing) {\n const header = this.createPartHeader(panel, panel.id);\n wrapper.appendChild(header);\n }\n\n // Create content area\n const content = document.createElement('div');\n content.className = 'dashboard-part-content';\n content.style.cssText = 'flex: 1; overflow: auto; min-height: 0;';\n\n // Try to create dynamic component via ClassFactory\n const componentRef = await this.createDynamicPartComponent(panel, partType, content);\n\n if (!componentRef) {\n // Fallback to static rendering if no DriverClass or component creation failed\n this.renderPartContent(panel, content, partType);\n }\n\n wrapper.appendChild(content);\n container.appendChild(wrapper);\n\n // Store reference for cleanup\n this._panelComponents.set(panel.id, { wrapper, componentRef: componentRef || undefined });\n }\n\n /**\n * Create a dynamic part component using ClassFactory\n */\n private async createDynamicPartComponent(\n panel: DashboardPanel,\n partType: MJDashboardPartTypeEntity | undefined,\n container: HTMLElement\n ): Promise<ComponentRef<BaseDashboardPart> | null> {\n if (!partType?.DriverClass) {\n return null;\n }\n\n try {\n // Use ClassFactory to create instance and get the component class\n const partInstance = await MJGlobal.Instance.ClassFactory.CreateInstanceAsync<BaseDashboardPart>(\n BaseDashboardPart,\n partType.DriverClass\n );\n\n if (!partInstance) {\n return null;\n }\n\n // Get the Angular component class from the instance\n // The constructor is a concrete class that extends BaseDashboardPart\n const componentClass = (partInstance as object).constructor as Type<BaseDashboardPart>;\n\n // Create the component dynamically\n const componentRef = createComponent(componentClass, {\n environmentInjector: this.environmentInjector,\n elementInjector: this.injector\n });\n\n // Set inputs on the component\n const instance = componentRef.instance;\n instance.Panel = panel;\n instance.PartType = partType;\n instance.IsEditing = this.isEditing;\n\n // Subscribe to events\n instance.ConfigureRequested.subscribe(() => {\n this.onConfigurePart(panel.id);\n });\n instance.RemoveRequested.subscribe(() => {\n this.onRemovePart(panel.id);\n });\n instance.NavigationRequested.subscribe((event: DashboardNavRequestEvent) => {\n this.navigationRequested.emit(event);\n });\n\n // Attach component to DOM\n container.appendChild(componentRef.location.nativeElement);\n\n // Attach to Angular's change detection\n this.appRef.attachView(componentRef.hostView);\n\n return componentRef;\n } catch (error) {\n console.error('[DashboardViewer] Failed to create dynamic component:', error);\n return null;\n }\n }\n\n private createPartHeader(panel: DashboardPanel, panelId: string): HTMLElement {\n const header = document.createElement('div');\n header.className = 'dashboard-part-header';\n header.style.cssText = `\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 12px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n min-height: 40px;\n `;\n\n // Icon and title\n const titleSection = document.createElement('div');\n titleSection.style.cssText = 'display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;';\n titleSection.innerHTML = `\n <i class=\"${panel.icon || 'fa-solid fa-puzzle-piece'}\" style=\"color: var(--mj-brand-primary); font-size: 14px;\"></i>\n <span style=\"font-weight: 500; font-size: 14px; color: var(--mj-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\">${panel.title}</span>\n `;\n header.appendChild(titleSection);\n\n // Action buttons (only in edit mode)\n if (this.isEditing) {\n const actions = document.createElement('div');\n actions.style.cssText = 'display: flex; gap: 4px;';\n\n // Configure button\n const configBtn = document.createElement('button');\n configBtn.className = 'part-action-btn';\n configBtn.title = 'Configure';\n configBtn.style.cssText = `\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.15s;\n `;\n configBtn.innerHTML = '<i class=\"fa-solid fa-cog\" style=\"font-size: 12px;\"></i>';\n configBtn.addEventListener('click', () => this.onConfigurePart(panelId));\n configBtn.addEventListener('mouseenter', () => {\n configBtn.style.background = 'var(--mj-border-default)';\n configBtn.style.color = 'var(--mj-text-primary)';\n });\n configBtn.addEventListener('mouseleave', () => {\n configBtn.style.background = 'transparent';\n configBtn.style.color = 'var(--mj-text-secondary)';\n });\n\n // Remove button\n const removeBtn = document.createElement('button');\n removeBtn.className = 'part-action-btn';\n removeBtn.title = 'Remove';\n removeBtn.style.cssText = `\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.15s;\n `;\n removeBtn.innerHTML = '<i class=\"fa-solid fa-times\" style=\"font-size: 12px;\"></i>';\n removeBtn.addEventListener('click', () => this.onRemovePart(panelId));\n removeBtn.addEventListener('mouseenter', () => {\n removeBtn.style.background = 'color-mix(in srgb, var(--mj-status-error) 10%, transparent)';\n removeBtn.style.color = 'var(--mj-status-error)';\n });\n removeBtn.addEventListener('mouseleave', () => {\n removeBtn.style.background = 'transparent';\n removeBtn.style.color = 'var(--mj-text-secondary)';\n });\n\n actions.appendChild(configBtn);\n actions.appendChild(removeBtn);\n header.appendChild(actions);\n }\n\n return header;\n }\n\n private renderPartContent(panel: DashboardPanel, container: HTMLElement, partType: MJDashboardPartTypeEntity | undefined): void {\n const config = panel.config;\n\n switch (config?.type) {\n case 'WebURL':\n this.renderWebURLPart(panel, container, config);\n break;\n case 'View':\n this.renderViewPart(panel, container, config);\n break;\n case 'Query':\n this.renderQueryPart(panel, container, config);\n break;\n case 'Artifact':\n this.renderArtifactPart(panel, container, config);\n break;\n default:\n this.renderPlaceholderPart(panel, container, partType);\n }\n }\n\n private renderWebURLPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const url = config['url'] as string | undefined;\n if (!url) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-globe\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No URL Configured</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click the configure button to set a URL for this part.</p>\n </div>\n `;\n return;\n }\n\n const sandboxMode = config['sandboxMode'] as string | undefined;\n // Determine sandbox permissions based on mode\n let sandbox = 'allow-scripts allow-same-origin allow-forms allow-popups';\n if (sandboxMode === 'strict') {\n sandbox = 'allow-scripts';\n } else if (sandboxMode === 'permissive') {\n sandbox = 'allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-top-navigation';\n }\n\n const iframe = document.createElement('iframe');\n iframe.src = url;\n iframe.style.cssText = 'width: 100%; height: 100%; border: none;';\n iframe.sandbox.value = sandbox;\n if (config['allowFullscreen'] !== false) {\n iframe.allowFullscreen = true;\n }\n iframe.title = panel.title;\n\n container.appendChild(iframe);\n }\n\n private renderViewPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const viewId = config['viewId'] as string | undefined;\n const entityName = config['entityName'] as string | undefined;\n if (!viewId && !entityName) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-table\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No View Selected</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click configure to select a view for this part.</p>\n </div>\n `;\n return;\n }\n\n const viewInfo = viewId ? viewId.substring(0, 8) + '...' : entityName;\n const displayModeValue = config['displayMode'] as string | undefined;\n const displayMode = displayModeValue === 'grid' ? 'Grid View' : displayModeValue === 'cards' ? 'Card View' : 'Timeline View';\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);\">\n <div style=\"padding: 16px 20px; border-bottom: 1px solid var(--mj-border-default); background: var(--mj-bg-surface-card);\">\n <div style=\"display: flex; align-items: center; gap: 12px;\">\n <i class=\"fa-solid fa-table\" style=\"font-size: 20px; color: var(--mj-brand-primary);\"></i>\n <div>\n <div style=\"font-weight: 500; color: var(--mj-text-primary); font-size: 14px;\">Entity View</div>\n <div style=\"font-size: 12px; color: var(--mj-text-secondary);\">${entityName || 'View ' + viewInfo}</div>\n </div>\n <span style=\"margin-left: auto; padding: 4px 10px; background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent); color: var(--mj-brand-primary); border-radius: 12px; font-size: 11px; font-weight: 500;\">${displayMode}</span>\n </div>\n </div>\n <div style=\"flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--mj-text-muted); padding: 24px;\">\n <i class=\"fa-solid fa-spinner fa-spin\" style=\"font-size: 24px; margin-bottom: 12px;\"></i>\n <p style=\"margin: 0; font-size: 13px;\">Entity grid loading...</p>\n <p style=\"margin: 8px 0 0 0; font-size: 11px; color: var(--mj-text-muted);\">Full implementation pending Angular integration</p>\n </div>\n </div>\n `;\n }\n\n private renderQueryPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const queryId = config['queryId'] as string | undefined;\n const queryName = config['queryName'] as string | undefined;\n if (!queryId && !queryName) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-database\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No Query Selected</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click configure to select a query for this part.</p>\n </div>\n `;\n return;\n }\n\n const autoRefreshSeconds = (config['autoRefreshSeconds'] as number) || 0;\n const queryInfo = queryName || (queryId ? queryId.substring(0, 8) + '...' : 'Unknown');\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);\">\n <div style=\"padding: 16px 20px; border-bottom: 1px solid var(--mj-border-default); background: var(--mj-bg-surface-card);\">\n <div style=\"display: flex; align-items: center; gap: 12px;\">\n <i class=\"fa-solid fa-database\" style=\"font-size: 20px; color: var(--mj-brand-primary);\"></i>\n <div>\n <div style=\"font-weight: 500; color: var(--mj-text-primary); font-size: 14px;\">Query Results</div>\n <div style=\"font-size: 12px; color: var(--mj-text-secondary);\">${queryInfo}</div>\n </div>\n <span style=\"margin-left: auto; padding: 4px 10px; background: color-mix(in srgb, var(--mj-status-success) 10%, transparent); color: var(--mj-status-success); border-radius: 12px; font-size: 11px; font-weight: 500;\">${autoRefreshSeconds > 0 ? 'Refresh: ' + autoRefreshSeconds + 's' : 'Manual refresh'}</span>\n </div>\n </div>\n <div style=\"flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--mj-text-muted); padding: 24px;\">\n <i class=\"fa-solid fa-spinner fa-spin\" style=\"font-size: 24px; margin-bottom: 12px;\"></i>\n <p style=\"margin: 0; font-size: 13px;\">Query grid loading...</p>\n <p style=\"margin: 8px 0 0 0; font-size: 11px; color: var(--mj-text-muted);\">Full implementation pending Angular integration</p>\n </div>\n </div>\n `;\n }\n\n private renderArtifactPart(panel: DashboardPanel, container: HTMLElement, config: PanelConfig): void {\n const artifactId = config['artifactId'] as string | undefined;\n if (!artifactId) {\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-cube\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">No Artifact Selected</h4>\n <p style=\"margin: 0; font-size: 13px;\">Click configure to select an artifact for this part.</p>\n </div>\n `;\n return;\n }\n\n const versionNumber = config['versionNumber'] as number | undefined;\n const artifactInfo = artifactId.substring(0, 8) + '...';\n const versionInfo = versionNumber ? `v${versionNumber}` : 'Latest';\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface);\">\n <div style=\"padding: 16px 20px; border-bottom: 1px solid var(--mj-border-default); background: var(--mj-bg-surface-card);\">\n <div style=\"display: flex; align-items: center; gap: 12px;\">\n <i class=\"fa-solid fa-cube\" style=\"font-size: 20px; color: var(--mj-brand-primary);\"></i>\n <div>\n <div style=\"font-weight: 500; color: var(--mj-text-primary); font-size: 14px;\">Artifact</div>\n <div style=\"font-size: 12px; color: var(--mj-text-secondary);\">ID: ${artifactInfo}</div>\n </div>\n <span style=\"margin-left: auto; padding: 4px 10px; background: color-mix(in srgb, var(--mj-status-error) 10%, transparent); color: var(--mj-status-error); border-radius: 12px; font-size: 11px; font-weight: 500;\">${versionInfo}</span>\n </div>\n </div>\n <div style=\"flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--mj-text-muted); padding: 24px;\">\n <i class=\"fa-solid fa-spinner fa-spin\" style=\"font-size: 24px; margin-bottom: 12px;\"></i>\n <p style=\"margin: 0; font-size: 13px;\">Artifact viewer loading...</p>\n <p style=\"margin: 8px 0 0 0; font-size: 11px; color: var(--mj-text-muted);\">Full implementation pending Angular integration</p>\n </div>\n </div>\n `;\n }\n\n private renderPlaceholderPart(panel: DashboardPanel, container: HTMLElement, partType: MJDashboardPartTypeEntity | undefined): void {\n const partTypeName = partType?.Name || 'Custom';\n container.innerHTML = `\n <div style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--mj-text-secondary); text-align: center; padding: 24px;\">\n <i class=\"fa-solid fa-puzzle-piece\" style=\"font-size: 48px; color: var(--mj-text-muted); margin-bottom: 16px;\"></i>\n <h4 style=\"margin: 0 0 8px 0; color: var(--mj-text-primary);\">${partTypeName} Part</h4>\n <p style=\"margin: 0; font-size: 13px;\">This part type is not yet fully implemented.</p>\n </div>\n `;\n }\n\n private onConfigurePart(panelId: string): void {\n // Emit event for parent to handle configuration\n this.panelInteraction.emit({\n panelId,\n interactionType: 'custom',\n payload: { action: 'configure-part-requested' }\n });\n }\n\n private onRemovePart(panelId: string): void {\n // Emit event for parent to show confirmation dialog\n const panel = findPanelInLayout(this.config?.layout ?? null, panelId);\n this.panelInteraction.emit({\n panelId,\n interactionType: 'custom',\n payload: {\n action: 'remove-part-requested',\n panelTitle: panel?.title || 'this part'\n }\n });\n }\n\n /**\n * Confirm removal of a panel (called by parent after confirmation dialog)\n */\n public confirmRemovePanel(panelId: string): void {\n this.removePanel(panelId);\n }\n\n private destroyPanelComponent(panelId: string): void {\n const entry = this._panelComponents.get(panelId);\n if (entry) {\n // Destroy the Angular component if present\n if (entry.componentRef) {\n this.appRef.detachView(entry.componentRef.hostView);\n entry.componentRef.destroy();\n }\n this._panelComponents.delete(panelId);\n }\n }\n\n private updatePanelEditModes(): void {\n // Update IsEditing on all dynamic components\n this._panelComponents.forEach((entry) => {\n if (entry.componentRef) {\n entry.componentRef.instance.IsEditing = this.isEditing;\n }\n });\n\n // Save current layout before reinitializing (preserves user's arrangement)\n if (this._glService && this.config) {\n const currentLayout = this._glService.getLayoutConfig();\n if (currentLayout) {\n this.config.layout = currentLayout;\n }\n }\n\n // Reinitialize layout to apply new Golden Layout settings (edit mode lock/unlock)\n if (this._glService) {\n this.initializeLayout();\n }\n }\n\n // ========================================\n // Private Methods - State\n // ========================================\n\n private markDirty(): void {\n this.hasUnsavedChanges = true;\n\n if (this.autoSave && this.config) {\n this.save();\n }\n }\n}\n","<!-- Dashboard Viewer Component -->\n<div class=\"dashboard-viewer\" [class.editing]=\"isEditing\" [class.has-toolbar]=\"shouldShowToolbar\">\n <!-- Breadcrumb Navigation (hidden in edit mode) -->\n @if (showBreadcrumb && !isEditing && dashboard) {\n <mj-dashboard-breadcrumb\n [Categories]=\"Categories\"\n [CurrentCategoryId]=\"dashboard.CategoryID\"\n [CurrentDashboard]=\"dashboard\"\n [ShowDashboardName]=\"true\"\n [AllowDragDrop]=\"false\"\n Size=\"large\"\n RootIcon=\"fa-solid fa-gauge-high\"\n RootLabel=\"Dashboards\"\n (Navigate)=\"onBreadcrumbNavigate($event)\">\n </mj-dashboard-breadcrumb>\n }\n\n <!-- Toolbar (auto-hides when all elements are disabled) -->\n @if (shouldShowToolbar) {\n <div class=\"dashboard-toolbar\">\n <div class=\"toolbar-left\">\n @if (dashboard && (isEditing || !showBreadcrumb)) {\n <span class=\"dashboard-title\">\n <i class=\"fa-solid fa-chart-line\"></i>\n {{ dashboard.Name }}\n </span>\n }\n </div>\n <div class=\"toolbar-center\">\n @if (hasUnsavedChanges && isEditing) {\n <span class=\"unsaved-indicator\">\n <i class=\"fa-solid fa-circle\"></i>\n Unsaved changes\n </span>\n }\n </div>\n <div class=\"toolbar-right\">\n <!-- Open in New Tab button (when embedded) -->\n @if (showOpenInTabButton && !isEditing) {\n <button\n class=\"toolbar-button\"\n (click)=\"onOpenInTabClick()\"\n title=\"Open in its own tab\">\n <i class=\"fa-solid fa-up-right-from-square\"></i>\n Open in Tab\n </button>\n }\n @if (isEditing) {\n <button\n class=\"toolbar-button\"\n (click)=\"onAddPanelClick()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Part\n </button>\n }\n @if (showEditButton) {\n <button\n class=\"toolbar-button\"\n [class.active]=\"isEditing\"\n (click)=\"toggleEditMode()\">\n <i class=\"fa-solid fa-edit\"></i>\n {{ isEditing ? 'Editing' : 'Edit' }}\n </button>\n }\n @if (isEditing && hasUnsavedChanges) {\n <button\n class=\"toolbar-button primary\"\n (click)=\"save()\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Loading Overlay -->\n @if (isLoading) {\n <div class=\"loading-overlay\">\n <mj-loading text=\"Loading dashboard...\"></mj-loading>\n </div>\n }\n\n <!-- Layout Container -->\n <div class=\"layout-container\" #layoutContainer>\n <!-- Golden Layout will render panels here -->\n </div>\n\n <!-- Empty State -->\n @if (!hasPanels && !isLoading) {\n <div class=\"empty-state\">\n <div class=\"empty-icon\">\n <i class=\"fa-solid fa-layer-group\"></i>\n </div>\n <h3>No parts configured</h3>\n <p>This dashboard has no parts yet. Add your first part to start visualizing your data.</p>\n @if (isEditing) {\n <button class=\"add-part-button\" (click)=\"onAddPanelClick()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Your First Part\n </button>\n }\n </div>\n }\n</div>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-panel-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialogs/add-panel-dialog/add-panel-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EACZ,iBAAiB,EAEjB,gBAAgB,EAEhB,aAAa,EACb,SAAS,EACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAmB,iBAAiB,E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I,IAAI;IASrB;;OAEG;IACI,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAMvD;;OAEG;IACI,OAAO,IAAI,IAAI;IAoCtB;;OAEG;IACI,QAAQ,IAAI,IAAI;IAKvB;;OAEG;IACI,iBAAiB,IAAI,MAAM;IAOlC;;OAEG;IACI,cAAc,IAAI,OAAO;IAQhC;;OAEG;
|
|
1
|
+
{"version":3,"file":"add-panel-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialogs/add-panel-dialog/add-panel-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EACZ,iBAAiB,EAEjB,gBAAgB,EAEhB,aAAa,EACb,SAAS,EACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAmB,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAE3F;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,yBAAyB,CAAC;IACpC,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,KAAK,UAAU,GAAG,aAAa,GAAG,WAAW,CAAC;AAE9C;;;;;;GAMG;AACH,qBAMa,uBAAwB,YAAW,aAAa,EAAE,SAAS;IAqExD,OAAO,CAAC,QAAQ,CAAC,GAAG;IAhEhC,0CAA0C;IACjC,SAAS,EAAE,yBAAyB,EAAE,CAAM;IAErD,oCAAoC;IACpC,IACI,OAAO,CAAC,KAAK,EAAE,OAAO,EAOzB;IACD,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,OAAO,CAAC,QAAQ,CAAS;IAMzB,yDAAyD;IAC/C,UAAU,+BAAsC;IAE1D,2CAA2C;IACjC,SAAS,qBAA4B;IAO/C,oBAAoB,EAAG,gBAAgB,CAAC;IAMjC,IAAI,EAAE,UAAU,CAAiB;IACjC,gBAAgB,EAAE,yBAAyB,GAAG,IAAI,CAAQ;IAEjE,oEAAoE;IAC7D,aAAa,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAEtD,oDAAoD;IAC7C,UAAU,UAAS;IAE1B,oDAAoD;IACpD,OAAO,CAAC,cAAc,CAA8C;IAEpE,4CAA4C;IAC5C,OAAO,CAAC,eAAe,CAAS;IAEhC,qCAAqC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEvC,sCAAsC;IAC/B,cAAc,UAAS;gBAMD,GAAG,EAAE,iBAAiB;IAMnD,eAAe,IAAI,IAAI;IAIvB,WAAW,IAAI,IAAI;IAQnB;;OAEG;IACI,KAAK,IAAI,IAAI;IAWpB;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAYlE;;OAEG;IACI,MAAM,IAAI,IAAI;IASrB;;OAEG;IACI,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAMvD;;OAEG;IACI,OAAO,IAAI,IAAI;IAoCtB;;OAEG;IACI,QAAQ,IAAI,IAAI;IAKvB;;OAEG;IACI,iBAAiB,IAAI,MAAM;IAOlC;;OAEG;IACI,cAAc,IAAI,OAAO;IAQhC;;OAEG;YACW,eAAe;IA+D7B;;OAEG;IACH,OAAO,CAAC,kBAAkB;yCAlRjB,uBAAuB;2CAAvB,uBAAuB;CAwRnC"}
|
|
@@ -367,7 +367,7 @@ export class AddPanelDialogComponent {
|
|
|
367
367
|
/**
|
|
368
368
|
* Dynamically load the config panel component
|
|
369
369
|
*/
|
|
370
|
-
loadConfigPanel() {
|
|
370
|
+
async loadConfigPanel() {
|
|
371
371
|
this.destroyConfigPanel();
|
|
372
372
|
if (!this.selectedPartType?.ConfigDialogClass) {
|
|
373
373
|
// No config panel for this type - that's okay, use defaults
|
|
@@ -384,7 +384,7 @@ export class AddPanelDialogComponent {
|
|
|
384
384
|
this.cdr.detectChanges();
|
|
385
385
|
try {
|
|
386
386
|
// Use ClassFactory to create the config panel instance
|
|
387
|
-
const panelInstance = MJGlobal.Instance.ClassFactory.
|
|
387
|
+
const panelInstance = await MJGlobal.Instance.ClassFactory.CreateInstanceAsync(BaseConfigPanel, this.selectedPartType.ConfigDialogClass);
|
|
388
388
|
if (!panelInstance) {
|
|
389
389
|
this.loadError = `Could not create config panel: ${this.selectedPartType.ConfigDialogClass}`;
|
|
390
390
|
this.isLoadingPanel = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-panel-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/dialogs/add-panel-dialog/add-panel-dialog.component.ts","../../../../src/lib/dialogs/add-panel-dialog/add-panel-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAInB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAqB,MAAM,uCAAuC,CAAC;;;;ICevE,gCAA+B;IAC7B,YACF;IAAA,iBAAO;;;IADL,cACF;IADE,wDACF;;;;IAXN,+BAEuC;IAArC,4OAAS,oCAA0B,KAAC;IACpC,+BAAuB;IACrB,oBAA6D;IAC/D,iBAAM;IAEJ,AADF,+BAA0B,eACC;IAAA,YAAmB;IAAA,iBAAO;IACnD,8HAA4B;IAK9B,iBAAM;IACN,wBAAoD;IACtD,iBAAM;;;IAXC,eAAqD;IAArD,6DAAqD;IAG/B,eAAmB;IAAnB,sCAAmB;IAC5C,cAIC;IAJD,kDAIC;;;IAQL,AADF,+BAAsB,cACM;IACxB,wBAAgD;IAClD,iBAAM;IACN,0BAAI;IAAA,uCAAuB;IAAA,iBAAK;IAChC,yBAAG;IAAA,4EAA4D;IACjE,AADiE,iBAAI,EAC/D;;;;IAtCR,AAD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;kBAGN,MAAM;;kBAMN,SAAS;mBAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE;;kFArCnE,uBAAuB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ViewChild,\n ViewContainerRef,\n ComponentRef,\n AfterViewInit,\n OnDestroy\n} from '@angular/core';\nimport { MJGlobal } from '@memberjunction/global';\nimport { MJDashboardPartTypeEntity } from '@memberjunction/core-entities';\nimport { PanelConfig } from '../../models/dashboard-types';\nimport { BaseConfigPanel, ConfigPanelResult } from '../../config-panels/base-config-panel';\n\n/**\n * Result when a panel is added\n */\nexport interface AddPanelResult {\n PartType: MJDashboardPartTypeEntity;\n Config: PanelConfig;\n Title: string;\n Icon?: string;\n}\n\n/**\n * Dialog step type\n */\ntype DialogStep = 'select-type' | 'configure';\n\n/**\n * Dialog for adding a new part to the dashboard.\n * Two-step flow: first select the part type, then configure using dynamically loaded config panels.\n *\n * Config panels are loaded via ClassFactory using DashboardPartType.ConfigDialogClass,\n * allowing new part types to be added without modifying this component.\n */\n@Component({\n standalone: false,\n selector: 'mj-add-panel-dialog',\n templateUrl: './add-panel-dialog.component.html',\n styleUrls: ['./add-panel-dialog.component.css']\n})\nexport class AddPanelDialogComponent implements AfterViewInit, OnDestroy {\n // ========================================\n // Inputs\n // ========================================\n\n /** Available part types to choose from */\n @Input() partTypes: MJDashboardPartTypeEntity[] = [];\n\n /** Whether the dialog is visible */\n @Input()\n set visible(value: boolean) {\n const previous = this._visible;\n this._visible = value;\n if (!value && previous) {\n // Dialog closing - cleanup\n this.destroyConfigPanel();\n }\n }\n get visible(): boolean {\n return this._visible;\n }\n private _visible = false;\n\n // ========================================\n // Outputs\n // ========================================\n\n /** Emitted when a part is configured and ready to add */\n @Output() panelAdded = new EventEmitter<AddPanelResult>();\n\n /** Emitted when the dialog is cancelled */\n @Output() cancelled = new EventEmitter<void>();\n\n // ========================================\n // ViewChild for dynamic component loading\n // ========================================\n\n @ViewChild('configPanelContainer', { read: ViewContainerRef, static: false })\n configPanelContainer!: ViewContainerRef;\n\n // ========================================\n // State\n // ========================================\n\n public step: DialogStep = 'select-type';\n public selectedPartType: MJDashboardPartTypeEntity | null = null;\n\n /** Current config panel result (updated via configChanged event) */\n public currentResult: ConfigPanelResult | null = null;\n\n /** Whether the Add Part button should be enabled */\n public canAddPart = false;\n\n /** Reference to dynamically created config panel */\n private configPanelRef: ComponentRef<BaseConfigPanel> | null = null;\n\n /** Whether the view has been initialized */\n private viewInitialized = false;\n\n /** Error loading the config panel */\n public loadError: string | null = null;\n\n /** Whether config panel is loading */\n public isLoadingPanel = false;\n\n // ========================================\n // Constructor\n // ========================================\n\n constructor(private readonly cdr: ChangeDetectorRef) {}\n\n // ========================================\n // Lifecycle\n // ========================================\n\n ngAfterViewInit(): void {\n this.viewInitialized = true;\n }\n\n ngOnDestroy(): void {\n this.destroyConfigPanel();\n }\n\n // ========================================\n // Public Methods\n // ========================================\n\n /**\n * Reset the dialog to initial state\n */\n public reset(): void {\n this.step = 'select-type';\n this.selectedPartType = null;\n this.currentResult = null;\n this.canAddPart = false;\n this.loadError = null;\n this.isLoadingPanel = false;\n this.destroyConfigPanel();\n this.cdr.detectChanges();\n }\n\n /**\n * Select a part type and go to configuration step\n */\n public onPartTypeSelect(partType: MJDashboardPartTypeEntity): void {\n this.selectedPartType = partType;\n this.currentResult = null;\n this.canAddPart = false;\n this.loadError = null;\n this.step = 'configure';\n this.cdr.detectChanges();\n\n // Load the config panel after view updates\n setTimeout(() => this.loadConfigPanel(), 0);\n }\n\n /**\n * Go back to type selection\n */\n public goBack(): void {\n this.step = 'select-type';\n this.currentResult = null;\n this.canAddPart = false;\n this.loadError = null;\n this.destroyConfigPanel();\n this.cdr.detectChanges();\n }\n\n /**\n * Handle config changes from embedded config panel\n */\n public onConfigChanged(result: ConfigPanelResult): void {\n this.currentResult = result;\n this.canAddPart = result.isValid;\n this.cdr.detectChanges();\n }\n\n /**\n * Add the configured part\n */\n public addPart(): void {\n if (!this.selectedPartType) return;\n\n // Get result from the dynamic panel\n if (this.configPanelRef) {\n const panel = this.configPanelRef.instance;\n const result = panel.getResult();\n\n if (!result.isValid) {\n this.currentResult = result;\n this.canAddPart = false;\n this.cdr.detectChanges();\n return;\n }\n\n this.panelAdded.emit({\n PartType: this.selectedPartType,\n Config: result.config,\n Title: result.title,\n Icon: result.icon || this.selectedPartType.Icon || 'fa-solid fa-puzzle-piece'\n });\n\n this.reset();\n return;\n }\n\n // Handle types without a config panel - use a generic config with just the type\n this.panelAdded.emit({\n PartType: this.selectedPartType,\n Config: { type: this.selectedPartType.Name },\n Title: this.selectedPartType.Name,\n Icon: this.selectedPartType.Icon || 'fa-solid fa-puzzle-piece'\n });\n this.reset();\n }\n\n /**\n * Cancel the dialog\n */\n public onCancel(): void {\n this.reset();\n this.cancelled.emit();\n }\n\n /**\n * Get the configuration type name\n */\n public getConfigTypeName(): string {\n if (!this.selectedPartType) return '';\n const name = this.selectedPartType.Name;\n if (name === 'WebURL') return 'Web URL';\n return name;\n }\n\n /**\n * Check if the selected part type has a config panel class\n */\n public hasConfigPanel(): boolean {\n return !!this.selectedPartType?.ConfigDialogClass;\n }\n\n // ========================================\n // Private Methods\n // ========================================\n\n /**\n * Dynamically load the config panel component\n */\n private loadConfigPanel(): void {\n this.destroyConfigPanel();\n\n if (!this.selectedPartType?.ConfigDialogClass) {\n // No config panel for this type - that's okay, use defaults\n this.canAddPart = true;\n this.cdr.detectChanges();\n return;\n }\n\n if (!this.viewInitialized || !this.configPanelContainer) {\n this.loadError = 'View container not ready';\n this.cdr.detectChanges();\n return;\n }\n\n this.isLoadingPanel = true;\n this.cdr.detectChanges();\n\n try {\n // Use ClassFactory to create the config panel instance\n const panelInstance = MJGlobal.Instance.ClassFactory.CreateInstance<BaseConfigPanel>(\n BaseConfigPanel,\n this.selectedPartType.ConfigDialogClass\n );\n\n if (!panelInstance) {\n this.loadError = `Could not create config panel: ${this.selectedPartType.ConfigDialogClass}`;\n this.isLoadingPanel = false;\n this.canAddPart = true; // Allow adding with default config\n this.cdr.detectChanges();\n return;\n }\n\n // Get the component class from the instance\n const componentClass = (panelInstance as object).constructor as typeof BaseConfigPanel;\n\n // Clear the container and create the component\n this.configPanelContainer.clear();\n this.configPanelRef = this.configPanelContainer.createComponent(componentClass as never);\n\n // Set inputs on the component\n const panel = this.configPanelRef.instance;\n panel.partType = this.selectedPartType;\n panel.panel = null; // New panel, not editing\n panel.config = null; // Start with defaults\n\n // Subscribe to config changes\n panel.configChanged.subscribe((result: ConfigPanelResult) => {\n this.onConfigChanged(result);\n });\n\n this.isLoadingPanel = false;\n this.cdr.detectChanges();\n\n } catch (error) {\n this.loadError = `Failed to load config panel: ${error instanceof Error ? error.message : String(error)}`;\n this.isLoadingPanel = false;\n this.canAddPart = true; // Allow adding with default config\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Destroy the dynamically created config panel\n */\n private destroyConfigPanel(): void {\n if (this.configPanelRef) {\n this.configPanelRef.destroy();\n this.configPanelRef = null;\n }\n }\n}\n","<!-- Add Part Dialog -->\n@if (visible) {\n <div class=\"add-part-dialog-overlay\" (click)=\"onCancel()\">\n <div class=\"add-part-dialog\" (click)=\"$event.stopPropagation()\">\n <!-- Step 1: Select Part Type -->\n @if (step === 'select-type') {\n <!-- Header -->\n <div class=\"dialog-header\">\n <h3>\n <i class=\"fa-solid fa-plus-circle\"></i>\n Add Part\n </h3>\n <button class=\"close-button\" (click)=\"onCancel()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Content -->\n <div class=\"dialog-content\">\n <p class=\"instruction\">Select a part type to add to your dashboard:</p>\n <div class=\"part-type-grid\">\n @for (partType of partTypes; track partType) {\n <div\n class=\"part-type-card\"\n (click)=\"onPartTypeSelect(partType)\">\n <div class=\"card-icon\">\n <i [class]=\"partType.Icon || 'fa-solid fa-puzzle-piece'\"></i>\n </div>\n <div class=\"card-content\">\n <span class=\"card-title\">{{ partType.Name }}</span>\n @if (partType.Description) {\n <span class=\"card-description\">\n {{ partType.Description }}\n </span>\n }\n </div>\n <i class=\"fa-solid fa-chevron-right card-arrow\"></i>\n </div>\n }\n </div>\n @if (partTypes.length === 0) {\n <div class=\"no-types\">\n <div class=\"warning-icon\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n </div>\n <h4>No part types available</h4>\n <p>Dashboard part types have not been configured in the system.</p>\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <button class=\"btn-secondary\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n <!-- Step 2: Configure Part -->\n @if (step === 'configure') {\n <!-- Header -->\n <div class=\"dialog-header\">\n <button class=\"back-button\" (click)=\"goBack()\">\n <i class=\"fa-solid fa-arrow-left\"></i>\n </button>\n <h3>\n <i [class]=\"selectedPartType?.Icon || 'fa-solid fa-puzzle-piece'\"></i>\n Configure {{ getConfigTypeName() }} Part\n </h3>\n <button class=\"close-button\" (click)=\"onCancel()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Content - Dynamic Config Panel -->\n <div class=\"dialog-content config-content\">\n <!-- Loading state -->\n @if (isLoadingPanel) {\n <div class=\"loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading configuration panel...</span>\n </div>\n }\n <!-- Error state -->\n @if (loadError && !isLoadingPanel) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <span>{{ loadError }}</span>\n <p class=\"error-hint\">You can still add this part with default settings.</p>\n </div>\n }\n <!-- Dynamic config panel container -->\n <ng-container #configPanelContainer></ng-container>\n <!-- No config panel available (custom type) -->\n @if (!hasConfigPanel() && !isLoadingPanel && !loadError) {\n <div class=\"config-placeholder\">\n <i class=\"fa-solid fa-cog\"></i>\n <p>This part type uses default configuration.</p>\n </div>\n }\n <!-- Validation Errors -->\n @if (currentResult && currentResult.errors.length > 0) {\n <div class=\"validation-errors\">\n @for (error of currentResult.errors; track error) {\n <div class=\"error-item\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n {{ error }}\n </div>\n }\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <button class=\"btn-primary\" (click)=\"addPart()\" [disabled]=\"!canAddPart && !loadError\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Part\n </button>\n <button class=\"btn-secondary\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n </div>\n </div>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"add-panel-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/dialogs/add-panel-dialog/add-panel-dialog.component.ts","../../../../src/lib/dialogs/add-panel-dialog/add-panel-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAInB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAqB,MAAM,uCAAuC,CAAC;;;;ICevE,gCAA+B;IAC7B,YACF;IAAA,iBAAO;;;IADL,cACF;IADE,wDACF;;;;IAXN,+BAEuC;IAArC,4OAAS,oCAA0B,KAAC;IACpC,+BAAuB;IACrB,oBAA6D;IAC/D,iBAAM;IAEJ,AADF,+BAA0B,eACC;IAAA,YAAmB;IAAA,iBAAO;IACnD,8HAA4B;IAK9B,iBAAM;IACN,wBAAoD;IACtD,iBAAM;;;IAXC,eAAqD;IAArD,6DAAqD;IAG/B,eAAmB;IAAnB,sCAAmB;IAC5C,cAIC;IAJD,kDAIC;;;IAQL,AADF,+BAAsB,cACM;IACxB,wBAAgD;IAClD,iBAAM;IACN,0BAAI;IAAA,uCAAuB;IAAA,iBAAK;IAChC,yBAAG;IAAA,4EAA4D;IACjE,AADiE,iBAAI,EAC/D;;;;IAtCR,AADF,8BAA2B,SACrB;IACF,uBAAuC;IACvC,0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BAMN,SAAS;mBAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE;;kFArCnE,uBAAuB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ViewChild,\n ViewContainerRef,\n ComponentRef,\n AfterViewInit,\n OnDestroy\n} from '@angular/core';\nimport { MJGlobal } from '@memberjunction/global';\nimport { MJDashboardPartTypeEntity } from '@memberjunction/core-entities';\nimport { PanelConfig } from '../../models/dashboard-types';\nimport { BaseConfigPanel, ConfigPanelResult } from '../../config-panels/base-config-panel';\n\n/**\n * Result when a panel is added\n */\nexport interface AddPanelResult {\n PartType: MJDashboardPartTypeEntity;\n Config: PanelConfig;\n Title: string;\n Icon?: string;\n}\n\n/**\n * Dialog step type\n */\ntype DialogStep = 'select-type' | 'configure';\n\n/**\n * Dialog for adding a new part to the dashboard.\n * Two-step flow: first select the part type, then configure using dynamically loaded config panels.\n *\n * Config panels are loaded via ClassFactory using DashboardPartType.ConfigDialogClass,\n * allowing new part types to be added without modifying this component.\n */\n@Component({\n standalone: false,\n selector: 'mj-add-panel-dialog',\n templateUrl: './add-panel-dialog.component.html',\n styleUrls: ['./add-panel-dialog.component.css']\n})\nexport class AddPanelDialogComponent implements AfterViewInit, OnDestroy {\n // ========================================\n // Inputs\n // ========================================\n\n /** Available part types to choose from */\n @Input() partTypes: MJDashboardPartTypeEntity[] = [];\n\n /** Whether the dialog is visible */\n @Input()\n set visible(value: boolean) {\n const previous = this._visible;\n this._visible = value;\n if (!value && previous) {\n // Dialog closing - cleanup\n this.destroyConfigPanel();\n }\n }\n get visible(): boolean {\n return this._visible;\n }\n private _visible = false;\n\n // ========================================\n // Outputs\n // ========================================\n\n /** Emitted when a part is configured and ready to add */\n @Output() panelAdded = new EventEmitter<AddPanelResult>();\n\n /** Emitted when the dialog is cancelled */\n @Output() cancelled = new EventEmitter<void>();\n\n // ========================================\n // ViewChild for dynamic component loading\n // ========================================\n\n @ViewChild('configPanelContainer', { read: ViewContainerRef, static: false })\n configPanelContainer!: ViewContainerRef;\n\n // ========================================\n // State\n // ========================================\n\n public step: DialogStep = 'select-type';\n public selectedPartType: MJDashboardPartTypeEntity | null = null;\n\n /** Current config panel result (updated via configChanged event) */\n public currentResult: ConfigPanelResult | null = null;\n\n /** Whether the Add Part button should be enabled */\n public canAddPart = false;\n\n /** Reference to dynamically created config panel */\n private configPanelRef: ComponentRef<BaseConfigPanel> | null = null;\n\n /** Whether the view has been initialized */\n private viewInitialized = false;\n\n /** Error loading the config panel */\n public loadError: string | null = null;\n\n /** Whether config panel is loading */\n public isLoadingPanel = false;\n\n // ========================================\n // Constructor\n // ========================================\n\n constructor(private readonly cdr: ChangeDetectorRef) {}\n\n // ========================================\n // Lifecycle\n // ========================================\n\n ngAfterViewInit(): void {\n this.viewInitialized = true;\n }\n\n ngOnDestroy(): void {\n this.destroyConfigPanel();\n }\n\n // ========================================\n // Public Methods\n // ========================================\n\n /**\n * Reset the dialog to initial state\n */\n public reset(): void {\n this.step = 'select-type';\n this.selectedPartType = null;\n this.currentResult = null;\n this.canAddPart = false;\n this.loadError = null;\n this.isLoadingPanel = false;\n this.destroyConfigPanel();\n this.cdr.detectChanges();\n }\n\n /**\n * Select a part type and go to configuration step\n */\n public onPartTypeSelect(partType: MJDashboardPartTypeEntity): void {\n this.selectedPartType = partType;\n this.currentResult = null;\n this.canAddPart = false;\n this.loadError = null;\n this.step = 'configure';\n this.cdr.detectChanges();\n\n // Load the config panel after view updates\n setTimeout(() => this.loadConfigPanel(), 0);\n }\n\n /**\n * Go back to type selection\n */\n public goBack(): void {\n this.step = 'select-type';\n this.currentResult = null;\n this.canAddPart = false;\n this.loadError = null;\n this.destroyConfigPanel();\n this.cdr.detectChanges();\n }\n\n /**\n * Handle config changes from embedded config panel\n */\n public onConfigChanged(result: ConfigPanelResult): void {\n this.currentResult = result;\n this.canAddPart = result.isValid;\n this.cdr.detectChanges();\n }\n\n /**\n * Add the configured part\n */\n public addPart(): void {\n if (!this.selectedPartType) return;\n\n // Get result from the dynamic panel\n if (this.configPanelRef) {\n const panel = this.configPanelRef.instance;\n const result = panel.getResult();\n\n if (!result.isValid) {\n this.currentResult = result;\n this.canAddPart = false;\n this.cdr.detectChanges();\n return;\n }\n\n this.panelAdded.emit({\n PartType: this.selectedPartType,\n Config: result.config,\n Title: result.title,\n Icon: result.icon || this.selectedPartType.Icon || 'fa-solid fa-puzzle-piece'\n });\n\n this.reset();\n return;\n }\n\n // Handle types without a config panel - use a generic config with just the type\n this.panelAdded.emit({\n PartType: this.selectedPartType,\n Config: { type: this.selectedPartType.Name },\n Title: this.selectedPartType.Name,\n Icon: this.selectedPartType.Icon || 'fa-solid fa-puzzle-piece'\n });\n this.reset();\n }\n\n /**\n * Cancel the dialog\n */\n public onCancel(): void {\n this.reset();\n this.cancelled.emit();\n }\n\n /**\n * Get the configuration type name\n */\n public getConfigTypeName(): string {\n if (!this.selectedPartType) return '';\n const name = this.selectedPartType.Name;\n if (name === 'WebURL') return 'Web URL';\n return name;\n }\n\n /**\n * Check if the selected part type has a config panel class\n */\n public hasConfigPanel(): boolean {\n return !!this.selectedPartType?.ConfigDialogClass;\n }\n\n // ========================================\n // Private Methods\n // ========================================\n\n /**\n * Dynamically load the config panel component\n */\n private async loadConfigPanel(): Promise<void> {\n this.destroyConfigPanel();\n\n if (!this.selectedPartType?.ConfigDialogClass) {\n // No config panel for this type - that's okay, use defaults\n this.canAddPart = true;\n this.cdr.detectChanges();\n return;\n }\n\n if (!this.viewInitialized || !this.configPanelContainer) {\n this.loadError = 'View container not ready';\n this.cdr.detectChanges();\n return;\n }\n\n this.isLoadingPanel = true;\n this.cdr.detectChanges();\n\n try {\n // Use ClassFactory to create the config panel instance\n const panelInstance = await MJGlobal.Instance.ClassFactory.CreateInstanceAsync<BaseConfigPanel>(\n BaseConfigPanel,\n this.selectedPartType.ConfigDialogClass\n );\n\n if (!panelInstance) {\n this.loadError = `Could not create config panel: ${this.selectedPartType.ConfigDialogClass}`;\n this.isLoadingPanel = false;\n this.canAddPart = true; // Allow adding with default config\n this.cdr.detectChanges();\n return;\n }\n\n // Get the component class from the instance\n const componentClass = (panelInstance as object).constructor as typeof BaseConfigPanel;\n\n // Clear the container and create the component\n this.configPanelContainer.clear();\n this.configPanelRef = this.configPanelContainer.createComponent(componentClass as never);\n\n // Set inputs on the component\n const panel = this.configPanelRef.instance;\n panel.partType = this.selectedPartType;\n panel.panel = null; // New panel, not editing\n panel.config = null; // Start with defaults\n\n // Subscribe to config changes\n panel.configChanged.subscribe((result: ConfigPanelResult) => {\n this.onConfigChanged(result);\n });\n\n this.isLoadingPanel = false;\n this.cdr.detectChanges();\n\n } catch (error) {\n this.loadError = `Failed to load config panel: ${error instanceof Error ? error.message : String(error)}`;\n this.isLoadingPanel = false;\n this.canAddPart = true; // Allow adding with default config\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Destroy the dynamically created config panel\n */\n private destroyConfigPanel(): void {\n if (this.configPanelRef) {\n this.configPanelRef.destroy();\n this.configPanelRef = null;\n }\n }\n}\n","<!-- Add Part Dialog -->\n@if (visible) {\n <div class=\"add-part-dialog-overlay\" (click)=\"onCancel()\">\n <div class=\"add-part-dialog\" (click)=\"$event.stopPropagation()\">\n <!-- Step 1: Select Part Type -->\n @if (step === 'select-type') {\n <!-- Header -->\n <div class=\"dialog-header\">\n <h3>\n <i class=\"fa-solid fa-plus-circle\"></i>\n Add Part\n </h3>\n <button class=\"close-button\" (click)=\"onCancel()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Content -->\n <div class=\"dialog-content\">\n <p class=\"instruction\">Select a part type to add to your dashboard:</p>\n <div class=\"part-type-grid\">\n @for (partType of partTypes; track partType) {\n <div\n class=\"part-type-card\"\n (click)=\"onPartTypeSelect(partType)\">\n <div class=\"card-icon\">\n <i [class]=\"partType.Icon || 'fa-solid fa-puzzle-piece'\"></i>\n </div>\n <div class=\"card-content\">\n <span class=\"card-title\">{{ partType.Name }}</span>\n @if (partType.Description) {\n <span class=\"card-description\">\n {{ partType.Description }}\n </span>\n }\n </div>\n <i class=\"fa-solid fa-chevron-right card-arrow\"></i>\n </div>\n }\n </div>\n @if (partTypes.length === 0) {\n <div class=\"no-types\">\n <div class=\"warning-icon\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n </div>\n <h4>No part types available</h4>\n <p>Dashboard part types have not been configured in the system.</p>\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <button class=\"btn-secondary\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n <!-- Step 2: Configure Part -->\n @if (step === 'configure') {\n <!-- Header -->\n <div class=\"dialog-header\">\n <button class=\"back-button\" (click)=\"goBack()\">\n <i class=\"fa-solid fa-arrow-left\"></i>\n </button>\n <h3>\n <i [class]=\"selectedPartType?.Icon || 'fa-solid fa-puzzle-piece'\"></i>\n Configure {{ getConfigTypeName() }} Part\n </h3>\n <button class=\"close-button\" (click)=\"onCancel()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Content - Dynamic Config Panel -->\n <div class=\"dialog-content config-content\">\n <!-- Loading state -->\n @if (isLoadingPanel) {\n <div class=\"loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading configuration panel...</span>\n </div>\n }\n <!-- Error state -->\n @if (loadError && !isLoadingPanel) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <span>{{ loadError }}</span>\n <p class=\"error-hint\">You can still add this part with default settings.</p>\n </div>\n }\n <!-- Dynamic config panel container -->\n <ng-container #configPanelContainer></ng-container>\n <!-- No config panel available (custom type) -->\n @if (!hasConfigPanel() && !isLoadingPanel && !loadError) {\n <div class=\"config-placeholder\">\n <i class=\"fa-solid fa-cog\"></i>\n <p>This part type uses default configuration.</p>\n </div>\n }\n <!-- Validation Errors -->\n @if (currentResult && currentResult.errors.length > 0) {\n <div class=\"validation-errors\">\n @for (error of currentResult.errors; track error) {\n <div class=\"error-item\">\n <i class=\"fa-solid fa-exclamation-circle\"></i>\n {{ error }}\n </div>\n }\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <button class=\"btn-primary\" (click)=\"addPart()\" [disabled]=\"!canAddPart && !loadError\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Part\n </button>\n <button class=\"btn-secondary\" (click)=\"onCancel()\">Cancel</button>\n </div>\n }\n </div>\n </div>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-part-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialogs/edit-part-dialog/edit-part-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EACZ,iBAAiB,EAEjB,gBAAgB,EAEhB,SAAS,EACT,aAAa,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAmB,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAE3F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,sCAAsC;IACtC,MAAM,EAAE,WAAW,CAAC;IACpB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,qBAMa,uBAAwB,YAAW,SAAS,EAAE,aAAa;IAkFxD,OAAO,CAAC,GAAG;IAjFvB;;OAEG;IACH,IACI,OAAO,CAAC,KAAK,EAAE,OAAO,EAazB;IACD,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;IACM,QAAQ,EAAE,yBAAyB,GAAG,IAAI,CAAQ;IAE3D;;OAEG;IACM,KAAK,EAAE,cAAc,GAAG,IAAI,CAAQ;IAE7C;;OAEG;IACM,MAAM,EAAE,WAAW,GAAG,IAAI,CAAQ;IAE3C;;OAEG;IACO,KAAK,qCAA4C;IAE3D;;OAEG;IACO,SAAS,qBAA4B;IAE/C;;OAEG;IAEH,oBAAoB,EAAG,gBAAgB,CAAC;IAExC;;OAEG;IACH,OAAO,CAAC,cAAc,CAA8C;IAEpE;;OAEG;IACI,OAAO,UAAS;IAEvB;;OAEG;IACH,OAAO,CAAC,YAAY,CAAkC;IAEtD;;OAEG;IACI,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEvC;;OAEG;IACI,SAAS,UAAS;IAEzB,OAAO,CAAC,eAAe,CAAS;gBAEZ,GAAG,EAAE,iBAAiB;IAE1C,eAAe,IAAI,IAAI;IAOvB,WAAW,IAAI,IAAI;IAInB;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;
|
|
1
|
+
{"version":3,"file":"edit-part-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialogs/edit-part-dialog/edit-part-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,YAAY,EACZ,iBAAiB,EAEjB,gBAAgB,EAEhB,SAAS,EACT,aAAa,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAmB,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAE3F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,sCAAsC;IACtC,MAAM,EAAE,WAAW,CAAC;IACpB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,qBAMa,uBAAwB,YAAW,SAAS,EAAE,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PartDialogComponent {
|
|
|
176
176
|
/**
|
|
177
177
|
* Dynamically load the config panel component
|
|
178
178
|
*/
|
|
179
|
-
loadConfigPanel() {
|
|
179
|
+
async loadConfigPanel() {
|
|
180
180
|
this.destroyConfigPanel();
|
|
181
181
|
this.LoadError = null; // Clear any previous error
|
|
182
182
|
console.log('[EditPartDialog] loadConfigPanel() called');
|
|
@@ -200,7 +200,7 @@ export class EditPartDialogComponent {
|
|
|
200
200
|
try {
|
|
201
201
|
// Use ClassFactory to create the config panel instance
|
|
202
202
|
console.log('[EditPartDialog] Attempting to create instance via ClassFactory:', this.PartType.ConfigDialogClass);
|
|
203
|
-
const panelInstance = MJGlobal.Instance.ClassFactory.
|
|
203
|
+
const panelInstance = await MJGlobal.Instance.ClassFactory.CreateInstanceAsync(BaseConfigPanel, this.PartType.ConfigDialogClass);
|
|
204
204
|
console.log('[EditPartDialog] ClassFactory returned:', panelInstance);
|
|
205
205
|
if (!panelInstance) {
|
|
206
206
|
this.LoadError = `Could not create config panel: ${this.PartType.ConfigDialogClass}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-part-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/dialogs/edit-part-dialog/edit-part-dialog.component.ts","../../../../src/lib/dialogs/edit-part-dialog/edit-part-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAInB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAqB,MAAM,uCAAuC,CAAC;;;;ICGjF,8BAA2B;IACzB,wBAA2C;IAC3C,4BAAM;IAAA,8CAA8B;IACtC,AADsC,iBAAO,EACvC;;;IAIN,+BAAyB;IACvB,wBAAgD;IAChD,4BAAM;IAAA,YAAe;IACvB,AADuB,iBAAO,EACxB;;;IADE,eAAe;IAAf,s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AC,IAAI,CAAC,YAAY,EAAE,CAAC;YACtC,OAAO;QACX,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI;SAC/B,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,MAAM;QACT,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC;IACpD,CAAC;iHAlQQ,uBAAuB;6DAAvB,uBAAuB;mCAoDW,gBAAgB;;;;;YC/F/D,0FAAe;;YAAf,sCA+CC;;;iFDJY,uBAAuB;cANnC,SAAS;6BACI,KAAK,YACL,qBAAqB;;kBAQ9B,KAAK;;kBAuBL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,MAAM;;kBAKN,MAAM;;kBAKN,SAAS;mBAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE;;kFApDnE,uBAAuB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ViewChild,\n ViewContainerRef,\n ComponentRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { MJGlobal } from '@memberjunction/global';\nimport { MJDashboardPartTypeEntity } from '@memberjunction/core-entities';\nimport { PanelConfig, DashboardPanel } from '../../models/dashboard-types';\nimport { BaseConfigPanel, ConfigPanelResult } from '../../config-panels/base-config-panel';\n\n/**\n * Result from the edit part dialog\n */\nexport interface EditPartDialogResult {\n /** The updated panel configuration */\n Config: PanelConfig;\n /** Updated title */\n Title: string;\n /** Updated icon (optional) */\n Icon?: string;\n}\n\n/**\n * Generic dialog for editing dashboard part configuration.\n *\n * This dialog dynamically loads the appropriate config panel based on the\n * DashboardPartType.ConfigDialogClass field, using MJGlobal.ClassFactory.\n *\n * This allows new part types to be added without modifying this dialog -\n * just create a config panel, register it, and set the ConfigDialogClass.\n */\n@Component({\n standalone: false,\n selector: 'mj-edit-part-dialog',\n templateUrl: './edit-part-dialog.component.html',\n styleUrls: ['./edit-part-dialog.component.css']\n})\nexport class EditPartDialogComponent implements OnDestroy, AfterViewInit {\n /**\n * Whether the dialog is visible\n */\n @Input()\n set Visible(value: boolean) {\n const previous = this._visible;\n this._visible = value;\n if (value && !previous) {\n this.onDialogOpened();\n // Delay loadConfigPanel to next tick to ensure all inputs are set\n // Angular doesn't guarantee input order, so PartType might not be set yet\n if (this.viewInitialized) {\n setTimeout(() => this.loadConfigPanel(), 0);\n }\n } else if (!value && previous) {\n this.onDialogClosed();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n private _visible = false;\n\n /**\n * The part type being configured\n */\n @Input() PartType: MJDashboardPartTypeEntity | null = null;\n\n /**\n * The panel being edited\n */\n @Input() Panel: DashboardPanel | null = null;\n\n /**\n * The current configuration\n */\n @Input() Config: PanelConfig | null = null;\n\n /**\n * Emitted when configuration is saved\n */\n @Output() Saved = new EventEmitter<EditPartDialogResult>();\n\n /**\n * Emitted when dialog is cancelled\n */\n @Output() Cancelled = new EventEmitter<void>();\n\n /**\n * Container for dynamically loaded config panel\n */\n @ViewChild('configPanelContainer', { read: ViewContainerRef, static: false })\n configPanelContainer!: ViewContainerRef;\n\n /**\n * Reference to the dynamically created config panel component\n */\n private configPanelRef: ComponentRef<BaseConfigPanel> | null = null;\n\n /**\n * Track validity from the embedded panel\n */\n public IsValid = false;\n\n /**\n * Store the latest result from the panel\n */\n private latestResult: ConfigPanelResult | null = null;\n\n /**\n * Error message if panel failed to load\n */\n public LoadError: string | null = null;\n\n /**\n * Whether the panel is loading\n */\n public IsLoading = false;\n\n private viewInitialized = false;\n\n constructor(private cdr: ChangeDetectorRef) {}\n\n ngAfterViewInit(): void {\n this.viewInitialized = true;\n if (this.Visible) {\n this.loadConfigPanel();\n }\n }\n\n ngOnDestroy(): void {\n this.destroyConfigPanel();\n }\n\n /**\n * Called when dialog opens\n */\n private onDialogOpened(): void {\n this.IsValid = false;\n this.latestResult = null;\n this.LoadError = null;\n\n if (this.viewInitialized) {\n this.loadConfigPanel();\n }\n }\n\n /**\n * Called when dialog closes\n */\n private onDialogClosed(): void {\n this.destroyConfigPanel();\n }\n\n /**\n * Dynamically load the config panel component\n */\n private loadConfigPanel(): void {\n this.destroyConfigPanel();\n this.LoadError = null; // Clear any previous error\n\n console.log('[EditPartDialog] loadConfigPanel() called');\n console.log('[EditPartDialog] PartType:', this.PartType?.Name);\n console.log('[EditPartDialog] ConfigDialogClass:', this.PartType?.ConfigDialogClass);\n\n if (!this.PartType?.ConfigDialogClass) {\n // No config class specified - this is okay for simple part types\n // Just enable the save button with default config\n console.log('[EditPartDialog] No ConfigDialogClass specified, using default');\n this.IsValid = true;\n this.cdr.detectChanges();\n return;\n }\n\n if (!this.configPanelContainer) {\n // Container not ready yet - will be called again from ngAfterViewInit\n console.log('[EditPartDialog] Container not ready yet');\n return;\n }\n\n this.IsLoading = true;\n this.cdr.detectChanges();\n\n try {\n // Use ClassFactory to create the config panel instance\n console.log('[EditPartDialog] Attempting to create instance via ClassFactory:', this.PartType.ConfigDialogClass);\n const panelInstance = MJGlobal.Instance.ClassFactory.CreateInstance<BaseConfigPanel>(\n BaseConfigPanel,\n this.PartType.ConfigDialogClass\n );\n\n console.log('[EditPartDialog] ClassFactory returned:', panelInstance);\n\n if (!panelInstance) {\n this.LoadError = `Could not create config panel: ${this.PartType.ConfigDialogClass}`;\n console.error('[EditPartDialog]', this.LoadError);\n this.IsLoading = false;\n this.IsValid = true; // Allow saving with default config\n this.cdr.detectChanges();\n return;\n }\n\n // Get the component class from the instance\n // We need to find the Angular component class that was registered\n const componentClass = (panelInstance as object).constructor as typeof BaseConfigPanel;\n console.log('[EditPartDialog] Component class:', componentClass.name);\n\n // Clear the container and create the component\n this.configPanelContainer.clear();\n this.configPanelRef = this.configPanelContainer.createComponent(componentClass as never);\n console.log('[EditPartDialog] Component created successfully');\n\n // Set inputs on the component\n const panel = this.configPanelRef.instance;\n panel.partType = this.PartType;\n panel.panel = this.Panel;\n panel.config = this.Config;\n\n // Subscribe to config changes\n panel.configChanged.subscribe((result: ConfigPanelResult) => {\n this.onConfigChanged(result);\n });\n\n this.IsLoading = false;\n this.LoadError = null; // Ensure error is cleared on success\n this.cdr.detectChanges();\n\n } catch (error) {\n this.LoadError = `Failed to load config panel: ${error instanceof Error ? error.message : String(error)}`;\n console.error('[EditPartDialog]', this.LoadError, error);\n this.IsLoading = false;\n this.IsValid = true; // Allow saving with default config\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Destroy the dynamically created config panel\n */\n private destroyConfigPanel(): void {\n if (this.configPanelRef) {\n this.configPanelRef.destroy();\n this.configPanelRef = null;\n }\n }\n\n /**\n * Handle configuration changes from the embedded panel\n */\n public onConfigChanged(result: ConfigPanelResult): void {\n this.latestResult = result;\n this.IsValid = result.isValid;\n this.cdr.detectChanges();\n }\n\n /**\n * Get the dialog title based on part type\n */\n public getDialogTitle(): string {\n const partName = this.PartType?.Name || 'Part';\n return this.Panel ? `Configure ${partName}` : `Add ${partName}`;\n }\n\n /**\n * Get the part type icon\n */\n public getIcon(): string {\n return this.PartType?.Icon || 'fa-solid fa-puzzle-piece';\n }\n\n /**\n * Save the configuration\n */\n public save(): void {\n if (!this.IsValid || !this.latestResult) {\n return;\n }\n\n this.Saved.emit({\n Config: this.latestResult.config,\n Title: this.latestResult.title,\n Icon: this.latestResult.icon\n });\n }\n\n /**\n * Cancel and close the dialog\n */\n public cancel(): void {\n this.Cancelled.emit();\n }\n\n /**\n * Get save button text\n */\n public getSaveButtonText(): string {\n return this.Panel ? 'Save Changes' : 'Add Part';\n }\n}\n","<!-- Generic Edit Part Dialog -->\n@if (Visible) {\n <div class=\"edit-part-dialog-overlay\" (click)=\"cancel()\">\n <div class=\"edit-part-dialog\" (click)=\"$event.stopPropagation()\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <div class=\"header-icon\">\n <i [class]=\"getIcon()\"></i>\n </div>\n <h3>{{ getDialogTitle() }}</h3>\n <button class=\"close-button\" (click)=\"cancel()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Content -->\n <div class=\"dialog-content\">\n <!-- Loading state -->\n @if (IsLoading) {\n <div class=\"loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading configuration panel...</span>\n </div>\n }\n <!-- Error state -->\n @if (LoadError && !IsLoading) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <span>{{ LoadError }}</span>\n </div>\n }\n <!-- Dynamic config panel container -->\n <ng-container #configPanelContainer></ng-container>\n </div>\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <button\n class=\"btn-primary\"\n (click)=\"save()\"\n [disabled]=\"!IsValid || IsLoading || LoadError\">\n <i class=\"fa-solid fa-check\"></i>\n {{ getSaveButtonText() }}\n </button>\n <button class=\"btn-secondary\" (click)=\"cancel()\">\n Cancel\n </button>\n </div>\n </div>\n </div>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"edit-part-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/dialogs/edit-part-dialog/edit-part-dialog.component.ts","../../../../src/lib/dialogs/edit-part-dialog/edit-part-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAInB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAqB,MAAM,uCAAuC,CAAC;;;;ICGjF,8BAA2B;IACzB,wBAA2C;IAC3C,4BAAM;IAAA,8CAA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ACI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,0BAA0B,CAAC;IAC7D,CAAC;IAED;;OAEG;IACI,IAAI;QACP,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACtC,OAAO;QACX,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;YAChC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;YAC9B,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI;SAC/B,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,MAAM;QACT,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC;IACpD,CAAC;iHAlQQ,uBAAuB;6DAAvB,uBAAuB;mCAoDW,gBAAgB;;;;;YC/F/D,0FAAe;;YAAf,sCA+CC;;;iFDJY,uBAAuB;cANnC,SAAS;6BACI,KAAK,YACL,qBAAqB;;kBAQ9B,KAAK;;kBAuBL,KAAK;;kBAKL,KAAK;;kBAKL,KAAK;;kBAKL,MAAM;;kBAKN,MAAM;;kBAKN,SAAS;mBAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE;;kFApDnE,uBAAuB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ViewChild,\n ViewContainerRef,\n ComponentRef,\n OnDestroy,\n AfterViewInit\n} from '@angular/core';\nimport { MJGlobal } from '@memberjunction/global';\nimport { MJDashboardPartTypeEntity } from '@memberjunction/core-entities';\nimport { PanelConfig, DashboardPanel } from '../../models/dashboard-types';\nimport { BaseConfigPanel, ConfigPanelResult } from '../../config-panels/base-config-panel';\n\n/**\n * Result from the edit part dialog\n */\nexport interface EditPartDialogResult {\n /** The updated panel configuration */\n Config: PanelConfig;\n /** Updated title */\n Title: string;\n /** Updated icon (optional) */\n Icon?: string;\n}\n\n/**\n * Generic dialog for editing dashboard part configuration.\n *\n * This dialog dynamically loads the appropriate config panel based on the\n * DashboardPartType.ConfigDialogClass field, using MJGlobal.ClassFactory.\n *\n * This allows new part types to be added without modifying this dialog -\n * just create a config panel, register it, and set the ConfigDialogClass.\n */\n@Component({\n standalone: false,\n selector: 'mj-edit-part-dialog',\n templateUrl: './edit-part-dialog.component.html',\n styleUrls: ['./edit-part-dialog.component.css']\n})\nexport class EditPartDialogComponent implements OnDestroy, AfterViewInit {\n /**\n * Whether the dialog is visible\n */\n @Input()\n set Visible(value: boolean) {\n const previous = this._visible;\n this._visible = value;\n if (value && !previous) {\n this.onDialogOpened();\n // Delay loadConfigPanel to next tick to ensure all inputs are set\n // Angular doesn't guarantee input order, so PartType might not be set yet\n if (this.viewInitialized) {\n setTimeout(() => this.loadConfigPanel(), 0);\n }\n } else if (!value && previous) {\n this.onDialogClosed();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n private _visible = false;\n\n /**\n * The part type being configured\n */\n @Input() PartType: MJDashboardPartTypeEntity | null = null;\n\n /**\n * The panel being edited\n */\n @Input() Panel: DashboardPanel | null = null;\n\n /**\n * The current configuration\n */\n @Input() Config: PanelConfig | null = null;\n\n /**\n * Emitted when configuration is saved\n */\n @Output() Saved = new EventEmitter<EditPartDialogResult>();\n\n /**\n * Emitted when dialog is cancelled\n */\n @Output() Cancelled = new EventEmitter<void>();\n\n /**\n * Container for dynamically loaded config panel\n */\n @ViewChild('configPanelContainer', { read: ViewContainerRef, static: false })\n configPanelContainer!: ViewContainerRef;\n\n /**\n * Reference to the dynamically created config panel component\n */\n private configPanelRef: ComponentRef<BaseConfigPanel> | null = null;\n\n /**\n * Track validity from the embedded panel\n */\n public IsValid = false;\n\n /**\n * Store the latest result from the panel\n */\n private latestResult: ConfigPanelResult | null = null;\n\n /**\n * Error message if panel failed to load\n */\n public LoadError: string | null = null;\n\n /**\n * Whether the panel is loading\n */\n public IsLoading = false;\n\n private viewInitialized = false;\n\n constructor(private cdr: ChangeDetectorRef) {}\n\n ngAfterViewInit(): void {\n this.viewInitialized = true;\n if (this.Visible) {\n this.loadConfigPanel();\n }\n }\n\n ngOnDestroy(): void {\n this.destroyConfigPanel();\n }\n\n /**\n * Called when dialog opens\n */\n private onDialogOpened(): void {\n this.IsValid = false;\n this.latestResult = null;\n this.LoadError = null;\n\n if (this.viewInitialized) {\n this.loadConfigPanel();\n }\n }\n\n /**\n * Called when dialog closes\n */\n private onDialogClosed(): void {\n this.destroyConfigPanel();\n }\n\n /**\n * Dynamically load the config panel component\n */\n private async loadConfigPanel(): Promise<void> {\n this.destroyConfigPanel();\n this.LoadError = null; // Clear any previous error\n\n console.log('[EditPartDialog] loadConfigPanel() called');\n console.log('[EditPartDialog] PartType:', this.PartType?.Name);\n console.log('[EditPartDialog] ConfigDialogClass:', this.PartType?.ConfigDialogClass);\n\n if (!this.PartType?.ConfigDialogClass) {\n // No config class specified - this is okay for simple part types\n // Just enable the save button with default config\n console.log('[EditPartDialog] No ConfigDialogClass specified, using default');\n this.IsValid = true;\n this.cdr.detectChanges();\n return;\n }\n\n if (!this.configPanelContainer) {\n // Container not ready yet - will be called again from ngAfterViewInit\n console.log('[EditPartDialog] Container not ready yet');\n return;\n }\n\n this.IsLoading = true;\n this.cdr.detectChanges();\n\n try {\n // Use ClassFactory to create the config panel instance\n console.log('[EditPartDialog] Attempting to create instance via ClassFactory:', this.PartType.ConfigDialogClass);\n const panelInstance = await MJGlobal.Instance.ClassFactory.CreateInstanceAsync<BaseConfigPanel>(\n BaseConfigPanel,\n this.PartType.ConfigDialogClass\n );\n\n console.log('[EditPartDialog] ClassFactory returned:', panelInstance);\n\n if (!panelInstance) {\n this.LoadError = `Could not create config panel: ${this.PartType.ConfigDialogClass}`;\n console.error('[EditPartDialog]', this.LoadError);\n this.IsLoading = false;\n this.IsValid = true; // Allow saving with default config\n this.cdr.detectChanges();\n return;\n }\n\n // Get the component class from the instance\n // We need to find the Angular component class that was registered\n const componentClass = (panelInstance as object).constructor as typeof BaseConfigPanel;\n console.log('[EditPartDialog] Component class:', componentClass.name);\n\n // Clear the container and create the component\n this.configPanelContainer.clear();\n this.configPanelRef = this.configPanelContainer.createComponent(componentClass as never);\n console.log('[EditPartDialog] Component created successfully');\n\n // Set inputs on the component\n const panel = this.configPanelRef.instance;\n panel.partType = this.PartType;\n panel.panel = this.Panel;\n panel.config = this.Config;\n\n // Subscribe to config changes\n panel.configChanged.subscribe((result: ConfigPanelResult) => {\n this.onConfigChanged(result);\n });\n\n this.IsLoading = false;\n this.LoadError = null; // Ensure error is cleared on success\n this.cdr.detectChanges();\n\n } catch (error) {\n this.LoadError = `Failed to load config panel: ${error instanceof Error ? error.message : String(error)}`;\n console.error('[EditPartDialog]', this.LoadError, error);\n this.IsLoading = false;\n this.IsValid = true; // Allow saving with default config\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Destroy the dynamically created config panel\n */\n private destroyConfigPanel(): void {\n if (this.configPanelRef) {\n this.configPanelRef.destroy();\n this.configPanelRef = null;\n }\n }\n\n /**\n * Handle configuration changes from the embedded panel\n */\n public onConfigChanged(result: ConfigPanelResult): void {\n this.latestResult = result;\n this.IsValid = result.isValid;\n this.cdr.detectChanges();\n }\n\n /**\n * Get the dialog title based on part type\n */\n public getDialogTitle(): string {\n const partName = this.PartType?.Name || 'Part';\n return this.Panel ? `Configure ${partName}` : `Add ${partName}`;\n }\n\n /**\n * Get the part type icon\n */\n public getIcon(): string {\n return this.PartType?.Icon || 'fa-solid fa-puzzle-piece';\n }\n\n /**\n * Save the configuration\n */\n public save(): void {\n if (!this.IsValid || !this.latestResult) {\n return;\n }\n\n this.Saved.emit({\n Config: this.latestResult.config,\n Title: this.latestResult.title,\n Icon: this.latestResult.icon\n });\n }\n\n /**\n * Cancel and close the dialog\n */\n public cancel(): void {\n this.Cancelled.emit();\n }\n\n /**\n * Get save button text\n */\n public getSaveButtonText(): string {\n return this.Panel ? 'Save Changes' : 'Add Part';\n }\n}\n","<!-- Generic Edit Part Dialog -->\n@if (Visible) {\n <div class=\"edit-part-dialog-overlay\" (click)=\"cancel()\">\n <div class=\"edit-part-dialog\" (click)=\"$event.stopPropagation()\">\n <!-- Header -->\n <div class=\"dialog-header\">\n <div class=\"header-icon\">\n <i [class]=\"getIcon()\"></i>\n </div>\n <h3>{{ getDialogTitle() }}</h3>\n <button class=\"close-button\" (click)=\"cancel()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Content -->\n <div class=\"dialog-content\">\n <!-- Loading state -->\n @if (IsLoading) {\n <div class=\"loading-state\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading configuration panel...</span>\n </div>\n }\n <!-- Error state -->\n @if (LoadError && !IsLoading) {\n <div class=\"error-state\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <span>{{ LoadError }}</span>\n </div>\n }\n <!-- Dynamic config panel container -->\n <ng-container #configPanelContainer></ng-container>\n </div>\n <!-- Footer -->\n <div class=\"dialog-footer\">\n <button\n class=\"btn-primary\"\n (click)=\"save()\"\n [disabled]=\"!IsValid || IsLoading || LoadError\">\n <i class=\"fa-solid fa-check\"></i>\n {{ getSaveButtonText() }}\n </button>\n <button class=\"btn-secondary\" (click)=\"cancel()\">\n Cancel\n </button>\n </div>\n </div>\n </div>\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-dashboard-viewer",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0",
|
|
4
4
|
"description": "MemberJunction: Angular components for metadata-driven dashboards with Golden Layout panels, supporting views, queries, artifacts, and custom content",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"golden-layout": "^2.6.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@memberjunction/core-entities": "5.
|
|
41
|
-
"@memberjunction/global": "5.
|
|
42
|
-
"@memberjunction/core": "5.
|
|
43
|
-
"@memberjunction/ng-shared-generic": "5.
|
|
44
|
-
"@memberjunction/ng-entity-viewer": "5.
|
|
45
|
-
"@memberjunction/ng-artifacts": "5.
|
|
46
|
-
"@memberjunction/ng-query-viewer": "5.
|
|
47
|
-
"@memberjunction/ng-trees": "5.
|
|
40
|
+
"@memberjunction/core-entities": "5.22.0",
|
|
41
|
+
"@memberjunction/global": "5.22.0",
|
|
42
|
+
"@memberjunction/core": "5.22.0",
|
|
43
|
+
"@memberjunction/ng-shared-generic": "5.22.0",
|
|
44
|
+
"@memberjunction/ng-entity-viewer": "5.22.0",
|
|
45
|
+
"@memberjunction/ng-artifacts": "5.22.0",
|
|
46
|
+
"@memberjunction/ng-query-viewer": "5.22.0",
|
|
47
|
+
"@memberjunction/ng-trees": "5.22.0",
|
|
48
48
|
"rxjs": "^7.8.2",
|
|
49
49
|
"tslib": "^2.8.1"
|
|
50
50
|
},
|