@memberjunction/ng-dashboards 5.30.1 → 5.32.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/AI/components/agents/agent-configuration.component.d.ts.map +1 -1
- package/dist/AI/components/agents/agent-configuration.component.js +4 -4
- package/dist/AI/components/agents/agent-configuration.component.js.map +1 -1
- package/dist/AI/components/agents/agent-editor.component.d.ts +2 -1
- package/dist/AI/components/agents/agent-editor.component.d.ts.map +1 -1
- package/dist/AI/components/agents/agent-editor.component.js +8 -6
- package/dist/AI/components/agents/agent-editor.component.js.map +1 -1
- package/dist/AI/components/analytics/agent-runs/agent-run-analysis.component.d.ts +2 -1
- package/dist/AI/components/analytics/agent-runs/agent-run-analysis.component.d.ts.map +1 -1
- package/dist/AI/components/analytics/agent-runs/agent-run-analysis.component.js +6 -5
- package/dist/AI/components/analytics/agent-runs/agent-run-analysis.component.js.map +1 -1
- package/dist/AI/components/analytics/cost-budget/cost-budget.component.d.ts +2 -1
- package/dist/AI/components/analytics/cost-budget/cost-budget.component.d.ts.map +1 -1
- package/dist/AI/components/analytics/cost-budget/cost-budget.component.js +6 -5
- package/dist/AI/components/analytics/cost-budget/cost-budget.component.js.map +1 -1
- package/dist/AI/components/analytics/error-analysis/error-analysis.component.d.ts +2 -1
- package/dist/AI/components/analytics/error-analysis/error-analysis.component.d.ts.map +1 -1
- package/dist/AI/components/analytics/error-analysis/error-analysis.component.js +6 -5
- package/dist/AI/components/analytics/error-analysis/error-analysis.component.js.map +1 -1
- package/dist/AI/components/analytics/executive-summary/executive-summary.component.d.ts +2 -1
- package/dist/AI/components/analytics/executive-summary/executive-summary.component.d.ts.map +1 -1
- package/dist/AI/components/analytics/executive-summary/executive-summary.component.js +7 -4
- package/dist/AI/components/analytics/executive-summary/executive-summary.component.js.map +1 -1
- package/dist/AI/components/analytics/model-performance/model-performance.component.d.ts +3 -2
- package/dist/AI/components/analytics/model-performance/model-performance.component.d.ts.map +1 -1
- package/dist/AI/components/analytics/model-performance/model-performance.component.js +10 -6
- package/dist/AI/components/analytics/model-performance/model-performance.component.js.map +1 -1
- package/dist/AI/components/analytics/prompt-runs/prompt-run-analysis.component.d.ts +2 -1
- package/dist/AI/components/analytics/prompt-runs/prompt-run-analysis.component.d.ts.map +1 -1
- package/dist/AI/components/analytics/prompt-runs/prompt-run-analysis.component.js +6 -5
- package/dist/AI/components/analytics/prompt-runs/prompt-run-analysis.component.js.map +1 -1
- package/dist/AI/components/analytics/usage-patterns/usage-patterns.component.d.ts +2 -1
- package/dist/AI/components/analytics/usage-patterns/usage-patterns.component.d.ts.map +1 -1
- package/dist/AI/components/analytics/usage-patterns/usage-patterns.component.js +6 -5
- package/dist/AI/components/analytics/usage-patterns/usage-patterns.component.js.map +1 -1
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.d.ts.map +1 -1
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.js +55 -52
- package/dist/AI/components/autotagging/autotagging-pipeline-resource.component.js.map +1 -1
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.js +15 -15
- package/dist/AI/components/duplicates/duplicate-detection-resource.component.js.map +1 -1
- package/dist/AI/components/execution-monitoring.component.d.ts.map +1 -1
- package/dist/AI/components/execution-monitoring.component.js +4 -3
- package/dist/AI/components/execution-monitoring.component.js.map +1 -1
- package/dist/AI/components/models/model-management.component.js +2 -2
- package/dist/AI/components/models/model-management.component.js.map +1 -1
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts +2 -1
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts.map +1 -1
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js +10 -8
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js.map +1 -1
- package/dist/AI/components/prompts/prompt-management.component.d.ts.map +1 -1
- package/dist/AI/components/prompts/prompt-management.component.js +2 -2
- package/dist/AI/components/prompts/prompt-management.component.js.map +1 -1
- package/dist/AI/components/prompts/prompt-version-control.component.d.ts +2 -1
- package/dist/AI/components/prompts/prompt-version-control.component.d.ts.map +1 -1
- package/dist/AI/components/prompts/prompt-version-control.component.js +13 -10
- package/dist/AI/components/prompts/prompt-version-control.component.js.map +1 -1
- package/dist/AI/components/requests/agent-requests-resource.component.js +1 -1
- package/dist/AI/components/requests/agent-requests-resource.component.js.map +1 -1
- package/dist/AI/components/tags/tags-resource.component.d.ts +1181 -0
- package/dist/AI/components/tags/tags-resource.component.d.ts.map +1 -0
- package/dist/AI/components/tags/tags-resource.component.js +7487 -0
- package/dist/AI/components/tags/tags-resource.component.js.map +1 -0
- package/dist/AI/components/vectors/vector-management-resource.component.d.ts.map +1 -1
- package/dist/AI/components/vectors/vector-management-resource.component.js +25 -21
- package/dist/AI/components/vectors/vector-management-resource.component.js.map +1 -1
- package/dist/AI/index.d.ts +1 -0
- package/dist/AI/index.d.ts.map +1 -1
- package/dist/AI/index.js +5 -0
- package/dist/AI/index.js.map +1 -1
- package/dist/AI/services/ai-instrumentation.service.d.ts +5 -0
- package/dist/AI/services/ai-instrumentation.service.d.ts.map +1 -1
- package/dist/AI/services/ai-instrumentation.service.js +12 -4
- package/dist/AI/services/ai-instrumentation.service.js.map +1 -1
- package/dist/APIKeys/api-applications-panel.component.d.ts +3 -2
- package/dist/APIKeys/api-applications-panel.component.d.ts.map +1 -1
- package/dist/APIKeys/api-applications-panel.component.js +5 -4
- package/dist/APIKeys/api-applications-panel.component.js.map +1 -1
- package/dist/APIKeys/api-key-create-dialog.component.d.ts +2 -1
- package/dist/APIKeys/api-key-create-dialog.component.d.ts.map +1 -1
- package/dist/APIKeys/api-key-create-dialog.component.js +5 -5
- package/dist/APIKeys/api-key-create-dialog.component.js.map +1 -1
- package/dist/APIKeys/api-key-edit-panel.component.d.ts +3 -2
- package/dist/APIKeys/api-key-edit-panel.component.d.ts.map +1 -1
- package/dist/APIKeys/api-key-edit-panel.component.js +11 -10
- package/dist/APIKeys/api-key-edit-panel.component.js.map +1 -1
- package/dist/APIKeys/api-key-list.component.d.ts +2 -1
- package/dist/APIKeys/api-key-list.component.d.ts.map +1 -1
- package/dist/APIKeys/api-key-list.component.js +6 -5
- package/dist/APIKeys/api-key-list.component.js.map +1 -1
- package/dist/APIKeys/api-keys-resource.component.d.ts.map +1 -1
- package/dist/APIKeys/api-keys-resource.component.js +4 -4
- package/dist/APIKeys/api-keys-resource.component.js.map +1 -1
- package/dist/APIKeys/api-scopes-panel.component.d.ts +3 -2
- package/dist/APIKeys/api-scopes-panel.component.d.ts.map +1 -1
- package/dist/APIKeys/api-scopes-panel.component.js +8 -6
- package/dist/APIKeys/api-scopes-panel.component.js.map +1 -1
- package/dist/APIKeys/api-usage-panel.component.d.ts +3 -2
- package/dist/APIKeys/api-usage-panel.component.d.ts.map +1 -1
- package/dist/APIKeys/api-usage-panel.component.js +10 -8
- package/dist/APIKeys/api-usage-panel.component.js.map +1 -1
- package/dist/Actions/components/actions-list-view.component.d.ts +2 -1
- package/dist/Actions/components/actions-list-view.component.d.ts.map +1 -1
- package/dist/Actions/components/actions-list-view.component.js +6 -5
- package/dist/Actions/components/actions-list-view.component.js.map +1 -1
- package/dist/Actions/components/actions-overview.component.js +2 -2
- package/dist/Actions/components/actions-overview.component.js.map +1 -1
- package/dist/Actions/components/categories-list-view.component.d.ts +2 -1
- package/dist/Actions/components/categories-list-view.component.d.ts.map +1 -1
- package/dist/Actions/components/categories-list-view.component.js +6 -5
- package/dist/Actions/components/categories-list-view.component.js.map +1 -1
- package/dist/Actions/components/execution-monitoring.component.js +1 -1
- package/dist/Actions/components/execution-monitoring.component.js.map +1 -1
- package/dist/Actions/components/explorer/action-card.component.d.ts +2 -1
- package/dist/Actions/components/explorer/action-card.component.d.ts.map +1 -1
- package/dist/Actions/components/explorer/action-card.component.js +6 -4
- package/dist/Actions/components/explorer/action-card.component.js.map +1 -1
- package/dist/Actions/components/explorer/action-explorer.component.js +1 -1
- package/dist/Actions/components/explorer/action-explorer.component.js.map +1 -1
- package/dist/Actions/components/explorer/new-action-panel.component.d.ts +2 -1
- package/dist/Actions/components/explorer/new-action-panel.component.d.ts.map +1 -1
- package/dist/Actions/components/explorer/new-action-panel.component.js +7 -5
- package/dist/Actions/components/explorer/new-action-panel.component.js.map +1 -1
- package/dist/Actions/components/explorer/new-category-panel.component.d.ts +2 -1
- package/dist/Actions/components/explorer/new-category-panel.component.d.ts.map +1 -1
- package/dist/Actions/components/explorer/new-category-panel.component.js +7 -5
- package/dist/Actions/components/explorer/new-category-panel.component.js.map +1 -1
- package/dist/ApplicationRoles/application-roles-resource.component.js +4 -4
- package/dist/ApplicationRoles/application-roles-resource.component.js.map +1 -1
- package/dist/Communication/communication-logs-resource.component.js +1 -1
- package/dist/Communication/communication-logs-resource.component.js.map +1 -1
- package/dist/Communication/communication-monitor-resource.component.js +1 -1
- package/dist/Communication/communication-monitor-resource.component.js.map +1 -1
- package/dist/Communication/communication-providers-resource.component.js +3 -3
- package/dist/Communication/communication-providers-resource.component.js.map +1 -1
- package/dist/Communication/communication-runs-resource.component.js +1 -1
- package/dist/Communication/communication-runs-resource.component.js.map +1 -1
- package/dist/Communication/communication-templates-resource.component.js +3 -3
- package/dist/Communication/communication-templates-resource.component.js.map +1 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.d.ts +1 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.d.ts.map +1 -1
- package/dist/ComponentStudio/component-studio-dashboard.component.js +5 -4
- package/dist/ComponentStudio/component-studio-dashboard.component.js.map +1 -1
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.d.ts +2 -1
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.js +6 -4
- package/dist/ComponentStudio/components/ai-assistant/ai-assistant-panel.component.js.map +1 -1
- package/dist/ComponentStudio/components/artifact-load-dialog.component.d.ts +11 -2
- package/dist/ComponentStudio/components/artifact-load-dialog.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/artifact-load-dialog.component.js +61 -27
- package/dist/ComponentStudio/components/artifact-load-dialog.component.js.map +1 -1
- package/dist/ComponentStudio/components/artifact-selection-dialog.component.d.ts +4 -2
- package/dist/ComponentStudio/components/artifact-selection-dialog.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/artifact-selection-dialog.component.js +19 -11
- package/dist/ComponentStudio/components/artifact-selection-dialog.component.js.map +1 -1
- package/dist/ComponentStudio/components/editors/data-requirements-editor.component.d.ts +4 -2
- package/dist/ComponentStudio/components/editors/data-requirements-editor.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/editors/data-requirements-editor.component.js +11 -3
- package/dist/ComponentStudio/components/editors/data-requirements-editor.component.js.map +1 -1
- package/dist/ComponentStudio/components/workspace/component-preview.component.d.ts +10 -1
- package/dist/ComponentStudio/components/workspace/component-preview.component.d.ts.map +1 -1
- package/dist/ComponentStudio/components/workspace/component-preview.component.js +18 -9
- package/dist/ComponentStudio/components/workspace/component-preview.component.js.map +1 -1
- package/dist/ComponentStudio/services/component-studio-state.service.d.ts +11 -1
- package/dist/ComponentStudio/services/component-studio-state.service.d.ts.map +1 -1
- package/dist/ComponentStudio/services/component-studio-state.service.js +23 -3
- package/dist/ComponentStudio/services/component-studio-state.service.js.map +1 -1
- package/dist/ComponentStudio/services/component-version.service.d.ts +6 -1
- package/dist/ComponentStudio/services/component-version.service.d.ts.map +1 -1
- package/dist/ComponentStudio/services/component-version.service.js +16 -6
- package/dist/ComponentStudio/services/component-version.service.js.map +1 -1
- package/dist/Credentials/components/credentials-audit-resource.component.js +1 -1
- package/dist/Credentials/components/credentials-audit-resource.component.js.map +1 -1
- package/dist/Credentials/components/credentials-categories-resource.component.d.ts.map +1 -1
- package/dist/Credentials/components/credentials-categories-resource.component.js +3 -3
- package/dist/Credentials/components/credentials-categories-resource.component.js.map +1 -1
- package/dist/Credentials/components/credentials-list-resource.component.d.ts.map +1 -1
- package/dist/Credentials/components/credentials-list-resource.component.js +3 -3
- package/dist/Credentials/components/credentials-list-resource.component.js.map +1 -1
- package/dist/Credentials/components/credentials-overview-resource.component.d.ts.map +1 -1
- package/dist/Credentials/components/credentials-overview-resource.component.js +3 -3
- package/dist/Credentials/components/credentials-overview-resource.component.js.map +1 -1
- package/dist/Credentials/components/credentials-types-resource.component.d.ts.map +1 -1
- package/dist/Credentials/components/credentials-types-resource.component.js +3 -3
- package/dist/Credentials/components/credentials-types-resource.component.js.map +1 -1
- package/dist/Credentials/credentials-dashboard.component.js +1 -1
- package/dist/Credentials/credentials-dashboard.component.js.map +1 -1
- package/dist/DashboardBrowser/dashboard-browser-resource.component.js +13 -13
- package/dist/DashboardBrowser/dashboard-browser-resource.component.js.map +1 -1
- package/dist/DashboardBrowser/dashboard-share-adapter.d.ts +4 -0
- package/dist/DashboardBrowser/dashboard-share-adapter.d.ts.map +1 -1
- package/dist/DashboardBrowser/dashboard-share-adapter.js +5 -2
- package/dist/DashboardBrowser/dashboard-share-adapter.js.map +1 -1
- package/dist/DashboardBrowser/dashboard-share-dialog.component.d.ts +3 -1
- package/dist/DashboardBrowser/dashboard-share-dialog.component.d.ts.map +1 -1
- package/dist/DashboardBrowser/dashboard-share-dialog.component.js +9 -4
- package/dist/DashboardBrowser/dashboard-share-dialog.component.js.map +1 -1
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.d.ts +3 -2
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.d.ts.map +1 -1
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.js +7 -6
- package/dist/DataExplorer/components/navigation-panel/navigation-panel.component.js.map +1 -1
- package/dist/DataExplorer/components/view-selector/view-selector.component.d.ts +3 -2
- package/dist/DataExplorer/components/view-selector/view-selector.component.d.ts.map +1 -1
- package/dist/DataExplorer/components/view-selector/view-selector.component.js +6 -5
- package/dist/DataExplorer/components/view-selector/view-selector.component.js.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.d.ts.map +1 -1
- package/dist/DataExplorer/data-explorer-dashboard.component.js +10 -9
- package/dist/DataExplorer/data-explorer-dashboard.component.js.map +1 -1
- package/dist/DataExplorer/services/explorer-state.service.d.ts +6 -1
- package/dist/DataExplorer/services/explorer-state.service.d.ts.map +1 -1
- package/dist/DataExplorer/services/explorer-state.service.js +15 -5
- package/dist/DataExplorer/services/explorer-state.service.js.map +1 -1
- package/dist/DatabaseDesigner/components/create-wizard/database-create-wizard.component.d.ts +64 -0
- package/dist/DatabaseDesigner/components/create-wizard/database-create-wizard.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/database-create-wizard.component.js +400 -0
- package/dist/DatabaseDesigner/components/create-wizard/database-create-wizard.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-basics.component.d.ts +42 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-basics.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-basics.component.js +232 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-basics.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-fields.component.d.ts +14 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-fields.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-fields.component.js +38 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-fields.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-pipeline.component.d.ts +24 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-pipeline.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-pipeline.component.js +77 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-pipeline.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-relationships.component.d.ts +88 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-relationships.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-relationships.component.js +404 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-relationships.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-review.component.d.ts +12 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-review.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-review.component.js +116 -0
- package/dist/DatabaseDesigner/components/create-wizard/steps/step-review.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/database-designer-dashboard.component.d.ts +55 -0
- package/dist/DatabaseDesigner/components/database-designer-dashboard.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/database-designer-dashboard.component.js +204 -0
- package/dist/DatabaseDesigner/components/database-designer-dashboard.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/entity-list.component.d.ts +61 -0
- package/dist/DatabaseDesigner/components/entity-list.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/entity-list.component.js +485 -0
- package/dist/DatabaseDesigner/components/entity-list.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/modify/database-modify.component.d.ts +52 -0
- package/dist/DatabaseDesigner/components/modify/database-modify.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/modify/database-modify.component.js +320 -0
- package/dist/DatabaseDesigner/components/modify/database-modify.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/shared/database-preview-pane.component.d.ts +79 -0
- package/dist/DatabaseDesigner/components/shared/database-preview-pane.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/shared/database-preview-pane.component.js +378 -0
- package/dist/DatabaseDesigner/components/shared/database-preview-pane.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/shared/entity-fields-grid.component.d.ts +85 -0
- package/dist/DatabaseDesigner/components/shared/entity-fields-grid.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/shared/entity-fields-grid.component.js +429 -0
- package/dist/DatabaseDesigner/components/shared/entity-fields-grid.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/shared/entity-pipeline-panel.component.d.ts +58 -0
- package/dist/DatabaseDesigner/components/shared/entity-pipeline-panel.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/shared/entity-pipeline-panel.component.js +333 -0
- package/dist/DatabaseDesigner/components/shared/entity-pipeline-panel.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/shared/entity-review-panel.component.d.ts +36 -0
- package/dist/DatabaseDesigner/components/shared/entity-review-panel.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/shared/entity-review-panel.component.js +345 -0
- package/dist/DatabaseDesigner/components/shared/entity-review-panel.component.js.map +1 -0
- package/dist/DatabaseDesigner/components/shared/wizard-step-indicator.component.d.ts +13 -0
- package/dist/DatabaseDesigner/components/shared/wizard-step-indicator.component.d.ts.map +1 -0
- package/dist/DatabaseDesigner/components/shared/wizard-step-indicator.component.js +81 -0
- package/dist/DatabaseDesigner/components/shared/wizard-step-indicator.component.js.map +1 -0
- package/dist/DatabaseDesigner/database-designer-dashboards.module.d.ts +30 -0
- package/dist/DatabaseDesigner/database-designer-dashboards.module.d.ts.map +1 -0
- package/dist/DatabaseDesigner/database-designer-dashboards.module.js +131 -0
- package/dist/DatabaseDesigner/database-designer-dashboards.module.js.map +1 -0
- package/dist/DatabaseDesigner/database-designer-erd.d.ts +19 -0
- package/dist/DatabaseDesigner/database-designer-erd.d.ts.map +1 -0
- package/dist/DatabaseDesigner/database-designer-erd.js +84 -0
- package/dist/DatabaseDesigner/database-designer-erd.js.map +1 -0
- package/dist/DatabaseDesigner/database-designer.types.d.ts +167 -0
- package/dist/DatabaseDesigner/database-designer.types.d.ts.map +1 -0
- package/dist/DatabaseDesigner/database-designer.types.js +26 -0
- package/dist/DatabaseDesigner/database-designer.types.js.map +1 -0
- package/dist/DatabaseDesigner/services/database-designer.engine.d.ts +94 -0
- package/dist/DatabaseDesigner/services/database-designer.engine.d.ts.map +1 -0
- package/dist/DatabaseDesigner/services/database-designer.engine.js +392 -0
- package/dist/DatabaseDesigner/services/database-designer.engine.js.map +1 -0
- package/dist/DatabaseDesigner/services/database-designer.service.d.ts +78 -0
- package/dist/DatabaseDesigner/services/database-designer.service.d.ts.map +1 -0
- package/dist/DatabaseDesigner/services/database-designer.service.js +273 -0
- package/dist/DatabaseDesigner/services/database-designer.service.js.map +1 -0
- package/dist/DatabaseDesigner/services/entity-wizard-state.service.d.ts +79 -0
- package/dist/DatabaseDesigner/services/entity-wizard-state.service.d.ts.map +1 -0
- package/dist/DatabaseDesigner/services/entity-wizard-state.service.js +204 -0
- package/dist/DatabaseDesigner/services/entity-wizard-state.service.js.map +1 -0
- package/dist/EntityAdmin/entity-admin-dashboard.component.d.ts.map +1 -1
- package/dist/EntityAdmin/entity-admin-dashboard.component.js +2 -2
- package/dist/EntityAdmin/entity-admin-dashboard.component.js.map +1 -1
- package/dist/Home/action-pin-config-dialog.component.d.ts +2 -1
- package/dist/Home/action-pin-config-dialog.component.d.ts.map +1 -1
- package/dist/Home/action-pin-config-dialog.component.js +6 -4
- package/dist/Home/action-pin-config-dialog.component.js.map +1 -1
- package/dist/Home/action-pin-runner-dialog.component.d.ts +2 -1
- package/dist/Home/action-pin-runner-dialog.component.d.ts.map +1 -1
- package/dist/Home/action-pin-runner-dialog.component.js +5 -4
- package/dist/Home/action-pin-runner-dialog.component.js.map +1 -1
- package/dist/Home/home-application.d.ts.map +1 -1
- package/dist/Home/home-application.js +10 -12
- package/dist/Home/home-application.js.map +1 -1
- package/dist/Home/home-dashboard.component.d.ts.map +1 -1
- package/dist/Home/home-dashboard.component.js +3 -3
- package/dist/Home/home-dashboard.component.js.map +1 -1
- package/dist/Integration/components/activity/activity.component.d.ts.map +1 -1
- package/dist/Integration/components/activity/activity.component.js +1 -0
- package/dist/Integration/components/activity/activity.component.js.map +1 -1
- package/dist/Integration/components/connections/connections.component.d.ts.map +1 -1
- package/dist/Integration/components/connections/connections.component.js +11 -10
- package/dist/Integration/components/connections/connections.component.js.map +1 -1
- package/dist/Integration/components/mapping-workspace/mapping-workspace.component.d.ts.map +1 -1
- package/dist/Integration/components/mapping-workspace/mapping-workspace.component.js +2 -2
- package/dist/Integration/components/mapping-workspace/mapping-workspace.component.js.map +1 -1
- package/dist/Integration/components/overview/overview.component.d.ts.map +1 -1
- package/dist/Integration/components/overview/overview.component.js +1 -0
- package/dist/Integration/components/overview/overview.component.js.map +1 -1
- package/dist/Integration/components/pipelines/pipelines.component.d.ts.map +1 -1
- package/dist/Integration/components/pipelines/pipelines.component.js +1 -0
- package/dist/Integration/components/pipelines/pipelines.component.js.map +1 -1
- package/dist/Integration/components/schedules/schedules.component.d.ts.map +1 -1
- package/dist/Integration/components/schedules/schedules.component.js +5 -4
- package/dist/Integration/components/schedules/schedules.component.js.map +1 -1
- package/dist/Integration/services/integration-data.service.d.ts +5 -1
- package/dist/Integration/services/integration-data.service.d.ts.map +1 -1
- package/dist/Integration/services/integration-data.service.js +27 -19
- package/dist/Integration/services/integration-data.service.js.map +1 -1
- package/dist/KnowledgeHub/components/analytics/analytics-resource.component.js +6 -6
- package/dist/KnowledgeHub/components/analytics/analytics-resource.component.js.map +1 -1
- package/dist/KnowledgeHub/components/clusters/cluster-visualization-resource.component.d.ts.map +1 -1
- package/dist/KnowledgeHub/components/clusters/cluster-visualization-resource.component.js +8 -6
- package/dist/KnowledgeHub/components/clusters/cluster-visualization-resource.component.js.map +1 -1
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.js +6 -6
- package/dist/KnowledgeHub/components/config/knowledge-config-resource.component.js.map +1 -1
- package/dist/KnowledgeHub/components/scheduling/scheduling-resource.component.js +3 -3
- package/dist/KnowledgeHub/components/scheduling/scheduling-resource.component.js.map +1 -1
- package/dist/Lists/components/lists-browse-resource.component.js +6 -6
- package/dist/Lists/components/lists-browse-resource.component.js.map +1 -1
- package/dist/Lists/components/lists-categories-resource.component.js +4 -4
- package/dist/Lists/components/lists-categories-resource.component.js.map +1 -1
- package/dist/Lists/components/lists-my-lists-resource.component.js +6 -6
- package/dist/Lists/components/lists-my-lists-resource.component.js.map +1 -1
- package/dist/Lists/components/lists-operations-resource.component.d.ts.map +1 -1
- package/dist/Lists/components/lists-operations-resource.component.js +11 -10
- package/dist/Lists/components/lists-operations-resource.component.js.map +1 -1
- package/dist/Lists/services/list-set-operations.service.d.ts +5 -0
- package/dist/Lists/services/list-set-operations.service.d.ts.map +1 -1
- package/dist/Lists/services/list-set-operations.service.js +11 -3
- package/dist/Lists/services/list-set-operations.service.js.map +1 -1
- package/dist/MCP/components/mcp-connection-dialog.component.d.ts +2 -1
- package/dist/MCP/components/mcp-connection-dialog.component.d.ts.map +1 -1
- package/dist/MCP/components/mcp-connection-dialog.component.js +8 -6
- package/dist/MCP/components/mcp-connection-dialog.component.js.map +1 -1
- package/dist/MCP/components/mcp-server-dialog.component.d.ts +2 -1
- package/dist/MCP/components/mcp-server-dialog.component.d.ts.map +1 -1
- package/dist/MCP/components/mcp-server-dialog.component.js +7 -5
- package/dist/MCP/components/mcp-server-dialog.component.js.map +1 -1
- package/dist/MCP/mcp-dashboard.component.d.ts.map +1 -1
- package/dist/MCP/mcp-dashboard.component.js +12 -12
- package/dist/MCP/mcp-dashboard.component.js.map +1 -1
- package/dist/Permissions/permissions-shared.d.ts +3 -3
- package/dist/Permissions/permissions-shared.d.ts.map +1 -1
- package/dist/Permissions/permissions-shared.js +5 -5
- package/dist/Permissions/permissions-shared.js.map +1 -1
- package/dist/Permissions/resource-access-resource.component.js +1 -1
- package/dist/Permissions/resource-access-resource.component.js.map +1 -1
- package/dist/Permissions/user-access-resource.component.js +1 -2
- package/dist/Permissions/user-access-resource.component.js.map +1 -1
- package/dist/QueryBrowser/query-browser-resource.component.d.ts.map +1 -1
- package/dist/QueryBrowser/query-browser-resource.component.js +2 -2
- package/dist/QueryBrowser/query-browser-resource.component.js.map +1 -1
- package/dist/Scheduling/scheduling-dashboard.component.d.ts.map +1 -1
- package/dist/Scheduling/scheduling-dashboard.component.js +1 -0
- package/dist/Scheduling/scheduling-dashboard.component.js.map +1 -1
- package/dist/Scheduling/services/scheduling-instrumentation.service.d.ts +5 -0
- package/dist/Scheduling/services/scheduling-instrumentation.service.d.ts.map +1 -1
- package/dist/Scheduling/services/scheduling-instrumentation.service.js +21 -13
- package/dist/Scheduling/services/scheduling-instrumentation.service.js.map +1 -1
- package/dist/SystemDiagnostics/system-diagnostics.component.d.ts.map +1 -1
- package/dist/SystemDiagnostics/system-diagnostics.component.js +2 -2
- package/dist/SystemDiagnostics/system-diagnostics.component.js.map +1 -1
- package/dist/Testing/components/testing-explorer.component.d.ts +2 -1
- package/dist/Testing/components/testing-explorer.component.d.ts.map +1 -1
- package/dist/Testing/components/testing-explorer.component.js +9 -7
- package/dist/Testing/components/testing-explorer.component.js.map +1 -1
- package/dist/Testing/services/testing-instrumentation.service.d.ts +6 -1
- package/dist/Testing/services/testing-instrumentation.service.d.ts.map +1 -1
- package/dist/Testing/services/testing-instrumentation.service.js +21 -11
- package/dist/Testing/services/testing-instrumentation.service.js.map +1 -1
- package/dist/Testing/testing-dashboard.component.d.ts +3 -1
- package/dist/Testing/testing-dashboard.component.d.ts.map +1 -1
- package/dist/Testing/testing-dashboard.component.js +15 -11
- package/dist/Testing/testing-dashboard.component.js.map +1 -1
- package/dist/VersionHistory/components/diff-resource.component.d.ts.map +1 -1
- package/dist/VersionHistory/components/diff-resource.component.js +5 -5
- package/dist/VersionHistory/components/diff-resource.component.js.map +1 -1
- package/dist/VersionHistory/components/graph-resource.component.d.ts.map +1 -1
- package/dist/VersionHistory/components/graph-resource.component.js +1 -2
- package/dist/VersionHistory/components/graph-resource.component.js.map +1 -1
- package/dist/VersionHistory/components/labels-resource.component.d.ts.map +1 -1
- package/dist/VersionHistory/components/labels-resource.component.js +3 -3
- package/dist/VersionHistory/components/labels-resource.component.js.map +1 -1
- package/dist/VersionHistory/components/restore-resource.component.js +1 -1
- package/dist/VersionHistory/components/restore-resource.component.js.map +1 -1
- package/dist/ai-dashboards.module.d.ts +35 -34
- package/dist/ai-dashboards.module.d.ts.map +1 -1
- package/dist/ai-dashboards.module.js +6 -0
- package/dist/ai-dashboards.module.js.map +1 -1
- package/dist/module.d.ts +13 -12
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +7 -0
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +3 -1
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -1
- package/dist/public-api.js.map +1 -1
- package/dist/shared/entity-field-display.d.ts +4 -3
- package/dist/shared/entity-field-display.d.ts.map +1 -1
- package/dist/shared/entity-field-display.js +9 -9
- package/dist/shared/entity-field-display.js.map +1 -1
- package/package.json +52 -51
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module database-preview-pane.component
|
|
3
|
+
* @description Live preview of the current wizard `TableDefinition`.
|
|
4
|
+
*
|
|
5
|
+
* Two tabs:
|
|
6
|
+
* - **Diagram** — renders an `mj-erd-diagram` with the in-progress entity
|
|
7
|
+
* as the focus node and any FK-referenced entities as satellite nodes.
|
|
8
|
+
* - **SQL** — renders the CREATE TABLE / ALTER TABLE DDL in a read-only
|
|
9
|
+
* `mj-code-editor` with SQL syntax highlighting.
|
|
10
|
+
*
|
|
11
|
+
* The component is a pure function of `TableDefinition`: set the input, the
|
|
12
|
+
* preview re-renders. No side effects, no service subscriptions — the wizard
|
|
13
|
+
* host owns the subscription to `EntityWizardStateService.tableDefinition$`
|
|
14
|
+
* and pushes values down.
|
|
15
|
+
*/
|
|
16
|
+
import { Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, inject, } from '@angular/core';
|
|
17
|
+
import { Metadata } from '@memberjunction/core';
|
|
18
|
+
import * as i0 from "@angular/core";
|
|
19
|
+
import * as i1 from "@memberjunction/ng-code-editor";
|
|
20
|
+
import * as i2 from "@memberjunction/ng-entity-relationship-diagram";
|
|
21
|
+
function DatabasePreviewPaneComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
i0.ɵɵelement(0, "mj-erd-diagram", 8);
|
|
23
|
+
} if (rf & 2) {
|
|
24
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
25
|
+
i0.ɵɵproperty("nodes", ctx_r0.ErdNodes)("focusNodeId", ctx_r0.FocusNodeId)("focusDepth", 1)("readOnly", true)("showHeader", false)("config", ctx_r0.ErdConfig);
|
|
26
|
+
} }
|
|
27
|
+
function DatabasePreviewPaneComponent_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵelement(0, "mj-code-editor", 9);
|
|
29
|
+
} if (rf & 2) {
|
|
30
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
31
|
+
i0.ɵɵproperty("value", ctx_r0.SqlText)("readonly", true)("lineWrapping", false);
|
|
32
|
+
} }
|
|
33
|
+
export class DatabasePreviewPaneComponent {
|
|
34
|
+
cdr = inject(ChangeDetectorRef);
|
|
35
|
+
// ─── Inputs ────────────────────────────────────────────────────────────
|
|
36
|
+
/**
|
|
37
|
+
* Current wizard draft. Accepts a partial spec so the preview can
|
|
38
|
+
* render meaningfully even on Step 1 (name only).
|
|
39
|
+
*/
|
|
40
|
+
set TableDefinition(value) {
|
|
41
|
+
this._tableDefinition = value ?? {};
|
|
42
|
+
this.recompute();
|
|
43
|
+
}
|
|
44
|
+
get TableDefinition() { return this._tableDefinition; }
|
|
45
|
+
_tableDefinition = {};
|
|
46
|
+
/**
|
|
47
|
+
* True when this preview is showing an edit of an existing entity
|
|
48
|
+
* (modify flow). Switches the SQL header to `ALTER` wording and draws
|
|
49
|
+
* a "current vs proposed" indicator in the diagram.
|
|
50
|
+
*
|
|
51
|
+
* Defaults to false (create flow).
|
|
52
|
+
*/
|
|
53
|
+
set IsAlter(value) {
|
|
54
|
+
this._isAlter = value;
|
|
55
|
+
this.recompute();
|
|
56
|
+
}
|
|
57
|
+
get IsAlter() { return this._isAlter; }
|
|
58
|
+
_isAlter = false;
|
|
59
|
+
// ─── View state ────────────────────────────────────────────────────────
|
|
60
|
+
ActiveTab = 'diagram';
|
|
61
|
+
ErdNodes = [];
|
|
62
|
+
SqlText = '';
|
|
63
|
+
/** Focus node ID — lets `mj-erd-diagram` highlight the in-progress entity. */
|
|
64
|
+
FocusNodeId = null;
|
|
65
|
+
/**
|
|
66
|
+
* Stable config reference — bound to `mj-erd-diagram` via `[config]`.
|
|
67
|
+
* Must be a class property, not an inline object literal in the template,
|
|
68
|
+
* or every CD cycle produces a new reference and the ERD re-runs its
|
|
69
|
+
* layout / fit-to-view on every tick.
|
|
70
|
+
*/
|
|
71
|
+
ErdConfig = { showAllFields: true, maxNodeHeight: 520 };
|
|
72
|
+
// ─── Tab handler ───────────────────────────────────────────────────────
|
|
73
|
+
SelectTab(tab) {
|
|
74
|
+
this.ActiveTab = tab;
|
|
75
|
+
this.cdr.markForCheck();
|
|
76
|
+
}
|
|
77
|
+
// ─── Derivation ────────────────────────────────────────────────────────
|
|
78
|
+
recompute() {
|
|
79
|
+
const enrichments = this.resolveSatelliteFields(this._tableDefinition.ForeignKeys ?? []);
|
|
80
|
+
this.ErdNodes = DatabasePreviewPaneComponent.BuildErdNodes(this._tableDefinition, enrichments);
|
|
81
|
+
this.SqlText = DatabasePreviewPaneComponent.BuildSqlText(this._tableDefinition, this._isAlter);
|
|
82
|
+
this.FocusNodeId = DatabasePreviewPaneComponent.BuildFocusId(this._tableDefinition);
|
|
83
|
+
this.cdr.markForCheck();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Look up each FK target in MJ metadata and return PK + name-field rows per
|
|
87
|
+
* satellite node. Falls back to a minimal single-column stub when the
|
|
88
|
+
* referenced table isn't a known MJ entity.
|
|
89
|
+
*/
|
|
90
|
+
resolveSatelliteFields(foreignKeys) {
|
|
91
|
+
const md = new Metadata(); // global-provider-ok: client-side Angular component, single provider
|
|
92
|
+
const result = new Map();
|
|
93
|
+
const seen = new Set();
|
|
94
|
+
for (const fk of foreignKeys) {
|
|
95
|
+
const satId = DatabasePreviewPaneComponent.MakeSatelliteId(fk);
|
|
96
|
+
if (seen.has(satId))
|
|
97
|
+
continue;
|
|
98
|
+
seen.add(satId);
|
|
99
|
+
const entity = md.Entities.find(e => e.SchemaName === fk.ReferencedSchema && e.BaseTable === fk.ReferencedTable);
|
|
100
|
+
if (!entity)
|
|
101
|
+
continue;
|
|
102
|
+
const fields = [];
|
|
103
|
+
const refField = entity.Fields.find(f => f.Name === fk.ReferencedColumn);
|
|
104
|
+
if (refField) {
|
|
105
|
+
fields.push({
|
|
106
|
+
id: `${satId}:${refField.Name}`,
|
|
107
|
+
name: refField.Name,
|
|
108
|
+
type: refField.SQLFullType,
|
|
109
|
+
isPrimaryKey: refField.IsPrimaryKey,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const nameField = entity.Fields.find(f => f.IsNameField && f.Name !== fk.ReferencedColumn);
|
|
113
|
+
if (nameField) {
|
|
114
|
+
fields.push({
|
|
115
|
+
id: `${satId}:${nameField.Name}`,
|
|
116
|
+
name: nameField.Name,
|
|
117
|
+
type: nameField.SQLFullType,
|
|
118
|
+
isPrimaryKey: false,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (fields.length > 0)
|
|
122
|
+
result.set(satId, fields);
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
// ─── Pure builders (exposed for unit testing) ──────────────────────────
|
|
127
|
+
/** DOM id for the focus node, used by `mj-erd-diagram` to highlight. */
|
|
128
|
+
static BuildFocusId(spec) {
|
|
129
|
+
const name = spec.TableName || spec.EntityName;
|
|
130
|
+
return name ? `focus:${name}` : null;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* ERD node list: one focus node + one satellite per distinct FK target.
|
|
134
|
+
* `satelliteEnrichments` — optional PK + name-field rows per satellite,
|
|
135
|
+
* keyed by `MakeSatelliteId(fk)`. When absent, satellites render a
|
|
136
|
+
* minimal single-column stub.
|
|
137
|
+
*/
|
|
138
|
+
static BuildErdNodes(spec, satelliteEnrichments) {
|
|
139
|
+
const tableName = spec.TableName || spec.EntityName || 'NewEntity';
|
|
140
|
+
const schemaName = spec.SchemaName || '__mj_UDT';
|
|
141
|
+
const focusId = `focus:${tableName}`;
|
|
142
|
+
const focusFields = this.BuildFocusFields(focusId, spec);
|
|
143
|
+
this.AnnotateFkLinks(focusFields, spec.ForeignKeys ?? []);
|
|
144
|
+
const focusNode = {
|
|
145
|
+
id: focusId,
|
|
146
|
+
name: spec.EntityName || tableName,
|
|
147
|
+
schemaName,
|
|
148
|
+
baseTable: tableName,
|
|
149
|
+
description: spec.Description,
|
|
150
|
+
fields: focusFields,
|
|
151
|
+
};
|
|
152
|
+
return [focusNode, ...this.BuildSatelliteNodes(spec.ForeignKeys ?? [], satelliteEnrichments)];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Field list for the focus node: PK + user columns + synthetic FK columns + system audit.
|
|
156
|
+
* Pure — no link annotation. `AnnotateFkLinks` runs after to mark FK sources.
|
|
157
|
+
*/
|
|
158
|
+
static BuildFocusFields(focusId, spec) {
|
|
159
|
+
const columns = spec.Columns ?? [];
|
|
160
|
+
const foreignKeys = spec.ForeignKeys ?? [];
|
|
161
|
+
const columnNames = new Set(columns.map(c => c.Name));
|
|
162
|
+
const fields = [];
|
|
163
|
+
fields.push({
|
|
164
|
+
id: `${focusId}:ID`,
|
|
165
|
+
name: 'ID',
|
|
166
|
+
type: 'uniqueidentifier',
|
|
167
|
+
isPrimaryKey: true,
|
|
168
|
+
description: 'Primary key — always present',
|
|
169
|
+
});
|
|
170
|
+
for (const col of columns) {
|
|
171
|
+
fields.push({
|
|
172
|
+
id: `${focusId}:${col.Name}`,
|
|
173
|
+
name: col.Name,
|
|
174
|
+
type: this.FormatFieldType(col),
|
|
175
|
+
isPrimaryKey: false,
|
|
176
|
+
allowsNull: col.IsNullable,
|
|
177
|
+
length: col.MaxLength,
|
|
178
|
+
precision: col.Precision,
|
|
179
|
+
scale: col.Scale,
|
|
180
|
+
defaultValue: col.DefaultValue,
|
|
181
|
+
description: col.Description,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
// Synthetic field for any FK whose source column isn't declared in Columns yet.
|
|
185
|
+
for (const fk of foreignKeys) {
|
|
186
|
+
if (!fk.ColumnName || columnNames.has(fk.ColumnName))
|
|
187
|
+
continue;
|
|
188
|
+
fields.push({
|
|
189
|
+
id: `${focusId}:${fk.ColumnName}`,
|
|
190
|
+
name: fk.ColumnName,
|
|
191
|
+
type: 'uniqueidentifier',
|
|
192
|
+
isPrimaryKey: false,
|
|
193
|
+
allowsNull: true,
|
|
194
|
+
relatedNodeId: this.MakeSatelliteId(fk),
|
|
195
|
+
relatedNodeName: fk.ReferencedTable,
|
|
196
|
+
relatedFieldName: fk.ReferencedColumn,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
fields.push({
|
|
200
|
+
id: `${focusId}:__mj_CreatedAt`,
|
|
201
|
+
name: '__mj_CreatedAt',
|
|
202
|
+
type: 'datetimeoffset',
|
|
203
|
+
isPrimaryKey: false,
|
|
204
|
+
defaultValue: 'GETUTCDATE()',
|
|
205
|
+
description: 'Record creation timestamp',
|
|
206
|
+
}, {
|
|
207
|
+
id: `${focusId}:__mj_UpdatedAt`,
|
|
208
|
+
name: '__mj_UpdatedAt',
|
|
209
|
+
type: 'datetimeoffset',
|
|
210
|
+
isPrimaryKey: false,
|
|
211
|
+
defaultValue: 'GETUTCDATE()',
|
|
212
|
+
description: 'Last update timestamp',
|
|
213
|
+
});
|
|
214
|
+
return fields;
|
|
215
|
+
}
|
|
216
|
+
/** Stamp FK metadata onto any existing fields that match an FK source column. */
|
|
217
|
+
static AnnotateFkLinks(fields, foreignKeys) {
|
|
218
|
+
for (const fk of foreignKeys) {
|
|
219
|
+
if (!fk.ColumnName)
|
|
220
|
+
continue;
|
|
221
|
+
const fld = fields.find(f => f.name === fk.ColumnName);
|
|
222
|
+
if (fld && !fld.relatedNodeId) {
|
|
223
|
+
fld.relatedNodeId = this.MakeSatelliteId(fk);
|
|
224
|
+
fld.relatedNodeName = fk.ReferencedTable;
|
|
225
|
+
fld.relatedFieldName = fk.ReferencedColumn;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* One satellite node per distinct FK target (dedupes on schema+table).
|
|
231
|
+
* When `enrichments` provides rows for a satellite id, those rows (PK +
|
|
232
|
+
* name field, resolved from MJ metadata) are used instead of the minimal
|
|
233
|
+
* single-column stub.
|
|
234
|
+
*/
|
|
235
|
+
static BuildSatelliteNodes(foreignKeys, enrichments) {
|
|
236
|
+
const seen = new Set();
|
|
237
|
+
const satelliteNodes = [];
|
|
238
|
+
for (const fk of foreignKeys) {
|
|
239
|
+
// Skip in-progress rows where the target hasn't been picked yet.
|
|
240
|
+
if (!fk.ReferencedSchema || !fk.ReferencedTable)
|
|
241
|
+
continue;
|
|
242
|
+
const satId = this.MakeSatelliteId(fk);
|
|
243
|
+
if (seen.has(satId))
|
|
244
|
+
continue;
|
|
245
|
+
seen.add(satId);
|
|
246
|
+
const enriched = enrichments?.get(satId);
|
|
247
|
+
const fields = enriched && enriched.length > 0 ? enriched : [
|
|
248
|
+
{
|
|
249
|
+
id: `${satId}:${fk.ReferencedColumn}`,
|
|
250
|
+
name: fk.ReferencedColumn,
|
|
251
|
+
type: 'uniqueidentifier',
|
|
252
|
+
isPrimaryKey: true,
|
|
253
|
+
},
|
|
254
|
+
];
|
|
255
|
+
satelliteNodes.push({
|
|
256
|
+
id: satId,
|
|
257
|
+
name: fk.ReferencedTable,
|
|
258
|
+
schemaName: fk.ReferencedSchema,
|
|
259
|
+
baseTable: fk.ReferencedTable,
|
|
260
|
+
fields,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
return satelliteNodes;
|
|
264
|
+
}
|
|
265
|
+
static MakeSatelliteId(fk) {
|
|
266
|
+
return `ref:${fk.ReferencedSchema}.${fk.ReferencedTable}`;
|
|
267
|
+
}
|
|
268
|
+
/** Preview DDL for the given TableDefinition. `isAlter` only affects the lead comment. */
|
|
269
|
+
static BuildSqlText(spec, isAlter = false) {
|
|
270
|
+
const table = spec.TableName || spec.EntityName || 'NewEntity';
|
|
271
|
+
const schema = spec.SchemaName || '__mj_UDT';
|
|
272
|
+
const qualified = `[${schema}].[${table}]`;
|
|
273
|
+
const leadComment = isAlter
|
|
274
|
+
? `-- Generated by Database Designer · preview (ALTER)`
|
|
275
|
+
: `-- Generated by Database Designer · preview`;
|
|
276
|
+
// Column lines, padded for alignment
|
|
277
|
+
const colLines = [];
|
|
278
|
+
colLines.push(` [ID] UNIQUEIDENTIFIER NOT NULL DEFAULT NEWSEQUENTIALID(),`);
|
|
279
|
+
for (const col of spec.Columns ?? []) {
|
|
280
|
+
if (!col.Name)
|
|
281
|
+
continue;
|
|
282
|
+
colLines.push(` ${this.FormatColumnLine(col)},`);
|
|
283
|
+
}
|
|
284
|
+
// FK columns that aren't already in Columns
|
|
285
|
+
for (const fk of spec.ForeignKeys ?? []) {
|
|
286
|
+
const inColumns = (spec.Columns ?? []).some(c => c.Name === fk.ColumnName);
|
|
287
|
+
if (inColumns)
|
|
288
|
+
continue;
|
|
289
|
+
const name = `[${fk.ColumnName}]`.padEnd(18);
|
|
290
|
+
colLines.push(` ${name} UNIQUEIDENTIFIER NULL, -- auto-generated FK`);
|
|
291
|
+
}
|
|
292
|
+
colLines.push(` [__mj_CreatedAt] DATETIMEOFFSET NOT NULL DEFAULT GETUTCDATE(),`);
|
|
293
|
+
colLines.push(` [__mj_UpdatedAt] DATETIMEOFFSET NOT NULL DEFAULT GETUTCDATE(),`);
|
|
294
|
+
colLines.push(` CONSTRAINT [PK_${table}] PRIMARY KEY ([ID])`);
|
|
295
|
+
const lines = [
|
|
296
|
+
leadComment,
|
|
297
|
+
`CREATE TABLE ${qualified} (`,
|
|
298
|
+
...colLines,
|
|
299
|
+
`);`,
|
|
300
|
+
];
|
|
301
|
+
// FK constraints
|
|
302
|
+
for (const fk of spec.ForeignKeys ?? []) {
|
|
303
|
+
lines.push('');
|
|
304
|
+
lines.push(`ALTER TABLE ${qualified}`);
|
|
305
|
+
lines.push(` ADD CONSTRAINT [FK_${table}_${fk.ColumnName}]`);
|
|
306
|
+
lines.push(` FOREIGN KEY ([${fk.ColumnName}]) REFERENCES [${fk.ReferencedSchema}].[${fk.ReferencedTable}]([${fk.ReferencedColumn}]);`);
|
|
307
|
+
}
|
|
308
|
+
return lines.join('\n');
|
|
309
|
+
}
|
|
310
|
+
static FormatColumnLine(col) {
|
|
311
|
+
const name = `[${col.Name}]`.padEnd(18);
|
|
312
|
+
const type = col.RawSqlType || this.FormatFieldType(col);
|
|
313
|
+
const nullability = col.IsNullable ? 'NULL' : 'NOT NULL';
|
|
314
|
+
const dflt = col.DefaultValue ? ` DEFAULT ${col.DefaultValue}` : '';
|
|
315
|
+
return `${name} ${type.padEnd(16)} ${nullability}${dflt}`;
|
|
316
|
+
}
|
|
317
|
+
static FormatFieldType(col) {
|
|
318
|
+
if (col.RawSqlType)
|
|
319
|
+
return col.RawSqlType;
|
|
320
|
+
switch (col.Type) {
|
|
321
|
+
case 'string': return `NVARCHAR(${col.MaxLength ?? 200})`;
|
|
322
|
+
case 'text': return 'NVARCHAR(MAX)';
|
|
323
|
+
case 'integer': return 'INT';
|
|
324
|
+
case 'bigint': return 'BIGINT';
|
|
325
|
+
case 'float': return 'FLOAT';
|
|
326
|
+
case 'decimal': return `DECIMAL(${col.Precision ?? 18},${col.Scale ?? 2})`;
|
|
327
|
+
case 'boolean': return 'BIT';
|
|
328
|
+
case 'date': return 'DATE';
|
|
329
|
+
case 'datetime': return 'DATETIMEOFFSET';
|
|
330
|
+
case 'time': return 'TIME';
|
|
331
|
+
case 'uuid': return 'UNIQUEIDENTIFIER';
|
|
332
|
+
case 'json': return 'NVARCHAR(MAX)';
|
|
333
|
+
default: return 'NVARCHAR(200)';
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
static ɵfac = function DatabasePreviewPaneComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatabasePreviewPaneComponent)(); };
|
|
337
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DatabasePreviewPaneComponent, selectors: [["mj-database-preview-pane"]], inputs: { TableDefinition: "TableDefinition", IsAlter: "IsAlter" }, standalone: false, decls: 14, vars: 8, consts: [[1, "preview-pane"], ["role", "tablist", 1, "preview-tabs"], ["type", "button", "role", "tab", 1, "preview-tab", 3, "click"], [1, "fa-solid", "fa-diagram-project"], [1, "fa-solid", "fa-code"], [1, "preview-tabs-spacer"], [1, "preview-tabs-hint"], [1, "preview-body"], [1, "preview-erd", 3, "nodes", "focusNodeId", "focusDepth", "readOnly", "showHeader", "config"], ["language", "sql", "setup", "minimal", 1, "preview-sql", 3, "value", "readonly", "lineWrapping"]], template: function DatabasePreviewPaneComponent_Template(rf, ctx) { if (rf & 1) {
|
|
338
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "button", 2);
|
|
339
|
+
i0.ɵɵlistener("click", function DatabasePreviewPaneComponent_Template_button_click_2_listener() { return ctx.SelectTab("diagram"); });
|
|
340
|
+
i0.ɵɵelement(3, "i", 3);
|
|
341
|
+
i0.ɵɵtext(4, " Diagram ");
|
|
342
|
+
i0.ɵɵelementEnd();
|
|
343
|
+
i0.ɵɵelementStart(5, "button", 2);
|
|
344
|
+
i0.ɵɵlistener("click", function DatabasePreviewPaneComponent_Template_button_click_5_listener() { return ctx.SelectTab("sql"); });
|
|
345
|
+
i0.ɵɵelement(6, "i", 4);
|
|
346
|
+
i0.ɵɵtext(7, " SQL ");
|
|
347
|
+
i0.ɵɵelementEnd();
|
|
348
|
+
i0.ɵɵelement(8, "div", 5);
|
|
349
|
+
i0.ɵɵelementStart(9, "span", 6);
|
|
350
|
+
i0.ɵɵtext(10, "Updates as you edit");
|
|
351
|
+
i0.ɵɵelementEnd()();
|
|
352
|
+
i0.ɵɵelementStart(11, "div", 7);
|
|
353
|
+
i0.ɵɵconditionalCreate(12, DatabasePreviewPaneComponent_Conditional_12_Template, 1, 6, "mj-erd-diagram", 8);
|
|
354
|
+
i0.ɵɵconditionalCreate(13, DatabasePreviewPaneComponent_Conditional_13_Template, 1, 3, "mj-code-editor", 9);
|
|
355
|
+
i0.ɵɵelementEnd()();
|
|
356
|
+
} if (rf & 2) {
|
|
357
|
+
i0.ɵɵadvance(2);
|
|
358
|
+
i0.ɵɵclassProp("active", ctx.ActiveTab === "diagram");
|
|
359
|
+
i0.ɵɵattribute("aria-selected", ctx.ActiveTab === "diagram");
|
|
360
|
+
i0.ɵɵadvance(3);
|
|
361
|
+
i0.ɵɵclassProp("active", ctx.ActiveTab === "sql");
|
|
362
|
+
i0.ɵɵattribute("aria-selected", ctx.ActiveTab === "sql");
|
|
363
|
+
i0.ɵɵadvance(7);
|
|
364
|
+
i0.ɵɵconditional(ctx.ActiveTab === "diagram" ? 12 : -1);
|
|
365
|
+
i0.ɵɵadvance();
|
|
366
|
+
i0.ɵɵconditional(ctx.ActiveTab === "sql" ? 13 : -1);
|
|
367
|
+
} }, dependencies: [i1.CodeEditorComponent, i2.ERDDiagramComponent], styles: [".preview-pane[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n background: var(--mj-bg-surface-card);\n border-left: 1px solid var(--mj-border-default);\n}\n\n\n\n\n.preview-tabs[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n flex-shrink: 0;\n}\n\n.preview-tab[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n border: 1px solid transparent;\n border-radius: 6px;\n background: transparent;\n color: var(--mj-text-secondary);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 120ms, color 120ms, border-color 120ms;\n}\n\n.preview-tab[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n\n.preview-tab.active[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n}\n\n.preview-tab[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 12px;\n}\n\n.preview-tabs-spacer[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.preview-tabs-hint[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--mj-text-muted);\n letter-spacing: 0.02em;\n}\n\n\n\n\n.preview-body[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.preview-erd[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n min-width: 0;\n}\n\n.preview-sql[_ngcontent-%COMP%] {\n display: block;\n flex: 1;\n min-height: 0;\n}"], changeDetection: 0 });
|
|
368
|
+
}
|
|
369
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatabasePreviewPaneComponent, [{
|
|
370
|
+
type: Component,
|
|
371
|
+
args: [{ standalone: false, selector: 'mj-database-preview-pane', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"preview-pane\">\n\n <!-- \u2500\u2500 Tab switcher \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"preview-tabs\" role=\"tablist\">\n <button\n type=\"button\"\n role=\"tab\"\n class=\"preview-tab\"\n [class.active]=\"ActiveTab === 'diagram'\"\n [attr.aria-selected]=\"ActiveTab === 'diagram'\"\n (click)=\"SelectTab('diagram')\">\n <i class=\"fa-solid fa-diagram-project\"></i>\n Diagram\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n class=\"preview-tab\"\n [class.active]=\"ActiveTab === 'sql'\"\n [attr.aria-selected]=\"ActiveTab === 'sql'\"\n (click)=\"SelectTab('sql')\">\n <i class=\"fa-solid fa-code\"></i>\n SQL\n </button>\n <div class=\"preview-tabs-spacer\"></div>\n <span class=\"preview-tabs-hint\">Updates as you edit</span>\n </div>\n\n <!-- \u2500\u2500 Tab body \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n <div class=\"preview-body\">\n\n @if (ActiveTab === 'diagram') {\n <mj-erd-diagram\n class=\"preview-erd\"\n [nodes]=\"ErdNodes\"\n [focusNodeId]=\"FocusNodeId\"\n [focusDepth]=\"1\"\n [readOnly]=\"true\"\n [showHeader]=\"false\"\n [config]=\"ErdConfig\">\n </mj-erd-diagram>\n }\n\n @if (ActiveTab === 'sql') {\n <mj-code-editor\n class=\"preview-sql\"\n [value]=\"SqlText\"\n language=\"sql\"\n [readonly]=\"true\"\n [lineWrapping]=\"false\"\n setup=\"minimal\">\n </mj-code-editor>\n }\n\n </div>\n\n</div>\n", styles: [".preview-pane {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n background: var(--mj-bg-surface-card);\n border-left: 1px solid var(--mj-border-default);\n}\n\n/* \u2500\u2500 Tab switcher \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.preview-tabs {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n flex-shrink: 0;\n}\n\n.preview-tab {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n border: 1px solid transparent;\n border-radius: 6px;\n background: transparent;\n color: var(--mj-text-secondary);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 120ms, color 120ms, border-color 120ms;\n}\n\n.preview-tab:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n\n.preview-tab.active {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n}\n\n.preview-tab i {\n font-size: 12px;\n}\n\n.preview-tabs-spacer {\n flex: 1;\n}\n\n.preview-tabs-hint {\n font-size: 11px;\n color: var(--mj-text-muted);\n letter-spacing: 0.02em;\n}\n\n/* \u2500\u2500 Body (ERD / SQL) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.preview-body {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.preview-erd {\n flex: 1;\n min-height: 0;\n min-width: 0;\n}\n\n.preview-sql {\n display: block;\n flex: 1;\n min-height: 0;\n}\n"] }]
|
|
372
|
+
}], null, { TableDefinition: [{
|
|
373
|
+
type: Input
|
|
374
|
+
}], IsAlter: [{
|
|
375
|
+
type: Input
|
|
376
|
+
}] }); })();
|
|
377
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DatabasePreviewPaneComponent, { className: "DatabasePreviewPaneComponent", filePath: "src/DatabaseDesigner/components/shared/database-preview-pane.component.ts", lineNumber: 34 }); })();
|
|
378
|
+
//# sourceMappingURL=database-preview-pane.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-preview-pane.component.js","sourceRoot":"","sources":["../../../../src/DatabaseDesigner/components/shared/database-preview-pane.component.ts","../../../../src/DatabaseDesigner/components/shared/database-preview-pane.component.html"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACH,SAAS,EAAE,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,GACvE,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;;;;;ICa1C,oCAQiB;;;IADf,AADA,AADA,AADA,AADA,AADA,uCAAkB,mCACS,iBACX,kBACC,qBACG,4BACA;;;IAKtB,oCAOiB;;;IAFf,AADA,AAFA,sCAAiB,kBAEA,uBACK;;ADhB9B,MAAM,OAAO,4BAA4B;IAEpB,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAEjD,0EAA0E;IAE1E;;;OAGG;IACH,IACW,eAAe,CAAC,KAAkD;QACzE,IAAI,CAAC,gBAAgB,GAAG,KAAK,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;IACD,IAAW,eAAe,KAA+B,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAChF,gBAAgB,GAA6B,EAAE,CAAC;IAExD;;;;;;OAMG;IACH,IACW,OAAO,CAAC,KAAc;QAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB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AA,iBAAS;YACT,iCAM6B;YAA3B,yGAAS,cAAU,KAAK,CAAC,IAAC;YAC1B,uBAAgC;YAChC,qBACF;YAAA,iBAAS;YACT,yBAAuC;YACvC,+BAAgC;YAAA,oCAAmB;YACrD,AADqD,iBAAO,EACtD;YAGN,+BAA0B;YAExB,2GAA+B;YAY/B,2GAA2B;YAa/B,AAFE,iBAAM,EAEF;;YAhDA,eAAwC;YAAxC,qDAAwC;;YAUxC,eAAoC;YAApC,iDAAoC;;YAatC,eAUC;YAVD,uDAUC;YAED,cASC;YATD,mDASC;;;iFDnBQ,4BAA4B;cAPxC,SAAS;6BACM,KAAK,YACP,0BAA0B,mBAGnB,uBAAuB,CAAC,MAAM;;kBAY9C,KAAK;;kBAeL,KAAK;;kFAzBG,4BAA4B","sourcesContent":["/**\n * @module database-preview-pane.component\n * @description Live preview of the current wizard `TableDefinition`.\n *\n * Two tabs:\n * - **Diagram** — renders an `mj-erd-diagram` with the in-progress entity\n * as the focus node and any FK-referenced entities as satellite nodes.\n * - **SQL** — renders the CREATE TABLE / ALTER TABLE DDL in a read-only\n * `mj-code-editor` with SQL syntax highlighting.\n *\n * The component is a pure function of `TableDefinition`: set the input, the\n * preview re-renders. No side effects, no service subscriptions — the wizard\n * host owns the subscription to `EntityWizardStateService.tableDefinition$`\n * and pushes values down.\n */\n\nimport {\n Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, inject,\n} from '@angular/core';\nimport { Metadata } from '@memberjunction/core';\nimport type { ERDNode, ERDField } from '@memberjunction/ng-entity-relationship-diagram';\nimport type { ColumnSpec, EntityTableSpec, ForeignKeySpec } from '../../database-designer.types.js';\n\n/** Which tab is currently active. */\nexport type PreviewTab = 'diagram' | 'sql';\n\n@Component({\n standalone: false,\n selector: 'mj-database-preview-pane',\n templateUrl: './database-preview-pane.component.html',\n styleUrls: ['./database-preview-pane.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DatabasePreviewPaneComponent {\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n // ─── Inputs ────────────────────────────────────────────────────────────\n\n /**\n * Current wizard draft. Accepts a partial spec so the preview can\n * render meaningfully even on Step 1 (name only).\n */\n @Input()\n public set TableDefinition(value: Partial<EntityTableSpec> | null | undefined) {\n this._tableDefinition = value ?? {};\n this.recompute();\n }\n public get TableDefinition(): Partial<EntityTableSpec> { return this._tableDefinition; }\n private _tableDefinition: Partial<EntityTableSpec> = {};\n\n /**\n * True when this preview is showing an edit of an existing entity\n * (modify flow). Switches the SQL header to `ALTER` wording and draws\n * a \"current vs proposed\" indicator in the diagram.\n *\n * Defaults to false (create flow).\n */\n @Input()\n public set IsAlter(value: boolean) {\n this._isAlter = value;\n this.recompute();\n }\n public get IsAlter(): boolean { return this._isAlter; }\n private _isAlter = false;\n\n // ─── View state ────────────────────────────────────────────────────────\n\n public ActiveTab: PreviewTab = 'diagram';\n\n public ErdNodes: ERDNode[] = [];\n\n public SqlText = '';\n\n /** Focus node ID — lets `mj-erd-diagram` highlight the in-progress entity. */\n public FocusNodeId: string | null = null;\n\n /**\n * Stable config reference — bound to `mj-erd-diagram` via `[config]`.\n * Must be a class property, not an inline object literal in the template,\n * or every CD cycle produces a new reference and the ERD re-runs its\n * layout / fit-to-view on every tick.\n */\n public readonly ErdConfig = { showAllFields: true, maxNodeHeight: 520 } as const;\n\n // ─── Tab handler ───────────────────────────────────────────────────────\n\n public SelectTab(tab: PreviewTab): void {\n this.ActiveTab = tab;\n this.cdr.markForCheck();\n }\n\n // ─── Derivation ────────────────────────────────────────────────────────\n\n private recompute(): void {\n const enrichments = this.resolveSatelliteFields(this._tableDefinition.ForeignKeys ?? []);\n this.ErdNodes = DatabasePreviewPaneComponent.BuildErdNodes(this._tableDefinition, enrichments);\n this.SqlText = DatabasePreviewPaneComponent.BuildSqlText(this._tableDefinition, this._isAlter);\n this.FocusNodeId = DatabasePreviewPaneComponent.BuildFocusId(this._tableDefinition);\n this.cdr.markForCheck();\n }\n\n /**\n * Look up each FK target in MJ metadata and return PK + name-field rows per\n * satellite node. Falls back to a minimal single-column stub when the\n * referenced table isn't a known MJ entity.\n */\n private resolveSatelliteFields(foreignKeys: ForeignKeySpec[]): Map<string, ERDField[]> {\n const md = new Metadata(); // global-provider-ok: client-side Angular component, single provider\n const result = new Map<string, ERDField[]>();\n const seen = new Set<string>();\n\n for (const fk of foreignKeys) {\n const satId = DatabasePreviewPaneComponent.MakeSatelliteId(fk);\n if (seen.has(satId)) continue;\n seen.add(satId);\n\n const entity = md.Entities.find(e =>\n e.SchemaName === fk.ReferencedSchema && e.BaseTable === fk.ReferencedTable);\n if (!entity) continue;\n\n const fields: ERDField[] = [];\n const refField = entity.Fields.find(f => f.Name === fk.ReferencedColumn);\n if (refField) {\n fields.push({\n id: `${satId}:${refField.Name}`,\n name: refField.Name,\n type: refField.SQLFullType,\n isPrimaryKey: refField.IsPrimaryKey,\n });\n }\n\n const nameField = entity.Fields.find(f => f.IsNameField && f.Name !== fk.ReferencedColumn);\n if (nameField) {\n fields.push({\n id: `${satId}:${nameField.Name}`,\n name: nameField.Name,\n type: nameField.SQLFullType,\n isPrimaryKey: false,\n });\n }\n\n if (fields.length > 0) result.set(satId, fields);\n }\n\n return result;\n }\n\n // ─── Pure builders (exposed for unit testing) ──────────────────────────\n\n /** DOM id for the focus node, used by `mj-erd-diagram` to highlight. */\n public static BuildFocusId(spec: Partial<EntityTableSpec>): string | null {\n const name = spec.TableName || spec.EntityName;\n return name ? `focus:${name}` : null;\n }\n\n /**\n * ERD node list: one focus node + one satellite per distinct FK target.\n * `satelliteEnrichments` — optional PK + name-field rows per satellite,\n * keyed by `MakeSatelliteId(fk)`. When absent, satellites render a\n * minimal single-column stub.\n */\n public static BuildErdNodes(\n spec: Partial<EntityTableSpec>,\n satelliteEnrichments?: Map<string, ERDField[]>,\n ): ERDNode[] {\n const tableName = spec.TableName || spec.EntityName || 'NewEntity';\n const schemaName = spec.SchemaName || '__mj_UDT';\n const focusId = `focus:${tableName}`;\n\n const focusFields = this.BuildFocusFields(focusId, spec);\n this.AnnotateFkLinks(focusFields, spec.ForeignKeys ?? []);\n\n const focusNode: ERDNode = {\n id: focusId,\n name: spec.EntityName || tableName,\n schemaName,\n baseTable: tableName,\n description: spec.Description,\n fields: focusFields,\n };\n\n return [focusNode, ...this.BuildSatelliteNodes(spec.ForeignKeys ?? [], satelliteEnrichments)];\n }\n\n /**\n * Field list for the focus node: PK + user columns + synthetic FK columns + system audit.\n * Pure — no link annotation. `AnnotateFkLinks` runs after to mark FK sources.\n */\n public static BuildFocusFields(focusId: string, spec: Partial<EntityTableSpec>): ERDField[] {\n const columns = spec.Columns ?? [];\n const foreignKeys = spec.ForeignKeys ?? [];\n const columnNames = new Set(columns.map(c => c.Name));\n\n const fields: ERDField[] = [];\n\n fields.push({\n id: `${focusId}:ID`,\n name: 'ID',\n type: 'uniqueidentifier',\n isPrimaryKey: true,\n description: 'Primary key — always present',\n });\n\n for (const col of columns) {\n fields.push({\n id: `${focusId}:${col.Name}`,\n name: col.Name,\n type: this.FormatFieldType(col),\n isPrimaryKey: false,\n allowsNull: col.IsNullable,\n length: col.MaxLength,\n precision: col.Precision,\n scale: col.Scale,\n defaultValue: col.DefaultValue,\n description: col.Description,\n });\n }\n\n // Synthetic field for any FK whose source column isn't declared in Columns yet.\n for (const fk of foreignKeys) {\n if (!fk.ColumnName || columnNames.has(fk.ColumnName)) continue;\n fields.push({\n id: `${focusId}:${fk.ColumnName}`,\n name: fk.ColumnName,\n type: 'uniqueidentifier',\n isPrimaryKey: false,\n allowsNull: true,\n relatedNodeId: this.MakeSatelliteId(fk),\n relatedNodeName: fk.ReferencedTable,\n relatedFieldName: fk.ReferencedColumn,\n });\n }\n\n fields.push(\n {\n id: `${focusId}:__mj_CreatedAt`,\n name: '__mj_CreatedAt',\n type: 'datetimeoffset',\n isPrimaryKey: false,\n defaultValue: 'GETUTCDATE()',\n description: 'Record creation timestamp',\n },\n {\n id: `${focusId}:__mj_UpdatedAt`,\n name: '__mj_UpdatedAt',\n type: 'datetimeoffset',\n isPrimaryKey: false,\n defaultValue: 'GETUTCDATE()',\n description: 'Last update timestamp',\n },\n );\n\n return fields;\n }\n\n /** Stamp FK metadata onto any existing fields that match an FK source column. */\n public static AnnotateFkLinks(fields: ERDField[], foreignKeys: ForeignKeySpec[]): void {\n for (const fk of foreignKeys) {\n if (!fk.ColumnName) continue;\n const fld = fields.find(f => f.name === fk.ColumnName);\n if (fld && !fld.relatedNodeId) {\n fld.relatedNodeId = this.MakeSatelliteId(fk);\n fld.relatedNodeName = fk.ReferencedTable;\n fld.relatedFieldName = fk.ReferencedColumn;\n }\n }\n }\n\n /**\n * One satellite node per distinct FK target (dedupes on schema+table).\n * When `enrichments` provides rows for a satellite id, those rows (PK +\n * name field, resolved from MJ metadata) are used instead of the minimal\n * single-column stub.\n */\n public static BuildSatelliteNodes(\n foreignKeys: ForeignKeySpec[],\n enrichments?: Map<string, ERDField[]>,\n ): ERDNode[] {\n const seen = new Set<string>();\n const satelliteNodes: ERDNode[] = [];\n for (const fk of foreignKeys) {\n // Skip in-progress rows where the target hasn't been picked yet.\n if (!fk.ReferencedSchema || !fk.ReferencedTable) continue;\n const satId = this.MakeSatelliteId(fk);\n if (seen.has(satId)) continue;\n seen.add(satId);\n\n const enriched = enrichments?.get(satId);\n const fields: ERDField[] = enriched && enriched.length > 0 ? enriched : [\n {\n id: `${satId}:${fk.ReferencedColumn}`,\n name: fk.ReferencedColumn,\n type: 'uniqueidentifier',\n isPrimaryKey: true,\n },\n ];\n\n satelliteNodes.push({\n id: satId,\n name: fk.ReferencedTable,\n schemaName: fk.ReferencedSchema,\n baseTable: fk.ReferencedTable,\n fields,\n });\n }\n return satelliteNodes;\n }\n\n public static MakeSatelliteId(fk: ForeignKeySpec): string {\n return `ref:${fk.ReferencedSchema}.${fk.ReferencedTable}`;\n }\n\n /** Preview DDL for the given TableDefinition. `isAlter` only affects the lead comment. */\n public static BuildSqlText(spec: Partial<EntityTableSpec>, isAlter = false): string {\n const table = spec.TableName || spec.EntityName || 'NewEntity';\n const schema = spec.SchemaName || '__mj_UDT';\n const qualified = `[${schema}].[${table}]`;\n const leadComment = isAlter\n ? `-- Generated by Database Designer · preview (ALTER)`\n : `-- Generated by Database Designer · preview`;\n\n // Column lines, padded for alignment\n const colLines: string[] = [];\n colLines.push(` [ID] UNIQUEIDENTIFIER NOT NULL DEFAULT NEWSEQUENTIALID(),`);\n\n for (const col of spec.Columns ?? []) {\n if (!col.Name) continue;\n colLines.push(` ${this.FormatColumnLine(col)},`);\n }\n\n // FK columns that aren't already in Columns\n for (const fk of spec.ForeignKeys ?? []) {\n const inColumns = (spec.Columns ?? []).some(c => c.Name === fk.ColumnName);\n if (inColumns) continue;\n const name = `[${fk.ColumnName}]`.padEnd(18);\n colLines.push(` ${name} UNIQUEIDENTIFIER NULL, -- auto-generated FK`);\n }\n\n colLines.push(` [__mj_CreatedAt] DATETIMEOFFSET NOT NULL DEFAULT GETUTCDATE(),`);\n colLines.push(` [__mj_UpdatedAt] DATETIMEOFFSET NOT NULL DEFAULT GETUTCDATE(),`);\n colLines.push(` CONSTRAINT [PK_${table}] PRIMARY KEY ([ID])`);\n\n const lines: string[] = [\n leadComment,\n `CREATE TABLE ${qualified} (`,\n ...colLines,\n `);`,\n ];\n\n // FK constraints\n for (const fk of spec.ForeignKeys ?? []) {\n lines.push('');\n lines.push(`ALTER TABLE ${qualified}`);\n lines.push(` ADD CONSTRAINT [FK_${table}_${fk.ColumnName}]`);\n lines.push(` FOREIGN KEY ([${fk.ColumnName}]) REFERENCES [${fk.ReferencedSchema}].[${fk.ReferencedTable}]([${fk.ReferencedColumn}]);`);\n }\n\n return lines.join('\\n');\n }\n\n public static FormatColumnLine(col: ColumnSpec): string {\n const name = `[${col.Name}]`.padEnd(18);\n const type = col.RawSqlType || this.FormatFieldType(col);\n const nullability = col.IsNullable ? 'NULL' : 'NOT NULL';\n const dflt = col.DefaultValue ? ` DEFAULT ${col.DefaultValue}` : '';\n return `${name} ${type.padEnd(16)} ${nullability}${dflt}`;\n }\n\n public static FormatFieldType(col: ColumnSpec): string {\n if (col.RawSqlType) return col.RawSqlType;\n switch (col.Type) {\n case 'string': return `NVARCHAR(${col.MaxLength ?? 200})`;\n case 'text': return 'NVARCHAR(MAX)';\n case 'integer': return 'INT';\n case 'bigint': return 'BIGINT';\n case 'float': return 'FLOAT';\n case 'decimal': return `DECIMAL(${col.Precision ?? 18},${col.Scale ?? 2})`;\n case 'boolean': return 'BIT';\n case 'date': return 'DATE';\n case 'datetime': return 'DATETIMEOFFSET';\n case 'time': return 'TIME';\n case 'uuid': return 'UNIQUEIDENTIFIER';\n case 'json': return 'NVARCHAR(MAX)';\n default: return 'NVARCHAR(200)';\n }\n }\n}\n","<div class=\"preview-pane\">\n\n <!-- ── Tab switcher ──────────────────────────────────────────────────── -->\n <div class=\"preview-tabs\" role=\"tablist\">\n <button\n type=\"button\"\n role=\"tab\"\n class=\"preview-tab\"\n [class.active]=\"ActiveTab === 'diagram'\"\n [attr.aria-selected]=\"ActiveTab === 'diagram'\"\n (click)=\"SelectTab('diagram')\">\n <i class=\"fa-solid fa-diagram-project\"></i>\n Diagram\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n class=\"preview-tab\"\n [class.active]=\"ActiveTab === 'sql'\"\n [attr.aria-selected]=\"ActiveTab === 'sql'\"\n (click)=\"SelectTab('sql')\">\n <i class=\"fa-solid fa-code\"></i>\n SQL\n </button>\n <div class=\"preview-tabs-spacer\"></div>\n <span class=\"preview-tabs-hint\">Updates as you edit</span>\n </div>\n\n <!-- ── Tab body ──────────────────────────────────────────────────────── -->\n <div class=\"preview-body\">\n\n @if (ActiveTab === 'diagram') {\n <mj-erd-diagram\n class=\"preview-erd\"\n [nodes]=\"ErdNodes\"\n [focusNodeId]=\"FocusNodeId\"\n [focusDepth]=\"1\"\n [readOnly]=\"true\"\n [showHeader]=\"false\"\n [config]=\"ErdConfig\">\n </mj-erd-diagram>\n }\n\n @if (ActiveTab === 'sql') {\n <mj-code-editor\n class=\"preview-sql\"\n [value]=\"SqlText\"\n language=\"sql\"\n [readonly]=\"true\"\n [lineWrapping]=\"false\"\n setup=\"minimal\">\n </mj-code-editor>\n }\n\n </div>\n\n</div>\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module entity-fields-grid.component
|
|
3
|
+
* @description Inline field editor for the Database Designer wizard (Step 2) and
|
|
4
|
+
* the Modify view (Fields tab).
|
|
5
|
+
*
|
|
6
|
+
* Each row represents one column definition. Cells are directly editable —
|
|
7
|
+
* click any cell to edit it in-place. No separate dialog needed.
|
|
8
|
+
*
|
|
9
|
+
* ### Modes
|
|
10
|
+
* - `create`: all rows are new columns being defined. Any row can be deleted.
|
|
11
|
+
* - `modify`: rows loaded from an existing entity. Existing rows can be hidden
|
|
12
|
+
* from new records (soft-removal preserving data) but not deleted. New rows
|
|
13
|
+
* added by the user can be deleted outright.
|
|
14
|
+
*
|
|
15
|
+
* ### Validation
|
|
16
|
+
* Reserved column names (`ID`, `__mj_CreatedAt`, `__mj_UpdatedAt`) are detected
|
|
17
|
+
* and shown with an inline error badge. The parent step component reads
|
|
18
|
+
* `HasErrors` to gate the "Next" button.
|
|
19
|
+
*/
|
|
20
|
+
import { EventEmitter } from '@angular/core';
|
|
21
|
+
import type { ColumnSpec, FieldTypeOption } from '../../database-designer.types.js';
|
|
22
|
+
import * as i0 from "@angular/core";
|
|
23
|
+
/** Extends ColumnSpec with grid-specific display state. */
|
|
24
|
+
interface FieldRow extends ColumnSpec {
|
|
25
|
+
/** True when the column already exists in the DB (modify mode). */
|
|
26
|
+
isExisting: boolean;
|
|
27
|
+
/** True when the user has soft-toggled this existing column to hidden. */
|
|
28
|
+
isHidden: boolean;
|
|
29
|
+
/** 0-based index for stable tracking. */
|
|
30
|
+
rowIndex: number;
|
|
31
|
+
}
|
|
32
|
+
export declare class EntityFieldsGridComponent {
|
|
33
|
+
private readonly cdr;
|
|
34
|
+
set Columns(v: ColumnSpec[]);
|
|
35
|
+
Mode: 'create' | 'modify';
|
|
36
|
+
/** Emitted on every change so the parent/state service can stay in sync. */
|
|
37
|
+
readonly ColumnsChanged: EventEmitter<ColumnSpec[]>;
|
|
38
|
+
rows: FieldRow[];
|
|
39
|
+
/** Index of the row currently being actively edited (-1 = none). */
|
|
40
|
+
ActiveRowIndex: number;
|
|
41
|
+
/** Available type options — drives the dropdown. */
|
|
42
|
+
readonly FieldTypeOptions: readonly FieldTypeOption[];
|
|
43
|
+
/** True when any row has a reserved-name validation error. */
|
|
44
|
+
get HasErrors(): boolean;
|
|
45
|
+
/** True when any row has an error (exposed for parent template). */
|
|
46
|
+
get HasReservedNameError(): boolean;
|
|
47
|
+
TrackByIndex(_: number, row: FieldRow): number;
|
|
48
|
+
IsReservedName(name: string): boolean;
|
|
49
|
+
TypeLabel(type: ColumnSpec['Type']): string;
|
|
50
|
+
/** True when the selected type supports a Max Length field. */
|
|
51
|
+
ShowMaxLength(type: ColumnSpec['Type']): boolean;
|
|
52
|
+
/** True when the selected type supports precision/scale fields. */
|
|
53
|
+
ShowPrecisionScale(type: ColumnSpec['Type']): boolean;
|
|
54
|
+
/** Append an empty row and make it active for editing. */
|
|
55
|
+
AddField(): void;
|
|
56
|
+
/** Remove a new (non-existing) row outright. */
|
|
57
|
+
DeleteRow(index: number): void;
|
|
58
|
+
/**
|
|
59
|
+
* Toggle the "hidden" state of an existing row in modify mode.
|
|
60
|
+
* Hidden = soft-remove: `IncludeInAPI` will be set to false server-side;
|
|
61
|
+
* data in the column is preserved.
|
|
62
|
+
*/
|
|
63
|
+
ToggleHide(index: number): void;
|
|
64
|
+
/** Update a field's Name. */
|
|
65
|
+
OnNameChange(index: number, value: string): void;
|
|
66
|
+
/** Update a field's Type. */
|
|
67
|
+
OnTypeChange(index: number, value: ColumnSpec['Type']): void;
|
|
68
|
+
/** Toggle the "Required" (not-nullable) flag. */
|
|
69
|
+
OnRequiredToggle(index: number): void;
|
|
70
|
+
/** Update MaxLength for string columns. */
|
|
71
|
+
OnMaxLengthChange(index: number, value: string): void;
|
|
72
|
+
/** Update the Default Value string. */
|
|
73
|
+
OnDefaultValueChange(index: number, value: string): void;
|
|
74
|
+
/** Update the Description string. */
|
|
75
|
+
OnDescriptionChange(index: number, value: string): void;
|
|
76
|
+
private isReservedName;
|
|
77
|
+
/** Called directly from the template for precision/scale inline updates. */
|
|
78
|
+
updateRow(index: number, patch: Partial<FieldRow>): void;
|
|
79
|
+
/** Emit the current non-hidden rows as `ColumnSpec[]` to the parent. */
|
|
80
|
+
private emit;
|
|
81
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntityFieldsGridComponent, never>;
|
|
82
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EntityFieldsGridComponent, "mj-database-fields-grid", never, { "Columns": { "alias": "Columns"; "required": false; }; "Mode": { "alias": "Mode"; "required": false; }; }, { "ColumnsChanged": "ColumnsChanged"; }, never, never, false, never>;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=entity-fields-grid.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-fields-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/DatabaseDesigner/components/shared/entity-fields-grid.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACuB,YAAY,EAEzC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;;AAMpF,2DAA2D;AAC3D,UAAU,QAAS,SAAQ,UAAU;IACjC,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,QAAQ,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,qBAOa,yBAAyB;IAIlC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IAIjD,IAAoB,OAAO,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