@memberjunction/ng-explorer-core 6.1.0-edge.5 → 6.1.0-edge.7

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.
Files changed (77) hide show
  1. package/README.md +19 -0
  2. package/dist/generated/lazy-feature-config.js +3 -3
  3. package/dist/generated/lazy-feature-config.js.map +1 -1
  4. package/dist/lib/about/about-dialog.component.js +4 -4
  5. package/dist/lib/about/about-dialog.component.js.map +1 -1
  6. package/dist/lib/command-palette/command-palette.component.js +1 -1
  7. package/dist/lib/conversation-feedback/conversation-feedback.js +1 -1
  8. package/dist/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.js +1 -1
  9. package/dist/lib/oauth/oauth-callback.component.js +1 -1
  10. package/dist/lib/omnibar/omnibar-palette.component.d.ts.map +1 -1
  11. package/dist/lib/omnibar/omnibar-palette.component.js +9 -3
  12. package/dist/lib/omnibar/omnibar-palette.component.js.map +1 -1
  13. package/dist/lib/omnibar/providers/omnibar-record.provider.d.ts.map +1 -1
  14. package/dist/lib/omnibar/providers/omnibar-record.provider.js +9 -3
  15. package/dist/lib/omnibar/providers/omnibar-record.provider.js.map +1 -1
  16. package/dist/lib/profile/profile-dialog.component.js +1 -1
  17. package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts.map +1 -1
  18. package/dist/lib/resource-wrappers/dashboard-resource.component.js +6 -14
  19. package/dist/lib/resource-wrappers/dashboard-resource.component.js.map +1 -1
  20. package/dist/lib/resource-wrappers/list-detail-resource.component.js +1 -1
  21. package/dist/lib/resource-wrappers/list-detail-resource.component.js.map +1 -1
  22. package/dist/lib/resource-wrappers/query-resource.component.js +1 -1
  23. package/dist/lib/resource-wrappers/query-resource.component.js.map +1 -1
  24. package/dist/lib/resource-wrappers/record-resource.component.d.ts +3 -0
  25. package/dist/lib/resource-wrappers/record-resource.component.d.ts.map +1 -1
  26. package/dist/lib/resource-wrappers/record-resource.component.js +18 -4
  27. package/dist/lib/resource-wrappers/record-resource.component.js.map +1 -1
  28. package/dist/lib/resource-wrappers/search-results-resource.component.d.ts.map +1 -1
  29. package/dist/lib/resource-wrappers/search-results-resource.component.js +6 -2
  30. package/dist/lib/resource-wrappers/search-results-resource.component.js.map +1 -1
  31. package/dist/lib/resource-wrappers/view-resource.component.d.ts.map +1 -1
  32. package/dist/lib/resource-wrappers/view-resource.component.js +6 -3
  33. package/dist/lib/resource-wrappers/view-resource.component.js.map +1 -1
  34. package/dist/lib/shell/components/dialogs/app-access-dialog.component.js +2 -2
  35. package/dist/lib/shell/components/dialogs/app-access-dialog.component.js.map +1 -1
  36. package/dist/lib/shell/components/header/app-nav.component.js +1 -1
  37. package/dist/lib/shell/components/header/app-switcher.component.js +82 -83
  38. package/dist/lib/shell/components/header/app-switcher.component.js.map +1 -1
  39. package/dist/lib/shell/components/record-open/record-bar.component.js +1 -1
  40. package/dist/lib/shell/components/record-open/record-origin-crumb.component.js +1 -1
  41. package/dist/lib/shell/components/record-open/record-switcher-sheet.component.js +1 -1
  42. package/dist/lib/shell/components/record-open/records-hub-pill.component.js +1 -1
  43. package/dist/lib/shell/components/tabs/tab-container.component.d.ts +25 -0
  44. package/dist/lib/shell/components/tabs/tab-container.component.d.ts.map +1 -1
  45. package/dist/lib/shell/components/tabs/tab-container.component.js +88 -4
  46. package/dist/lib/shell/components/tabs/tab-container.component.js.map +1 -1
  47. package/dist/lib/shell/services/sharing-center-dialog-host.component.js +2 -2
  48. package/dist/lib/shell/services/sharing-center-dialog-host.component.js.map +1 -1
  49. package/dist/lib/shell/shell-chrome-policy.d.ts +54 -0
  50. package/dist/lib/shell/shell-chrome-policy.d.ts.map +1 -0
  51. package/dist/lib/shell/shell-chrome-policy.js +62 -0
  52. package/dist/lib/shell/shell-chrome-policy.js.map +1 -0
  53. package/dist/lib/shell/shell.component.d.ts +19 -0
  54. package/dist/lib/shell/shell.component.d.ts.map +1 -1
  55. package/dist/lib/shell/shell.component.js +190 -119
  56. package/dist/lib/shell/shell.component.js.map +1 -1
  57. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +1 -1
  58. package/dist/lib/single-dashboard/single-dashboard.component.js +1 -1
  59. package/dist/lib/single-list-detail/single-list-detail.component.d.ts +9 -0
  60. package/dist/lib/single-list-detail/single-list-detail.component.d.ts.map +1 -1
  61. package/dist/lib/single-list-detail/single-list-detail.component.js +34 -15
  62. package/dist/lib/single-list-detail/single-list-detail.component.js.map +1 -1
  63. package/dist/lib/single-record/single-record.component.d.ts +10 -0
  64. package/dist/lib/single-record/single-record.component.d.ts.map +1 -1
  65. package/dist/lib/single-record/single-record.component.js +23 -3
  66. package/dist/lib/single-record/single-record.component.js.map +1 -1
  67. package/dist/lib/single-search-result/single-search-result.component.d.ts.map +1 -1
  68. package/dist/lib/single-search-result/single-search-result.component.js +5 -2
  69. package/dist/lib/single-search-result/single-search-result.component.js.map +1 -1
  70. package/dist/lib/user-notifications/user-notifications.component.js +11 -12
  71. package/dist/lib/user-notifications/user-notifications.component.js.map +1 -1
  72. package/dist/lib/user-profile/user-profile.component.js +1 -1
  73. package/dist/public-api.d.ts +1 -0
  74. package/dist/public-api.d.ts.map +1 -1
  75. package/dist/public-api.js +1 -0
  76. package/dist/public-api.js.map +1 -1
  77. package/package.json +62 -62
@@ -1 +1 @@
1
- {"version":3,"file":"omnibar-record.provider.js","sourceRoot":"","sources":["../../../../src/lib/omnibar/providers/omnibar-record.provider.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAA6D,MAAM,sBAAsB,CAAC;AAClI,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AAE1F,iEAAiE;AACjE,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B;;;;;;GAMG;AAEI,IAAM,qBAA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AAC;IACL,CAAC;CACJ,CAAA;AA9JY,qBAAqB;IADjC,aAAa,CAAC,eAAe,EAAE,iBAAiB,CAAC;GACrC,qBAAqB,CA8JjC;;AAED,iEAAiE;AACjE,MAAM,UAAU,yBAAyB;IACrC,oBAAoB;AACxB,CAAC","sourcesContent":["import { RegisterClass } from '@memberjunction/global';\nimport { CompositeKey, Metadata, RunView, EntityInfo, IMetadataProvider, IRunViewProvider, UserInfo } from '@memberjunction/core';\nimport { UserInfoEngine } from '@memberjunction/core-entities';\nimport type { MentionSuggestion, ComposerSuggestionRequest } from '@memberjunction/ng-composer';\nimport { OmnibarProvider, OMNIBAR_NAV_KEY, OmnibarNavPayload } from '../omnibar-provider';\n\n/** How many record rows the best-matching entity contributes. */\nconst MAX_RECORD_ROWS = 5;\n\n/**\n * '#' — jump straight to a record. Two-phase within one query:\n * 1. Entity-name matches from metadata (grouped \"Entities\").\n * 2. Top records of the BEST-matching entity, searched by its name field\n * (grouped \"Matching records\") — fail-soft per entity (RLS/permission errors\n * simply yield no record rows).\n */\n@RegisterClass(OmnibarProvider, 'omnibar-records')\nexport class OmnibarRecordProvider extends OmnibarProvider {\n public readonly TriggerChar = '#';\n public readonly Key = 'omnibar-records';\n public override readonly Priority = 50;\n public readonly ModeLabel = 'Jump to Record';\n // Placeholder doubles as syntax education — the two-phase '#<entity> <record>'\n // pattern wasn't discoverable from a generic hint (design-review finding).\n public override readonly Placeholder = 'Type an entity, then a record — e.g. #accounts acme';\n\n /**\n * Bare '#' empty state: the user's recently OPENED records (from the\n * UserInfoEngine's cached 'MJ: User Record Logs'), newest first. Previously\n * this returned nothing — deliberate (avoid a full-entity dump) but it read\n * as \"no results / broken\" in the design review. Fail-soft throughout:\n * any error just yields an empty list, never blocks the palette.\n */\n public override async EmptyStateSuggestions(request: ComposerSuggestionRequest): Promise<MentionSuggestion[]> {\n try {\n const md: IMetadataProvider = request.Provider ?? Metadata.Provider;\n const user = request.ContextUser ?? md.CurrentUser;\n const engine = UserInfoEngine.Instance;\n await engine.Config(false, user ?? undefined); // no-op when already loaded\n const logs = [...engine.UserRecordLogs]\n .sort((a, b) => new Date(b.LatestAt).getTime() - new Date(a.LatestAt).getTime())\n .slice(0, request.MaxResults);\n if (logs.length === 0) {\n return [];\n }\n const names = await this.resolveRecordNames(\n md,\n logs.map((l) => ({ entityName: l.Entity, recordId: l.RecordID })),\n user ?? undefined,\n );\n return logs.map((log) => {\n const nav: OmnibarNavPayload = { kind: 'record', entityName: log.Entity, recordId: log.RecordID };\n const display = names.get(`${log.Entity}||${log.RecordID}`) ?? log.RecordID;\n return {\n type: 'record',\n id: `recent-record:${log.Entity}:${log.RecordID}`,\n name: display,\n displayName: display,\n description: log.Entity,\n icon: 'fa-solid fa-clock-rotate-left',\n data: { [OMNIBAR_NAV_KEY]: nav, group: 'Recently opened' },\n } satisfies MentionSuggestion;\n });\n } catch {\n return [];\n }\n }\n\n /** Batch display-name lookup; entries that fail resolve to absent (caller falls back to the ID). */\n private async resolveRecordNames(\n md: IMetadataProvider,\n targets: Array<{ entityName: string; recordId: string }>,\n user?: UserInfo,\n ): Promise<Map<string, string>> {\n const resolved = new Map<string, string>();\n try {\n const inputs = targets.map((t) => ({ EntityName: t.entityName, CompositeKey: CompositeKey.FromID(t.recordId) }));\n const results = await md.GetEntityRecordNames(inputs, user);\n for (const r of results ?? []) {\n if (r.Success && r.RecordName) {\n resolved.set(`${r.EntityName}||${r.CompositeKey.GetValueByIndex(0)}`, r.RecordName);\n }\n }\n } catch {\n // name lookup is cosmetic — IDs are an acceptable fallback\n }\n return resolved;\n }\n\n public async GetSuggestions(request: ComposerSuggestionRequest): Promise<MentionSuggestion[]> {\n const query = request.Query.trim().toLowerCase();\n const md: IMetadataProvider = request.Provider ?? Metadata.Provider;\n const matches = this.matchEntities(md.Entities, query);\n const suggestions: MentionSuggestion[] = matches.slice(0, 4).map((e) => this.entitySuggestion(e));\n if (matches.length > 0 && query.length > 0) {\n // Record term = the query MINUS the matched entity name when the query leads\n // with it ('#mj: ai agents amanda' → term 'amanda'); an exact entity-name\n // query lists the entity's top records (empty term = browse).\n const best = matches[0];\n const bestName = best.Name.toLowerCase();\n const term = query.startsWith(bestName) ? query.substring(bestName.length).trim() : query;\n suggestions.push(...await this.recordSuggestions(best, term, request));\n }\n return suggestions.slice(0, request.MaxResults);\n }\n\n /** Name-ranked entity matches: startsWith beats contains; empty query = none (avoid a 300-entity dump). */\n private matchEntities(entities: EntityInfo[], query: string): EntityInfo[] {\n if (query.length === 0) {\n return [];\n }\n const scored = entities\n .map((e) => {\n const name = e.Name.toLowerCase();\n const score = name === query ? 3 : name.startsWith(query) ? 2 : name.includes(query) ? 1 : 0;\n return { e, score };\n })\n .filter((x) => x.score > 0)\n .sort((a, b) => (b.score - a.score) || a.e.Name.localeCompare(b.e.Name));\n return scored.map((x) => x.e);\n }\n\n private entitySuggestion(entity: EntityInfo): MentionSuggestion {\n // Enter/click on an entity row NAVIGATES: opens the entity's dynamic list view.\n // Drilling into records happens by TYPING ('#<entity name> <record term>').\n const nav: OmnibarNavPayload = { kind: 'entity-list', entityName: entity.Name };\n return {\n type: 'entity',\n id: entity.ID,\n name: entity.Name,\n displayName: entity.Name,\n description: entity.Description ? entity.Description.substring(0, 120) : 'Entity — open list view',\n icon: entity.Icon || 'fa-solid fa-table',\n data: { [OMNIBAR_NAV_KEY]: nav, group: 'Entities', entityName: entity.Name },\n };\n }\n\n /** Top records of one entity whose name field matches the query. Fail-soft. */\n private async recordSuggestions(entity: EntityInfo, term: string, request: ComposerSuggestionRequest): Promise<MentionSuggestion[]> {\n const nameField = entity.NameField;\n if (!nameField) {\n return [];\n }\n try {\n const escaped = term.replace(/'/g, \"''\");\n const rv = request.Provider ? RunView.FromMetadataProvider(request.Provider) : new RunView();\n const result = await rv.RunView<Record<string, unknown>>({\n EntityName: entity.Name,\n ExtraFilter: escaped.length > 0 ? `${nameField.Name} LIKE '%${escaped}%'` : '',\n Fields: [entity.FirstPrimaryKey.Name, nameField.Name],\n OrderBy: nameField.Name,\n MaxRows: MAX_RECORD_ROWS,\n ResultType: 'simple',\n }, request.ContextUser ?? undefined);\n if (!result.Success) {\n return [];\n }\n return result.Results.map((row) => {\n const recordId = String(row[entity.FirstPrimaryKey.Name]);\n const name = String(row[nameField.Name] ?? recordId);\n const nav: OmnibarNavPayload = { kind: 'record', entityName: entity.Name, recordId };\n return {\n type: 'record',\n id: `${entity.Name}:${recordId}`,\n name,\n displayName: name,\n description: entity.Name,\n icon: 'fa-solid fa-id-card',\n data: { [OMNIBAR_NAV_KEY]: nav, group: 'Matching records' },\n } satisfies MentionSuggestion;\n });\n } catch {\n return [];\n }\n }\n}\n\n/** Tree-shaking guard — referenced by LoadOmnibarProviders(). */\nexport function LoadOmnibarRecordProvider(): void {\n // intentional no-op\n}\n"]}
1
+ {"version":3,"file":"omnibar-record.provider.js","sourceRoot":"","sources":["../../../../src/lib/omnibar/providers/omnibar-record.provider.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAA6D,MAAM,sBAAsB,CAAC;AAClI,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AAE1F,iEAAiE;AACjE,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B;;;;;;GAMG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,eAAe;IACtC,WAAW,GAAG,GAAG,CAAC;IAClB,GAAG,GAAG,iBAAiB,CAAC;IACf,QAAQ,GAAG,EAAE,CAAC;IACvB,SAAS,GAAG,gBAAgB,CAAC;IAC7C,+EAA+E;IAC/E,2EAA2E;IAClD,WAAW,GAAG,qDAAqD,CAAC;IAE7F;;;;;;OAMG;IACa,KAAK,CAAC,qBAAqB,CAAC,OAAkC;QAC1E,IAAI,CAAC;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AM,UAAU,yBAAyB;IACrC,oBAAoB;AACxB,CAAC","sourcesContent":["import { RegisterClass } from '@memberjunction/global';\nimport { CompositeKey, Metadata, RunView, EntityInfo, IMetadataProvider, IRunViewProvider, UserInfo } from '@memberjunction/core';\nimport { UserInfoEngine } from '@memberjunction/core-entities';\nimport type { MentionSuggestion, ComposerSuggestionRequest } from '@memberjunction/ng-composer';\nimport { OmnibarProvider, OMNIBAR_NAV_KEY, OmnibarNavPayload } from '../omnibar-provider';\n\n/** How many record rows the best-matching entity contributes. */\nconst MAX_RECORD_ROWS = 5;\n\n/**\n * '#' — jump straight to a record. Two-phase within one query:\n * 1. Entity-name matches from metadata (grouped \"Entities\").\n * 2. Top records of the BEST-matching entity, searched by its name field\n * (grouped \"Matching records\") — fail-soft per entity (RLS/permission errors\n * simply yield no record rows).\n */\n@RegisterClass(OmnibarProvider, 'omnibar-records')\nexport class OmnibarRecordProvider extends OmnibarProvider {\n public readonly TriggerChar = '#';\n public readonly Key = 'omnibar-records';\n public override readonly Priority = 50;\n public readonly ModeLabel = 'Jump to Record';\n // Placeholder doubles as syntax education — the two-phase '#<entity> <record>'\n // pattern wasn't discoverable from a generic hint (design-review finding).\n public override readonly Placeholder = 'Type an entity, then a record — e.g. #accounts acme';\n\n /**\n * Bare '#' empty state: the user's recently OPENED records (from the\n * UserInfoEngine's cached 'MJ: User Record Logs'), newest first. Previously\n * this returned nothing — deliberate (avoid a full-entity dump) but it read\n * as \"no results / broken\" in the design review. Fail-soft throughout:\n * any error just yields an empty list, never blocks the palette.\n */\n public override async EmptyStateSuggestions(request: ComposerSuggestionRequest): Promise<MentionSuggestion[]> {\n try {\n const md: IMetadataProvider = request.Provider ?? Metadata.Provider;\n const user = request.ContextUser ?? md.CurrentUser;\n const engine = UserInfoEngine.Instance;\n await engine.Config(false, user ?? undefined); // no-op when already loaded\n const logs = [...engine.UserRecordLogs]\n .sort((a, b) => new Date(b.LatestAt).getTime() - new Date(a.LatestAt).getTime())\n .slice(0, request.MaxResults);\n if (logs.length === 0) {\n return [];\n }\n const names = await this.resolveRecordNames(\n md,\n logs.map((l) => ({ entityName: l.Entity, recordId: l.RecordID })),\n user ?? undefined,\n );\n return logs.map((log) => {\n const nav: OmnibarNavPayload = { kind: 'record', entityName: log.Entity, recordId: log.RecordID };\n const display = names.get(`${log.Entity}||${log.RecordID}`) ?? log.RecordID;\n return {\n type: 'record',\n id: `recent-record:${log.Entity}:${log.RecordID}`,\n name: display,\n displayName: display,\n description: log.Entity,\n icon: 'fa-solid fa-clock-rotate-left',\n data: { [OMNIBAR_NAV_KEY]: nav, group: 'Recently opened' },\n } satisfies MentionSuggestion;\n });\n } catch {\n return [];\n }\n }\n\n /** Batch display-name lookup; entries that fail resolve to absent (caller falls back to the ID). */\n private async resolveRecordNames(\n md: IMetadataProvider,\n targets: Array<{ entityName: string; recordId: string }>,\n user?: UserInfo,\n ): Promise<Map<string, string>> {\n const resolved = new Map<string, string>();\n try {\n // Recents span arbitrary entities whose key column can have any name; `FromID` assumed\n // `ID` and left those records showing a raw id instead of a name.\n const inputs = targets.map((t) => ({\n EntityName: t.entityName,\n CompositeKey: CompositeKey.FromURLSegment(md.EntityByName(t.entityName), t.recordId),\n }));\n const results = await md.GetEntityRecordNames(inputs, user);\n for (const r of results ?? []) {\n if (r.Success && r.RecordName) {\n resolved.set(`${r.EntityName}||${r.CompositeKey.GetValueByIndex(0)}`, r.RecordName);\n }\n }\n } catch {\n // name lookup is cosmetic — IDs are an acceptable fallback\n }\n return resolved;\n }\n\n public async GetSuggestions(request: ComposerSuggestionRequest): Promise<MentionSuggestion[]> {\n const query = request.Query.trim().toLowerCase();\n const md: IMetadataProvider = request.Provider ?? Metadata.Provider;\n const matches = this.matchEntities(md.Entities, query);\n const suggestions: MentionSuggestion[] = matches.slice(0, 4).map((e) => this.entitySuggestion(e));\n if (matches.length > 0 && query.length > 0) {\n // Record term = the query MINUS the matched entity name when the query leads\n // with it ('#mj: ai agents amanda' → term 'amanda'); an exact entity-name\n // query lists the entity's top records (empty term = browse).\n const best = matches[0];\n const bestName = best.Name.toLowerCase();\n const term = query.startsWith(bestName) ? query.substring(bestName.length).trim() : query;\n suggestions.push(...await this.recordSuggestions(best, term, request));\n }\n return suggestions.slice(0, request.MaxResults);\n }\n\n /** Name-ranked entity matches: startsWith beats contains; empty query = none (avoid a 300-entity dump). */\n private matchEntities(entities: EntityInfo[], query: string): EntityInfo[] {\n if (query.length === 0) {\n return [];\n }\n const scored = entities\n .map((e) => {\n const name = e.Name.toLowerCase();\n const score = name === query ? 3 : name.startsWith(query) ? 2 : name.includes(query) ? 1 : 0;\n return { e, score };\n })\n .filter((x) => x.score > 0)\n .sort((a, b) => (b.score - a.score) || a.e.Name.localeCompare(b.e.Name));\n return scored.map((x) => x.e);\n }\n\n private entitySuggestion(entity: EntityInfo): MentionSuggestion {\n // Enter/click on an entity row NAVIGATES: opens the entity's dynamic list view.\n // Drilling into records happens by TYPING ('#<entity name> <record term>').\n const nav: OmnibarNavPayload = { kind: 'entity-list', entityName: entity.Name };\n return {\n type: 'entity',\n id: entity.ID,\n name: entity.Name,\n displayName: entity.Name,\n description: entity.Description ? entity.Description.substring(0, 120) : 'Entity — open list view',\n icon: entity.Icon || 'fa-solid fa-table',\n data: { [OMNIBAR_NAV_KEY]: nav, group: 'Entities', entityName: entity.Name },\n };\n }\n\n /** Top records of one entity whose name field matches the query. Fail-soft. */\n private async recordSuggestions(entity: EntityInfo, term: string, request: ComposerSuggestionRequest): Promise<MentionSuggestion[]> {\n const nameField = entity.NameField;\n if (!nameField) {\n return [];\n }\n try {\n const escaped = term.replace(/'/g, \"''\");\n const rv = request.Provider ? RunView.FromMetadataProvider(request.Provider) : new RunView();\n const result = await rv.RunView<Record<string, unknown>>({\n EntityName: entity.Name,\n ExtraFilter: escaped.length > 0 ? `${nameField.Name} LIKE '%${escaped}%'` : '',\n Fields: [...entity.PrimaryKeys.map((pk) => pk.Name), nameField.Name],\n OrderBy: nameField.Name,\n MaxRows: MAX_RECORD_ROWS,\n ResultType: 'simple',\n }, request.ContextUser ?? undefined);\n if (!result.Success) {\n return [];\n }\n return result.Results.map((row) => {\n // Compact key segment (raw value, or \"F1|v1||F2|v2\" for a composite key) — the palette resolves it with FromURLSegment\n const recordId = CompositeKey.FromEntityRecord(entity, row).ToCompactURLSegment();\n const name = String(row[nameField.Name] ?? recordId);\n const nav: OmnibarNavPayload = { kind: 'record', entityName: entity.Name, recordId };\n return {\n type: 'record',\n id: `${entity.Name}:${recordId}`,\n name,\n displayName: name,\n description: entity.Name,\n icon: 'fa-solid fa-id-card',\n data: { [OMNIBAR_NAV_KEY]: nav, group: 'Matching records' },\n } satisfies MentionSuggestion;\n });\n } catch {\n return [];\n }\n }\n}\n\n/** Tree-shaking guard — referenced by LoadOmnibarProviders(). */\nexport function LoadOmnibarRecordProvider(): void {\n // intentional no-op\n}\n"]}
@@ -746,7 +746,7 @@ export class ProfileDialogComponent extends BaseAngularComponent {
746
746
  i0.ɵɵtextInterpolate(ctx.PanelTitle);
747
747
  i0.ɵɵadvance(2);
748
748
  i0.ɵɵconditional(ctx.ActivePanel === "photo" ? 60 : ctx.ActivePanel === "theme" ? 61 : -1);
749
- } }, dependencies: [CommonModule, ExplorerSettingsModule, i1.UserProfileSettingsComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n width: 100%;\n height: 100%;\n}\n.mj-profile[_ngcontent-%COMP%] {\n display: block;\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n height: 100%;\n min-height: 0;\n position: relative;\n font-family: inherit;\n overflow: hidden;\n}\n.mj-profile__close[_ngcontent-%COMP%] {\n position: absolute;\n top: 12px; right: 12px;\n width: 36px; height: 36px;\n border: none; border-radius: 8px;\n background: rgba(255, 255, 255, 0.18);\n backdrop-filter: blur(8px);\n color: #fff;\n cursor: pointer;\n font-size: 16px;\n display: flex; align-items: center; justify-content: center;\n transition: background 0.15s, opacity 0.2s;\n z-index: 4;\n}\n.mj-profile__close[_ngcontent-%COMP%]:hover { background: rgba(255, 255, 255, 0.3); }\n.mj-profile--panel-open[_ngcontent-%COMP%] .mj-profile__close[_ngcontent-%COMP%] { opacity: 0; pointer-events: none; }\n\n\n\n.mj-profile__main[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n}\n.mj-profile--panel-open[_ngcontent-%COMP%] .mj-profile__main[_ngcontent-%COMP%] {\n transform: translateX(-12%);\n pointer-events: none;\n}\n\n.mj-profile__hero[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #264FAF 0%, #0076b6 100%);\n color: #fff;\n padding: 22px 24px 56px;\n position: relative;\n overflow: hidden;\n flex-shrink: 0;\n}\n.mj-profile__hero[_ngcontent-%COMP%]::before {\n content: '';\n position: absolute;\n inset: -50%;\n background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, transparent 60%);\n animation: _ngcontent-%COMP%_mj-profile-rotate 24s linear infinite;\n pointer-events: none;\n}\n@media (prefers-reduced-motion: reduce) {\n .mj-profile__hero[_ngcontent-%COMP%]::before { animation: none; }\n}\n@keyframes _ngcontent-%COMP%_mj-profile-rotate { to { transform: rotate(360deg); } }\n\n.mj-profile__hero-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 12px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 1.2px;\n opacity: 0.85;\n position: relative;\n z-index: 1;\n}\n\n.mj-profile__avatar-zone[_ngcontent-%COMP%] {\n position: relative;\n width: 96px;\n height: 96px;\n margin: -48px auto 12px;\n z-index: 2;\n}\n.mj-profile__avatar[_ngcontent-%COMP%] {\n width: 96px;\n height: 96px;\n border-radius: 50%;\n background: linear-gradient(135deg, #264FAF 0%, #0076b6 100%);\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 32px;\n font-weight: 700;\n border: 4px solid var(--mj-bg-surface);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);\n object-fit: cover;\n overflow: hidden;\n}\nimg.mj-profile__avatar[_ngcontent-%COMP%] { background: var(--mj-bg-surface-card); }\n.mj-profile__avatar--icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { font-size: 36px; }\n\n.mj-profile__avatar-edit[_ngcontent-%COMP%] {\n position: absolute;\n bottom: 2px; right: 2px;\n width: 30px; height: 30px;\n border-radius: 50%;\n background: var(--mj-bg-surface);\n color: var(--mj-brand-primary);\n border: 2px solid var(--mj-bg-surface);\n cursor: pointer;\n display: flex; align-items: center; justify-content: center;\n font-size: 12px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);\n transition: transform 0.15s;\n}\n.mj-profile__avatar-edit[_ngcontent-%COMP%]:hover { transform: scale(1.1); }\n\n.mj-profile__identity[_ngcontent-%COMP%] {\n text-align: center;\n padding: 0 24px 16px;\n flex-shrink: 0;\n}\n.mj-profile__name[_ngcontent-%COMP%] {\n margin: 0 0 4px;\n font-size: 22px;\n font-weight: 700;\n letter-spacing: -0.4px;\n color: var(--mj-text-primary);\n}\n.mj-profile__email[_ngcontent-%COMP%] {\n margin: 0 0 12px;\n color: var(--mj-text-muted);\n font-size: 13px;\n word-break: break-all;\n}\n.mj-profile__chips[_ngcontent-%COMP%] {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n justify-content: center;\n}\n.mj-profile__chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 9px;\n border-radius: 100px;\n font-size: 11px;\n font-weight: 600;\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n color: var(--mj-brand-primary);\n}\n.mj-profile__chip--admin[_ngcontent-%COMP%] {\n background: color-mix(in srgb, #f59e0b 14%, transparent);\n color: #b45309;\n}\n.mj-profile__chip--dev[_ngcontent-%COMP%] {\n background: color-mix(in srgb, #10b981 14%, transparent);\n color: #047857;\n}\n\n.mj-profile__field-list[_ngcontent-%COMP%] {\n padding: 0 24px;\n flex-shrink: 0;\n}\n.mj-profile__field[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n padding: 12px 0;\n gap: 14px;\n border-top: 1px solid var(--mj-border-subtle);\n width: 100%;\n text-align: left;\n background: transparent;\n border-left: none;\n border-right: none;\n border-bottom: none;\n font-family: inherit;\n color: inherit;\n}\n.mj-profile__field[_ngcontent-%COMP%]:first-child { border-top: none; }\n.mj-profile__field--button[_ngcontent-%COMP%] {\n cursor: pointer;\n transition: background 0.12s;\n margin: 0 -8px;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 8px;\n border-top: none;\n}\n.mj-profile__field--button[_ngcontent-%COMP%] + .mj-profile__field--button[_ngcontent-%COMP%] { margin-top: 0; }\n.mj-profile__field--button[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-hover); }\n.mj-profile__field--button[_ngcontent-%COMP%]:hover .mj-profile__field-chev[_ngcontent-%COMP%] { color: var(--mj-brand-primary); }\n.mj-profile__field-icon[_ngcontent-%COMP%] {\n width: 32px; height: 32px;\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n color: var(--mj-text-secondary);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n flex-shrink: 0;\n}\n.mj-profile__field-body[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n.mj-profile__field-label[_ngcontent-%COMP%] {\n font-size: 10.5px;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.5px;\n}\n.mj-profile__field-value[_ngcontent-%COMP%] {\n font-size: 13px;\n color: var(--mj-text-primary);\n margin-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.mj-profile__field-muted[_ngcontent-%COMP%] { color: var(--mj-text-muted); }\n.mj-profile__field-chev[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 11px;\n transition: color 0.15s;\n}\n\n.mj-profile__section[_ngcontent-%COMP%] {\n padding: 16px 24px 8px;\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n}\n.mj-profile__section-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n}\n.mj-profile__section-head[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 11px;\n font-weight: 700;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.6px;\n}\n.mj-profile__unread[_ngcontent-%COMP%] {\n font-size: 11px;\n font-weight: 600;\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n padding: 2px 8px;\n border-radius: 100px;\n}\n.mj-profile__channels-loading[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 12.5px;\n padding: 12px;\n text-align: center;\n}\n.mj-profile__channels[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.mj-profile__channel[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 14px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n border-radius: 10px;\n cursor: pointer;\n transition: all 0.15s;\n font-family: inherit;\n text-align: left;\n width: 100%;\n}\n.mj-profile__channel[_ngcontent-%COMP%]:hover:not(:disabled) {\n border-color: var(--mj-border-default);\n background: var(--mj-bg-surface-hover);\n}\n.mj-profile__channel[_ngcontent-%COMP%]:disabled { cursor: wait; opacity: 0.7; }\n.mj-profile__channel-icon[_ngcontent-%COMP%] {\n width: 32px; height: 32px;\n border-radius: 8px;\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n display: flex; align-items: center; justify-content: center;\n font-size: 13px;\n flex-shrink: 0;\n transition: all 0.15s;\n}\n.mj-profile__channel--on[_ngcontent-%COMP%] .mj-profile__channel-icon[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-brand-primary) 14%, transparent);\n color: var(--mj-brand-primary);\n}\n.mj-profile__channel-label[_ngcontent-%COMP%] {\n flex: 1;\n font-size: 13.5px;\n font-weight: 500;\n color: var(--mj-text-primary);\n}\n.mj-profile__channel-hint[_ngcontent-%COMP%] {\n font-size: 11.5px;\n font-weight: 400;\n color: var(--mj-text-muted);\n margin-top: 2px;\n}\n.mj-profile__channel-state[_ngcontent-%COMP%] {\n flex-shrink: 0;\n color: var(--mj-text-muted);\n font-size: 13px;\n min-width: 36px;\n display: flex; justify-content: flex-end; align-items: center;\n}\n\n.mj-profile__switch[_ngcontent-%COMP%] {\n width: 36px;\n height: 20px;\n background: var(--mj-border-strong);\n border-radius: 100px;\n position: relative;\n transition: background 0.2s;\n display: inline-block;\n}\n.mj-profile__switch-knob[_ngcontent-%COMP%] {\n position: absolute;\n top: 2px; left: 2px;\n width: 16px; height: 16px;\n background: white;\n border-radius: 50%;\n transition: transform 0.2s;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n}\n.mj-profile__switch--on[_ngcontent-%COMP%] { background: var(--mj-brand-primary); }\n.mj-profile__switch--on[_ngcontent-%COMP%] .mj-profile__switch-knob[_ngcontent-%COMP%] { transform: translateX(16px); }\n\n.mj-profile__footer[_ngcontent-%COMP%] {\n border-top: 1px solid var(--mj-border-subtle);\n padding: 14px 20px;\n display: flex;\n gap: 8px;\n align-items: center;\n flex-shrink: 0;\n}\n.mj-profile__spacer[_ngcontent-%COMP%] { flex: 1; }\n.mj-profile__btn[_ngcontent-%COMP%] {\n padding: 9px 16px;\n border-radius: 8px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n transition: all 0.15s;\n}\n.mj-profile__btn[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-hover); border-color: var(--mj-border-strong); }\n.mj-profile__btn--primary[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border-color: var(--mj-brand-primary);\n}\n.mj-profile__btn--primary[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 88%, black);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 88%, black);\n}\n.mj-profile__btn--danger[_ngcontent-%COMP%] {\n color: var(--mj-status-error);\n border-color: color-mix(in srgb, var(--mj-status-error) 30%, var(--mj-border-default));\n}\n.mj-profile__btn--danger[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-status-error) 8%, transparent);\n border-color: var(--mj-status-error);\n}\n\n\n\n.mj-profile__panel[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n background: var(--mj-bg-surface);\n transform: translateX(100%);\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n display: flex;\n flex-direction: column;\n z-index: 3;\n}\n.mj-profile__panel--open[_ngcontent-%COMP%] {\n transform: translateX(0);\n box-shadow: -8px 0 24px rgba(0, 0, 0, 0.06);\n}\n.mj-profile__panel-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 14px 18px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n flex-shrink: 0;\n}\n.mj-profile__panel-back[_ngcontent-%COMP%] {\n width: 34px; height: 34px;\n border-radius: 8px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n cursor: pointer;\n display: flex; align-items: center; justify-content: center;\n font-size: 13px;\n transition: all 0.15s;\n font-family: inherit;\n}\n.mj-profile__panel-back[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n}\n.mj-profile__panel-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--mj-text-primary);\n letter-spacing: -0.2px;\n}\n.mj-profile__panel-body[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: 16px 20px 20px;\n}\n\n\n\n.mj-profile__themes[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.mj-profile__theme[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 14px;\n padding: 12px 14px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n border-radius: 10px;\n cursor: pointer;\n transition: all 0.15s;\n text-align: left;\n width: 100%;\n font-family: inherit;\n}\n.mj-profile__theme[_ngcontent-%COMP%]:hover:not(:disabled) {\n border-color: var(--mj-brand-primary);\n background: var(--mj-bg-surface-hover);\n}\n.mj-profile__theme[_ngcontent-%COMP%]:disabled { cursor: wait; opacity: 0.7; }\n.mj-profile__theme--active[_ngcontent-%COMP%] {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface-card));\n}\n.mj-profile__theme-swatch[_ngcontent-%COMP%] {\n width: 40px; height: 40px;\n border-radius: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n flex-shrink: 0;\n border: 1px solid var(--mj-border-default);\n}\n.mj-profile__theme-swatch--light[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);\n color: #f59e0b;\n}\n.mj-profile__theme-swatch--dark[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);\n color: #94a3b8;\n border-color: #334155;\n}\n.mj-profile__theme-swatch--system[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #ffffff 0%, #ffffff 49%, #1e293b 51%, #0f172a 100%);\n color: var(--mj-text-secondary);\n}\n.mj-profile__theme-info[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n.mj-profile__theme-name[_ngcontent-%COMP%] {\n font-size: 13.5px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n.mj-profile__theme-desc[_ngcontent-%COMP%] {\n font-size: 11.5px;\n color: var(--mj-text-muted);\n margin-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.mj-profile__theme-check[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n font-size: 14px;\n flex-shrink: 0;\n}\n\n\n\n.mj-profile__theme-sep[_ngcontent-%COMP%] {\n font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;\n color: var(--mj-text-muted); padding: 6px 4px 2px; margin-top: 6px;\n}\n.mj-profile__brand-swatch[_ngcontent-%COMP%] {\n display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0;\n}\n.mj-profile__brand-swatch[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n width: 33%; height: 100%; display: block;\n}\n\n@media (max-width: 480px) {\n .mj-profile__hero[_ngcontent-%COMP%] { padding: 20px 18px 48px; }\n .mj-profile__avatar-zone[_ngcontent-%COMP%] { width: 88px; height: 88px; margin-top: -44px; }\n .mj-profile__avatar[_ngcontent-%COMP%] { width: 88px; height: 88px; font-size: 28px; }\n .mj-profile__name[_ngcontent-%COMP%] { font-size: 19px; }\n .mj-profile__field-list[_ngcontent-%COMP%], \n .mj-profile__section[_ngcontent-%COMP%] { padding-left: 18px; padding-right: 18px; }\n .mj-profile__footer[_ngcontent-%COMP%] { padding: 12px 16px; }\n .mj-profile--panel-open[_ngcontent-%COMP%] .mj-profile__main[_ngcontent-%COMP%] { transform: translateX(-20%); }\n .mj-profile__panel-body[_ngcontent-%COMP%] { padding: 14px 16px 16px; }\n}"] });
749
+ } }, dependencies: [CommonModule, ExplorerSettingsModule, i1.UserProfileSettingsComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n width: 100%;\n height: 100%;\n}\n.mj-profile[_ngcontent-%COMP%] {\n display: block;\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n height: 100%;\n min-height: 0;\n position: relative;\n font-family: inherit;\n overflow: hidden;\n}\n.mj-profile__close[_ngcontent-%COMP%] {\n position: absolute;\n top: 12px; right: 12px;\n width: 36px; height: 36px;\n border: none; border-radius: 8px;\n background: rgba(255, 255, 255, 0.18);\n backdrop-filter: blur(8px);\n color: #fff;\n cursor: pointer;\n font-size: 16px;\n display: flex; align-items: center; justify-content: center;\n transition: background 0.15s, opacity 0.2s;\n z-index: 4;\n}\n.mj-profile__close[_ngcontent-%COMP%]:hover { background: rgba(255, 255, 255, 0.3); }\n.mj-profile--panel-open[_ngcontent-%COMP%] .mj-profile__close[_ngcontent-%COMP%] { opacity: 0; pointer-events: none; }\n\n\n.mj-profile__main[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n}\n.mj-profile--panel-open[_ngcontent-%COMP%] .mj-profile__main[_ngcontent-%COMP%] {\n transform: translateX(-12%);\n pointer-events: none;\n}\n\n.mj-profile__hero[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #264FAF 0%, #0076b6 100%);\n color: #fff;\n padding: 22px 24px 56px;\n position: relative;\n overflow: hidden;\n flex-shrink: 0;\n}\n.mj-profile__hero[_ngcontent-%COMP%]::before {\n content: '';\n position: absolute;\n inset: -50%;\n background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, transparent 60%);\n animation: _ngcontent-%COMP%_mj-profile-rotate 24s linear infinite;\n pointer-events: none;\n}\n@media (prefers-reduced-motion: reduce) {\n .mj-profile__hero[_ngcontent-%COMP%]::before { animation: none; }\n}\n@keyframes _ngcontent-%COMP%_mj-profile-rotate { to { transform: rotate(360deg); } }\n\n.mj-profile__hero-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 12px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 1.2px;\n opacity: 0.85;\n position: relative;\n z-index: 1;\n}\n\n.mj-profile__avatar-zone[_ngcontent-%COMP%] {\n position: relative;\n width: 96px;\n height: 96px;\n margin: -48px auto 12px;\n z-index: 2;\n}\n.mj-profile__avatar[_ngcontent-%COMP%] {\n width: 96px;\n height: 96px;\n border-radius: 50%;\n background: linear-gradient(135deg, #264FAF 0%, #0076b6 100%);\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 32px;\n font-weight: 700;\n border: 4px solid var(--mj-bg-surface);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);\n object-fit: cover;\n overflow: hidden;\n}\nimg.mj-profile__avatar[_ngcontent-%COMP%] { background: var(--mj-bg-surface-card); }\n.mj-profile__avatar--icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { font-size: 36px; }\n\n.mj-profile__avatar-edit[_ngcontent-%COMP%] {\n position: absolute;\n bottom: 2px; right: 2px;\n width: 30px; height: 30px;\n border-radius: 50%;\n background: var(--mj-bg-surface);\n color: var(--mj-brand-primary);\n border: 2px solid var(--mj-bg-surface);\n cursor: pointer;\n display: flex; align-items: center; justify-content: center;\n font-size: 12px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);\n transition: transform 0.15s;\n}\n.mj-profile__avatar-edit[_ngcontent-%COMP%]:hover { transform: scale(1.1); }\n\n.mj-profile__identity[_ngcontent-%COMP%] {\n text-align: center;\n padding: 0 24px 16px;\n flex-shrink: 0;\n}\n.mj-profile__name[_ngcontent-%COMP%] {\n margin: 0 0 4px;\n font-size: 22px;\n font-weight: 700;\n letter-spacing: -0.4px;\n color: var(--mj-text-primary);\n}\n.mj-profile__email[_ngcontent-%COMP%] {\n margin: 0 0 12px;\n color: var(--mj-text-muted);\n font-size: 13px;\n word-break: break-all;\n}\n.mj-profile__chips[_ngcontent-%COMP%] {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n justify-content: center;\n}\n.mj-profile__chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 9px;\n border-radius: 100px;\n font-size: 11px;\n font-weight: 600;\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n color: var(--mj-brand-primary);\n}\n.mj-profile__chip--admin[_ngcontent-%COMP%] {\n background: color-mix(in srgb, #f59e0b 14%, transparent);\n color: #b45309;\n}\n.mj-profile__chip--dev[_ngcontent-%COMP%] {\n background: color-mix(in srgb, #10b981 14%, transparent);\n color: #047857;\n}\n\n.mj-profile__field-list[_ngcontent-%COMP%] {\n padding: 0 24px;\n flex-shrink: 0;\n}\n.mj-profile__field[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n padding: 12px 0;\n gap: 14px;\n border-top: 1px solid var(--mj-border-subtle);\n width: 100%;\n text-align: left;\n background: transparent;\n border-left: none;\n border-right: none;\n border-bottom: none;\n font-family: inherit;\n color: inherit;\n}\n.mj-profile__field[_ngcontent-%COMP%]:first-child { border-top: none; }\n.mj-profile__field--button[_ngcontent-%COMP%] {\n cursor: pointer;\n transition: background 0.12s;\n margin: 0 -8px;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 8px;\n border-top: none;\n}\n.mj-profile__field--button[_ngcontent-%COMP%] + .mj-profile__field--button[_ngcontent-%COMP%] { margin-top: 0; }\n.mj-profile__field--button[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-hover); }\n.mj-profile__field--button[_ngcontent-%COMP%]:hover .mj-profile__field-chev[_ngcontent-%COMP%] { color: var(--mj-brand-primary); }\n.mj-profile__field-icon[_ngcontent-%COMP%] {\n width: 32px; height: 32px;\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n color: var(--mj-text-secondary);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n flex-shrink: 0;\n}\n.mj-profile__field-body[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n.mj-profile__field-label[_ngcontent-%COMP%] {\n font-size: 10.5px;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.5px;\n}\n.mj-profile__field-value[_ngcontent-%COMP%] {\n font-size: 13px;\n color: var(--mj-text-primary);\n margin-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.mj-profile__field-muted[_ngcontent-%COMP%] { color: var(--mj-text-muted); }\n.mj-profile__field-chev[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 11px;\n transition: color 0.15s;\n}\n\n.mj-profile__section[_ngcontent-%COMP%] {\n padding: 16px 24px 8px;\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n}\n.mj-profile__section-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 10px;\n}\n.mj-profile__section-head[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 11px;\n font-weight: 700;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.6px;\n}\n.mj-profile__unread[_ngcontent-%COMP%] {\n font-size: 11px;\n font-weight: 600;\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n padding: 2px 8px;\n border-radius: 100px;\n}\n.mj-profile__channels-loading[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 12.5px;\n padding: 12px;\n text-align: center;\n}\n.mj-profile__channels[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.mj-profile__channel[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 14px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n border-radius: 10px;\n cursor: pointer;\n transition: all 0.15s;\n font-family: inherit;\n text-align: left;\n width: 100%;\n}\n.mj-profile__channel[_ngcontent-%COMP%]:hover:not(:disabled) {\n border-color: var(--mj-border-default);\n background: var(--mj-bg-surface-hover);\n}\n.mj-profile__channel[_ngcontent-%COMP%]:disabled { cursor: wait; opacity: 0.7; }\n.mj-profile__channel-icon[_ngcontent-%COMP%] {\n width: 32px; height: 32px;\n border-radius: 8px;\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n display: flex; align-items: center; justify-content: center;\n font-size: 13px;\n flex-shrink: 0;\n transition: all 0.15s;\n}\n.mj-profile__channel--on[_ngcontent-%COMP%] .mj-profile__channel-icon[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-brand-primary) 14%, transparent);\n color: var(--mj-brand-primary);\n}\n.mj-profile__channel-label[_ngcontent-%COMP%] {\n flex: 1;\n font-size: 13.5px;\n font-weight: 500;\n color: var(--mj-text-primary);\n}\n.mj-profile__channel-hint[_ngcontent-%COMP%] {\n font-size: 11.5px;\n font-weight: 400;\n color: var(--mj-text-muted);\n margin-top: 2px;\n}\n.mj-profile__channel-state[_ngcontent-%COMP%] {\n flex-shrink: 0;\n color: var(--mj-text-muted);\n font-size: 13px;\n min-width: 36px;\n display: flex; justify-content: flex-end; align-items: center;\n}\n\n.mj-profile__switch[_ngcontent-%COMP%] {\n width: 36px;\n height: 20px;\n background: var(--mj-border-strong);\n border-radius: 100px;\n position: relative;\n transition: background 0.2s;\n display: inline-block;\n}\n.mj-profile__switch-knob[_ngcontent-%COMP%] {\n position: absolute;\n top: 2px; left: 2px;\n width: 16px; height: 16px;\n background: white;\n border-radius: 50%;\n transition: transform 0.2s;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n}\n.mj-profile__switch--on[_ngcontent-%COMP%] { background: var(--mj-brand-primary); }\n.mj-profile__switch--on[_ngcontent-%COMP%] .mj-profile__switch-knob[_ngcontent-%COMP%] { transform: translateX(16px); }\n\n.mj-profile__footer[_ngcontent-%COMP%] {\n border-top: 1px solid var(--mj-border-subtle);\n padding: 14px 20px;\n display: flex;\n gap: 8px;\n align-items: center;\n flex-shrink: 0;\n}\n.mj-profile__spacer[_ngcontent-%COMP%] { flex: 1; }\n.mj-profile__btn[_ngcontent-%COMP%] {\n padding: 9px 16px;\n border-radius: 8px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n transition: all 0.15s;\n}\n.mj-profile__btn[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-hover); border-color: var(--mj-border-strong); }\n.mj-profile__btn--primary[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border-color: var(--mj-brand-primary);\n}\n.mj-profile__btn--primary[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 88%, black);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 88%, black);\n}\n.mj-profile__btn--danger[_ngcontent-%COMP%] {\n color: var(--mj-status-error);\n border-color: color-mix(in srgb, var(--mj-status-error) 30%, var(--mj-border-default));\n}\n.mj-profile__btn--danger[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-status-error) 8%, transparent);\n border-color: var(--mj-status-error);\n}\n\n\n.mj-profile__panel[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n background: var(--mj-bg-surface);\n transform: translateX(100%);\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n display: flex;\n flex-direction: column;\n z-index: 3;\n}\n.mj-profile__panel--open[_ngcontent-%COMP%] {\n transform: translateX(0);\n box-shadow: -8px 0 24px rgba(0, 0, 0, 0.06);\n}\n.mj-profile__panel-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 14px 18px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n flex-shrink: 0;\n}\n.mj-profile__panel-back[_ngcontent-%COMP%] {\n width: 34px; height: 34px;\n border-radius: 8px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n cursor: pointer;\n display: flex; align-items: center; justify-content: center;\n font-size: 13px;\n transition: all 0.15s;\n font-family: inherit;\n}\n.mj-profile__panel-back[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n}\n.mj-profile__panel-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--mj-text-primary);\n letter-spacing: -0.2px;\n}\n.mj-profile__panel-body[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: 16px 20px 20px;\n}\n\n\n.mj-profile__themes[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.mj-profile__theme[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 14px;\n padding: 12px 14px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n border-radius: 10px;\n cursor: pointer;\n transition: all 0.15s;\n text-align: left;\n width: 100%;\n font-family: inherit;\n}\n.mj-profile__theme[_ngcontent-%COMP%]:hover:not(:disabled) {\n border-color: var(--mj-brand-primary);\n background: var(--mj-bg-surface-hover);\n}\n.mj-profile__theme[_ngcontent-%COMP%]:disabled { cursor: wait; opacity: 0.7; }\n.mj-profile__theme--active[_ngcontent-%COMP%] {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface-card));\n}\n.mj-profile__theme-swatch[_ngcontent-%COMP%] {\n width: 40px; height: 40px;\n border-radius: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n flex-shrink: 0;\n border: 1px solid var(--mj-border-default);\n}\n.mj-profile__theme-swatch--light[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);\n color: #f59e0b;\n}\n.mj-profile__theme-swatch--dark[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);\n color: #94a3b8;\n border-color: #334155;\n}\n.mj-profile__theme-swatch--system[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, #ffffff 0%, #ffffff 49%, #1e293b 51%, #0f172a 100%);\n color: var(--mj-text-secondary);\n}\n.mj-profile__theme-info[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n.mj-profile__theme-name[_ngcontent-%COMP%] {\n font-size: 13.5px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n.mj-profile__theme-desc[_ngcontent-%COMP%] {\n font-size: 11.5px;\n color: var(--mj-text-muted);\n margin-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.mj-profile__theme-check[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n font-size: 14px;\n flex-shrink: 0;\n}\n\n\n.mj-profile__theme-sep[_ngcontent-%COMP%] {\n font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;\n color: var(--mj-text-muted); padding: 6px 4px 2px; margin-top: 6px;\n}\n.mj-profile__brand-swatch[_ngcontent-%COMP%] {\n display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0;\n}\n.mj-profile__brand-swatch[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n width: 33%; height: 100%; display: block;\n}\n\n@media (max-width: 480px) {\n .mj-profile__hero[_ngcontent-%COMP%] { padding: 20px 18px 48px; }\n .mj-profile__avatar-zone[_ngcontent-%COMP%] { width: 88px; height: 88px; margin-top: -44px; }\n .mj-profile__avatar[_ngcontent-%COMP%] { width: 88px; height: 88px; font-size: 28px; }\n .mj-profile__name[_ngcontent-%COMP%] { font-size: 19px; }\n .mj-profile__field-list[_ngcontent-%COMP%], \n .mj-profile__section[_ngcontent-%COMP%] { padding-left: 18px; padding-right: 18px; }\n .mj-profile__footer[_ngcontent-%COMP%] { padding: 12px 16px; }\n .mj-profile--panel-open[_ngcontent-%COMP%] .mj-profile__main[_ngcontent-%COMP%] { transform: translateX(-20%); }\n .mj-profile__panel-body[_ngcontent-%COMP%] { padding: 14px 16px 16px; }\n}"] });
750
750
  }
751
751
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ProfileDialogComponent, [{
752
752
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-resource.component.d.ts","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/dashboard-resource.component.ts"],"names":[],"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I,YAAY,CAEhC;IAED,WAAW,IAAI,IAAI;IAWnB;;OAEG;IACI,cAAc,IAAI,IAAI;IAQ7B;;OAEG;IACH,OAAO,CAAC,aAAa;IAerB;;OAEG;IACI,UAAU,IAAI,IAAI;IAWzB;;OAEG;IACU,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB3C;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAOhC;;OAEG;IACI,eAAe,IAAI,IAAI;IAK9B;;OAEG;IACI,gBAAgB,IAAI,IAAI;IAK/B;;OAEG;IACI,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAe3D;;;OAGG;YACW,aAAa;IAiD3B;;;;;OAKG;YACW,gBAAgB;IAiF9B;;OAEG;YACW,sBAAsB;cAgGpB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAiBhG;;OAEG;YACW,wBAAwB;IAwEtC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAiD/B;;;OAGG;IACY,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAmB1E;;OAEG;IACG,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;yCA7nBtD,iBAAiB;2CAAjB,iBAAiB;CAgoB7B"}
1
+ {"version":3,"file":"dashboard-resource.component.d.ts","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/dashboard-resource.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,gBAAgB,EAA2B,UAAU,EAAE,iBAAiB,EAAU,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,qBAAqB,EAAqD,MAAM,2BAA2B,CAAC;AACrH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAmB,0BAA0B,EAAwD,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAI7M,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;;AAE9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,gBAAgB,IAAI,IAAI;IAK/B;;OAEG;IACI,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAe3D;;;OAGG;YACW,aAAa;IAiD3B;;;;;OAKG;YACW,gBAAgB;IAiF9B;;OAEG;YACW,sBAAsB;cAgGpB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAiBhG;;OAEG;YACW,wBAAwB;IAwEtC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IA0C/B;;;OAGG;IACY,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAmB1E;;OAEG;IACG,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;yCAtnBtD,iBAAiB;2CAAjB,iBAAiB;CAynB7B"}
@@ -622,19 +622,11 @@ let DashboardResource = class DashboardResource extends BaseResourceComponent {
622
622
  // ToURLSegment serialize it a second time as `ID|<segment>` and produces a
623
623
  // malformed `Field|Field|Value` URL the host parser silently mis-reads (manifesting
624
624
  // downstream as `BaseEntity.Load(... Key: ID=ID)` and `Primary Key value is not a
625
- // valid number`). Parse the segment with `LoadFromURLSegment` against the entity's
626
- // PK metadata instead, so single-PK and composite-PK both round-trip correctly.
625
+ // valid number`). Parse the segment with `FromURLSegment` against the entity's PK
626
+ // metadata instead, so single-PK and composite-PK both round-trip correctly (it also
627
+ // owns the last-resort `ID` fallback for an entity name metadata can't resolve).
627
628
  const md = this.ProviderToUse;
628
- const entityInfo = md.EntityByName(entityRequest.entityName);
629
- const pkey = new CompositeKey();
630
- if (entityInfo) {
631
- pkey.LoadFromURLSegment(entityInfo, entityRequest.recordId);
632
- }
633
- else {
634
- // Last-resort fallback when entity metadata isn't resolvable — preserves
635
- // pre-fix behavior so we don't NRE on an unknown entity name.
636
- pkey.KeyValuePairs = [{ FieldName: 'ID', Value: entityRequest.recordId }];
637
- }
629
+ const pkey = CompositeKey.FromURLSegment(md.EntityByName(entityRequest.entityName), entityRequest.recordId);
638
630
  this.navigationService.OpenEntityRecord(entityRequest.entityName, pkey);
639
631
  break;
640
632
  }
@@ -664,7 +656,7 @@ let DashboardResource = class DashboardResource extends BaseResourceComponent {
664
656
  // Try to load dashboard metadata if we have the record ID
665
657
  if (data.ResourceRecordID && data.ResourceRecordID.length > 0) {
666
658
  const md = this.ProviderToUse;
667
- const compositeKey = new CompositeKey([{ FieldName: 'ID', Value: data.ResourceRecordID }]);
659
+ const compositeKey = CompositeKey.FromID(data.ResourceRecordID); // first-pk-ok: ResourceRecordID of a Dashboards resource — core entity keyed by ID
668
660
  const name = await md.GetEntityRecordName('Dashboards', compositeKey);
669
661
  if (name) {
670
662
  return name;
@@ -706,7 +698,7 @@ let DashboardResource = class DashboardResource extends BaseResourceComponent {
706
698
  i0.ɵɵconditional(ctx.configDashboard && ctx.isEditMode && !ctx.errorMessage ? 3 : -1);
707
699
  i0.ɵɵadvance(3);
708
700
  i0.ɵɵconditional(ctx.configDashboard ? 6 : -1);
709
- } }, dependencies: [i1.DefaultValueAccessor, i1.NgControlStatus, i1.NgModel, i2.DashboardShareDialogComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .dashboard-resource-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n }\n .dashboard-resource-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n }\n\n \n\n .viewer-toolbar[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n gap: 16px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .toolbar-left[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .dashboard-title[_ngcontent-%COMP%] {\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .dashboard-title[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n }\n .shared-indicator[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 11px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .toolbar-actions[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n \n\n .viewer-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n transition: background 0.2s, border-color 0.2s;\n }\n .viewer-header.editing[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface)) 0%, color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface)) 100%);\n border-bottom: 2px solid var(--mj-brand-primary);\n }\n .viewer-header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n }\n .viewer-header[_ngcontent-%COMP%] .header-right[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n \n\n .btn-add-part[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s, transform 0.1s;\n box-shadow: 0 2px 4px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n }\n .btn-add-part[_ngcontent-%COMP%]:hover {\n background: var(--mj-brand-primary-hover);\n transform: translateY(-1px);\n box-shadow: 0 3px 6px color-mix(in srgb, var(--mj-brand-primary) 40%, transparent);\n }\n .btn-add-part[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { font-size: 12px; }\n\n \n\n .header-separator[_ngcontent-%COMP%] {\n width: 1px;\n height: 28px;\n background: color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n margin: 0 4px;\n }\n\n \n\n .btn-primary[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n .btn-primary[_ngcontent-%COMP%]:hover { background: var(--mj-brand-primary-hover); }\n\n .btn-icon[_ngcontent-%COMP%] {\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-icon[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-sunken); }\n\n .btn-cancel[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-cancel[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n color: var(--mj-text-primary);\n }\n\n \n\n .dashboard-info-edit[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 16px;\n flex: 1;\n }\n .dashboard-name-input[_ngcontent-%COMP%] {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n background: rgba(255, 255, 255, 0.7);\n outline: none;\n min-width: 200px;\n max-width: 300px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-name-input[_ngcontent-%COMP%]:hover { background: rgba(255, 255, 255, 0.9); }\n .dashboard-name-input[_ngcontent-%COMP%]:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input[_ngcontent-%COMP%] {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n background: rgba(255, 255, 255, 0.5);\n outline: none;\n flex: 1;\n min-width: 150px;\n max-width: 400px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-description-input[_ngcontent-%COMP%]:hover { background: rgba(255, 255, 255, 0.8); }\n .dashboard-description-input[_ngcontent-%COMP%]:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input[_ngcontent-%COMP%]::placeholder {\n color: var(--mj-text-muted);\n font-style: normal;\n }\n\n \n\n .error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .error-icon[_ngcontent-%COMP%] {\n font-size: 64px;\n color: var(--mj-status-error);\n margin-bottom: 24px;\n opacity: 0.8;\n }\n .error-title[_ngcontent-%COMP%] {\n font-size: 24px;\n font-weight: 500;\n margin: 0 0 12px 0;\n color: var(--mj-text-primary);\n }\n .error-message[_ngcontent-%COMP%] {\n font-size: 16px;\n color: var(--mj-text-muted);\n margin: 0 0 24px 0;\n max-width: 500px;\n line-height: 1.5;\n }\n .error-details[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n padding: 12px 16px;\n max-width: 600px;\n text-align: left;\n font-size: 13px;\n }\n .error-details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] {\n cursor: pointer;\n font-weight: 500;\n color: var(--mj-text-muted);\n margin-bottom: 8px;\n }\n .error-details[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--mj-status-error-text);\n font-family: 'Consolas', 'Monaco', monospace;\n font-size: 12px;\n }\n\n \n\n @media (max-width: 768px) {\n .viewer-header[_ngcontent-%COMP%] {\n flex-direction: column;\n gap: 12px;\n align-items: stretch;\n }\n .viewer-header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] { flex-wrap: wrap; }\n .dashboard-info-edit[_ngcontent-%COMP%] {\n flex-direction: column;\n align-items: stretch;\n }\n .dashboard-name-input[_ngcontent-%COMP%], \n .dashboard-description-input[_ngcontent-%COMP%] { max-width: none; }\n }"] });
701
+ } }, dependencies: [i1.DefaultValueAccessor, i1.NgControlStatus, i1.NgModel, i2.DashboardShareDialogComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .dashboard-resource-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n }\n .dashboard-resource-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n }\n\n \n .viewer-toolbar[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n gap: 16px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .toolbar-left[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .dashboard-title[_ngcontent-%COMP%] {\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .dashboard-title[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n }\n .shared-indicator[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 11px;\n }\n .viewer-toolbar[_ngcontent-%COMP%] .toolbar-actions[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n \n .viewer-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n transition: background 0.2s, border-color 0.2s;\n }\n .viewer-header.editing[_ngcontent-%COMP%] {\n background: linear-gradient(135deg, color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface)) 0%, color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface)) 100%);\n border-bottom: 2px solid var(--mj-brand-primary);\n }\n .viewer-header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n }\n .viewer-header[_ngcontent-%COMP%] .header-right[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n \n .btn-add-part[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s, transform 0.1s;\n box-shadow: 0 2px 4px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n }\n .btn-add-part[_ngcontent-%COMP%]:hover {\n background: var(--mj-brand-primary-hover);\n transform: translateY(-1px);\n box-shadow: 0 3px 6px color-mix(in srgb, var(--mj-brand-primary) 40%, transparent);\n }\n .btn-add-part[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { font-size: 12px; }\n\n \n .header-separator[_ngcontent-%COMP%] {\n width: 1px;\n height: 28px;\n background: color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n margin: 0 4px;\n }\n\n \n .btn-primary[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n .btn-primary[_ngcontent-%COMP%]:hover { background: var(--mj-brand-primary-hover); }\n\n .btn-icon[_ngcontent-%COMP%] {\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-icon[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-sunken); }\n\n .btn-cancel[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-cancel[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n color: var(--mj-text-primary);\n }\n\n \n .dashboard-info-edit[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 16px;\n flex: 1;\n }\n .dashboard-name-input[_ngcontent-%COMP%] {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n background: rgba(255, 255, 255, 0.7);\n outline: none;\n min-width: 200px;\n max-width: 300px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-name-input[_ngcontent-%COMP%]:hover { background: rgba(255, 255, 255, 0.9); }\n .dashboard-name-input[_ngcontent-%COMP%]:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input[_ngcontent-%COMP%] {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n background: rgba(255, 255, 255, 0.5);\n outline: none;\n flex: 1;\n min-width: 150px;\n max-width: 400px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-description-input[_ngcontent-%COMP%]:hover { background: rgba(255, 255, 255, 0.8); }\n .dashboard-description-input[_ngcontent-%COMP%]:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input[_ngcontent-%COMP%]::placeholder {\n color: var(--mj-text-muted);\n font-style: normal;\n }\n\n \n .error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .error-icon[_ngcontent-%COMP%] {\n font-size: 64px;\n color: var(--mj-status-error);\n margin-bottom: 24px;\n opacity: 0.8;\n }\n .error-title[_ngcontent-%COMP%] {\n font-size: 24px;\n font-weight: 500;\n margin: 0 0 12px 0;\n color: var(--mj-text-primary);\n }\n .error-message[_ngcontent-%COMP%] {\n font-size: 16px;\n color: var(--mj-text-muted);\n margin: 0 0 24px 0;\n max-width: 500px;\n line-height: 1.5;\n }\n .error-details[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n padding: 12px 16px;\n max-width: 600px;\n text-align: left;\n font-size: 13px;\n }\n .error-details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] {\n cursor: pointer;\n font-weight: 500;\n color: var(--mj-text-muted);\n margin-bottom: 8px;\n }\n .error-details[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--mj-status-error-text);\n font-family: 'Consolas', 'Monaco', monospace;\n font-size: 12px;\n }\n\n \n @media (max-width: 768px) {\n .viewer-header[_ngcontent-%COMP%] {\n flex-direction: column;\n gap: 12px;\n align-items: stretch;\n }\n .viewer-header[_ngcontent-%COMP%] .header-left[_ngcontent-%COMP%] { flex-wrap: wrap; }\n .dashboard-info-edit[_ngcontent-%COMP%] {\n flex-direction: column;\n align-items: stretch;\n }\n .dashboard-name-input[_ngcontent-%COMP%], \n .dashboard-description-input[_ngcontent-%COMP%] { max-width: none; }\n }"] });
710
702
  };
711
703
  DashboardResource = __decorate([
712
704
  RegisterClass(BaseResourceComponent, 'DashboardResource')
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/dashboard-resource.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAkC,SAAS,EAAyC,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,qBAAqB,EAAqB,aAAa,EAAmB,MAAM,2BAA2B,CAAC;AACrH,OAAO,EAAmC,eAAe,EAA8G,MAAM,+BAA+B,CAAC;AAC7M,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAG,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAY,YAAY,EAAW,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGjF,OAAO,EAAE,wBAAwB,EAAmF,MAAM,qCAAqC,CAAC;;;;;;IAsBpI,AADJ,mCAA+B,cAClB;IAAA,iCAAiB;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nBQ,iBAAiB;6DAAjB,iBAAiB;;;;;;YAvYtB,8BAAwC;YAEpC,mFAAoB;YAiBpB,mFAAuD;YAmCvD,oFAAsD;YAkCtD,4BAA2D;YAG3D,yGAAuB;YAO3B,iBAAM;;YAhGF,cAcC;YAdD,2CAcC;YAGD,cAgCC;YAhCD,sFAgCC;YAGD,cA+BC;YA/BD,qFA+BC;YAMD,eAMC;YAND,8CAMC;;;AAsSA,iBAAiB;IA5Y7B,aAAa,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;GA4Y7C,iBAAiB,CAgoB7B;;iFAhoBY,iBAAiB;cA3Y7B,SAAS;6BACI,KAAK,YACL,uBAAuB,YACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoGT;;kBAiTA,SAAS;mBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAb/B,iBAAiB","sourcesContent":["import { Component, ViewContainerRef, ComponentRef, ViewChild, ElementRef, ChangeDetectorRef, inject } from '@angular/core';\nimport { BaseResourceComponent, NavigationService, BaseDashboard, DashboardConfig } from '@memberjunction/ng-shared';\nimport { ResourceData, MJDashboardEntity, DashboardEngine, MJDashboardUserStateEntity, MJDashboardCategoryEntity, MJDashboardPartTypeEntity, DashboardUserPermissions } from '@memberjunction/core-entities';\nimport { RegisterClass, MJGlobal, SafeJSONParse , UUIDsEqual } from '@memberjunction/global';\nimport { Metadata, CompositeKey, RunView, LogError } from '@memberjunction/core';\nimport type { DataExplorerFilter } from '@memberjunction/ng-dashboards/data-explorer-dashboards.module';\nimport type { ShareDialogResult } from '@memberjunction/ng-dashboards/core-dashboards.module';\nimport { DashboardViewerComponent, DashboardNavRequestEvent, PanelInteractionEvent, AddPanelResult, DashboardPanel } from '@memberjunction/ng-dashboard-viewer';\n/**\n * Dashboard Resource Wrapper - displays a single dashboard in a tab\n * Extends BaseResourceComponent to work with the resource type system\n * Dynamically routes between code-based and config-based dashboards based on dashboard type\n */\n@RegisterClass(BaseResourceComponent, 'DashboardResource')\n@Component({\n standalone: false,\n selector: 'mj-dashboard-resource',\n template: `\n <div class=\"dashboard-resource-wrapper\">\n <!-- Error State -->\n @if (errorMessage) {\n <div class=\"error-state\">\n <div class=\"error-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h2 class=\"error-title\">Unable to Load Dashboard</h2>\n <p class=\"error-message\">{{ errorMessage }}</p>\n @if (errorDetails) {\n <details class=\"error-details\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n }\n\n <!-- View Mode Toolbar -->\n @if (configDashboard && !isEditMode && !errorMessage) {\n <div class=\"viewer-toolbar\">\n <div class=\"toolbar-left\">\n <span class=\"dashboard-title\">\n <i class=\"fa-solid fa-chart-line\"></i>\n {{ configDashboard.Name }}\n </span>\n @if (!dashboardPermissions.IsOwner && dashboardPermissions.PermissionSource !== 'none') {\n <span class=\"shared-indicator\" title=\"Shared with you\">\n <i class=\"fa-solid fa-share-nodes\"></i>\n </span>\n }\n </div>\n <div class=\"toolbar-actions\">\n @if (dashboardPermissions.CanShare) {\n <button\n class=\"btn-icon\"\n title=\"Share Dashboard\"\n (click)=\"openShareDialog()\">\n <i class=\"fa-solid fa-share-nodes\"></i>\n </button>\n }\n @if (dashboardPermissions.CanEdit) {\n <button\n class=\"btn-icon\"\n title=\"Edit Dashboard\"\n (click)=\"toggleEditMode()\">\n <i class=\"fa-solid fa-edit\"></i>\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Edit Mode Toolbar -->\n @if (configDashboard && isEditMode && !errorMessage) {\n <div class=\"viewer-header editing\">\n <div class=\"header-left\">\n <button class=\"btn-add-part\" (click)=\"openAddPartDialog()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Part\n </button>\n <div class=\"header-separator\"></div>\n <div class=\"dashboard-info-edit\">\n <input\n type=\"text\"\n class=\"dashboard-name-input\"\n [(ngModel)]=\"editingName\"\n placeholder=\"Dashboard name\">\n <input\n type=\"text\"\n class=\"dashboard-description-input\"\n [(ngModel)]=\"editingDescription\"\n placeholder=\"Add a description...\">\n </div>\n </div>\n <div class=\"header-right\">\n <button class=\"btn-primary\" (click)=\"saveDashboard()\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n <button class=\"btn-cancel\" (click)=\"cancelEdit()\">\n Cancel\n </button>\n </div>\n </div>\n }\n\n <!-- Dashboard Content Container -->\n <div #container class=\"dashboard-resource-container\"></div>\n\n <!-- Share Dashboard Dialog -->\n @if (configDashboard) {\n <mj-dashboard-share-dialog\n [Visible]=\"showShareDialog\"\n [Dashboard]=\"configDashboard\"\n (Result)=\"onShareDialogResult($event)\">\n </mj-dashboard-share-dialog>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .dashboard-resource-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n }\n .dashboard-resource-container {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n }\n\n /* View Mode Toolbar */\n .viewer-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n gap: 16px;\n }\n .viewer-toolbar .toolbar-left {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n .viewer-toolbar .dashboard-title {\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .viewer-toolbar .dashboard-title i {\n color: var(--mj-brand-primary);\n }\n .shared-indicator {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 11px;\n }\n .viewer-toolbar .toolbar-actions {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n /* Edit Mode Header */\n .viewer-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n transition: background 0.2s, border-color 0.2s;\n }\n .viewer-header.editing {\n background: linear-gradient(135deg, color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface)) 0%, color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface)) 100%);\n border-bottom: 2px solid var(--mj-brand-primary);\n }\n .viewer-header .header-left {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n }\n .viewer-header .header-right {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n /* Add Part button */\n .btn-add-part {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s, transform 0.1s;\n box-shadow: 0 2px 4px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n }\n .btn-add-part:hover {\n background: var(--mj-brand-primary-hover);\n transform: translateY(-1px);\n box-shadow: 0 3px 6px color-mix(in srgb, var(--mj-brand-primary) 40%, transparent);\n }\n .btn-add-part i { font-size: 12px; }\n\n /* Header separator */\n .header-separator {\n width: 1px;\n height: 28px;\n background: color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n margin: 0 4px;\n }\n\n /* Buttons */\n .btn-primary {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n .btn-primary:hover { background: var(--mj-brand-primary-hover); }\n\n .btn-icon {\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-icon:hover { background: var(--mj-bg-surface-sunken); }\n\n .btn-cancel {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-cancel:hover {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n color: var(--mj-text-primary);\n }\n\n /* Dashboard info inputs */\n .dashboard-info-edit {\n display: flex;\n align-items: center;\n gap: 16px;\n flex: 1;\n }\n .dashboard-name-input {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n background: rgba(255, 255, 255, 0.7);\n outline: none;\n min-width: 200px;\n max-width: 300px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-name-input:hover { background: rgba(255, 255, 255, 0.9); }\n .dashboard-name-input:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n background: rgba(255, 255, 255, 0.5);\n outline: none;\n flex: 1;\n min-width: 150px;\n max-width: 400px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-description-input:hover { background: rgba(255, 255, 255, 0.8); }\n .dashboard-description-input:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input::placeholder {\n color: var(--mj-text-muted);\n font-style: normal;\n }\n\n /* Error state */\n .error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .error-icon {\n font-size: 64px;\n color: var(--mj-status-error);\n margin-bottom: 24px;\n opacity: 0.8;\n }\n .error-title {\n font-size: 24px;\n font-weight: 500;\n margin: 0 0 12px 0;\n color: var(--mj-text-primary);\n }\n .error-message {\n font-size: 16px;\n color: var(--mj-text-muted);\n margin: 0 0 24px 0;\n max-width: 500px;\n line-height: 1.5;\n }\n .error-details {\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n padding: 12px 16px;\n max-width: 600px;\n text-align: left;\n font-size: 13px;\n }\n .error-details summary {\n cursor: pointer;\n font-weight: 500;\n color: var(--mj-text-muted);\n margin-bottom: 8px;\n }\n .error-details pre {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--mj-status-error-text);\n font-family: 'Consolas', 'Monaco', monospace;\n font-size: 12px;\n }\n\n /* Responsive */\n @media (max-width: 768px) {\n .viewer-header {\n flex-direction: column;\n gap: 12px;\n align-items: stretch;\n }\n .viewer-header .header-left { flex-wrap: wrap; }\n .dashboard-info-edit {\n flex-direction: column;\n align-items: stretch;\n }\n .dashboard-name-input,\n .dashboard-description-input { max-width: none; }\n }\n `]\n})\nexport class DashboardResource extends BaseResourceComponent {\n private componentRef: ComponentRef<unknown> | null = null;\n\n /**\n * A cache reattach moves this wrapper to another tab without recreating the dashboard inside it,\n * so the child's tab stamp — taken when we created it — has to move too. Without this the\n * dashboard keeps reading and writing the params of the tab it was born in, from inside a tab it\n * no longer belongs to.\n */\n protected override onTabIdRebound(tabId: string): void {\n this.rehomeChildToTab(this.componentRef?.instance as BaseResourceComponent | undefined, tabId);\n }\n private dataLoaded = false;\n @ViewChild('container', { static: true }) containerElement!: ElementRef<HTMLDivElement>;\n\n /** Error message to display when dashboard fails to load */\n public errorMessage: string | null = null;\n /** Technical error details (shown in expandable section) */\n public errorDetails: string | null = null;\n\n /** Cached dashboard categories for breadcrumb navigation */\n private categories: MJDashboardCategoryEntity[] = [];\n\n /** Reference to the dashboard viewer component (for config-based dashboards) */\n private viewerInstance: DashboardViewerComponent | null = null;\n\n /** The config-based dashboard entity (null for code-based dashboards) */\n public configDashboard: MJDashboardEntity | null = null;\n\n /** Whether we're in edit mode */\n public isEditMode = false;\n\n /** Editing fields */\n public editingName = '';\n public editingDescription = '';\n\n /** Current user's permissions for this dashboard */\n public dashboardPermissions: DashboardUserPermissions = {\n DashboardID: '',\n CanRead: true,\n CanEdit: true,\n CanDelete: true,\n CanShare: true,\n IsOwner: true,\n PermissionSource: 'owner'\n };\n\n /** Whether the share dialog is visible */\n public showShareDialog = false;\n\n /**\n * Sets the error state with a user-friendly message and optional technical details\n */\n private setError(message: string, error?: unknown): void {\n this.errorMessage = message;\n if (error instanceof Error) {\n this.errorDetails = error.message;\n if (error.stack) {\n this.errorDetails += '\\n\\nStack trace:\\n' + error.stack;\n }\n } else if (error) {\n this.errorDetails = String(error);\n }\n }\n\n /**\n * Clears any previous error state\n */\n private clearError(): void {\n this.errorMessage = null;\n this.errorDetails = null;\n }\n\n constructor(\n private viewContainer: ViewContainerRef,\n private cdr: ChangeDetectorRef\n ) {\n super();\n }\n\n override set Data(value: ResourceData) {\n const previousRecordId = super.Data?.ResourceRecordID;\n super.Data = value;\n\n const newRecordId = value?.ResourceRecordID;\n\n // Load on first set, or when the dashboard has changed\n if (!this.dataLoaded || newRecordId !== previousRecordId) {\n this.dataLoaded = true;\n // Destroy previous component before loading new one\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n this.clearError();\n this.configDashboard = null;\n this.viewerInstance = null;\n this.loadDashboard();\n }\n }\n\n // Need to override the getter too in TS otherwise the override to the setter alone above would break things\n override get Data(): ResourceData {\n return super.Data;\n }\n\n ngOnDestroy(): void {\n super.ngOnDestroy();\n if (this.componentRef) {\n this.componentRef.destroy();\n }\n }\n\n // ========================================\n // Edit Mode Methods\n // ========================================\n\n /**\n * Toggle between view and edit mode\n */\n public toggleEditMode(): void {\n if (this.isEditMode) {\n this.cancelEdit();\n } else {\n this.enterEditMode();\n }\n }\n\n /**\n * Enter edit mode\n */\n private enterEditMode(): void {\n if (!this.configDashboard) return;\n\n this.isEditMode = true;\n this.editingName = this.configDashboard.Name;\n this.editingDescription = this.configDashboard.Description || '';\n\n // Tell the viewer to enter edit mode\n if (this.viewerInstance) {\n this.viewerInstance.isEditing = true;\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Cancel edit mode and discard changes\n */\n public cancelEdit(): void {\n this.isEditMode = false;\n\n // Tell the viewer to exit edit mode\n if (this.viewerInstance) {\n this.viewerInstance.isEditing = false;\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Save dashboard changes\n */\n public async saveDashboard(): Promise<void> {\n if (!this.configDashboard || !this.viewerInstance) return;\n\n try {\n // Update dashboard name and description\n this.configDashboard.Name = this.editingName;\n this.configDashboard.Description = this.editingDescription;\n\n // Save via the viewer (which handles layout saving)\n await this.viewerInstance.save();\n\n // Exit edit mode\n this.isEditMode = false;\n this.viewerInstance.isEditing = false;\n\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Error saving dashboard:', error);\n }\n }\n\n /**\n * Open the add panel dialog\n */\n public openAddPartDialog(): void {\n if (this.viewerInstance) {\n // Trigger the viewer's add panel flow\n this.viewerInstance.onAddPanelClick();\n }\n }\n\n /**\n * Open the share dialog for this dashboard\n */\n public openShareDialog(): void {\n this.showShareDialog = true;\n this.cdr.detectChanges();\n }\n\n /**\n * Close the share dialog\n */\n public closeShareDialog(): void {\n this.showShareDialog = false;\n this.cdr.detectChanges();\n }\n\n /**\n * Handle share dialog result\n */\n public onShareDialogResult(result: ShareDialogResult): void {\n this.showShareDialog = false;\n\n if (result.Action === 'save' && this.configDashboard) {\n // Recompute permissions after sharing changes\n const md = this.ProviderToUse;\n this.dashboardPermissions = DashboardEngine.Instance.GetDashboardPermissions(\n this.configDashboard.ID,\n md.CurrentUser.ID\n );\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Load the appropriate dashboard component based on dashboard type\n * Routes between code-based dashboards (registered classes) and config-based dashboards\n */\n private async loadDashboard(): Promise<void> {\n // Clear any previous error state\n this.clearError();\n\n const data = this.Data;\n\n if (!data?.ResourceRecordID) {\n this.NotifyLoadStarted();\n this.NotifyLoadComplete();\n return;\n }\n\n this.NotifyLoadStarted();\n\n try {\n // Check if this is a special dashboard type (not a database record)\n const config = data.Configuration || {};\n\n if (config['dashboardType'] === 'DataExplorer' || data.ResourceRecordID === 'DataExplorer') {\n // Special case: Data Explorer dashboard with optional entity filter\n await this.loadDataExplorer(\n config['entityFilter'],\n config['appName'] as string | undefined,\n config['appIcon'] as string | undefined\n );\n return;\n }\n\n await DashboardEngine.Instance.Config(false); // make sure it is configured, if already configured does nothing\n const dashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, data.ResourceRecordID));\n if (!dashboard) {\n throw new Error(`Dashboard with ID ${data.ResourceRecordID} not found.`);\n }\n\n // Determine which dashboard component to load based on dashboard type\n if (dashboard.Type === 'Code') {\n // CODE-BASED DASHBOARD: Use registered class via DriverClass\n await this.loadCodeBasedDashboard(dashboard);\n } else {\n // CONFIG-BASED DASHBOARD: Use the generic metadata-driven renderer\n await this.loadConfigBasedDashboard(dashboard);\n }\n } catch (error) {\n console.error('Error loading dashboard:', error);\n this.setError('The dashboard could not be loaded. This may be due to a missing component or configuration issue.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load the Data Explorer dashboard component with optional entity filter and context info\n * @param entityFilter Optional filter to constrain which entities are shown\n * @param contextName Optional name to display in the header (e.g., \"CRM\", \"Association Demo\")\n * @param contextIcon Optional Font Awesome icon class for the header\n */\n private async loadDataExplorer(\n entityFilter?: DataExplorerFilter,\n contextName?: string,\n contextIcon?: string\n ): Promise<void> {\n try {\n // Lazy-load the Data Explorer component to keep it out of the initial bundle\n const { DataExplorerDashboardComponent } = await import('@memberjunction/ng-dashboards/data-explorer-dashboards.module');\n this.containerElement.nativeElement.innerHTML = '';\n const componentRef = this.viewContainer.createComponent(DataExplorerDashboardComponent);\n this.componentRef = componentRef;\n const instance = componentRef.instance;\n\n // Scope the child's query-param reads/writes to THIS tab. A dashboard we instantiate\n // ourselves has no ResourceData and therefore no tab id of its own; without this it\n // cannot update the URL at all (BaseResourceComponent refuses tab-less writes rather\n // than corrupting whichever tab the user is viewing). Set before any await below —\n // Angular can run the child's ngOnInit, which binds its param subscription, while we\n // are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Set the entity filter - ngOnInit will use this when it runs\n if (entityFilter) {\n instance.entityFilter = entityFilter;\n }\n\n // Set context name and icon for customized header display\n if (contextName) {\n instance.contextName = contextName;\n }\n if (contextIcon) {\n instance.contextIcon = contextIcon;\n }\n\n // Manually append the component's native element inside the div\n const nativeElement = (componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.containerElement.nativeElement.appendChild(nativeElement);\n\n // Handle open entity record events\n instance.OpenEntityRecord.subscribe((eventData: { EntityName: string; RecordPKey: CompositeKey }) => {\n if (eventData && eventData.EntityName && eventData.RecordPKey) {\n this.navigationService.OpenEntityRecord(eventData.EntityName, eventData.RecordPKey);\n }\n });\n\n // Setup LoadCompleteEvent to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures — but only for the INITIAL load. Wrap the\n // completion hook to learn when the first load has settled, so a later Refresh() that\n // fails does NOT replace an already-rendered Data Explorer with a sticky error card.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError('The Data Explorer could not be loaded.', err);\n this.cdr.markForCheck();\n });\n\n // Initialize dashboard (no database config needed for DataExplorer)\n const config: DashboardConfig = {\n dashboard: null as unknown as MJDashboardEntity, // No database record\n userState: {}\n };\n instance.Config = config;\n instance.Refresh();\n\n // Trigger change detection to ensure the component updates\n componentRef.changeDetectorRef.detectChanges();\n } catch (error) {\n console.error('Error loading Data Explorer:', error);\n this.setError('The Data Explorer could not be loaded.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load a code-based dashboard by looking up the registered class\n */\n private async loadCodeBasedDashboard(dashboard: MJDashboardEntity): Promise<void> {\n try {\n if (!dashboard.DriverClass) {\n throw new Error(`Dashboard '${dashboard.Name}' is marked as Code type but has no DriverClass specified`);\n }\n\n // Look up the registered class using the DriverClass name (with lazy loading fallback via ClassFactory)\n const classReg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(\n BaseDashboard,\n dashboard.DriverClass\n );\n\n if (!classReg?.SubClass) {\n throw new Error(`Dashboard class '${dashboard.DriverClass}' is not registered. Please check the class registration.`);\n }\n\n // Create the component instance\n this.containerElement.nativeElement.innerHTML = '';\n this.componentRef = this.viewContainer.createComponent<BaseDashboard>(classReg.SubClass);\n const instance = this.componentRef.instance as BaseDashboard;\n\n // Scope the child's query-param reads/writes to THIS tab. Code dashboards resolved via\n // ClassFactory (every Open App dashboard, MCPDashboard, DataExplorer) get no\n // ResourceData and so have no tab id of their own; without this their UpdateQueryParams\n // calls are refused (and previously — worse — landed in whatever tab the user happened\n // to be looking at). Set before the awaits below: Angular can run the child's ngOnInit,\n // which binds its param subscription, while we are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Setup LoadCompleteEvent() to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures in the host's error card — but only for the\n // INITIAL load. BaseDashboard guarantees the loading screen is released even when\n // initDashboard()/loadData() throws (it emits Error, then NotifyLoadComplete in a\n // finally). Wrap the completion hook to learn when the first load has settled, so a later\n // Refresh() failure keeps the rendered dashboard instead of blanking it to a sticky error\n // card. Wired BEFORE the first await below, so an Error during the instance's own\n // ngOnInit isn't missed.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded.`, err);\n this.cdr.markForCheck();\n });\n\n // Initialize with dashboard data\n const userStateEntity = await this.loadDashboardUserState(dashboard.ID);\n const config: DashboardConfig = {\n dashboard,\n userState: userStateEntity.UserState ? SafeJSONParse(userStateEntity.UserState) : {}\n };\n\n instance.Config = config;\n\n // Manually append the component's native element inside the div\n const nativeElement = (this.componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.containerElement.nativeElement.appendChild(nativeElement);\n\n // handle open entity record events in MJ Explorer with routing\n instance.OpenEntityRecord.subscribe((data: { EntityName: string; RecordPKey: CompositeKey }) => {\n // check to see if the data has entityname/pkey\n if (data && data.EntityName && data.RecordPKey) {\n // Use NavigationService to open entity record in new tab\n this.navigationService.OpenEntityRecord(data.EntityName, data.RecordPKey);\n } else {\n console.warn('DashboardResource - invalid data, missing EntityName or RecordPKey:', data);\n }\n });\n\n instance.UserStateChanged.subscribe(async (userState: any) => {\n if (!userState) {\n // if the user state is null, we need to remove it from the user state\n userState = {};\n }\n // save the user state to the dashboard user state entity\n userStateEntity.UserState = JSON.stringify(userState);\n if (!await userStateEntity.Save()) {\n LogError('Error saving user state', null, userStateEntity.LatestResult?.CompleteMessage);\n }\n });\n\n instance.Refresh();\n } catch (error) {\n console.error('Error loading code-based dashboard:', error);\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded. The dashboard class may not be registered or may have failed to initialize.`, error);\n this.NotifyLoadComplete();\n }\n }\n\n protected async loadDashboardUserState(dashboardId: string): Promise<MJDashboardUserStateEntity> {\n // handle user state changes for the dashboard\n const md = this.ProviderToUse;\n const stateResult = DashboardEngine.Instance.DashboardUserStates.filter(dus => UUIDsEqual(dus.DashboardID, dashboardId) && UUIDsEqual(dus.UserID, md.CurrentUser.ID));\n let stateObject: MJDashboardUserStateEntity;\n if (stateResult && stateResult.length > 0) {\n stateObject = stateResult[0];\n }\n else {\n stateObject = await md.GetEntityObject<MJDashboardUserStateEntity>('MJ: Dashboard User States');\n stateObject.DashboardID = dashboardId;\n stateObject.UserID = md.CurrentUser.ID;\n // don't save becuase we don't care about the state until something changes\n }\n return stateObject;\n }\n\n /**\n * Load a config-based dashboard using the new DashboardViewerComponent (Golden Layout)\n */\n private async loadConfigBasedDashboard(dashboard: MJDashboardEntity): Promise<void> {\n try {\n this.containerElement.nativeElement.innerHTML = '';\n const componentRef = this.viewContainer.createComponent(DashboardViewerComponent);\n this.componentRef = componentRef;\n const instance = componentRef.instance;\n\n // Store references for external toolbar control\n this.viewerInstance = instance;\n this.configDashboard = dashboard;\n\n // Compute user permissions for this dashboard\n const md = this.ProviderToUse;\n this.dashboardPermissions = DashboardEngine.Instance.GetDashboardPermissions(\n dashboard.ID,\n md.CurrentUser.ID\n );\n\n // Manually append the component's native element inside the div\n const nativeElement = (this.componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.containerElement.nativeElement.appendChild(nativeElement);\n\n // Load categories for breadcrumb navigation (if not already loaded)\n if (this.categories.length === 0) {\n this.categories = DashboardEngine.Instance.DashboardCategories;\n }\n\n // Configure the viewer before assigning the dashboard. The dashboard input\n // starts the layout lifecycle synchronously, so event handlers need to be\n // wired first.\n instance.showToolbar = false; // We provide external toolbar\n instance.showBreadcrumb = false; // Already in its own tab, no breadcrumb needed\n instance.showOpenInTabButton = false; // Already in its own tab\n instance.showEditButton = false; // External toolbar handles edit\n instance.Categories = this.categories;\n\n // Wire up navigation events - handle navigation requests from the dashboard\n instance.navigationRequested.subscribe((event: DashboardNavRequestEvent) => {\n this.handleNavigationRequest(event);\n });\n\n // Wire up \"Open in Tab\" button click\n instance.openInTab.subscribe((event: { dashboardId: string; dashboardName: string }) => {\n this.navigationService.OpenDashboard(event.dashboardId, event.dashboardName);\n });\n\n // Wire up dashboard saved event\n instance.dashboardSaved.subscribe((savedDashboard: MJDashboardEntity) => {\n this.ResourceRecordSaved(savedDashboard);\n });\n\n // Wire up error events\n instance.error.subscribe((errorEvent: { message: string; error?: Error }) => {\n console.error('Dashboard error:', errorEvent.message, errorEvent.error);\n });\n\n // Set the dashboard entity directly on the viewer and wait for Golden Layout\n // to initialize against a real container before clearing the resource loader.\n instance.dashboard = dashboard;\n await instance.waitForLayoutReady();\n this.NotifyLoadComplete();\n this.cdr.detectChanges();\n\n } catch (error) {\n console.error('Error loading config-based dashboard:', error);\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded. There may be an issue with the dashboard configuration.`, error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Handle navigation requests from the dashboard viewer\n */\n private handleNavigationRequest(event: DashboardNavRequestEvent): void {\n const request = event.request;\n\n switch (request.type) {\n case 'OpenEntityRecord': {\n const entityRequest = request as { type: 'OpenEntityRecord'; entityName: string; recordId: string };\n // `recordId` is documented as URL-segment format (see OpenEntityRecordNavRequest in\n // @memberjunction/ng-dashboard-viewer). E.g. a single-PK record is `\"ID|11055\"`; a\n // composite-PK record is `\"Field1|Value1||Field2|Value2\"`. Senders in\n // dashboard-viewer (artifact-part, view-part) intentionally call\n // `compositeKey.ToURLSegment()` to produce this shape.\n //\n // Wrapping that string verbatim into `{ FieldName: 'ID', Value: <segment> }` makes\n // ToURLSegment serialize it a second time as `ID|<segment>` and produces a\n // malformed `Field|Field|Value` URL the host parser silently mis-reads (manifesting\n // downstream as `BaseEntity.Load(... Key: ID=ID)` and `Primary Key value is not a\n // valid number`). Parse the segment with `LoadFromURLSegment` against the entity's\n // PK metadata instead, so single-PK and composite-PK both round-trip correctly.\n const md = this.ProviderToUse;\n const entityInfo = md.EntityByName(entityRequest.entityName);\n const pkey = new CompositeKey();\n if (entityInfo) {\n pkey.LoadFromURLSegment(entityInfo, entityRequest.recordId);\n } else {\n // Last-resort fallback when entity metadata isn't resolvable — preserves\n // pre-fix behavior so we don't NRE on an unknown entity name.\n pkey.KeyValuePairs = [{ FieldName: 'ID', Value: entityRequest.recordId }];\n }\n this.navigationService.OpenEntityRecord(entityRequest.entityName, pkey);\n break;\n }\n case 'OpenDashboard': {\n const dashRequest = request as { type: 'OpenDashboard'; dashboardId: string };\n // Load dashboard name from engine cache\n const targetDashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, dashRequest.dashboardId));\n const name = targetDashboard?.Name || 'Dashboard';\n this.navigationService.OpenDashboard(dashRequest.dashboardId, name);\n break;\n }\n case 'OpenQuery': {\n const queryRequest = request as { type: 'OpenQuery'; queryId: string };\n this.navigationService.OpenQuery(queryRequest.queryId, 'Query');\n break;\n }\n default:\n console.warn('Unhandled navigation request type:', request.type);\n }\n }\n\n /**\n * Get the display name for a dashboard resource\n * Loads the actual dashboard name from the database if available\n */\n override async GetResourceDisplayName(data: ResourceData): Promise<string> {\n try {\n // Try to load dashboard metadata if we have the record ID\n if (data.ResourceRecordID && data.ResourceRecordID.length > 0) {\n const md = this.ProviderToUse;\n const compositeKey = new CompositeKey([{ FieldName: 'ID', Value: data.ResourceRecordID }]);\n const name = await md.GetEntityRecordName('Dashboards', compositeKey);\n if (name) {\n return name;\n }\n }\n } catch (error) {\n // Silently fail and use fallback\n }\n\n // Fallback: use provided name or generic label\n return data.Name || 'Dashboard';\n }\n\n /**\n * Get the icon class for dashboard resources\n */\n async GetResourceIconClass(data: ResourceData): Promise<string> {\n return 'fa-solid fa-table-columns';\n }\n}\n"]}
1
+ {"version":3,"file":"dashboard-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/dashboard-resource.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EA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W,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oBAAoB,CAAC,IAAkB;QACzC,OAAO,2BAA2B,CAAC;IACvC,CAAC;2GAxnBQ,iBAAiB;6DAAjB,iBAAiB;;;;;;YAvYtB,8BAAwC;YAEpC,mFAAoB;YAiBpB,mFAAuD;YAmCvD,oFAAsD;YAkCtD,4BAA2D;YAG3D,yGAAuB;YAO3B,iBAAM;;YAhGF,cAcC;YAdD,2CAcC;YAGD,cAgCC;YAhCD,sFAgCC;YAGD,cA+BC;YA/BD,qFA+BC;YAMD,eAMC;YAND,8CAMC;;;AAsSA,iBAAiB;IA5Y7B,aAAa,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;GA4Y7C,iBAAiB,CAynB7B;;iFAznBY,iBAAiB;cA3Y7B,SAAS;6BACI,KAAK,YACL,uBAAuB,YACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoGT;;kBAiTA,SAAS;mBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAb/B,iBAAiB","sourcesContent":["import { Component, ViewContainerRef, ComponentRef, ViewChild, ElementRef, ChangeDetectorRef, inject } from '@angular/core';\nimport { BaseResourceComponent, NavigationService, BaseDashboard, DashboardConfig } from '@memberjunction/ng-shared';\nimport { ResourceData, MJDashboardEntity, DashboardEngine, MJDashboardUserStateEntity, MJDashboardCategoryEntity, MJDashboardPartTypeEntity, DashboardUserPermissions } from '@memberjunction/core-entities';\nimport { RegisterClass, MJGlobal, SafeJSONParse , UUIDsEqual } from '@memberjunction/global';\nimport { Metadata, CompositeKey, RunView, LogError } from '@memberjunction/core';\nimport type { DataExplorerFilter } from '@memberjunction/ng-dashboards/data-explorer-dashboards.module';\nimport type { ShareDialogResult } from '@memberjunction/ng-dashboards/core-dashboards.module';\nimport { DashboardViewerComponent, DashboardNavRequestEvent, PanelInteractionEvent, AddPanelResult, DashboardPanel } from '@memberjunction/ng-dashboard-viewer';\n/**\n * Dashboard Resource Wrapper - displays a single dashboard in a tab\n * Extends BaseResourceComponent to work with the resource type system\n * Dynamically routes between code-based and config-based dashboards based on dashboard type\n */\n@RegisterClass(BaseResourceComponent, 'DashboardResource')\n@Component({\n standalone: false,\n selector: 'mj-dashboard-resource',\n template: `\n <div class=\"dashboard-resource-wrapper\">\n <!-- Error State -->\n @if (errorMessage) {\n <div class=\"error-state\">\n <div class=\"error-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h2 class=\"error-title\">Unable to Load Dashboard</h2>\n <p class=\"error-message\">{{ errorMessage }}</p>\n @if (errorDetails) {\n <details class=\"error-details\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n }\n\n <!-- View Mode Toolbar -->\n @if (configDashboard && !isEditMode && !errorMessage) {\n <div class=\"viewer-toolbar\">\n <div class=\"toolbar-left\">\n <span class=\"dashboard-title\">\n <i class=\"fa-solid fa-chart-line\"></i>\n {{ configDashboard.Name }}\n </span>\n @if (!dashboardPermissions.IsOwner && dashboardPermissions.PermissionSource !== 'none') {\n <span class=\"shared-indicator\" title=\"Shared with you\">\n <i class=\"fa-solid fa-share-nodes\"></i>\n </span>\n }\n </div>\n <div class=\"toolbar-actions\">\n @if (dashboardPermissions.CanShare) {\n <button\n class=\"btn-icon\"\n title=\"Share Dashboard\"\n (click)=\"openShareDialog()\">\n <i class=\"fa-solid fa-share-nodes\"></i>\n </button>\n }\n @if (dashboardPermissions.CanEdit) {\n <button\n class=\"btn-icon\"\n title=\"Edit Dashboard\"\n (click)=\"toggleEditMode()\">\n <i class=\"fa-solid fa-edit\"></i>\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Edit Mode Toolbar -->\n @if (configDashboard && isEditMode && !errorMessage) {\n <div class=\"viewer-header editing\">\n <div class=\"header-left\">\n <button class=\"btn-add-part\" (click)=\"openAddPartDialog()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Part\n </button>\n <div class=\"header-separator\"></div>\n <div class=\"dashboard-info-edit\">\n <input\n type=\"text\"\n class=\"dashboard-name-input\"\n [(ngModel)]=\"editingName\"\n placeholder=\"Dashboard name\">\n <input\n type=\"text\"\n class=\"dashboard-description-input\"\n [(ngModel)]=\"editingDescription\"\n placeholder=\"Add a description...\">\n </div>\n </div>\n <div class=\"header-right\">\n <button class=\"btn-primary\" (click)=\"saveDashboard()\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n <button class=\"btn-cancel\" (click)=\"cancelEdit()\">\n Cancel\n </button>\n </div>\n </div>\n }\n\n <!-- Dashboard Content Container -->\n <div #container class=\"dashboard-resource-container\"></div>\n\n <!-- Share Dashboard Dialog -->\n @if (configDashboard) {\n <mj-dashboard-share-dialog\n [Visible]=\"showShareDialog\"\n [Dashboard]=\"configDashboard\"\n (Result)=\"onShareDialogResult($event)\">\n </mj-dashboard-share-dialog>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .dashboard-resource-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n }\n .dashboard-resource-container {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n }\n\n /* View Mode Toolbar */\n .viewer-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n gap: 16px;\n }\n .viewer-toolbar .toolbar-left {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n .viewer-toolbar .dashboard-title {\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .viewer-toolbar .dashboard-title i {\n color: var(--mj-brand-primary);\n }\n .shared-indicator {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 11px;\n }\n .viewer-toolbar .toolbar-actions {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n /* Edit Mode Header */\n .viewer-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n transition: background 0.2s, border-color 0.2s;\n }\n .viewer-header.editing {\n background: linear-gradient(135deg, color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface)) 0%, color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface)) 100%);\n border-bottom: 2px solid var(--mj-brand-primary);\n }\n .viewer-header .header-left {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n }\n .viewer-header .header-right {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n /* Add Part button */\n .btn-add-part {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s, transform 0.1s;\n box-shadow: 0 2px 4px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n }\n .btn-add-part:hover {\n background: var(--mj-brand-primary-hover);\n transform: translateY(-1px);\n box-shadow: 0 3px 6px color-mix(in srgb, var(--mj-brand-primary) 40%, transparent);\n }\n .btn-add-part i { font-size: 12px; }\n\n /* Header separator */\n .header-separator {\n width: 1px;\n height: 28px;\n background: color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n margin: 0 4px;\n }\n\n /* Buttons */\n .btn-primary {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n .btn-primary:hover { background: var(--mj-brand-primary-hover); }\n\n .btn-icon {\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-icon:hover { background: var(--mj-bg-surface-sunken); }\n\n .btn-cancel {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-cancel:hover {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n color: var(--mj-text-primary);\n }\n\n /* Dashboard info inputs */\n .dashboard-info-edit {\n display: flex;\n align-items: center;\n gap: 16px;\n flex: 1;\n }\n .dashboard-name-input {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n background: rgba(255, 255, 255, 0.7);\n outline: none;\n min-width: 200px;\n max-width: 300px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-name-input:hover { background: rgba(255, 255, 255, 0.9); }\n .dashboard-name-input:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n background: rgba(255, 255, 255, 0.5);\n outline: none;\n flex: 1;\n min-width: 150px;\n max-width: 400px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-description-input:hover { background: rgba(255, 255, 255, 0.8); }\n .dashboard-description-input:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input::placeholder {\n color: var(--mj-text-muted);\n font-style: normal;\n }\n\n /* Error state */\n .error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .error-icon {\n font-size: 64px;\n color: var(--mj-status-error);\n margin-bottom: 24px;\n opacity: 0.8;\n }\n .error-title {\n font-size: 24px;\n font-weight: 500;\n margin: 0 0 12px 0;\n color: var(--mj-text-primary);\n }\n .error-message {\n font-size: 16px;\n color: var(--mj-text-muted);\n margin: 0 0 24px 0;\n max-width: 500px;\n line-height: 1.5;\n }\n .error-details {\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n padding: 12px 16px;\n max-width: 600px;\n text-align: left;\n font-size: 13px;\n }\n .error-details summary {\n cursor: pointer;\n font-weight: 500;\n color: var(--mj-text-muted);\n margin-bottom: 8px;\n }\n .error-details pre {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--mj-status-error-text);\n font-family: 'Consolas', 'Monaco', monospace;\n font-size: 12px;\n }\n\n /* Responsive */\n @media (max-width: 768px) {\n .viewer-header {\n flex-direction: column;\n gap: 12px;\n align-items: stretch;\n }\n .viewer-header .header-left { flex-wrap: wrap; }\n .dashboard-info-edit {\n flex-direction: column;\n align-items: stretch;\n }\n .dashboard-name-input,\n .dashboard-description-input { max-width: none; }\n }\n `]\n})\nexport class DashboardResource extends BaseResourceComponent {\n private componentRef: ComponentRef<unknown> | null = null;\n\n /**\n * A cache reattach moves this wrapper to another tab without recreating the dashboard inside it,\n * so the child's tab stamp — taken when we created it — has to move too. Without this the\n * dashboard keeps reading and writing the params of the tab it was born in, from inside a tab it\n * no longer belongs to.\n */\n protected override onTabIdRebound(tabId: string): void {\n this.rehomeChildToTab(this.componentRef?.instance as BaseResourceComponent | undefined, tabId);\n }\n private dataLoaded = false;\n @ViewChild('container', { static: true }) containerElement!: ElementRef<HTMLDivElement>;\n\n /** Error message to display when dashboard fails to load */\n public errorMessage: string | null = null;\n /** Technical error details (shown in expandable section) */\n public errorDetails: string | null = null;\n\n /** Cached dashboard categories for breadcrumb navigation */\n private categories: MJDashboardCategoryEntity[] = [];\n\n /** Reference to the dashboard viewer component (for config-based dashboards) */\n private viewerInstance: DashboardViewerComponent | null = null;\n\n /** The config-based dashboard entity (null for code-based dashboards) */\n public configDashboard: MJDashboardEntity | null = null;\n\n /** Whether we're in edit mode */\n public isEditMode = false;\n\n /** Editing fields */\n public editingName = '';\n public editingDescription = '';\n\n /** Current user's permissions for this dashboard */\n public dashboardPermissions: DashboardUserPermissions = {\n DashboardID: '',\n CanRead: true,\n CanEdit: true,\n CanDelete: true,\n CanShare: true,\n IsOwner: true,\n PermissionSource: 'owner'\n };\n\n /** Whether the share dialog is visible */\n public showShareDialog = false;\n\n /**\n * Sets the error state with a user-friendly message and optional technical details\n */\n private setError(message: string, error?: unknown): void {\n this.errorMessage = message;\n if (error instanceof Error) {\n this.errorDetails = error.message;\n if (error.stack) {\n this.errorDetails += '\\n\\nStack trace:\\n' + error.stack;\n }\n } else if (error) {\n this.errorDetails = String(error);\n }\n }\n\n /**\n * Clears any previous error state\n */\n private clearError(): void {\n this.errorMessage = null;\n this.errorDetails = null;\n }\n\n constructor(\n private viewContainer: ViewContainerRef,\n private cdr: ChangeDetectorRef\n ) {\n super();\n }\n\n override set Data(value: ResourceData) {\n const previousRecordId = super.Data?.ResourceRecordID;\n super.Data = value;\n\n const newRecordId = value?.ResourceRecordID;\n\n // Load on first set, or when the dashboard has changed\n if (!this.dataLoaded || newRecordId !== previousRecordId) {\n this.dataLoaded = true;\n // Destroy previous component before loading new one\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n this.clearError();\n this.configDashboard = null;\n this.viewerInstance = null;\n this.loadDashboard();\n }\n }\n\n // Need to override the getter too in TS otherwise the override to the setter alone above would break things\n override get Data(): ResourceData {\n return super.Data;\n }\n\n ngOnDestroy(): void {\n super.ngOnDestroy();\n if (this.componentRef) {\n this.componentRef.destroy();\n }\n }\n\n // ========================================\n // Edit Mode Methods\n // ========================================\n\n /**\n * Toggle between view and edit mode\n */\n public toggleEditMode(): void {\n if (this.isEditMode) {\n this.cancelEdit();\n } else {\n this.enterEditMode();\n }\n }\n\n /**\n * Enter edit mode\n */\n private enterEditMode(): void {\n if (!this.configDashboard) return;\n\n this.isEditMode = true;\n this.editingName = this.configDashboard.Name;\n this.editingDescription = this.configDashboard.Description || '';\n\n // Tell the viewer to enter edit mode\n if (this.viewerInstance) {\n this.viewerInstance.isEditing = true;\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Cancel edit mode and discard changes\n */\n public cancelEdit(): void {\n this.isEditMode = false;\n\n // Tell the viewer to exit edit mode\n if (this.viewerInstance) {\n this.viewerInstance.isEditing = false;\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Save dashboard changes\n */\n public async saveDashboard(): Promise<void> {\n if (!this.configDashboard || !this.viewerInstance) return;\n\n try {\n // Update dashboard name and description\n this.configDashboard.Name = this.editingName;\n this.configDashboard.Description = this.editingDescription;\n\n // Save via the viewer (which handles layout saving)\n await this.viewerInstance.save();\n\n // Exit edit mode\n this.isEditMode = false;\n this.viewerInstance.isEditing = false;\n\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Error saving dashboard:', error);\n }\n }\n\n /**\n * Open the add panel dialog\n */\n public openAddPartDialog(): void {\n if (this.viewerInstance) {\n // Trigger the viewer's add panel flow\n this.viewerInstance.onAddPanelClick();\n }\n }\n\n /**\n * Open the share dialog for this dashboard\n */\n public openShareDialog(): void {\n this.showShareDialog = true;\n this.cdr.detectChanges();\n }\n\n /**\n * Close the share dialog\n */\n public closeShareDialog(): void {\n this.showShareDialog = false;\n this.cdr.detectChanges();\n }\n\n /**\n * Handle share dialog result\n */\n public onShareDialogResult(result: ShareDialogResult): void {\n this.showShareDialog = false;\n\n if (result.Action === 'save' && this.configDashboard) {\n // Recompute permissions after sharing changes\n const md = this.ProviderToUse;\n this.dashboardPermissions = DashboardEngine.Instance.GetDashboardPermissions(\n this.configDashboard.ID,\n md.CurrentUser.ID\n );\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Load the appropriate dashboard component based on dashboard type\n * Routes between code-based dashboards (registered classes) and config-based dashboards\n */\n private async loadDashboard(): Promise<void> {\n // Clear any previous error state\n this.clearError();\n\n const data = this.Data;\n\n if (!data?.ResourceRecordID) {\n this.NotifyLoadStarted();\n this.NotifyLoadComplete();\n return;\n }\n\n this.NotifyLoadStarted();\n\n try {\n // Check if this is a special dashboard type (not a database record)\n const config = data.Configuration || {};\n\n if (config['dashboardType'] === 'DataExplorer' || data.ResourceRecordID === 'DataExplorer') {\n // Special case: Data Explorer dashboard with optional entity filter\n await this.loadDataExplorer(\n config['entityFilter'],\n config['appName'] as string | undefined,\n config['appIcon'] as string | undefined\n );\n return;\n }\n\n await DashboardEngine.Instance.Config(false); // make sure it is configured, if already configured does nothing\n const dashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, data.ResourceRecordID));\n if (!dashboard) {\n throw new Error(`Dashboard with ID ${data.ResourceRecordID} not found.`);\n }\n\n // Determine which dashboard component to load based on dashboard type\n if (dashboard.Type === 'Code') {\n // CODE-BASED DASHBOARD: Use registered class via DriverClass\n await this.loadCodeBasedDashboard(dashboard);\n } else {\n // CONFIG-BASED DASHBOARD: Use the generic metadata-driven renderer\n await this.loadConfigBasedDashboard(dashboard);\n }\n } catch (error) {\n console.error('Error loading dashboard:', error);\n this.setError('The dashboard could not be loaded. This may be due to a missing component or configuration issue.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load the Data Explorer dashboard component with optional entity filter and context info\n * @param entityFilter Optional filter to constrain which entities are shown\n * @param contextName Optional name to display in the header (e.g., \"CRM\", \"Association Demo\")\n * @param contextIcon Optional Font Awesome icon class for the header\n */\n private async loadDataExplorer(\n entityFilter?: DataExplorerFilter,\n contextName?: string,\n contextIcon?: string\n ): Promise<void> {\n try {\n // Lazy-load the Data Explorer component to keep it out of the initial bundle\n const { DataExplorerDashboardComponent } = await import('@memberjunction/ng-dashboards/data-explorer-dashboards.module');\n this.containerElement.nativeElement.innerHTML = '';\n const componentRef = this.viewContainer.createComponent(DataExplorerDashboardComponent);\n this.componentRef = componentRef;\n const instance = componentRef.instance;\n\n // Scope the child's query-param reads/writes to THIS tab. A dashboard we instantiate\n // ourselves has no ResourceData and therefore no tab id of its own; without this it\n // cannot update the URL at all (BaseResourceComponent refuses tab-less writes rather\n // than corrupting whichever tab the user is viewing). Set before any await below —\n // Angular can run the child's ngOnInit, which binds its param subscription, while we\n // are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Set the entity filter - ngOnInit will use this when it runs\n if (entityFilter) {\n instance.entityFilter = entityFilter;\n }\n\n // Set context name and icon for customized header display\n if (contextName) {\n instance.contextName = contextName;\n }\n if (contextIcon) {\n instance.contextIcon = contextIcon;\n }\n\n // Manually append the component's native element inside the div\n const nativeElement = (componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.containerElement.nativeElement.appendChild(nativeElement);\n\n // Handle open entity record events\n instance.OpenEntityRecord.subscribe((eventData: { EntityName: string; RecordPKey: CompositeKey }) => {\n if (eventData && eventData.EntityName && eventData.RecordPKey) {\n this.navigationService.OpenEntityRecord(eventData.EntityName, eventData.RecordPKey);\n }\n });\n\n // Setup LoadCompleteEvent to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures — but only for the INITIAL load. Wrap the\n // completion hook to learn when the first load has settled, so a later Refresh() that\n // fails does NOT replace an already-rendered Data Explorer with a sticky error card.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError('The Data Explorer could not be loaded.', err);\n this.cdr.markForCheck();\n });\n\n // Initialize dashboard (no database config needed for DataExplorer)\n const config: DashboardConfig = {\n dashboard: null as unknown as MJDashboardEntity, // No database record\n userState: {}\n };\n instance.Config = config;\n instance.Refresh();\n\n // Trigger change detection to ensure the component updates\n componentRef.changeDetectorRef.detectChanges();\n } catch (error) {\n console.error('Error loading Data Explorer:', error);\n this.setError('The Data Explorer could not be loaded.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load a code-based dashboard by looking up the registered class\n */\n private async loadCodeBasedDashboard(dashboard: MJDashboardEntity): Promise<void> {\n try {\n if (!dashboard.DriverClass) {\n throw new Error(`Dashboard '${dashboard.Name}' is marked as Code type but has no DriverClass specified`);\n }\n\n // Look up the registered class using the DriverClass name (with lazy loading fallback via ClassFactory)\n const classReg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(\n BaseDashboard,\n dashboard.DriverClass\n );\n\n if (!classReg?.SubClass) {\n throw new Error(`Dashboard class '${dashboard.DriverClass}' is not registered. Please check the class registration.`);\n }\n\n // Create the component instance\n this.containerElement.nativeElement.innerHTML = '';\n this.componentRef = this.viewContainer.createComponent<BaseDashboard>(classReg.SubClass);\n const instance = this.componentRef.instance as BaseDashboard;\n\n // Scope the child's query-param reads/writes to THIS tab. Code dashboards resolved via\n // ClassFactory (every Open App dashboard, MCPDashboard, DataExplorer) get no\n // ResourceData and so have no tab id of their own; without this their UpdateQueryParams\n // calls are refused (and previously — worse — landed in whatever tab the user happened\n // to be looking at). Set before the awaits below: Angular can run the child's ngOnInit,\n // which binds its param subscription, while we are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Setup LoadCompleteEvent() to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures in the host's error card — but only for the\n // INITIAL load. BaseDashboard guarantees the loading screen is released even when\n // initDashboard()/loadData() throws (it emits Error, then NotifyLoadComplete in a\n // finally). Wrap the completion hook to learn when the first load has settled, so a later\n // Refresh() failure keeps the rendered dashboard instead of blanking it to a sticky error\n // card. Wired BEFORE the first await below, so an Error during the instance's own\n // ngOnInit isn't missed.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded.`, err);\n this.cdr.markForCheck();\n });\n\n // Initialize with dashboard data\n const userStateEntity = await this.loadDashboardUserState(dashboard.ID);\n const config: DashboardConfig = {\n dashboard,\n userState: userStateEntity.UserState ? SafeJSONParse(userStateEntity.UserState) : {}\n };\n\n instance.Config = config;\n\n // Manually append the component's native element inside the div\n const nativeElement = (this.componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.containerElement.nativeElement.appendChild(nativeElement);\n\n // handle open entity record events in MJ Explorer with routing\n instance.OpenEntityRecord.subscribe((data: { EntityName: string; RecordPKey: CompositeKey }) => {\n // check to see if the data has entityname/pkey\n if (data && data.EntityName && data.RecordPKey) {\n // Use NavigationService to open entity record in new tab\n this.navigationService.OpenEntityRecord(data.EntityName, data.RecordPKey);\n } else {\n console.warn('DashboardResource - invalid data, missing EntityName or RecordPKey:', data);\n }\n });\n\n instance.UserStateChanged.subscribe(async (userState: any) => {\n if (!userState) {\n // if the user state is null, we need to remove it from the user state\n userState = {};\n }\n // save the user state to the dashboard user state entity\n userStateEntity.UserState = JSON.stringify(userState);\n if (!await userStateEntity.Save()) {\n LogError('Error saving user state', null, userStateEntity.LatestResult?.CompleteMessage);\n }\n });\n\n instance.Refresh();\n } catch (error) {\n console.error('Error loading code-based dashboard:', error);\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded. The dashboard class may not be registered or may have failed to initialize.`, error);\n this.NotifyLoadComplete();\n }\n }\n\n protected async loadDashboardUserState(dashboardId: string): Promise<MJDashboardUserStateEntity> {\n // handle user state changes for the dashboard\n const md = this.ProviderToUse;\n const stateResult = DashboardEngine.Instance.DashboardUserStates.filter(dus => UUIDsEqual(dus.DashboardID, dashboardId) && UUIDsEqual(dus.UserID, md.CurrentUser.ID));\n let stateObject: MJDashboardUserStateEntity;\n if (stateResult && stateResult.length > 0) {\n stateObject = stateResult[0];\n }\n else {\n stateObject = await md.GetEntityObject<MJDashboardUserStateEntity>('MJ: Dashboard User States');\n stateObject.DashboardID = dashboardId;\n stateObject.UserID = md.CurrentUser.ID;\n // don't save becuase we don't care about the state until something changes\n }\n return stateObject;\n }\n\n /**\n * Load a config-based dashboard using the new DashboardViewerComponent (Golden Layout)\n */\n private async loadConfigBasedDashboard(dashboard: MJDashboardEntity): Promise<void> {\n try {\n this.containerElement.nativeElement.innerHTML = '';\n const componentRef = this.viewContainer.createComponent(DashboardViewerComponent);\n this.componentRef = componentRef;\n const instance = componentRef.instance;\n\n // Store references for external toolbar control\n this.viewerInstance = instance;\n this.configDashboard = dashboard;\n\n // Compute user permissions for this dashboard\n const md = this.ProviderToUse;\n this.dashboardPermissions = DashboardEngine.Instance.GetDashboardPermissions(\n dashboard.ID,\n md.CurrentUser.ID\n );\n\n // Manually append the component's native element inside the div\n const nativeElement = (this.componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.containerElement.nativeElement.appendChild(nativeElement);\n\n // Load categories for breadcrumb navigation (if not already loaded)\n if (this.categories.length === 0) {\n this.categories = DashboardEngine.Instance.DashboardCategories;\n }\n\n // Configure the viewer before assigning the dashboard. The dashboard input\n // starts the layout lifecycle synchronously, so event handlers need to be\n // wired first.\n instance.showToolbar = false; // We provide external toolbar\n instance.showBreadcrumb = false; // Already in its own tab, no breadcrumb needed\n instance.showOpenInTabButton = false; // Already in its own tab\n instance.showEditButton = false; // External toolbar handles edit\n instance.Categories = this.categories;\n\n // Wire up navigation events - handle navigation requests from the dashboard\n instance.navigationRequested.subscribe((event: DashboardNavRequestEvent) => {\n this.handleNavigationRequest(event);\n });\n\n // Wire up \"Open in Tab\" button click\n instance.openInTab.subscribe((event: { dashboardId: string; dashboardName: string }) => {\n this.navigationService.OpenDashboard(event.dashboardId, event.dashboardName);\n });\n\n // Wire up dashboard saved event\n instance.dashboardSaved.subscribe((savedDashboard: MJDashboardEntity) => {\n this.ResourceRecordSaved(savedDashboard);\n });\n\n // Wire up error events\n instance.error.subscribe((errorEvent: { message: string; error?: Error }) => {\n console.error('Dashboard error:', errorEvent.message, errorEvent.error);\n });\n\n // Set the dashboard entity directly on the viewer and wait for Golden Layout\n // to initialize against a real container before clearing the resource loader.\n instance.dashboard = dashboard;\n await instance.waitForLayoutReady();\n this.NotifyLoadComplete();\n this.cdr.detectChanges();\n\n } catch (error) {\n console.error('Error loading config-based dashboard:', error);\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded. There may be an issue with the dashboard configuration.`, error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Handle navigation requests from the dashboard viewer\n */\n private handleNavigationRequest(event: DashboardNavRequestEvent): void {\n const request = event.request;\n\n switch (request.type) {\n case 'OpenEntityRecord': {\n const entityRequest = request as { type: 'OpenEntityRecord'; entityName: string; recordId: string };\n // `recordId` is documented as URL-segment format (see OpenEntityRecordNavRequest in\n // @memberjunction/ng-dashboard-viewer). E.g. a single-PK record is `\"ID|11055\"`; a\n // composite-PK record is `\"Field1|Value1||Field2|Value2\"`. Senders in\n // dashboard-viewer (artifact-part, view-part) intentionally call\n // `compositeKey.ToURLSegment()` to produce this shape.\n //\n // Wrapping that string verbatim into `{ FieldName: 'ID', Value: <segment> }` makes\n // ToURLSegment serialize it a second time as `ID|<segment>` and produces a\n // malformed `Field|Field|Value` URL the host parser silently mis-reads (manifesting\n // downstream as `BaseEntity.Load(... Key: ID=ID)` and `Primary Key value is not a\n // valid number`). Parse the segment with `FromURLSegment` against the entity's PK\n // metadata instead, so single-PK and composite-PK both round-trip correctly (it also\n // owns the last-resort `ID` fallback for an entity name metadata can't resolve).\n const md = this.ProviderToUse;\n const pkey = CompositeKey.FromURLSegment(md.EntityByName(entityRequest.entityName), entityRequest.recordId);\n this.navigationService.OpenEntityRecord(entityRequest.entityName, pkey);\n break;\n }\n case 'OpenDashboard': {\n const dashRequest = request as { type: 'OpenDashboard'; dashboardId: string };\n // Load dashboard name from engine cache\n const targetDashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, dashRequest.dashboardId));\n const name = targetDashboard?.Name || 'Dashboard';\n this.navigationService.OpenDashboard(dashRequest.dashboardId, name);\n break;\n }\n case 'OpenQuery': {\n const queryRequest = request as { type: 'OpenQuery'; queryId: string };\n this.navigationService.OpenQuery(queryRequest.queryId, 'Query');\n break;\n }\n default:\n console.warn('Unhandled navigation request type:', request.type);\n }\n }\n\n /**\n * Get the display name for a dashboard resource\n * Loads the actual dashboard name from the database if available\n */\n override async GetResourceDisplayName(data: ResourceData): Promise<string> {\n try {\n // Try to load dashboard metadata if we have the record ID\n if (data.ResourceRecordID && data.ResourceRecordID.length > 0) {\n const md = this.ProviderToUse;\n const compositeKey = CompositeKey.FromID(data.ResourceRecordID); // first-pk-ok: ResourceRecordID of a Dashboards resource — core entity keyed by ID\n const name = await md.GetEntityRecordName('Dashboards', compositeKey);\n if (name) {\n return name;\n }\n }\n } catch (error) {\n // Silently fail and use fallback\n }\n\n // Fallback: use provided name or generic label\n return data.Name || 'Dashboard';\n }\n\n /**\n * Get the icon class for dashboard resources\n */\n async GetResourceIconClass(data: ResourceData): Promise<string> {\n return 'fa-solid fa-table-columns';\n }\n}\n"]}
@@ -18,7 +18,7 @@ let ListDetailResource = class ListDetailResource extends BaseResourceComponent
18
18
  async GetResourceDisplayName(data) {
19
19
  const md = this.ProviderToUse;
20
20
  if (data.ResourceRecordID) {
21
- let compositeKey = new CompositeKey([{ FieldName: "ID", Value: data.ResourceRecordID }]);
21
+ let compositeKey = CompositeKey.FromID(data.ResourceRecordID); // first-pk-ok: ResourceRecordID of a Lists resource — core entity keyed by ID
22
22
  const name = await md.GetEntityRecordName('Lists', compositeKey);
23
23
  return name ? name : `List: ${data.ResourceRecordID}`;
24
24
  }