@memberjunction/ng-shared 5.43.0 → 5.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.service.js","sourceRoot":"","sources":["../../src/lib/navigation.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAItD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAA4B,MAAM,MAAM,CAAC;AAErF,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;AAgCpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAE1C;;GAEG;AACH,MAAM,iBAAiB,GAAG,SAAS,CAAC,CAAC,2BAA2B;AAEhE;;;GAGG;AAIH,MAAM,OAAO,iBAAiB;IAclB;IACA;IAdF,eAAe,GAAG,KAAK,CAAC;IACxB,aAAa,GAAmB,EAAE,CAAC;IAEnC,kBAAkB,GAAG,IAAI,OAAO,EAAyB,CAAC;IAClE,yFAAyF;IAClF,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAEnE,6EAA6E;IACrE,UAAU,GAA8B,SAAS,CAAC;IAC1D,4BAA4B;IACpB,aAAa,GAAkB,IAAI,CAAC;IAE5C,YACU,gBAAuC,EACvC,UAA8B;QAD9B,qBAAgB,GAAhB,gBAAgB,CAAuB;QACvC,eAAU,GAAV,UAAU,CAAoB;QAEtC,IAAI,CAAC,4BAA4B,EAAE,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,IAAI,gBAAgB;QAClB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACK,uBAAuB;QAC7B,oBAAoB;QACpB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE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D,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS;SACvF,CAAC,CAAC;IACL,CAAC;2GA93BU,iBAAiB;gEAAjB,iBAAiB,WAAjB,iBAAiB,mBAFhB,MAAM;;iFAEP,iBAAiB;cAH7B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { WorkspaceStateManager, NavItem, DynamicNavItem, TabRequest, ApplicationManager } from '@memberjunction/ng-base-application';\nimport { NavigationOptions } from './navigation.interfaces';\nimport { CompositeKey } from '@memberjunction/core';\nimport { fromEvent, BehaviorSubject, Subject, Subscription, Observable } from 'rxjs';\nimport type { AppContextSnapshot } from '@memberjunction/ai-core-plus';\nimport { map, distinctUntilChanged } from 'rxjs/operators';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BaseResourceComponent } from './base-resource-component';\n\n/**\n * Event emitted when query params change on a tab (e.g., from browser back/forward).\n * Includes the tab ID so that only the component in the affected tab reacts,\n * preventing cross-tab leakage in multi-tab scenarios.\n */\nexport interface QueryParamChangeEvent {\n TabId: string;\n Params: Record<string, string>;\n}\n\n/**\n * Event emitted when a resource component reports its agent context or tools.\n * The shell (which owns the ComponentCacheManager) subscribes to these events\n * and updates the cache + active AppContextSnapshot accordingly.\n */\nexport interface AgentContextUpdate {\n /** The component instance that reported the update */\n Caller: BaseResourceComponent;\n /** Dashboard-specific context for the agent (undefined = no change) */\n AgentContext?: Record<string, unknown>;\n /** Client tools available from this dashboard (undefined = no change) */\n AgentClientTools?: Array<{\n Name: string;\n Description: string;\n ParameterSchema: Record<string, unknown>;\n Handler: (params: Record<string, unknown>) => Promise<unknown>;\n }>;\n}\n\n/**\n * System application ID for non-app-specific resources (fallback only)\n * Uses double underscore prefix to indicate system-level resource\n * @deprecated Prefer using NavigationService.getDefaultApplicationId() instead\n */\nexport const SYSTEM_APP_ID = '__explorer';\n\n/**\n * Neutral color for fallback when no app is available\n */\nconst NEUTRAL_APP_COLOR = '#9E9E9E'; // Material Design Gray 500\n\n/**\n * Centralized navigation service that handles all navigation operations\n * with automatic shift-key detection for power user workflows\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class NavigationService implements OnDestroy {\n private shiftKeyPressed = false;\n private subscriptions: Subscription[] = [];\n\n private queryParamChanged$ = new Subject<QueryParamChangeEvent>();\n /** Observable that emits when query params change on a tab (back/forward navigation). */\n public QueryParamChanged$ = this.queryParamChanged$.asObservable();\n\n /** Cached Home app ID (null means not found, undefined means not checked) */\n private _homeAppId: string | null | undefined = undefined;\n /** Cached Home app color */\n private _homeAppColor: string | null = null;\n\n constructor(\n private workspaceManager: WorkspaceStateManager,\n private appManager: ApplicationManager\n ) {\n this.setupGlobalShiftKeyDetection();\n }\n\n /**\n * Get the neutral color used for system-wide resources (entities, views, dashboards)\n * Returns a light neutral gray\n * @deprecated Use getDefaultAppColor() for better UX with Home app integration\n */\n get ExplorerAppColor(): string {\n return NEUTRAL_APP_COLOR;\n }\n\n /**\n * Gets the default application ID for orphan resources.\n * Priority: Home app > Active app > SYSTEM_APP_ID\n *\n * This ensures orphan resources (entity records, dashboards, views opened directly)\n * are grouped under the Home app instead of being orphaned in the tab system.\n */\n private getDefaultApplicationId(): string {\n // Check cache first\n if (this._homeAppId !== undefined) {\n if (this._homeAppId !== null) {\n return this._homeAppId;\n }\n // Home app not found, check active app\n const activeApp = this.appManager.GetActiveApp();\n if (activeApp) {\n return activeApp.ID;\n }\n return SYSTEM_APP_ID;\n }\n\n // First time - look for Home app\n const homeApp = this.appManager.GetAppByName('Home');\n if (homeApp) {\n this._homeAppId = homeApp.ID;\n this._homeAppColor = homeApp.GetColor();\n return homeApp.ID;\n }\n\n // Cache that Home app doesn't exist\n this._homeAppId = null;\n\n // Fall back to currently active app\n const activeApp = this.appManager.GetActiveApp();\n if (activeApp) {\n return activeApp.ID;\n }\n\n // Last resort - system app ID\n return SYSTEM_APP_ID;\n }\n\n /**\n * Gets the default app color for orphan resources.\n * Returns Home app color if available, otherwise neutral gray.\n */\n private getDefaultAppColor(): string {\n // Ensure cache is populated\n this.getDefaultApplicationId();\n\n // If Home app exists, use its color\n if (this._homeAppColor) {\n return this._homeAppColor;\n }\n\n // Check active app\n const activeApp = this.appManager.GetActiveApp();\n if (activeApp) {\n return activeApp.GetColor();\n }\n\n // Fall back to neutral color\n return NEUTRAL_APP_COLOR;\n }\n\n /**\n * Clears the cached Home app info.\n * Call this if apps are reloaded or user logs out.\n */\n public clearHomeAppCache(): void {\n this._homeAppId = undefined;\n this._homeAppColor = null;\n }\n\n // ════════════════════════════════════════════\n // Agent Context & Client Tools\n // ════════════════════════════════════════════\n\n /**\n * Observable stream of agent context updates from resource components.\n * The shell subscribes to this to update the ComponentCacheManager and\n * push changes to the chat overlay's AppContextSnapshot.DashboardContext.\n */\n public readonly AgentContextUpdated$ = new Subject<AgentContextUpdate>();\n\n /**\n * Latest `AppContextSnapshot` published by the Explorer app shell.\n *\n * Why: any embedded `<mj-conversation-chat-area>` instance outside the\n * floating chat overlay (Form Builder cockpit, future domain dashboards\n * that pop their own AI pane) needs to feed the SAME context the overlay\n * does so the agent sees what app + view + dashboard state the user is\n * looking at. Without this, the agent only sees the embedder's narrow\n * `AdditionalContext` slice and treats the user as if they have no app\n * context at all — which is the bug we just fixed.\n *\n * `MJExplorerAppComponent` is the canonical publisher (it owns the\n * snapshot construction); consumers SUBSCRIBE and bind the value to\n * their chat-area's `[appContext]`. Non-Explorer apps (custom MJ apps\n * that don't include explorer-app at all) build their own snapshot via\n * `BuildAppContextSnapshot()` in `@memberjunction/ai-core-plus`.\n *\n * Initial value is `null`; the publisher emits the first real snapshot\n * after the active app + nav state resolve on bootstrap.\n */\n public readonly AppContextSnapshot$ = new BehaviorSubject<AppContextSnapshot | null>(null);\n\n /**\n * Push a fresh AppContextSnapshot. Called by MJExplorerAppComponent\n * after each (a) app/tab change, (b) `handleAgentContextUpdate`\n * merging in `AdditionalContext` from a dashboard. Idempotent — no\n * de-duplication; embedders should treat the stream as \"the latest\n * value is canonical.\"\n */\n public PublishAppContextSnapshot(snapshot: AppContextSnapshot | null): void {\n this.AppContextSnapshot$.next(snapshot);\n }\n\n /**\n * Report the current agent-visible state from a resource component.\n * Call this whenever the dashboard's internal state changes (tab switch,\n * filter change, pipeline status change, drill-down, etc.).\n *\n * @param caller - Pass `this` from the calling component. Used to match\n * against the ComponentCacheManager to identify which cached component\n * this update belongs to.\n * @param context - Key-value pairs representing dashboard state the agent\n * should know about. Each dashboard defines its own shape.\n */\n public SetAgentContext(caller: BaseResourceComponent, context: Record<string, unknown>): void {\n this.AgentContextUpdated$.next({ Caller: caller, AgentContext: context });\n }\n\n /**\n * Register the client tools available from a resource component.\n * Call this on component init and whenever the available tools change.\n * Tools are automatically unregistered when the component becomes inactive\n * (tab switch) and re-registered when it becomes active again.\n *\n * @param caller - Pass `this` from the calling component.\n * @param tools - Array of tool definitions with Name, Description,\n * ParameterSchema (JSON Schema), and Handler function.\n */\n public SetAgentClientTools(caller: BaseResourceComponent, tools: Array<{\n Name: string;\n Description: string;\n ParameterSchema: Record<string, unknown>;\n Handler: (params: Record<string, unknown>) => Promise<unknown>;\n }>): void {\n this.AgentContextUpdated$.next({ Caller: caller, AgentClientTools: tools });\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach(sub => sub.unsubscribe());\n }\n\n /**\n * Set up global keyboard event listeners to track shift key state\n */\n private setupGlobalShiftKeyDetection(): void {\n // Track shift key via mousedown events (capture phase) instead of keydown/keyup.\n // This is more reliable because:\n // 1. MouseEvent.shiftKey always reflects the actual modifier state at click time\n // 2. No risk of \"stuck\" state from missed keyup events (focus loss, tab switch, etc.)\n // 3. Navigation is always triggered by a click, so the shift state is read\n // at exactly the right moment\n this.subscriptions.push(\n fromEvent<MouseEvent>(document, 'mousedown', { capture: true }).subscribe(event => {\n this.shiftKeyPressed = event.shiftKey;\n })\n );\n }\n\n /**\n * Get current shift key state\n */\n private isShiftPressed(): boolean {\n return this.shiftKeyPressed;\n }\n\n /**\n * Determine if a new tab should be forced based on options and shift key state\n */\n private shouldForceNewTab(options?: NavigationOptions): boolean {\n // If forceNewTab is explicitly set, use that\n if (options?.forceNewTab !== undefined) {\n return options.forceNewTab;\n }\n\n // Otherwise, use global shift key detection\n return this.isShiftPressed();\n }\n\n /**\n * Returns whether the caller should use OpenTabForced (force-new path) or\n * OpenTab (replace-temp path).\n *\n * Rule: only honor an explicit force-new request — from the user via\n * shift+click, or from the caller via `options.forceNewTab`. We deliberately\n * do NOT apply heuristics that auto-switch the workspace out of\n * single-resource mode on cross-resource navigation. A previous version of\n * this method tried to do that (\"force new if single-resource + different\n * resource\") and it caused a regression: every plain hyperlink click on a\n * record opened a new tab and dropped the user into multi-tab mode, even\n * though they didn't ask for it. That violated the principle that mode\n * transitions are user-driven (shift) or explicitly requested (options).\n *\n * If a particular caller really needs the parent context preserved when\n * creating/navigating to a child resource (e.g. \"+New\" on a related-entity\n * grid inside an open record), the caller should pass `forceNewTab: true`\n * in `NavigationOptions`. That keeps intent explicit at the call site\n * instead of buried in a global heuristic.\n */\n private handleSingleResourceModeTransition(forceNew: boolean, _newRequest: TabRequest): boolean {\n return forceNew;\n }\n\n /**\n * Check if a tab request matches an existing tab's resource\n */\n private isSameResource(tab: any, request: TabRequest): boolean {\n // Different apps = different resources\n if (tab.applicationId !== request.ApplicationId) {\n return false;\n }\n\n // For resource-based tabs, compare resourceType and recordId\n if (request.Configuration?.resourceType) {\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n return tab.configuration?.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId;\n }\n\n // For app nav items, compare appName and navItemName\n if (request.Configuration?.appName && request.Configuration?.navItemName) {\n return tab.configuration?.appName === request.Configuration.appName &&\n tab.configuration?.navItemName === request.Configuration.navItemName;\n }\n\n // Fallback to basic comparison\n return false;\n }\n\n /**\n * Open a navigation item within an app\n */\n public OpenNavItem(appId: string, navItem: NavItem, appColor: string, options?: NavigationOptions): string {\n let forceNew = this.shouldForceNewTab(options);\n\n // Get the app to find its name\n const app = this.appManager.GetAppById(appId);\n const appName = app?.Name || '';\n\n // Dynamic nav items (e.g. orphan entity records) carry their original tab Configuration\n // and should NOT get navItemName stamped on them — that would cause buildResourceUrl\n // to produce a nav-item-style URL like /app/home/<label> instead of the correct\n // resource-type URL like /app/home/record/Entity/ID|...\n const isDynamic = (navItem as DynamicNavItem).isDynamic === true;\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: navItem.Label,\n ResourceRecordId: navItem.RecordID || '', // Also store at top level for consistent tab matching\n Configuration: {\n route: navItem.Route,\n resourceType: navItem.ResourceType,\n driverClass: navItem.DriverClass, // Pass through DriverClass for Custom resource type\n recordId: navItem.RecordID,\n appName: appName, // Store app name for URL building\n appId: appId,\n ...(isDynamic ? {} : { navItemName: navItem.Label }), // Only set for static nav items\n ...(navItem.Configuration || {})\n },\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n let tabId: string;\n if (forceNew) {\n // Always create a new tab\n tabId = this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n // Use existing OpenTab logic (may replace temporary tab)\n tabId = this.workspaceManager.OpenTab(request, appColor);\n }\n\n // Apply query params to the newly opened/activated tab if provided\n if (options?.queryParams) {\n this.applyQueryParamsToTab(tabId, options.queryParams);\n }\n\n return tabId;\n }\n\n /**\n * Open an entity record view\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenEntityRecord(\n entityName: string,\n recordPkey: CompositeKey,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n\n let forceNew = this.shouldForceNewTab(options);\n\n const recordId = recordPkey.ToURLSegment();\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `${entityName} - ${recordId}`,\n Configuration: {\n resourceType: 'Records',\n Entity: entityName, // Must use 'Entity' (capital E) - expected by record-resource.component\n recordId: recordId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: recordId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n let tabId: string;\n if (forceNew) {\n tabId = this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n tabId = this.workspaceManager.OpenTab(request, appColor);\n }\n\n return tabId;\n }\n\n /**\n * Open a view\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenView(\n viewId: string,\n viewName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: viewName,\n Configuration: {\n resourceType: 'MJ: User Views',\n viewId,\n recordId: viewId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: viewId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a dashboard\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenDashboard(\n dashboardId: string,\n dashboardName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: dashboardName,\n Configuration: {\n resourceType: 'Dashboards',\n dashboardId,\n recordId: dashboardId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: dashboardId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a report\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenReport(\n reportId: string,\n reportName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: reportName,\n Configuration: {\n resourceType: 'Reports',\n reportId,\n recordId: reportId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: reportId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open an artifact\n * Artifacts are versioned content containers (reports, dashboards, UI components, etc.)\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenArtifact(\n artifactId: string,\n artifactName?: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: artifactName || `Artifact - ${artifactId}`,\n Configuration: {\n resourceType: 'Artifacts',\n artifactId,\n recordId: artifactId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: artifactId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a dynamic view\n * Dynamic views are entity-based views with custom filters, not saved views\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenDynamicView(\n entityName: string,\n extraFilter?: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const filterSuffix = extraFilter ? ' (Filtered)' : '';\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `${entityName}${filterSuffix}`,\n Configuration: {\n resourceType: 'MJ: User Views',\n Entity: entityName,\n ExtraFilter: extraFilter,\n isDynamic: true,\n recordId: 'dynamic' // Special marker for dynamic views\n },\n ResourceRecordId: 'dynamic',\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a query\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenQuery(\n queryId: string,\n queryName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: queryName,\n Configuration: {\n resourceType: 'Queries',\n queryId,\n recordId: queryId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: queryId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a new entity record creation form\n * Uses Home app if available, otherwise falls back to active app or system app\n * @param entityName The name of the entity to create a new record for\n * @param options Navigation options including optional newRecordValues for pre-populating fields\n */\n public OpenNewEntityRecord(\n entityName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `New ${entityName}`,\n Configuration: {\n resourceType: 'Records',\n Entity: entityName, // Must use 'Entity' (capital E) - expected by record-resource.component\n recordId: '', // Empty recordId indicates new record\n isNew: true, // Flag to indicate this is a new record\n NewRecordValues: options?.newRecordValues // Pass through initial values if provided\n },\n ResourceRecordId: '', // Empty for new records\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a universal search results tab for the given query.\n * This is the primary way to open search results from anywhere in the application.\n *\n * @param query The search query text\n * @param searchOptions Optional search-specific options (e.g., minRelevance, scopeIDs)\n * @param options Navigation options\n */\n public OpenSearch(\n query: string,\n searchOptions?: { minRelevance?: number; scopeIDs?: string[] },\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const config: Record<string, unknown> = {\n resourceType: 'Search Results',\n Query: query,\n SearchInput: query,\n recordId: `search-${query}`\n };\n if (searchOptions?.minRelevance != null) {\n config['MinRelevance'] = searchOptions.minRelevance;\n }\n if (searchOptions?.scopeIDs && searchOptions.scopeIDs.length > 0) {\n config['ScopeIDs'] = searchOptions.scopeIDs;\n }\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `Search: ${query}`,\n Configuration: config,\n ResourceRecordId: `search-${query}`,\n IsPinned: false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Navigate to a nav item by name within the current or specified application.\n * Allows passing additional configuration parameters to merge with the nav item's config.\n * This is useful for cross-resource navigation where a component needs to navigate\n * to another nav item with specific parameters (e.g., navigate to Conversations with a specific conversationId).\n *\n * @param navItemName The label/name of the nav item to navigate to\n * @param configuration Additional configuration to merge (e.g., conversationId, artifactId)\n * @param appId Optional app ID (defaults to current active app)\n * @param options Navigation options\n * @returns The tab ID if successful, null if nav item not found\n */\n public async OpenNavItemByName(\n navItemName: string,\n configuration?: Record<string, unknown>,\n appId?: string,\n options?: NavigationOptions\n ): Promise<string | null> {\n // Get app (use provided or current active)\n const targetAppId = appId || this.appManager.GetActiveApp()?.ID;\n if (!targetAppId) {\n return null;\n }\n\n const app = this.appManager.GetAppById(targetAppId);\n if (!app) {\n return null;\n }\n\n // Find the nav item by name\n const navItems = await app.GetNavItems();\n const navItem = navItems.find(item => item.Label === navItemName);\n if (!navItem) {\n return null;\n }\n\n // Create a merged nav item with additional configuration\n const mergedNavItem: NavItem = {\n ...navItem,\n Configuration: {\n ...(navItem.Configuration || {}),\n ...(configuration || {})\n }\n };\n\n // Use existing OpenNavItem\n return this.OpenNavItem(targetAppId, mergedNavItem, app.GetColor(), options);\n }\n\n /**\n * Switch to an application by ID.\n * This sets the app as active and either opens a specific nav item or creates a default tab.\n * If the requested nav item already has an open tab, switches to that tab instead of creating a new one.\n * @param appId The application ID to switch to\n * @param navItemName Optional name of a nav item to open within the app. If provided, opens that nav item.\n * @param queryParams Optional query params to apply to the target tab. Applied SYNCHRONOUSLY once the\n * target tab is active — critical when navigating (e.g. from a Home pin) to an\n * app whose resource component is cached: the params must be in the tab config\n * BEFORE the tab-container reattaches the cached component, otherwise the cache\n * restores its own (stale) saved params and the navigation intent is lost.\n */\n async SwitchToApp(appId: string, navItemName?: string, queryParams?: Record<string, string | null>): Promise<void> {\n await this.appManager.SetActiveApp(appId);\n\n const app = this.appManager.GetAllApps().find(a => UUIDsEqual(a.ID, appId));\n if (!app) {\n return;\n }\n\n const appTabs = this.workspaceManager.GetAppTabs(appId);\n\n // If a specific nav item is requested\n if (navItemName) {\n const navItems = await app.GetNavItems();\n const navItem = navItems.find(item => item.Label === navItemName);\n if (navItem) {\n // Check if there's already a tab for this nav item\n const existingTab = appTabs.find(tab =>\n tab.title === navItem.Label ||\n (tab.configuration?.['route'] === navItem.Route && navItem.Route)\n );\n\n if (existingTab) {\n // Switch to existing tab\n this.workspaceManager.SetActiveTab(existingTab.id);\n } else {\n // Open new tab for this nav item\n this.OpenNavItem(appId, navItem, app.GetColor());\n }\n // Apply the requested query params to whichever tab is now active — synchronously,\n // so they're present before the (possibly cached) resource component reattaches.\n if (queryParams && Object.keys(queryParams).length > 0) {\n const targetTabId = this.workspaceManager.GetActiveTabId();\n if (targetTabId) {\n this.applyQueryParamsToTab(targetTabId, queryParams);\n }\n }\n return;\n }\n // Nav item not found, fall through to default behavior\n }\n\n // No specific nav item requested - check if app has any tabs\n if (appTabs.length === 0) {\n // Create default tab\n const tabRequest = await app.CreateDefaultTab();\n if (tabRequest) {\n this.workspaceManager.OpenTab(tabRequest, app.GetColor());\n }\n } else {\n // App has tabs - switch to the first one (or active one if exists)\n const config = this.workspaceManager.GetConfiguration();\n const activeAppTab = appTabs.find(t => t.id === config?.activeTabId);\n if (!activeAppTab) {\n // No active tab for this app, switch to first tab\n this.workspaceManager.SetActiveTab(appTabs[0].id);\n }\n }\n }\n\n /**\n * Update the query params for the currently active tab.\n * This updates the tab's configuration and triggers a URL sync via the shell's\n * workspace configuration subscription.\n *\n * Use this instead of directly calling router.navigate() to ensure proper\n * URL management that respects app-scoped routes.\n *\n * @param queryParams Object containing query param key-value pairs.\n * Use null values to remove a query param.\n * @example\n * // Add or update query params\n * navigationService.UpdateActiveTabQueryParams({ category: 'abc123', dashboard: 'xyz789' });\n *\n * // Remove a query param\n * navigationService.UpdateActiveTabQueryParams({ category: null });\n */\n UpdateActiveTabQueryParams(queryParams: Record<string, string | null>): void {\n const activeTabId = this.workspaceManager.GetActiveTabId();\n if (!activeTabId) {\n console.warn('NavigationService.UpdateActiveTabQueryParams: No active tab');\n return;\n }\n\n this.applyQueryParamsToTab(activeTabId, queryParams);\n }\n\n /**\n * Notify subscribers that query params changed on a specific tab.\n * Called by the shell when back/forward navigation changes query params on the active tab.\n * The notification includes the tab ID so only the component in that tab reacts.\n */\n NotifyQueryParamsChanged(tabId: string, params: Record<string, string>): void {\n this.queryParamChanged$.next({ TabId: tabId, Params: params });\n }\n\n /**\n * Reactively observe the query params for a specific tab.\n *\n * Backed by the workspace BehaviorSubject, so a subscriber receives the current\n * params *immediately* on subscribe AND every subsequent change — including the\n * deep-link params that the ResourceResolver merges into the tab configuration on\n * a cold/direct URL load.\n *\n * This is the race-free counterpart to {@link NotifyQueryParamsChanged} (a plain\n * Subject that drops events fired before a component has subscribed). A resource\n * component that mounts from workspace restoration can subscribe here and still\n * pick up its initial deep-link state regardless of whether the params landed in\n * the tab config before or after it mounted.\n */\n public ObserveTabQueryParams(tabId: string): Observable<Record<string, string>> {\n return this.workspaceManager.Configuration.pipe(\n map(config => {\n const tab = config?.tabs?.find(t => t.id === tabId);\n return (tab?.configuration?.['queryParams'] || {}) as Record<string, string>;\n }),\n distinctUntilChanged((a, b) => this.shallowParamsEqual(a, b))\n );\n }\n\n private shallowParamsEqual(a: Record<string, string>, b: Record<string, string>): boolean {\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) {\n return false;\n }\n return keysA.every(key => a[key] === b[key]);\n }\n\n /**\n * Apply query params to a specific tab by ID.\n * Merges with any existing query params on the tab. Use null values to remove params.\n */\n private applyQueryParamsToTab(tabId: string, queryParams: Record<string, string | null>): void {\n const tab = this.workspaceManager.GetTab(tabId);\n if (!tab) {\n console.warn('NavigationService.applyQueryParamsToTab: Tab not found:', tabId);\n return;\n }\n\n // Get existing queryParams from tab configuration\n const existingQueryParams = (tab.configuration?.['queryParams'] || {}) as Record<string, string | null>;\n\n // Merge with new query params\n const mergedQueryParams: Record<string, string> = {};\n\n // Start with existing params (excluding nulls)\n for (const [key, value] of Object.entries(existingQueryParams)) {\n if (value !== null) {\n mergedQueryParams[key] = value;\n }\n }\n\n // Apply new params (null means remove)\n for (const [key, value] of Object.entries(queryParams)) {\n if (value === null) {\n delete mergedQueryParams[key];\n } else {\n mergedQueryParams[key] = value;\n }\n }\n\n // Update the tab configuration\n this.workspaceManager.UpdateTabConfiguration(tabId, {\n queryParams: Object.keys(mergedQueryParams).length > 0 ? mergedQueryParams : undefined\n });\n }\n}\n"]}
1
+ {"version":3,"file":"navigation.service.js","sourceRoot":"","sources":["../../src/lib/navigation.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AAItD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAA4B,MAAM,MAAM,CAAC;AAErF,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;AAwCpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAE1C;;GAEG;AACH,MAAM,iBAAiB,GAAG,SAAS,CAAC,CAAC,2BAA2B;AAEhE;;;GAGG;AAIH,MAAM,OAAO,iBAAiB;IAclB;IACA;IAdF,eAAe,GAAG,KAAK,CAAC;IACxB,aAAa,GAAmB,EAAE,CAAC;IAEnC,kBAAkB,GAAG,IAAI,OAAO,EAAyB,CAAC;IAClE,yFAAyF;IAClF,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAEnE,6EAA6E;IACrE,UAAU,GAA8B,SAAS,CAAC;IAC1D,4BAA4B;IACpB,aAAa,GAAkB,IAAI,CAAC;IAE5C,YACU,gBAAuC,EACvC,UAA8B;QAD9B,qBAAgB,GAAhB,gBAAgB,CAAuB;QACvC,eAAU,GAAV,UAAU,CAAoB;QAEtC,IAAI,CAAC,4BAA4B,EAAE,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,IAAI,gBAAgB;QAClB,OAAO,iBAAiB,CAAC;IA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,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { WorkspaceStateManager, NavItem, DynamicNavItem, TabRequest, ApplicationManager } from '@memberjunction/ng-base-application';\nimport { NavigationOptions } from './navigation.interfaces';\nimport { CompositeKey } from '@memberjunction/core';\nimport { fromEvent, BehaviorSubject, Subject, Subscription, Observable } from 'rxjs';\nimport type { AppContextSnapshot } from '@memberjunction/ai-core-plus';\nimport { map, distinctUntilChanged } from 'rxjs/operators';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BaseResourceComponent } from './base-resource-component';\n\n/**\n * Event emitted when query params change on a tab (e.g., from browser back/forward).\n * Includes the tab ID so that only the component in the affected tab reacts,\n * preventing cross-tab leakage in multi-tab scenarios.\n */\nexport interface QueryParamChangeEvent {\n TabId: string;\n Params: Record<string, string>;\n}\n\n/**\n * Event emitted when a resource component reports its agent context or tools.\n * The shell (which owns the ComponentCacheManager) subscribes to these events\n * and updates the cache + active AppContextSnapshot accordingly.\n */\nexport interface AgentContextUpdate {\n /** The component instance that reported the update */\n Caller: BaseResourceComponent;\n /** Dashboard-specific context for the agent (undefined = no change) */\n AgentContext?: Record<string, unknown>;\n /** Client tools available from this dashboard (undefined = no change) */\n AgentClientTools?: Array<{\n Name: string;\n Description: string;\n ParameterSchema: Record<string, unknown>;\n Handler: (params: Record<string, unknown>) => Promise<unknown>;\n }>;\n}\n\nexport interface TabQueryParamUpdateGuard {\n resourceType?: string | null;\n driverClass?: string | null;\n recordId?: string | null;\n navItemName?: string | null;\n entity?: string | null;\n}\n\n/**\n * System application ID for non-app-specific resources (fallback only)\n * Uses double underscore prefix to indicate system-level resource\n * @deprecated Prefer using NavigationService.getDefaultApplicationId() instead\n */\nexport const SYSTEM_APP_ID = '__explorer';\n\n/**\n * Neutral color for fallback when no app is available\n */\nconst NEUTRAL_APP_COLOR = '#9E9E9E'; // Material Design Gray 500\n\n/**\n * Centralized navigation service that handles all navigation operations\n * with automatic shift-key detection for power user workflows\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class NavigationService implements OnDestroy {\n private shiftKeyPressed = false;\n private subscriptions: Subscription[] = [];\n\n private queryParamChanged$ = new Subject<QueryParamChangeEvent>();\n /** Observable that emits when query params change on a tab (back/forward navigation). */\n public QueryParamChanged$ = this.queryParamChanged$.asObservable();\n\n /** Cached Home app ID (null means not found, undefined means not checked) */\n private _homeAppId: string | null | undefined = undefined;\n /** Cached Home app color */\n private _homeAppColor: string | null = null;\n\n constructor(\n private workspaceManager: WorkspaceStateManager,\n private appManager: ApplicationManager\n ) {\n this.setupGlobalShiftKeyDetection();\n }\n\n /**\n * Get the neutral color used for system-wide resources (entities, views, dashboards)\n * Returns a light neutral gray\n * @deprecated Use getDefaultAppColor() for better UX with Home app integration\n */\n get ExplorerAppColor(): string {\n return NEUTRAL_APP_COLOR;\n }\n\n /**\n * Gets the default application ID for orphan resources.\n * Priority: Home app > Active app > SYSTEM_APP_ID\n *\n * This ensures orphan resources (entity records, dashboards, views opened directly)\n * are grouped under the Home app instead of being orphaned in the tab system.\n */\n private getDefaultApplicationId(): string {\n // Check cache first\n if (this._homeAppId !== undefined) {\n if (this._homeAppId !== null) {\n return this._homeAppId;\n }\n // Home app not found, check active app\n const activeApp = this.appManager.GetActiveApp();\n if (activeApp) {\n return activeApp.ID;\n }\n return SYSTEM_APP_ID;\n }\n\n // First time - look for Home app\n const homeApp = this.appManager.GetAppByName('Home');\n if (homeApp) {\n this._homeAppId = homeApp.ID;\n this._homeAppColor = homeApp.GetColor();\n return homeApp.ID;\n }\n\n // Cache that Home app doesn't exist\n this._homeAppId = null;\n\n // Fall back to currently active app\n const activeApp = this.appManager.GetActiveApp();\n if (activeApp) {\n return activeApp.ID;\n }\n\n // Last resort - system app ID\n return SYSTEM_APP_ID;\n }\n\n /**\n * Gets the default app color for orphan resources.\n * Returns Home app color if available, otherwise neutral gray.\n */\n private getDefaultAppColor(): string {\n // Ensure cache is populated\n this.getDefaultApplicationId();\n\n // If Home app exists, use its color\n if (this._homeAppColor) {\n return this._homeAppColor;\n }\n\n // Check active app\n const activeApp = this.appManager.GetActiveApp();\n if (activeApp) {\n return activeApp.GetColor();\n }\n\n // Fall back to neutral color\n return NEUTRAL_APP_COLOR;\n }\n\n /**\n * Clears the cached Home app info.\n * Call this if apps are reloaded or user logs out.\n */\n public clearHomeAppCache(): void {\n this._homeAppId = undefined;\n this._homeAppColor = null;\n }\n\n // ════════════════════════════════════════════\n // Agent Context & Client Tools\n // ════════════════════════════════════════════\n\n /**\n * Observable stream of agent context updates from resource components.\n * The shell subscribes to this to update the ComponentCacheManager and\n * push changes to the chat overlay's AppContextSnapshot.DashboardContext.\n */\n public readonly AgentContextUpdated$ = new Subject<AgentContextUpdate>();\n\n /** The client tools currently surfaced to the agent (the most recent SetAgentClientTools set). */\n private currentAgentTools: NonNullable<AgentContextUpdate['AgentClientTools']> = [];\n\n /**\n * Tools captured for each cached resource component at the moment it was DETACHED, keyed by that\n * component (the one the cache manager tracks). Replayed on reattach. Captured at detach time (vs.\n * keyed by the registering component) so it works even when a resource WRAPPER component is what's\n * cached/reattached while an INNER child component is what actually called SetAgentClientTools\n * (e.g. Data Explorer's resource wrapper hosting its dashboard) — keying by the registerer would\n * miss on reattach. This keeps the agent's live tool set a function of the CURRENTLY attached\n * surface, fixing the staleness where a previous app's tools lingered after navigation.\n */\n private readonly agentToolsByDetachedResource = new Map<BaseResourceComponent, NonNullable<AgentContextUpdate['AgentClientTools']>>();\n\n /**\n * Latest `AppContextSnapshot` published by the Explorer app shell.\n *\n * Why: any embedded `<mj-conversation-chat-area>` instance outside the\n * floating chat overlay (Form Builder cockpit, future domain dashboards\n * that pop their own AI pane) needs to feed the SAME context the overlay\n * does so the agent sees what app + view + dashboard state the user is\n * looking at. Without this, the agent only sees the embedder's narrow\n * `AdditionalContext` slice and treats the user as if they have no app\n * context at all — which is the bug we just fixed.\n *\n * `MJExplorerAppComponent` is the canonical publisher (it owns the\n * snapshot construction); consumers SUBSCRIBE and bind the value to\n * their chat-area's `[appContext]`. Non-Explorer apps (custom MJ apps\n * that don't include explorer-app at all) build their own snapshot via\n * `BuildAppContextSnapshot()` in `@memberjunction/ai-core-plus`.\n *\n * Initial value is `null`; the publisher emits the first real snapshot\n * after the active app + nav state resolve on bootstrap.\n */\n public readonly AppContextSnapshot$ = new BehaviorSubject<AppContextSnapshot | null>(null);\n\n /**\n * Push a fresh AppContextSnapshot. Called by MJExplorerAppComponent\n * after each (a) app/tab change, (b) `handleAgentContextUpdate`\n * merging in `AdditionalContext` from a dashboard. Idempotent — no\n * de-duplication; embedders should treat the stream as \"the latest\n * value is canonical.\"\n */\n public PublishAppContextSnapshot(snapshot: AppContextSnapshot | null): void {\n this.AppContextSnapshot$.next(snapshot);\n }\n\n /**\n * Report the current agent-visible state from a resource component.\n * Call this whenever the dashboard's internal state changes (tab switch,\n * filter change, pipeline status change, drill-down, etc.).\n *\n * @param caller - Pass `this` from the calling component. Used to match\n * against the ComponentCacheManager to identify which cached component\n * this update belongs to.\n * @param context - Key-value pairs representing dashboard state the agent\n * should know about. Each dashboard defines its own shape.\n */\n public SetAgentContext(caller: BaseResourceComponent, context: Record<string, unknown>): void {\n this.AgentContextUpdated$.next({ Caller: caller, AgentContext: context });\n }\n\n /**\n * Register the client tools available from a resource component.\n * Call this on component init and whenever the available tools change.\n * Tools are automatically unregistered when the component becomes inactive\n * (tab switch) and re-registered when it becomes active again.\n *\n * @param caller - Pass `this` from the calling component.\n * @param tools - Array of tool definitions with Name, Description,\n * ParameterSchema (JSON Schema), and Handler function.\n */\n public SetAgentClientTools(caller: BaseResourceComponent, tools: Array<{\n Name: string;\n Description: string;\n ParameterSchema: Record<string, unknown>;\n Handler: (params: Record<string, unknown>) => Promise<unknown>;\n }>): void {\n this.currentAgentTools = tools;\n this.AgentContextUpdated$.next({ Caller: caller, AgentClientTools: tools });\n }\n\n /**\n * Re-publish a cached resource component's tools when its tab is re-focused. Cached components keep\n * their Angular instance but do NOT re-run `ngAfterViewInit`, so they never re-register on reattach\n * — the shell calls this so the just-reactivated surface's tools become the agent's active set\n * again. Replays the set captured for this component at its last detach; no-op (lets a fresh\n * component register itself) when none was captured (e.g. a component's very first attach).\n */\n public NotifyResourceReattached(caller: BaseResourceComponent): void {\n const tools = this.agentToolsByDetachedResource.get(caller);\n if (tools === undefined) {\n return;\n }\n this.currentAgentTools = tools;\n this.AgentContextUpdated$.next({ Caller: caller, AgentClientTools: tools });\n }\n\n /**\n * Capture + clear the active client tools when a resource component's tab is detached (navigated\n * away from), so the previous surface's tools aren't offered to the agent on the next surface. We\n * snapshot whatever tools are CURRENTLY active and key them by the detaching component, so\n * {@link NotifyResourceReattached} can replay them — robust to a wrapper component being the one\n * cached/reattached while an inner child actually registered the tools (e.g. Data Explorer).\n */\n public NotifyResourceDetached(caller: BaseResourceComponent): void {\n this.agentToolsByDetachedResource.set(caller, this.currentAgentTools);\n this.currentAgentTools = [];\n this.AgentContextUpdated$.next({ Caller: caller, AgentClientTools: [] });\n }\n\n /**\n * Drop a destroyed component's captured tools (e.g. on LRU eviction), so the map doesn't retain\n * references to dead component instances.\n */\n public ForgetResource(caller: BaseResourceComponent): void {\n this.agentToolsByDetachedResource.delete(caller);\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach(sub => sub.unsubscribe());\n }\n\n /**\n * Set up global keyboard event listeners to track shift key state\n */\n private setupGlobalShiftKeyDetection(): void {\n // Track shift key via mousedown events (capture phase) instead of keydown/keyup.\n // This is more reliable because:\n // 1. MouseEvent.shiftKey always reflects the actual modifier state at click time\n // 2. No risk of \"stuck\" state from missed keyup events (focus loss, tab switch, etc.)\n // 3. Navigation is always triggered by a click, so the shift state is read\n // at exactly the right moment\n this.subscriptions.push(\n fromEvent<MouseEvent>(document, 'mousedown', { capture: true }).subscribe(event => {\n this.shiftKeyPressed = event.shiftKey;\n })\n );\n }\n\n /**\n * Get current shift key state\n */\n private isShiftPressed(): boolean {\n return this.shiftKeyPressed;\n }\n\n /**\n * Determine if a new tab should be forced based on options and shift key state\n */\n private shouldForceNewTab(options?: NavigationOptions): boolean {\n // If forceNewTab is explicitly set, use that\n if (options?.forceNewTab !== undefined) {\n return options.forceNewTab;\n }\n\n // Otherwise, use global shift key detection\n return this.isShiftPressed();\n }\n\n /**\n * Returns whether the caller should use OpenTabForced (force-new path) or\n * OpenTab (replace-temp path).\n *\n * Rule: only honor an explicit force-new request — from the user via\n * shift+click, or from the caller via `options.forceNewTab`. We deliberately\n * do NOT apply heuristics that auto-switch the workspace out of\n * single-resource mode on cross-resource navigation. A previous version of\n * this method tried to do that (\"force new if single-resource + different\n * resource\") and it caused a regression: every plain hyperlink click on a\n * record opened a new tab and dropped the user into multi-tab mode, even\n * though they didn't ask for it. That violated the principle that mode\n * transitions are user-driven (shift) or explicitly requested (options).\n *\n * If a particular caller really needs the parent context preserved when\n * creating/navigating to a child resource (e.g. \"+New\" on a related-entity\n * grid inside an open record), the caller should pass `forceNewTab: true`\n * in `NavigationOptions`. That keeps intent explicit at the call site\n * instead of buried in a global heuristic.\n */\n private handleSingleResourceModeTransition(forceNew: boolean, _newRequest: TabRequest): boolean {\n return forceNew;\n }\n\n /**\n * Check if a tab request matches an existing tab's resource\n */\n private isSameResource(tab: any, request: TabRequest): boolean {\n // Different apps = different resources\n if (tab.applicationId !== request.ApplicationId) {\n return false;\n }\n\n // For resource-based tabs, compare resourceType and recordId\n if (request.Configuration?.resourceType) {\n const requestRecordId = request.ResourceRecordId || '';\n const tabRecordId = tab.resourceRecordId || '';\n return tab.configuration?.resourceType === request.Configuration.resourceType &&\n tabRecordId === requestRecordId;\n }\n\n // For app nav items, compare appName and navItemName\n if (request.Configuration?.appName && request.Configuration?.navItemName) {\n return tab.configuration?.appName === request.Configuration.appName &&\n tab.configuration?.navItemName === request.Configuration.navItemName;\n }\n\n // Fallback to basic comparison\n return false;\n }\n\n /**\n * Open a navigation item within an app\n */\n public OpenNavItem(appId: string, navItem: NavItem, appColor: string, options?: NavigationOptions): string {\n let forceNew = this.shouldForceNewTab(options);\n\n // Get the app to find its name\n const app = this.appManager.GetAppById(appId);\n const appName = app?.Name || '';\n\n // Dynamic nav items (e.g. orphan entity records) carry their original tab Configuration\n // and should NOT get navItemName stamped on them — that would cause buildResourceUrl\n // to produce a nav-item-style URL like /app/home/<label> instead of the correct\n // resource-type URL like /app/home/record/Entity/ID|...\n const isDynamic = (navItem as DynamicNavItem).isDynamic === true;\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: navItem.Label,\n ResourceRecordId: navItem.RecordID || '', // Also store at top level for consistent tab matching\n Configuration: {\n route: navItem.Route,\n resourceType: navItem.ResourceType,\n driverClass: navItem.DriverClass, // Pass through DriverClass for Custom resource type\n recordId: navItem.RecordID,\n appName: appName, // Store app name for URL building\n appId: appId,\n ...(isDynamic ? {} : { navItemName: navItem.Label }), // Only set for static nav items\n ...(navItem.Configuration || {})\n },\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n let tabId: string;\n if (forceNew) {\n // Always create a new tab\n tabId = this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n // Use existing OpenTab logic (may replace temporary tab)\n tabId = this.workspaceManager.OpenTab(request, appColor);\n }\n\n // Apply query params to the newly opened/activated tab if provided\n if (options?.queryParams) {\n this.applyQueryParamsToTab(tabId, options.queryParams);\n }\n\n return tabId;\n }\n\n /**\n * Open an entity record view\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenEntityRecord(\n entityName: string,\n recordPkey: CompositeKey,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n\n let forceNew = this.shouldForceNewTab(options);\n\n const recordId = recordPkey.ToURLSegment();\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `${entityName} - ${recordId}`,\n Configuration: {\n resourceType: 'Records',\n Entity: entityName, // Must use 'Entity' (capital E) - expected by record-resource.component\n recordId: recordId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: recordId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n let tabId: string;\n if (forceNew) {\n tabId = this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n tabId = this.workspaceManager.OpenTab(request, appColor);\n }\n\n return tabId;\n }\n\n /**\n * Open a view\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenView(\n viewId: string,\n viewName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: viewName,\n Configuration: {\n resourceType: 'MJ: User Views',\n viewId,\n recordId: viewId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: viewId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a dashboard\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenDashboard(\n dashboardId: string,\n dashboardName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: dashboardName,\n Configuration: {\n resourceType: 'Dashboards',\n dashboardId,\n recordId: dashboardId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: dashboardId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a report\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenReport(\n reportId: string,\n reportName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: reportName,\n Configuration: {\n resourceType: 'Reports',\n reportId,\n recordId: reportId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: reportId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open an artifact\n * Artifacts are versioned content containers (reports, dashboards, UI components, etc.)\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenArtifact(\n artifactId: string,\n artifactName?: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: artifactName || `Artifact - ${artifactId}`,\n Configuration: {\n resourceType: 'Artifacts',\n artifactId,\n recordId: artifactId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: artifactId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a dynamic view\n * Dynamic views are entity-based views with custom filters, not saved views\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenDynamicView(\n entityName: string,\n extraFilter?: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const filterSuffix = extraFilter ? ' (Filtered)' : '';\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `${entityName}${filterSuffix}`,\n Configuration: {\n resourceType: 'MJ: User Views',\n Entity: entityName,\n ExtraFilter: extraFilter,\n isDynamic: true,\n recordId: 'dynamic' // Special marker for dynamic views\n },\n ResourceRecordId: 'dynamic',\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a query\n * Uses Home app if available, otherwise falls back to active app or system app\n */\n public OpenQuery(\n queryId: string,\n queryName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: queryName,\n Configuration: {\n resourceType: 'Queries',\n queryId,\n recordId: queryId // Also needed in Configuration for tab-container.component to populate ResourceRecordID\n },\n ResourceRecordId: queryId,\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a new entity record creation form\n * Uses Home app if available, otherwise falls back to active app or system app\n * @param entityName The name of the entity to create a new record for\n * @param options Navigation options including optional newRecordValues for pre-populating fields\n */\n public OpenNewEntityRecord(\n entityName: string,\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n\n let forceNew = this.shouldForceNewTab(options);\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `New ${entityName}`,\n Configuration: {\n resourceType: 'Records',\n Entity: entityName, // Must use 'Entity' (capital E) - expected by record-resource.component\n recordId: '', // Empty recordId indicates new record\n isNew: true, // Flag to indicate this is a new record\n NewRecordValues: options?.newRecordValues // Pass through initial values if provided\n },\n ResourceRecordId: '', // Empty for new records\n IsPinned: options?.pinTab || false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Open a universal search results tab for the given query.\n * This is the primary way to open search results from anywhere in the application.\n *\n * @param query The search query text\n * @param searchOptions Optional search-specific options (e.g., minRelevance, scopeIDs)\n * @param options Navigation options\n */\n public OpenSearch(\n query: string,\n searchOptions?: { minRelevance?: number; scopeIDs?: string[] },\n options?: NavigationOptions\n ): string {\n const appId = this.getDefaultApplicationId();\n const appColor = this.getDefaultAppColor();\n let forceNew = this.shouldForceNewTab(options);\n\n const config: Record<string, unknown> = {\n resourceType: 'Search Results',\n Query: query,\n SearchInput: query,\n recordId: `search-${query}`\n };\n if (searchOptions?.minRelevance != null) {\n config['MinRelevance'] = searchOptions.minRelevance;\n }\n if (searchOptions?.scopeIDs && searchOptions.scopeIDs.length > 0) {\n config['ScopeIDs'] = searchOptions.scopeIDs;\n }\n\n const request: TabRequest = {\n ApplicationId: appId,\n Title: `Search: ${query}`,\n Configuration: config,\n ResourceRecordId: `search-${query}`,\n IsPinned: false\n };\n\n // Handle transition from single-resource mode\n forceNew = this.handleSingleResourceModeTransition(forceNew, request);\n\n if (forceNew) {\n return this.workspaceManager.OpenTabForced(request, appColor);\n } else {\n return this.workspaceManager.OpenTab(request, appColor);\n }\n }\n\n /**\n * Navigate to a nav item by name within the current or specified application.\n * Allows passing additional configuration parameters to merge with the nav item's config.\n * This is useful for cross-resource navigation where a component needs to navigate\n * to another nav item with specific parameters (e.g., navigate to Conversations with a specific conversationId).\n *\n * @param navItemName The label/name of the nav item to navigate to\n * @param configuration Additional configuration to merge (e.g., conversationId, artifactId)\n * @param appId Optional app ID (defaults to current active app)\n * @param options Navigation options\n * @returns The tab ID if successful, null if nav item not found\n */\n public async OpenNavItemByName(\n navItemName: string,\n configuration?: Record<string, unknown>,\n appId?: string,\n options?: NavigationOptions\n ): Promise<string | null> {\n // Get app (use provided or current active)\n const targetAppId = appId || this.appManager.GetActiveApp()?.ID;\n if (!targetAppId) {\n return null;\n }\n\n const app = this.appManager.GetAppById(targetAppId);\n if (!app) {\n return null;\n }\n\n // Find the nav item by name\n const navItems = await app.GetNavItems();\n const navItem = navItems.find(item => item.Label === navItemName);\n if (!navItem) {\n return null;\n }\n\n // Create a merged nav item with additional configuration\n const mergedNavItem: NavItem = {\n ...navItem,\n Configuration: {\n ...(navItem.Configuration || {}),\n ...(configuration || {})\n }\n };\n\n // Use existing OpenNavItem\n return this.OpenNavItem(targetAppId, mergedNavItem, app.GetColor(), options);\n }\n\n /**\n * Switch to an application by ID.\n * This sets the app as active and either opens a specific nav item or creates a default tab.\n * If the requested nav item already has an open tab, switches to that tab instead of creating a new one.\n * @param appId The application ID to switch to\n * @param navItemName Optional name of a nav item to open within the app. If provided, opens that nav item.\n * @param queryParams Optional query params to apply to the target tab. Applied SYNCHRONOUSLY once the\n * target tab is active — critical when navigating (e.g. from a Home pin) to an\n * app whose resource component is cached: the params must be in the tab config\n * BEFORE the tab-container reattaches the cached component, otherwise the cache\n * restores its own (stale) saved params and the navigation intent is lost.\n */\n async SwitchToApp(appId: string, navItemName?: string, queryParams?: Record<string, string | null>): Promise<void> {\n await this.appManager.SetActiveApp(appId);\n\n const app = this.appManager.GetAllApps().find(a => UUIDsEqual(a.ID, appId));\n if (!app) {\n return;\n }\n\n const appTabs = this.workspaceManager.GetAppTabs(appId);\n\n // If a specific nav item is requested\n if (navItemName) {\n const navItems = await app.GetNavItems();\n const navItem = navItems.find(item => item.Label === navItemName);\n if (navItem) {\n // Check if there's already a tab for this nav item\n const existingTab = appTabs.find(tab =>\n tab.title === navItem.Label ||\n (tab.configuration?.['route'] === navItem.Route && navItem.Route)\n );\n\n if (existingTab) {\n // Switch to existing tab\n this.workspaceManager.SetActiveTab(existingTab.id);\n } else {\n // Open new tab for this nav item\n this.OpenNavItem(appId, navItem, app.GetColor());\n }\n // Apply the requested query params to whichever tab is now active — synchronously,\n // so they're present before the (possibly cached) resource component reattaches.\n if (queryParams && Object.keys(queryParams).length > 0) {\n const targetTabId = this.workspaceManager.GetActiveTabId();\n if (targetTabId) {\n this.applyQueryParamsToTab(targetTabId, queryParams);\n }\n }\n return;\n }\n // Nav item not found, fall through to default behavior\n }\n\n // No specific nav item requested - check if app has any tabs\n if (appTabs.length === 0) {\n // Create default tab\n const tabRequest = await app.CreateDefaultTab();\n if (tabRequest) {\n this.workspaceManager.OpenTab(tabRequest, app.GetColor());\n }\n } else {\n // App has tabs - switch to the first one (or active one if exists)\n const config = this.workspaceManager.GetConfiguration();\n const activeAppTab = appTabs.find(t => t.id === config?.activeTabId);\n if (!activeAppTab) {\n // No active tab for this app, switch to first tab\n this.workspaceManager.SetActiveTab(appTabs[0].id);\n }\n }\n }\n\n /**\n * Update the query params for the currently active tab.\n * This updates the tab's configuration and triggers a URL sync via the shell's\n * workspace configuration subscription.\n *\n * Use this instead of directly calling router.navigate() to ensure proper\n * URL management that respects app-scoped routes.\n *\n * @param queryParams Object containing query param key-value pairs.\n * Use null values to remove a query param.\n * @example\n * // Add or update query params\n * navigationService.UpdateActiveTabQueryParams({ category: 'abc123', dashboard: 'xyz789' });\n *\n * // Remove a query param\n * navigationService.UpdateActiveTabQueryParams({ category: null });\n */\n UpdateActiveTabQueryParams(queryParams: Record<string, string | null>): void {\n const activeTabId = this.workspaceManager.GetActiveTabId();\n if (!activeTabId) {\n console.warn('NavigationService.UpdateActiveTabQueryParams: No active tab');\n return;\n }\n\n this.applyQueryParamsToTab(activeTabId, queryParams);\n }\n\n /**\n * Update query params for a specific tab, optionally only if the tab still hosts\n * the expected resource identity. This matters in single-resource mode where a\n * tab ID can be reused for a different resource while the previous component is\n * detached but still alive in the cache.\n */\n UpdateTabQueryParams(\n tabId: string,\n queryParams: Record<string, string | null>,\n guard?: TabQueryParamUpdateGuard\n ): boolean {\n const tab = this.workspaceManager.GetTab(tabId);\n if (!tab) {\n console.debug('NavigationService.UpdateTabQueryParams: Tab not found; ignoring stale query-param update:', tabId);\n return false;\n }\n\n if (guard && !this.tabMatchesQueryParamGuard(tab, guard)) {\n console.debug('NavigationService.UpdateTabQueryParams: Tab identity changed; ignoring stale query-param update:', {\n tabId,\n guard,\n current: {\n resourceType: tab.configuration?.['resourceType'],\n driverClass: tab.configuration?.['resourceTypeDriverClass'] || tab.configuration?.['driverClass'],\n recordId: tab.resourceRecordId || tab.configuration?.['recordId'],\n navItemName: tab.configuration?.['navItemName'],\n entity: tab.configuration?.['Entity'] || tab.configuration?.['entity']\n }\n });\n return false;\n }\n\n this.applyQueryParamsToTab(tabId, queryParams);\n return true;\n }\n\n /**\n * Notify subscribers that query params changed on a specific tab.\n * Called by the shell when back/forward navigation changes query params on the active tab.\n * The notification includes the tab ID so only the component in that tab reacts.\n */\n NotifyQueryParamsChanged(tabId: string, params: Record<string, string>): void {\n this.queryParamChanged$.next({ TabId: tabId, Params: params });\n }\n\n /**\n * Reactively observe the query params for a specific tab.\n *\n * Backed by the workspace BehaviorSubject, so a subscriber receives the current\n * params *immediately* on subscribe AND every subsequent change — including the\n * deep-link params that the ResourceResolver merges into the tab configuration on\n * a cold/direct URL load.\n *\n * This is the race-free counterpart to {@link NotifyQueryParamsChanged} (a plain\n * Subject that drops events fired before a component has subscribed). A resource\n * component that mounts from workspace restoration can subscribe here and still\n * pick up its initial deep-link state regardless of whether the params landed in\n * the tab config before or after it mounted.\n */\n public ObserveTabQueryParams(tabId: string): Observable<Record<string, string>> {\n return this.workspaceManager.Configuration.pipe(\n map(config => {\n const tab = config?.tabs?.find(t => t.id === tabId);\n return (tab?.configuration?.['queryParams'] || {}) as Record<string, string>;\n }),\n distinctUntilChanged((a, b) => this.shallowParamsEqual(a, b))\n );\n }\n\n private shallowParamsEqual(a: Record<string, string>, b: Record<string, string>): boolean {\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) {\n return false;\n }\n return keysA.every(key => a[key] === b[key]);\n }\n\n private tabMatchesQueryParamGuard(tab: { resourceRecordId?: string; configuration?: Record<string, unknown> }, guard: TabQueryParamUpdateGuard): boolean {\n const config = tab.configuration || {};\n const matches = (expected: string | null | undefined, actual: unknown, normalize = false): boolean => {\n if (expected === undefined || expected === null) {\n return true;\n }\n const expectedText = String(expected);\n const actualText = actual == null ? '' : String(actual);\n return normalize\n ? expectedText.trim().toLowerCase() === actualText.trim().toLowerCase()\n : expectedText === actualText;\n };\n\n const currentDriverClass = (config['resourceTypeDriverClass'] || config['driverClass']) as string | undefined;\n const currentRecordId = tab.resourceRecordId || (config['recordId'] as string | undefined) || '';\n const currentEntity = (config['Entity'] || config['entity']) as string | undefined;\n\n // Resource type and entity names can vary by casing/metadata spelling; class names,\n // record IDs, and nav labels are canonical tab identity fields and stay exact-match.\n return matches(guard.resourceType, config['resourceType'], true) &&\n matches(guard.driverClass, currentDriverClass) &&\n matches(guard.recordId, currentRecordId) &&\n matches(guard.navItemName, config['navItemName']) &&\n matches(guard.entity, currentEntity, true);\n }\n\n /**\n * Apply query params to a specific tab by ID.\n * Merges with any existing query params on the tab. Use null values to remove params.\n */\n private applyQueryParamsToTab(tabId: string, queryParams: Record<string, string | null>): void {\n const tab = this.workspaceManager.GetTab(tabId);\n if (!tab) {\n console.warn('NavigationService.applyQueryParamsToTab: Tab not found:', tabId);\n return;\n }\n\n // Get existing queryParams from tab configuration\n const existingQueryParams = (tab.configuration?.['queryParams'] || {}) as Record<string, string | null>;\n\n // Merge with new query params\n const mergedQueryParams: Record<string, string> = {};\n\n // Start with existing params (excluding nulls)\n for (const [key, value] of Object.entries(existingQueryParams)) {\n if (value !== null) {\n mergedQueryParams[key] = value;\n }\n }\n\n // Apply new params (null means remove)\n for (const [key, value] of Object.entries(queryParams)) {\n if (value === null) {\n delete mergedQueryParams[key];\n } else {\n mergedQueryParams[key] = value;\n }\n }\n\n // Update the tab configuration\n this.workspaceManager.UpdateTabConfiguration(tabId, {\n queryParams: Object.keys(mergedQueryParams).length > 0 ? mergedQueryParams : undefined\n });\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-shared",
3
- "version": "5.43.0",
3
+ "version": "5.45.0",
4
4
  "description": "MemberJunction: MJ Explorer Angular Shared Package - utility functions and other reusable elements used across other MJ Angular packages within the MJ Explorer App - do not use outside of MJ Explorer.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -29,17 +29,17 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@angular/platform-browser": "21.1.3",
32
- "@memberjunction/ai-core-plus": "5.43.0",
33
- "@memberjunction/ai-engine-base": "5.43.0",
34
- "@memberjunction/core": "5.43.0",
35
- "@memberjunction/core-entities": "5.43.0",
36
- "@memberjunction/entity-communications-base": "5.43.0",
37
- "@memberjunction/global": "5.43.0",
38
- "@memberjunction/graphql-dataprovider": "5.43.0",
39
- "@memberjunction/ng-base-application": "5.43.0",
40
- "@memberjunction/ng-base-types": "5.43.0",
41
- "@memberjunction/ng-notifications": "5.43.0",
42
- "@memberjunction/ng-shared-generic": "5.43.0",
32
+ "@memberjunction/ai-core-plus": "5.45.0",
33
+ "@memberjunction/ai-engine-base": "5.45.0",
34
+ "@memberjunction/core": "5.45.0",
35
+ "@memberjunction/core-entities": "5.45.0",
36
+ "@memberjunction/entity-communications-base": "5.45.0",
37
+ "@memberjunction/global": "5.45.0",
38
+ "@memberjunction/graphql-dataprovider": "5.45.0",
39
+ "@memberjunction/ng-base-application": "5.45.0",
40
+ "@memberjunction/ng-base-types": "5.45.0",
41
+ "@memberjunction/ng-notifications": "5.45.0",
42
+ "@memberjunction/ng-shared-generic": "5.45.0",
43
43
  "html-to-image": "^1.11.11",
44
44
  "tslib": "^2.8.1"
45
45
  },
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=navigation-framework.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation-framework.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/navigation-framework.test.ts"],"names":[],"mappings":""}
@@ -1,307 +0,0 @@
1
- /**
2
- * Tests for the Navigation Back/Forward Framework:
3
- * - BaseResourceComponent query param lifecycle (OnQueryParamsChanged, UpdateQueryParams, GetQueryParams)
4
- * - NavigationService.NotifyQueryParamsChanged / QueryParamChanged$
5
- * - Suppression flag prevents loops
6
- * - Tab-scoped filtering prevents cross-tab leakage
7
- */
8
- import { describe, it, expect, vi } from 'vitest';
9
- // Mock Angular dependencies
10
- vi.mock('@angular/core', () => ({
11
- Directive: () => (target) => target,
12
- Injectable: () => (target) => target,
13
- OnInit: class {
14
- },
15
- OnDestroy: class {
16
- },
17
- inject: vi.fn(),
18
- Input: () => () => { },
19
- Output: () => () => { },
20
- EventEmitter: class {
21
- emit() { }
22
- },
23
- }));
24
- vi.mock('@angular/router', () => ({}));
25
- vi.mock('@memberjunction/core', () => ({
26
- BaseEntity: class {
27
- },
28
- Metadata: class {
29
- },
30
- CompositeKey: class {
31
- },
32
- }));
33
- vi.mock('@memberjunction/core-entities', () => ({
34
- ResourceData: class {
35
- ID = 0;
36
- Name = '';
37
- ResourceTypeID = '';
38
- ResourceRecordID = '';
39
- Configuration = {};
40
- constructor(data) {
41
- if (data)
42
- Object.assign(this, data);
43
- }
44
- },
45
- }));
46
- vi.mock('@memberjunction/global', () => ({
47
- UUIDsEqual: (a, b) => a === b,
48
- }));
49
- // ---- QueryParamChangeEvent tests ----
50
- describe('QueryParamChangeEvent', () => {
51
- it('should have TabId and Params fields', () => {
52
- // Verify the interface shape by creating a conforming object
53
- const event = {
54
- TabId: 'tab-123',
55
- Params: { entity: 'Actions', filter: 'active' },
56
- };
57
- expect(event.TabId).toBe('tab-123');
58
- expect(event.Params.entity).toBe('Actions');
59
- expect(event.Params.filter).toBe('active');
60
- });
61
- });
62
- // ---- Shell helper function tests (pure functions extracted for testing) ----
63
- describe('extractQueryParamsFromUrl', () => {
64
- // Replicate the shell's extractQueryParamsFromUrl logic for unit testing
65
- function extractQueryParamsFromUrl(url) {
66
- const fragmentIndex = url.indexOf('#');
67
- const cleanUrl = fragmentIndex !== -1 ? url.substring(0, fragmentIndex) : url;
68
- const queryIndex = cleanUrl.indexOf('?');
69
- if (queryIndex === -1)
70
- return {};
71
- const params = new URLSearchParams(cleanUrl.substring(queryIndex + 1));
72
- const result = {};
73
- params.forEach((value, key) => { result[key] = value; });
74
- return result;
75
- }
76
- it('should extract query params from URL', () => {
77
- const result = extractQueryParamsFromUrl('/app/data-explorer/Data?entity=Actions&filter=active');
78
- expect(result).toEqual({ entity: 'Actions', filter: 'active' });
79
- });
80
- it('should return empty object for URL without query params', () => {
81
- expect(extractQueryParamsFromUrl('/app/data-explorer/Data')).toEqual({});
82
- });
83
- it('should decode encoded values', () => {
84
- const result = extractQueryParamsFromUrl('/app/data?entity=MJ%3A%20Actions');
85
- expect(result.entity).toBe('MJ: Actions');
86
- });
87
- it('should handle empty values', () => {
88
- const result = extractQueryParamsFromUrl('/app/data?key=');
89
- expect(result.key).toBe('');
90
- });
91
- it('should ignore fragment (#hash)', () => {
92
- const result = extractQueryParamsFromUrl('/app/data?entity=Members#section');
93
- expect(result.entity).toBe('Members');
94
- expect(result['#section']).toBeUndefined();
95
- });
96
- it('should handle URL with only fragment, no query params', () => {
97
- const result = extractQueryParamsFromUrl('/app/data#section');
98
- expect(result).toEqual({});
99
- });
100
- it('should handle + as space', () => {
101
- const result = extractQueryParamsFromUrl('/app/data?entity=My+Entity');
102
- expect(result.entity).toBe('My Entity');
103
- });
104
- });
105
- describe('queryParamsEqual', () => {
106
- // Replicate the shell's queryParamsEqual logic
107
- function queryParamsEqual(a, b) {
108
- const keysA = Object.keys(a);
109
- const keysB = Object.keys(b);
110
- if (keysA.length !== keysB.length)
111
- return false;
112
- return keysA.every(key => decodeURIComponent(a[key]?.replace(/\+/g, ' ') || '') ===
113
- decodeURIComponent(b[key]?.replace(/\+/g, ' ') || ''));
114
- }
115
- it('should return true for identical params', () => {
116
- expect(queryParamsEqual({ entity: 'Actions' }, { entity: 'Actions' })).toBe(true);
117
- });
118
- it('should return false for different values', () => {
119
- expect(queryParamsEqual({ entity: 'Actions' }, { entity: 'Members' })).toBe(false);
120
- });
121
- it('should return false for different key counts', () => {
122
- expect(queryParamsEqual({ entity: 'Actions' }, { entity: 'Actions', filter: 'x' })).toBe(false);
123
- });
124
- it('should return true for both empty', () => {
125
- expect(queryParamsEqual({}, {})).toBe(true);
126
- });
127
- it('should return false for one empty, one not', () => {
128
- expect(queryParamsEqual({}, { entity: 'Actions' })).toBe(false);
129
- });
130
- it('should normalize + vs %20 encoding', () => {
131
- expect(queryParamsEqual({ entity: 'My+Entity' }, { entity: 'My%20Entity' })).toBe(true);
132
- });
133
- it('should handle missing keys', () => {
134
- expect(queryParamsEqual({ a: 'x' }, { b: 'x' })).toBe(false);
135
- });
136
- });
137
- // ---- buildResourceUrl appendQP helper tests ----
138
- describe('appendQueryParams (appendQP helper)', () => {
139
- function appendQP(url, queryParams) {
140
- if (!queryParams || Object.keys(queryParams).length === 0)
141
- return url;
142
- const separator = url.includes('?') ? '&' : '?';
143
- const params = new URLSearchParams(queryParams);
144
- return `${url}${separator}${params.toString()}`;
145
- }
146
- it('should append params to URL without existing params', () => {
147
- const result = appendQP('/app/data/record/Entity/123', { entity: 'Actions' });
148
- expect(result).toBe('/app/data/record/Entity/123?entity=Actions');
149
- });
150
- it('should append params to URL with existing params', () => {
151
- const result = appendQP('/app/data?existing=x', { entity: 'Actions' });
152
- expect(result).toBe('/app/data?existing=x&entity=Actions');
153
- });
154
- it('should return URL unchanged for empty params', () => {
155
- expect(appendQP('/app/data', {})).toBe('/app/data');
156
- });
157
- it('should return URL unchanged for undefined params', () => {
158
- expect(appendQP('/app/data', undefined)).toBe('/app/data');
159
- });
160
- it('should properly encode special characters', () => {
161
- const result = appendQP('/app/data', { entity: 'MJ: Actions' });
162
- expect(result).toContain('entity=MJ');
163
- // URLSearchParams encodes spaces as +
164
- expect(result).toMatch(/entity=MJ[+%].*Actions/);
165
- });
166
- it('should handle multiple params', () => {
167
- const result = appendQP('/app/data', { entity: 'Actions', filter: 'active', view: 'grid' });
168
- expect(result).toContain('entity=Actions');
169
- expect(result).toContain('filter=active');
170
- expect(result).toContain('view=grid');
171
- });
172
- });
173
- // ---- shouldReuseRoute logic tests ----
174
- describe('shouldReuseRoute logic', () => {
175
- // Test the comparison logic (routeConfig + params, NOT queryParams)
176
- function objectContentsEqual(obj1, obj2) {
177
- if (obj1 === obj2)
178
- return true;
179
- if (!obj1 || !obj2)
180
- return false;
181
- const keys1 = Object.keys(obj1);
182
- const keys2 = Object.keys(obj2);
183
- if (keys1.length !== keys2.length)
184
- return false;
185
- return keys1.every(key => obj1[key] === obj2[key]);
186
- }
187
- function shouldReuseRoute(futureConfig, currConfig, futureParams, currParams) {
188
- return futureConfig === currConfig && objectContentsEqual(futureParams, currParams);
189
- }
190
- it('should return true for same config and params with different query params', () => {
191
- const config = {};
192
- // Query params intentionally excluded
193
- expect(shouldReuseRoute(config, config, { id: '1' }, { id: '1' })).toBe(true);
194
- });
195
- it('should return false for different path params', () => {
196
- const config = {};
197
- expect(shouldReuseRoute(config, config, { id: '1' }, { id: '2' })).toBe(false);
198
- });
199
- it('should return false for different route configs', () => {
200
- expect(shouldReuseRoute({}, {}, { id: '1' }, { id: '1' })).toBe(false);
201
- });
202
- it('should return true for same everything', () => {
203
- const config = {};
204
- expect(shouldReuseRoute(config, config, {}, {})).toBe(true);
205
- });
206
- it('should return false when one has params and other does not', () => {
207
- const config = {};
208
- expect(shouldReuseRoute(config, config, { id: '1' }, {})).toBe(false);
209
- });
210
- });
211
- // ---- Suppression flag behavior ----
212
- describe('_suppressQueryParamSync behavior', () => {
213
- it('should prevent UpdateQueryParams during suppression', () => {
214
- let suppressFlag = false;
215
- const mockUpdateActiveTabQP = vi.fn();
216
- function updateQueryParams(params) {
217
- if (suppressFlag)
218
- return;
219
- mockUpdateActiveTabQP(params);
220
- }
221
- // Normal call
222
- updateQueryParams({ entity: 'Actions' });
223
- expect(mockUpdateActiveTabQP).toHaveBeenCalledTimes(1);
224
- // Suppressed call (simulates being inside OnQueryParamsChanged)
225
- suppressFlag = true;
226
- updateQueryParams({ entity: 'Members' });
227
- expect(mockUpdateActiveTabQP).toHaveBeenCalledTimes(1); // Still 1, not 2
228
- // After suppression cleared
229
- suppressFlag = false;
230
- updateQueryParams({ entity: 'Queries' });
231
- expect(mockUpdateActiveTabQP).toHaveBeenCalledTimes(2);
232
- });
233
- it('should clear suppression flag even if OnQueryParamsChanged throws', () => {
234
- let suppressFlag = false;
235
- function simulateSubscription(callback) {
236
- suppressFlag = true;
237
- try {
238
- callback();
239
- }
240
- finally {
241
- suppressFlag = false;
242
- }
243
- }
244
- // The try/finally ensures flag is cleared even when callback throws
245
- try {
246
- simulateSubscription(() => {
247
- throw new Error('Component error');
248
- });
249
- }
250
- catch {
251
- // Expected — the error propagates but flag should still be cleared
252
- }
253
- // Flag should be cleared despite the error
254
- expect(suppressFlag).toBe(false);
255
- });
256
- });
257
- // ---- GetQueryParams behavior ----
258
- describe('GetQueryParams', () => {
259
- it('should return params from Configuration.queryParams', () => {
260
- const config = { queryParams: { entity: 'Actions', filter: 'active' } };
261
- const result = config['queryParams'] || {};
262
- expect(result).toEqual({ entity: 'Actions', filter: 'active' });
263
- });
264
- it('should return empty object when no queryParams', () => {
265
- const config = {};
266
- const result = config['queryParams'] || {};
267
- expect(result).toEqual({});
268
- });
269
- it('should return empty object when Configuration is null', () => {
270
- const config = null;
271
- const result = (config?.['queryParams'] ?? {});
272
- expect(result).toEqual({});
273
- });
274
- });
275
- // ---- Tab-scoped filtering ----
276
- describe('Tab-scoped query param filtering', () => {
277
- it('should only deliver events matching the component tab ID', () => {
278
- const componentTabId = 'tab-abc';
279
- const events = [
280
- { TabId: 'tab-abc', Params: { entity: 'Actions' } },
281
- { TabId: 'tab-xyz', Params: { entity: 'Members' } },
282
- { TabId: 'tab-abc', Params: { entity: 'Queries' } },
283
- ];
284
- const received = events.filter(e => e.TabId === componentTabId);
285
- expect(received).toHaveLength(2);
286
- expect(received[0].Params.entity).toBe('Actions');
287
- expect(received[1].Params.entity).toBe('Queries');
288
- });
289
- it('should not deliver any events for non-matching tab ID', () => {
290
- const componentTabId = 'tab-none';
291
- const events = [
292
- { TabId: 'tab-abc', Params: { entity: 'Actions' } },
293
- { TabId: 'tab-xyz', Params: { entity: 'Members' } },
294
- ];
295
- const received = events.filter(e => e.TabId === componentTabId);
296
- expect(received).toHaveLength(0);
297
- });
298
- it('should handle empty tab ID gracefully', () => {
299
- const componentTabId = '';
300
- const events = [
301
- { TabId: 'tab-abc', Params: { entity: 'Actions' } },
302
- ];
303
- const received = events.filter(e => e.TabId === componentTabId);
304
- expect(received).toHaveLength(0);
305
- });
306
- });
307
- //# sourceMappingURL=navigation-framework.test.js.map