@memberjunction/ng-explorer-core 5.22.0 → 5.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/lazy-feature-config.d.ts +1 -1
- package/dist/generated/lazy-feature-config.d.ts.map +1 -1
- package/dist/generated/lazy-feature-config.js +3 -2
- package/dist/generated/lazy-feature-config.js.map +1 -1
- package/dist/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.js +49 -49
- package/dist/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.js.map +1 -1
- package/dist/lib/generic/form-toolbar.js +10 -10
- package/dist/lib/generic/form-toolbar.js.map +1 -1
- package/dist/lib/oauth/oauth-callback.component.js +6 -6
- package/dist/lib/oauth/oauth-callback.component.js.map +1 -1
- package/dist/lib/oauth/oauth.module.d.ts +2 -3
- package/dist/lib/oauth/oauth.module.d.ts.map +1 -1
- package/dist/lib/oauth/oauth.module.js +0 -4
- package/dist/lib/oauth/oauth.module.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts +6 -25
- package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-collections-resource.component.js +30 -124
- package/dist/lib/resource-wrappers/chat-collections-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts +7 -23
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.js +50 -142
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts +3 -19
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.js +16 -98
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/view-resource.component.d.ts +13 -11
- package/dist/lib/resource-wrappers/view-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/view-resource.component.js +80 -89
- package/dist/lib/resource-wrappers/view-resource.component.js.map +1 -1
- package/dist/lib/shell/components/header/app-nav.component.d.ts.map +1 -1
- package/dist/lib/shell/components/header/app-nav.component.js +18 -3
- package/dist/lib/shell/components/header/app-nav.component.js.map +1 -1
- package/dist/lib/shell/components/tabs/component-cache-manager.d.ts +38 -16
- package/dist/lib/shell/components/tabs/component-cache-manager.d.ts.map +1 -1
- package/dist/lib/shell/components/tabs/component-cache-manager.js +57 -35
- package/dist/lib/shell/components/tabs/component-cache-manager.js.map +1 -1
- package/dist/lib/shell/components/tabs/tab-container.component.d.ts +33 -0
- package/dist/lib/shell/components/tabs/tab-container.component.d.ts.map +1 -1
- package/dist/lib/shell/components/tabs/tab-container.component.js +99 -16
- package/dist/lib/shell/components/tabs/tab-container.component.js.map +1 -1
- package/dist/lib/shell/services/settings-dialog.service.d.ts +8 -8
- package/dist/lib/shell/services/settings-dialog.service.d.ts.map +1 -1
- package/dist/lib/shell/services/settings-dialog.service.js +20 -26
- package/dist/lib/shell/services/settings-dialog.service.js.map +1 -1
- package/dist/lib/shell/shell.component.d.ts.map +1 -1
- package/dist/lib/shell/shell.component.js +17 -16
- package/dist/lib/shell/shell.component.js.map +1 -1
- package/dist/lib/shell/shell.module.d.ts +4 -5
- package/dist/lib/shell/shell.module.d.ts.map +1 -1
- package/dist/lib/shell/shell.module.js +4 -8
- package/dist/lib/shell/shell.module.js.map +1 -1
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +72 -71
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js.map +1 -1
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +11 -11
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js.map +1 -1
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts +36 -12
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts.map +1 -1
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +78 -50
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js.map +1 -1
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts +12 -5
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts.map +1 -1
- package/dist/lib/single-dashboard/single-dashboard.component.js +44 -55
- package/dist/lib/single-dashboard/single-dashboard.component.js.map +1 -1
- package/dist/lib/single-list-detail/single-list-detail.component.d.ts +10 -2
- package/dist/lib/single-list-detail/single-list-detail.component.d.ts.map +1 -1
- package/dist/lib/single-list-detail/single-list-detail.component.js +313 -243
- package/dist/lib/single-list-detail/single-list-detail.component.js.map +1 -1
- package/dist/module.d.ts +23 -34
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +33 -74
- package/dist/module.js.map +1 -1
- package/package.json +37 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-preferences-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.ts","../../../src/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAe,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;ICO5C,wBAAiC;IAAC,8BACpC;;;IACE,wBAAuC;IAAC,YAC1C;;;IAD0C,cAC1C;IAD0C,oEAC1C;;;;IAKI,AADF,AADF,8BAAsC,YAC7B,gBAKsC;IADpC,uUAA4B;IAC5B,wMAAU,+BAAwB,KAAC;IAJ1C,iBAI2C;IAC3C,sCAC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AID,eAIC;YAJD,uCAIC;YAED,cAKC;YALD,qCAKC;YAED,cAqFC;YArFD,sDAqFC;YAWO,eAAkC;YAAlC,wDAAkC;YAExC,cAKC;YALD,sCAKC;;;iFD1IM,mCAAmC;cAN/C,SAAS;6BACI,KAAK,YACP,iCAAiC;;kBAK1C,KAAK;;kBACL,KAAK;;kBACL,MAAM;;kFAHI,mCAAmC","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';\nimport { LogError, Metadata, RunView } from '@memberjunction/core';\nimport { MJDashboardEntityExtended, MJDashboardUserPreferenceEntity, MJApplicationEntity } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\n\nexport interface DashboardPreferencesResult {\n saved: boolean;\n preferences?: MJDashboardUserPreferenceEntity[];\n}\n\n@Component({\n standalone: false,\n selector: 'mj-dashboard-preferences-dialog',\n templateUrl: './dashboard-preferences-dialog.component.html',\n styleUrls: ['./dashboard-preferences-dialog.component.css']\n})\nexport class DashboardPreferencesDialogComponent implements OnInit {\n @Input() public applicationId: string | null = null;\n @Input() public scope: 'Global' | 'App' = 'Global';\n @Output() public result = new EventEmitter<DashboardPreferencesResult>();\n\n public availableDashboards: MJDashboardEntityExtended[] = [];\n public configuredDashboards: MJDashboardEntityExtended[] = [];\n public applicationName: string = '';\n public loading: boolean = true;\n public saving: boolean = false;\n public error: string | null = null;\n public hasChanges: boolean = false;\n public isSysAdmin: boolean = false;\n public preferenceMode: 'personal' | 'system' = 'personal';\n\n private originalConfiguredIds: string[] = [];\n private currentUserPreferences: MJDashboardUserPreferenceEntity[] = [];\n private allAvailableDashboards: MJDashboardEntityExtended[] = [];\n\n async ngOnInit(): Promise<void> {\n try {\n await this.loadData();\n } catch (error) {\n LogError('Error initializing dashboard preferences dialog', null, error);\n this.error = 'Failed to load dashboard preferences';\n } finally {\n this.loading = false;\n }\n }\n\n private async loadData(): Promise<void> {\n const md = new Metadata();\n \n // Check if current user is sysadmin\n this.isSysAdmin = md.CurrentUser.Type.trim().toLowerCase() === 'owner';\n console.log('User is sysadmin:', this.isSysAdmin);\n \n // Default to personal preferences for all users (including sysadmin)\n this.preferenceMode = 'personal';\n \n // Load application name if we're in app scope\n if (this.scope === 'App' && this.applicationId) {\n await this.loadApplicationName();\n }\n\n // Get cached dashboards from MJ_Metadata dataset\n const ds = await md.GetAndCacheDatasetByName(\"MJ_Metadata\");\n if (!ds || !ds.Success) {\n throw new Error(ds?.Status || 'Failed to load metadata dataset');\n }\n\n const dashList = ds.Results.find(r => r.Code === 'Dashboards');\n if (!dashList) {\n throw new Error('Dashboards dataset not found');\n }\n\n // Filter dashboards by scope\n const appFilter = this.applicationId ? ` AND ApplicationID='${this.applicationId}'` : ' AND ApplicationID IS NULL';\n this.allAvailableDashboards = dashList.Results.filter((d: MJDashboardEntityExtended) => {\n if (this.scope === 'Global') {\n return d.Scope === 'Global' && !d.ApplicationID;\n } else {\n return UUIDsEqual(d.ApplicationID, this.applicationId) // ignore scope for dashboards that match app id, sometimes they have a global scope as they can be shown globally as well as app specific\n }\n });\n\n // Load current user preferences\n await this.loadCurrentPreferences();\n \n // Split dashboards into available and configured\n this.splitDashboards();\n \n // Store original state to detect changes\n this.originalConfiguredIds = this.configuredDashboards.map(d => d.ID);\n }\n\n private async loadApplicationName(): Promise<void> {\n if (!this.applicationId) return;\n \n try {\n const md = new Metadata();\n const ds = await md.GetAndCacheDatasetByName(\"MJ_Metadata\");\n const appList = ds.Results.find(r => r.Code === 'Applications');\n if (appList) {\n const app = appList.Results.find((a: MJApplicationEntity) => UUIDsEqual(a.ID, this.applicationId));\n this.applicationName = app?.Name || 'Unknown Application';\n }\n } catch (error) {\n LogError('Error loading application name', null, error);\n this.applicationName = 'Unknown Application';\n }\n }\n\n private async loadCurrentPreferences(): Promise<void> {\n const rv = new RunView();\n const md = new Metadata();\n \n const appFilter = this.applicationId ? ` AND ApplicationID='${this.applicationId}'` : '';\n const baseCondition = `Scope='${this.scope}'${appFilter}`;\n \n let filter: string;\n \n if (this.isSysAdmin && this.scope === 'Global' && this.preferenceMode === 'system') {\n // Load system defaults only (UserID IS NULL)\n filter = `UserID IS NULL AND ${baseCondition}`;\n } else {\n // Load personal user preferences (including for sysadmin when in personal mode)\n // For personal mode, we ONLY load the user's specific preferences, no fallback to system defaults\n // This allows sysadmin to see their actual personal preferences vs system defaults\n filter = `UserID='${md.CurrentUser.ID}' AND ${baseCondition}`;\n }\n\n console.log('Loading preferences with filter:', filter);\n\n const prefsResult = await rv.RunView<MJDashboardUserPreferenceEntity>({\n EntityName: 'MJ: Dashboard User Preferences',\n ExtraFilter: filter,\n ResultType: 'entity_object',\n OrderBy: 'DisplayOrder',\n });\n\n this.currentUserPreferences = prefsResult?.Results || [];\n console.log('Loaded preferences:', this.currentUserPreferences.length);\n }\n\n private splitDashboards(): void {\n const configuredIds = new Set(this.currentUserPreferences.map(p => p.DashboardID));\n \n // Get configured dashboards in the right order\n this.configuredDashboards = this.currentUserPreferences\n .map(pref => this.allAvailableDashboards.find(d => UUIDsEqual(d.ID, pref.DashboardID)))\n .filter((d): d is MJDashboardEntityExtended => d !== undefined);\n \n // Get available dashboards (not configured)\n this.availableDashboards = this.allAvailableDashboards\n .filter(d => !configuredIds.has(d.ID))\n .sort((a, b) => a.Name.localeCompare(b.Name));\n }\n\n public onDrop(event: CdkDragDrop<MJDashboardEntityExtended[]>): void {\n try {\n if (event.previousContainer === event.container) {\n // Reordering within the same list\n moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);\n } else {\n // Moving between lists\n transferArrayItem(\n event.previousContainer.data,\n event.container.data,\n event.previousIndex,\n event.currentIndex\n );\n \n // If moving to configured dashboards, sort the available list\n if (event.container.data === this.configuredDashboards) {\n this.availableDashboards.sort((a, b) => a.Name.localeCompare(b.Name));\n }\n }\n \n this.checkForChanges();\n } catch (error) {\n LogError('Error in drag drop operation', null, error);\n this.error = 'Error reordering dashboards. Please try again.';\n \n // Clear error after 3 seconds\n setTimeout(() => {\n this.error = null;\n }, 3000);\n }\n }\n\n public addDashboard(dashboard: MJDashboardEntityExtended): void {\n try {\n const index = this.availableDashboards.findIndex(d => UUIDsEqual(d.ID, dashboard.ID));\n if (index !== -1) {\n this.availableDashboards.splice(index, 1);\n this.configuredDashboards.push(dashboard);\n this.checkForChanges();\n }\n } catch (error) {\n LogError('Error adding dashboard', null, error);\n this.error = 'Error adding dashboard. Please try again.';\n \n // Clear error after 3 seconds\n setTimeout(() => {\n this.error = null;\n }, 3000);\n }\n }\n\n public removeDashboard(dashboard: MJDashboardEntityExtended): void {\n try {\n const index = this.configuredDashboards.findIndex(d => UUIDsEqual(d.ID, dashboard.ID));\n if (index !== -1) {\n this.configuredDashboards.splice(index, 1);\n this.availableDashboards.push(dashboard);\n this.availableDashboards.sort((a, b) => a.Name.localeCompare(b.Name));\n this.checkForChanges();\n }\n } catch (error) {\n LogError('Error removing dashboard', null, error);\n this.error = 'Error removing dashboard. Please try again.';\n \n // Clear error after 3 seconds\n setTimeout(() => {\n this.error = null;\n }, 3000);\n }\n }\n\n public async onPreferenceModeChange(): Promise<void> {\n try {\n this.loading = true;\n this.error = null;\n \n // Reload preferences with new mode\n await this.loadCurrentPreferences();\n this.splitDashboards();\n this.originalConfiguredIds = this.configuredDashboards.map(d => d.ID);\n this.hasChanges = false;\n \n } catch (error) {\n LogError('Error changing preference mode', null, error);\n this.error = 'Error loading preferences. Please try again.';\n } finally {\n this.loading = false;\n }\n }\n\n private checkForChanges(): void {\n try {\n const currentConfiguredIds = this.configuredDashboards.map(d => d.ID);\n \n // Check if the order or selection has changed\n this.hasChanges = currentConfiguredIds.length !== this.originalConfiguredIds.length ||\n currentConfiguredIds.some((id, index) => id !== this.originalConfiguredIds[index]);\n \n // Debug logging\n console.log('Dashboard preferences change check:', {\n original: this.originalConfiguredIds,\n current: currentConfiguredIds,\n hasChanges: this.hasChanges\n });\n } catch (error) {\n LogError('Error checking for changes', null, error);\n this.hasChanges = false;\n }\n }\n\n public async onSave(): Promise<void> {\n if (this.saving || !this.hasChanges) {\n console.log('Save cancelled:', { saving: this.saving, hasChanges: this.hasChanges });\n return;\n }\n\n try {\n this.saving = true;\n console.log('Starting save process with configured dashboards:', this.configuredDashboards.map(d => ({ id: d.ID, name: d.Name })));\n \n const md = new Metadata();\n const rv = new RunView();\n\n // Get existing preferences for this scope\n const baseCondition = this.scope === 'Global' \n ? `Scope='Global' AND ApplicationID IS NULL`\n : `Scope='App' AND ApplicationID='${this.applicationId}'`;\n \n let userFilter: string;\n \n if (this.isSysAdmin && this.scope === 'Global' && this.preferenceMode === 'system') {\n // Managing system defaults\n userFilter = `UserID IS NULL AND ${baseCondition}`;\n } else {\n // Managing personal preferences\n userFilter = `UserID='${md.CurrentUser.ID}' AND ${baseCondition}`;\n }\n \n console.log('Loading existing preferences with filter:', userFilter);\n \n const existingPrefs = await rv.RunView<MJDashboardUserPreferenceEntity>({\n EntityName: 'MJ: Dashboard User Preferences',\n ExtraFilter: userFilter,\n ResultType: 'entity_object',\n });\n\n const existingPreferences = existingPrefs?.Results || [];\n console.log('Found existing preferences:', existingPreferences.length);\n\n // Create maps for efficient lookups\n const existingByDashboardId = new Map<string, MJDashboardUserPreferenceEntity>();\n existingPreferences.forEach(pref => {\n existingByDashboardId.set(pref.DashboardID, pref);\n });\n\n const configuredDashboardIds = new Set(this.configuredDashboards.map(d => d.ID));\n\n // Step 1: Delete preferences that are no longer configured\n const prefsToDelete = existingPreferences.filter(pref => !configuredDashboardIds.has(pref.DashboardID));\n console.log('Preferences to delete:', prefsToDelete.length);\n \n for (const pref of prefsToDelete) {\n console.log('Deleting preference for dashboard:', pref.DashboardID);\n if (!await pref.Delete()) {\n const errorMsg = pref.LatestResult?.Error || pref.LatestResult?.Message || 'Unknown error';\n throw new Error(`Failed to delete preference: ${errorMsg}`);\n }\n }\n\n // Step 2: Update existing preferences or create new ones\n const newPreferences: MJDashboardUserPreferenceEntity[] = [];\n \n for (let i = 0; i < this.configuredDashboards.length; i++) {\n const dashboard = this.configuredDashboards[i];\n const newDisplayOrder = i + 1;\n \n let prefEntity = existingByDashboardId.get(dashboard.ID);\n \n if (prefEntity) {\n // Update existing preference\n console.log(`Updating existing preference for dashboard ${dashboard.Name}, new order: ${newDisplayOrder}`);\n prefEntity.DisplayOrder = newDisplayOrder;\n \n if (!await prefEntity.Save()) {\n const errorMsg = prefEntity.LatestResult?.Error || prefEntity.LatestResult?.Message || 'Unknown error';\n throw new Error(`Failed to update preference for dashboard ${dashboard.Name}: ${errorMsg}`);\n }\n } else {\n // Create new preference\n console.log(`Creating new preference for dashboard ${dashboard.Name}, order: ${newDisplayOrder}`);\n prefEntity = await md.GetEntityObject<MJDashboardUserPreferenceEntity>('MJ: Dashboard User Preferences');\n \n // Set UserID based on preference mode\n if (this.isSysAdmin && this.scope === 'Global' && this.preferenceMode === 'system') {\n prefEntity.UserID = null; // System default\n } else {\n prefEntity.UserID = md.CurrentUser.ID; // Personal preference\n }\n \n prefEntity.DashboardID = dashboard.ID;\n prefEntity.DisplayOrder = newDisplayOrder;\n prefEntity.Scope = this.scope;\n prefEntity.ApplicationID = this.applicationId;\n\n console.log('Creating preference entity:', {\n UserID: prefEntity.UserID,\n DashboardID: prefEntity.DashboardID,\n DisplayOrder: prefEntity.DisplayOrder,\n Scope: prefEntity.Scope,\n ApplicationID: prefEntity.ApplicationID\n });\n\n if (!await prefEntity.Save()) {\n const errorMsg = prefEntity.LatestResult?.Error || prefEntity.LatestResult?.Message || 'Unknown error';\n throw new Error(`Failed to create preference for dashboard ${dashboard.Name}: ${errorMsg}`);\n }\n }\n \n newPreferences.push(prefEntity);\n }\n\n console.log('Successfully processed', newPreferences.length, 'preferences');\n\n // Emit success result\n this.result.emit({\n saved: true,\n preferences: newPreferences\n });\n\n } catch (error) {\n console.error('Save error:', error);\n LogError('Error saving dashboard preferences', null, error);\n this.error = `Failed to save preferences: ${error instanceof Error ? error.message : 'Unknown error'}`;\n \n // Clear error after 5 seconds\n setTimeout(() => {\n this.error = null;\n }, 5000);\n } finally {\n this.saving = false;\n }\n }\n\n public onCancel(): void {\n this.result.emit({ saved: false });\n }\n}","<kendo-dialog title=\"Dashboard Preferences\" \n [width]=\"800\" \n [height]=\"600\"\n [minWidth]=\"600\"\n [minHeight]=\"400\"\n (close)=\"onCancel()\">\n<div class=\"dashboard-preferences-dialog\">\n <div class=\"dialog-header\">\n <h3><i class=\"fa-solid fa-sliders\"></i> Dashboard Preferences</h3>\n <p class=\"scope-indicator\">\n @if (scope === 'Global') {\n <i class=\"fa-solid fa-globe\"></i> Global Scope\n } @else {\n <i class=\"fa-solid fa-layer-group\"></i> Application: {{ applicationName }}\n }\n </p>\n @if (isSysAdmin && scope === 'Global') {\n <div class=\"preference-mode-selector\">\n <label>\n <input type=\"radio\" \n name=\"preferenceMode\" \n value=\"personal\" \n [(ngModel)]=\"preferenceMode\"\n (change)=\"onPreferenceModeChange()\">\n Personal Preferences\n </label>\n <label>\n <input type=\"radio\" \n name=\"preferenceMode\" \n value=\"system\" \n [(ngModel)]=\"preferenceMode\"\n (change)=\"onPreferenceModeChange()\">\n System Defaults\n </label>\n </div>\n }\n </div>\n\n <div class=\"dialog-content\">\n @if (loading) {\n <div class=\"loading-overlay\">\n <mj-loading text=\"Loading preferences...\" size=\"large\"></mj-loading>\n </div>\n }\n\n @if (error) {\n <div class=\"error-container\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ error }}\n </div>\n }\n\n @if (!loading && !error) {\n <div class=\"preferences-panels\">\n <!-- Available Dashboards Panel -->\n <div class=\"panel available-panel\">\n <h4><i class=\"fa-solid fa-list\"></i> Available Dashboards</h4>\n <div class=\"dashboard-list\" \n cdkDropList \n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableDashboards\"\n [cdkDropListConnectedTo]=\"[configuredList]\"\n (cdkDropListDropped)=\"onDrop($event)\">\n \n @if (availableDashboards.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-info-circle\"></i>\n All dashboards are configured\n </div>\n }\n\n @for (dashboard of availableDashboards; track dashboard.ID) {\n <div class=\"dashboard-item available-item\" \n cdkDrag\n [cdkDragData]=\"dashboard\">\n <div class=\"dashboard-item-content\">\n <i class=\"fa-solid fa-grip-vertical drag-handle\"></i>\n <div class=\"dashboard-info\">\n <span class=\"dashboard-name\">{{ dashboard.Name }}</span>\n @if (dashboard.Description) {\n <span class=\"dashboard-description\">{{ dashboard.Description }}</span>\n }\n </div>\n <button type=\"button\" \n class=\"add-button\"\n (click)=\"addDashboard(dashboard)\"\n title=\"Add to configured dashboards\">\n <i class=\"fa-solid fa-plus\"></i>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Configured Dashboards Panel -->\n <div class=\"panel configured-panel\">\n <h4><i class=\"fa-solid fa-list-ol\"></i> Configured Dashboards</h4>\n <div class=\"dashboard-list\" \n cdkDropList \n #configuredList=\"cdkDropList\"\n [cdkDropListData]=\"configuredDashboards\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n (cdkDropListDropped)=\"onDrop($event)\">\n \n @if (configuredDashboards.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-info-circle\"></i>\n No dashboards configured\n </div>\n }\n\n @for (dashboard of configuredDashboards; track dashboard.ID; let i = $index) {\n <div class=\"dashboard-item configured-item\" \n cdkDrag\n [cdkDragData]=\"dashboard\">\n <div class=\"dashboard-item-content\">\n <i class=\"fa-solid fa-grip-vertical drag-handle\"></i>\n <span class=\"order-number\">{{ i + 1 }}</span>\n <div class=\"dashboard-info\">\n <span class=\"dashboard-name\">{{ dashboard.Name }}</span>\n @if (dashboard.Description) {\n <span class=\"dashboard-description\">{{ dashboard.Description }}</span>\n }\n </div>\n <button type=\"button\" \n class=\"remove-button\"\n (click)=\"removeDashboard(dashboard)\"\n title=\"Remove from configured dashboards\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n <div class=\"dialog-footer\">\n <button type=\"button\" \n class=\"btn btn-secondary\" \n (click)=\"onCancel()\">\n <i class=\"fa-solid fa-times\"></i> Cancel\n </button>\n <button type=\"button\" \n class=\"btn btn-primary\" \n [disabled]=\"!hasChanges || saving\"\n (click)=\"onSave()\">\n @if (saving) {\n <mj-loading [showText]=\"false\" size=\"small\"></mj-loading>\n Saving...\n } @else {\n <i class=\"fa-solid fa-check\"></i> Save Changes\n }\n </button>\n </div>\n</div>\n</kendo-dialog>"]}
|
|
1
|
+
{"version":3,"file":"dashboard-preferences-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.ts","../../../src/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAe,eAAe,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;ICM5C,wBAAiC;IAAC,8BACpC;;;IACE,wBAAuC;IAAC,YAC1C;;;IAD0C,cAC1C;IAD0C,oEAC1C;;;;IAKI,AADF,AADF,8BAAsC,YAC7B,gBAKsC;IADpC,uUAA4B;IAC5B,wMAAU,+BAAwB,KAAC;IAJ1C,iBAI2C;IAC3C,sCACF;IAAA,iBAAQ;IAEN,AADF,6BAAO,gBAKsC;IADpC,uUAA4B;IAC5B,wMAAU,+BAAwB,KAAC;IAJ1C,iBAI2C;IAC3C,iCACF;IACF,AADE,iBAAQ,EACJ;;;IAZK,eAA4B;IAA5B,qDAA4B;IAQ5B,eAA4B;IAA5B,qDAA4B;;;IAUvC,8BAA6B;IAC3B,iCAAoE;IACtE,iBAAM;;;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{ Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';\nimport { LogError, Metadata, RunView } from '@memberjunction/core';\nimport { MJDashboardEntityExtended, MJDashboardUserPreferenceEntity, MJApplicationEntity } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\n\nexport interface DashboardPreferencesResult {\n saved: boolean;\n preferences?: MJDashboardUserPreferenceEntity[];\n}\n\n@Component({\n standalone: false,\n selector: 'mj-dashboard-preferences-dialog',\n templateUrl: './dashboard-preferences-dialog.component.html',\n styleUrls: ['./dashboard-preferences-dialog.component.css']\n})\nexport class DashboardPreferencesDialogComponent implements OnInit {\n @Input() public applicationId: string | null = null;\n @Input() public scope: 'Global' | 'App' = 'Global';\n @Output() public result = new EventEmitter<DashboardPreferencesResult>();\n\n public availableDashboards: MJDashboardEntityExtended[] = [];\n public configuredDashboards: MJDashboardEntityExtended[] = [];\n public applicationName: string = '';\n public loading: boolean = true;\n public saving: boolean = false;\n public error: string | null = null;\n public hasChanges: boolean = false;\n public isSysAdmin: boolean = false;\n public preferenceMode: 'personal' | 'system' = 'personal';\n\n private originalConfiguredIds: string[] = [];\n private currentUserPreferences: MJDashboardUserPreferenceEntity[] = [];\n private allAvailableDashboards: MJDashboardEntityExtended[] = [];\n\n async ngOnInit(): Promise<void> {\n try {\n await this.loadData();\n } catch (error) {\n LogError('Error initializing dashboard preferences dialog', null, error);\n this.error = 'Failed to load dashboard preferences';\n } finally {\n this.loading = false;\n }\n }\n\n private async loadData(): Promise<void> {\n const md = new Metadata();\n \n // Check if current user is sysadmin\n this.isSysAdmin = md.CurrentUser.Type.trim().toLowerCase() === 'owner';\n console.log('User is sysadmin:', this.isSysAdmin);\n \n // Default to personal preferences for all users (including sysadmin)\n this.preferenceMode = 'personal';\n \n // Load application name if we're in app scope\n if (this.scope === 'App' && this.applicationId) {\n await this.loadApplicationName();\n }\n\n // Get cached dashboards from MJ_Metadata dataset\n const ds = await md.GetAndCacheDatasetByName(\"MJ_Metadata\");\n if (!ds || !ds.Success) {\n throw new Error(ds?.Status || 'Failed to load metadata dataset');\n }\n\n const dashList = ds.Results.find(r => r.Code === 'Dashboards');\n if (!dashList) {\n throw new Error('Dashboards dataset not found');\n }\n\n // Filter dashboards by scope\n const appFilter = this.applicationId ? ` AND ApplicationID='${this.applicationId}'` : ' AND ApplicationID IS NULL';\n this.allAvailableDashboards = dashList.Results.filter((d: MJDashboardEntityExtended) => {\n if (this.scope === 'Global') {\n return d.Scope === 'Global' && !d.ApplicationID;\n } else {\n return UUIDsEqual(d.ApplicationID, this.applicationId) // ignore scope for dashboards that match app id, sometimes they have a global scope as they can be shown globally as well as app specific\n }\n });\n\n // Load current user preferences\n await this.loadCurrentPreferences();\n \n // Split dashboards into available and configured\n this.splitDashboards();\n \n // Store original state to detect changes\n this.originalConfiguredIds = this.configuredDashboards.map(d => d.ID);\n }\n\n private async loadApplicationName(): Promise<void> {\n if (!this.applicationId) return;\n \n try {\n const md = new Metadata();\n const ds = await md.GetAndCacheDatasetByName(\"MJ_Metadata\");\n const appList = ds.Results.find(r => r.Code === 'Applications');\n if (appList) {\n const app = appList.Results.find((a: MJApplicationEntity) => UUIDsEqual(a.ID, this.applicationId));\n this.applicationName = app?.Name || 'Unknown Application';\n }\n } catch (error) {\n LogError('Error loading application name', null, error);\n this.applicationName = 'Unknown Application';\n }\n }\n\n private async loadCurrentPreferences(): Promise<void> {\n const rv = new RunView();\n const md = new Metadata();\n \n const appFilter = this.applicationId ? ` AND ApplicationID='${this.applicationId}'` : '';\n const baseCondition = `Scope='${this.scope}'${appFilter}`;\n \n let filter: string;\n \n if (this.isSysAdmin && this.scope === 'Global' && this.preferenceMode === 'system') {\n // Load system defaults only (UserID IS NULL)\n filter = `UserID IS NULL AND ${baseCondition}`;\n } else {\n // Load personal user preferences (including for sysadmin when in personal mode)\n // For personal mode, we ONLY load the user's specific preferences, no fallback to system defaults\n // This allows sysadmin to see their actual personal preferences vs system defaults\n filter = `UserID='${md.CurrentUser.ID}' AND ${baseCondition}`;\n }\n\n console.log('Loading preferences with filter:', filter);\n\n const prefsResult = await rv.RunView<MJDashboardUserPreferenceEntity>({\n EntityName: 'MJ: Dashboard User Preferences',\n ExtraFilter: filter,\n ResultType: 'entity_object',\n OrderBy: 'DisplayOrder',\n });\n\n this.currentUserPreferences = prefsResult?.Results || [];\n console.log('Loaded preferences:', this.currentUserPreferences.length);\n }\n\n private splitDashboards(): void {\n const configuredIds = new Set(this.currentUserPreferences.map(p => p.DashboardID));\n \n // Get configured dashboards in the right order\n this.configuredDashboards = this.currentUserPreferences\n .map(pref => this.allAvailableDashboards.find(d => UUIDsEqual(d.ID, pref.DashboardID)))\n .filter((d): d is MJDashboardEntityExtended => d !== undefined);\n \n // Get available dashboards (not configured)\n this.availableDashboards = this.allAvailableDashboards\n .filter(d => !configuredIds.has(d.ID))\n .sort((a, b) => a.Name.localeCompare(b.Name));\n }\n\n public onDrop(event: CdkDragDrop<MJDashboardEntityExtended[]>): void {\n try {\n if (event.previousContainer === event.container) {\n // Reordering within the same list\n moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);\n } else {\n // Moving between lists\n transferArrayItem(\n event.previousContainer.data,\n event.container.data,\n event.previousIndex,\n event.currentIndex\n );\n \n // If moving to configured dashboards, sort the available list\n if (event.container.data === this.configuredDashboards) {\n this.availableDashboards.sort((a, b) => a.Name.localeCompare(b.Name));\n }\n }\n \n this.checkForChanges();\n } catch (error) {\n LogError('Error in drag drop operation', null, error);\n this.error = 'Error reordering dashboards. Please try again.';\n \n // Clear error after 3 seconds\n setTimeout(() => {\n this.error = null;\n }, 3000);\n }\n }\n\n public addDashboard(dashboard: MJDashboardEntityExtended): void {\n try {\n const index = this.availableDashboards.findIndex(d => UUIDsEqual(d.ID, dashboard.ID));\n if (index !== -1) {\n this.availableDashboards.splice(index, 1);\n this.configuredDashboards.push(dashboard);\n this.checkForChanges();\n }\n } catch (error) {\n LogError('Error adding dashboard', null, error);\n this.error = 'Error adding dashboard. Please try again.';\n \n // Clear error after 3 seconds\n setTimeout(() => {\n this.error = null;\n }, 3000);\n }\n }\n\n public removeDashboard(dashboard: MJDashboardEntityExtended): void {\n try {\n const index = this.configuredDashboards.findIndex(d => UUIDsEqual(d.ID, dashboard.ID));\n if (index !== -1) {\n this.configuredDashboards.splice(index, 1);\n this.availableDashboards.push(dashboard);\n this.availableDashboards.sort((a, b) => a.Name.localeCompare(b.Name));\n this.checkForChanges();\n }\n } catch (error) {\n LogError('Error removing dashboard', null, error);\n this.error = 'Error removing dashboard. Please try again.';\n \n // Clear error after 3 seconds\n setTimeout(() => {\n this.error = null;\n }, 3000);\n }\n }\n\n public async onPreferenceModeChange(): Promise<void> {\n try {\n this.loading = true;\n this.error = null;\n \n // Reload preferences with new mode\n await this.loadCurrentPreferences();\n this.splitDashboards();\n this.originalConfiguredIds = this.configuredDashboards.map(d => d.ID);\n this.hasChanges = false;\n \n } catch (error) {\n LogError('Error changing preference mode', null, error);\n this.error = 'Error loading preferences. Please try again.';\n } finally {\n this.loading = false;\n }\n }\n\n private checkForChanges(): void {\n try {\n const currentConfiguredIds = this.configuredDashboards.map(d => d.ID);\n \n // Check if the order or selection has changed\n this.hasChanges = currentConfiguredIds.length !== this.originalConfiguredIds.length ||\n currentConfiguredIds.some((id, index) => id !== this.originalConfiguredIds[index]);\n \n // Debug logging\n console.log('Dashboard preferences change check:', {\n original: this.originalConfiguredIds,\n current: currentConfiguredIds,\n hasChanges: this.hasChanges\n });\n } catch (error) {\n LogError('Error checking for changes', null, error);\n this.hasChanges = false;\n }\n }\n\n public async onSave(): Promise<void> {\n if (this.saving || !this.hasChanges) {\n console.log('Save cancelled:', { saving: this.saving, hasChanges: this.hasChanges });\n return;\n }\n\n try {\n this.saving = true;\n console.log('Starting save process with configured dashboards:', this.configuredDashboards.map(d => ({ id: d.ID, name: d.Name })));\n \n const md = new Metadata();\n const rv = new RunView();\n\n // Get existing preferences for this scope\n const baseCondition = this.scope === 'Global' \n ? `Scope='Global' AND ApplicationID IS NULL`\n : `Scope='App' AND ApplicationID='${this.applicationId}'`;\n \n let userFilter: string;\n \n if (this.isSysAdmin && this.scope === 'Global' && this.preferenceMode === 'system') {\n // Managing system defaults\n userFilter = `UserID IS NULL AND ${baseCondition}`;\n } else {\n // Managing personal preferences\n userFilter = `UserID='${md.CurrentUser.ID}' AND ${baseCondition}`;\n }\n \n console.log('Loading existing preferences with filter:', userFilter);\n \n const existingPrefs = await rv.RunView<MJDashboardUserPreferenceEntity>({\n EntityName: 'MJ: Dashboard User Preferences',\n ExtraFilter: userFilter,\n ResultType: 'entity_object',\n });\n\n const existingPreferences = existingPrefs?.Results || [];\n console.log('Found existing preferences:', existingPreferences.length);\n\n // Create maps for efficient lookups\n const existingByDashboardId = new Map<string, MJDashboardUserPreferenceEntity>();\n existingPreferences.forEach(pref => {\n existingByDashboardId.set(pref.DashboardID, pref);\n });\n\n const configuredDashboardIds = new Set(this.configuredDashboards.map(d => d.ID));\n\n // Step 1: Delete preferences that are no longer configured\n const prefsToDelete = existingPreferences.filter(pref => !configuredDashboardIds.has(pref.DashboardID));\n console.log('Preferences to delete:', prefsToDelete.length);\n \n for (const pref of prefsToDelete) {\n console.log('Deleting preference for dashboard:', pref.DashboardID);\n if (!await pref.Delete()) {\n const errorMsg = pref.LatestResult?.Error || pref.LatestResult?.Message || 'Unknown error';\n throw new Error(`Failed to delete preference: ${errorMsg}`);\n }\n }\n\n // Step 2: Update existing preferences or create new ones\n const newPreferences: MJDashboardUserPreferenceEntity[] = [];\n \n for (let i = 0; i < this.configuredDashboards.length; i++) {\n const dashboard = this.configuredDashboards[i];\n const newDisplayOrder = i + 1;\n \n let prefEntity = existingByDashboardId.get(dashboard.ID);\n \n if (prefEntity) {\n // Update existing preference\n console.log(`Updating existing preference for dashboard ${dashboard.Name}, new order: ${newDisplayOrder}`);\n prefEntity.DisplayOrder = newDisplayOrder;\n \n if (!await prefEntity.Save()) {\n const errorMsg = prefEntity.LatestResult?.Error || prefEntity.LatestResult?.Message || 'Unknown error';\n throw new Error(`Failed to update preference for dashboard ${dashboard.Name}: ${errorMsg}`);\n }\n } else {\n // Create new preference\n console.log(`Creating new preference for dashboard ${dashboard.Name}, order: ${newDisplayOrder}`);\n prefEntity = await md.GetEntityObject<MJDashboardUserPreferenceEntity>('MJ: Dashboard User Preferences');\n \n // Set UserID based on preference mode\n if (this.isSysAdmin && this.scope === 'Global' && this.preferenceMode === 'system') {\n prefEntity.UserID = null; // System default\n } else {\n prefEntity.UserID = md.CurrentUser.ID; // Personal preference\n }\n \n prefEntity.DashboardID = dashboard.ID;\n prefEntity.DisplayOrder = newDisplayOrder;\n prefEntity.Scope = this.scope;\n prefEntity.ApplicationID = this.applicationId;\n\n console.log('Creating preference entity:', {\n UserID: prefEntity.UserID,\n DashboardID: prefEntity.DashboardID,\n DisplayOrder: prefEntity.DisplayOrder,\n Scope: prefEntity.Scope,\n ApplicationID: prefEntity.ApplicationID\n });\n\n if (!await prefEntity.Save()) {\n const errorMsg = prefEntity.LatestResult?.Error || prefEntity.LatestResult?.Message || 'Unknown error';\n throw new Error(`Failed to create preference for dashboard ${dashboard.Name}: ${errorMsg}`);\n }\n }\n \n newPreferences.push(prefEntity);\n }\n\n console.log('Successfully processed', newPreferences.length, 'preferences');\n\n // Emit success result\n this.result.emit({\n saved: true,\n preferences: newPreferences\n });\n\n } catch (error) {\n console.error('Save error:', error);\n LogError('Error saving dashboard preferences', null, error);\n this.error = `Failed to save preferences: ${error instanceof Error ? error.message : 'Unknown error'}`;\n \n // Clear error after 5 seconds\n setTimeout(() => {\n this.error = null;\n }, 5000);\n } finally {\n this.saving = false;\n }\n }\n\n public onCancel(): void {\n this.result.emit({ saved: false });\n }\n}","<mj-dialog [Visible]=\"true\" Title=\"Dashboard Preferences\"\n [Width]=\"800\"\n [Height]=\"600\"\n [MinWidth]=\"600\"\n (Close)=\"onCancel()\">\n<div class=\"dashboard-preferences-dialog\">\n <div class=\"dialog-header\">\n <h3><i class=\"fa-solid fa-sliders\"></i> Dashboard Preferences</h3>\n <p class=\"scope-indicator\">\n @if (scope === 'Global') {\n <i class=\"fa-solid fa-globe\"></i> Global Scope\n } @else {\n <i class=\"fa-solid fa-layer-group\"></i> Application: {{ applicationName }}\n }\n </p>\n @if (isSysAdmin && scope === 'Global') {\n <div class=\"preference-mode-selector\">\n <label>\n <input type=\"radio\"\n name=\"preferenceMode\"\n value=\"personal\"\n [(ngModel)]=\"preferenceMode\"\n (change)=\"onPreferenceModeChange()\">\n Personal Preferences\n </label>\n <label>\n <input type=\"radio\"\n name=\"preferenceMode\"\n value=\"system\"\n [(ngModel)]=\"preferenceMode\"\n (change)=\"onPreferenceModeChange()\">\n System Defaults\n </label>\n </div>\n }\n </div>\n\n <div class=\"dialog-content\">\n @if (loading) {\n <div class=\"loading-overlay\">\n <mj-loading text=\"Loading preferences...\" size=\"large\"></mj-loading>\n </div>\n }\n\n @if (error) {\n <div class=\"error-container\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ error }}\n </div>\n }\n\n @if (!loading && !error) {\n <div class=\"preferences-panels\">\n <!-- Available Dashboards Panel -->\n <div class=\"panel available-panel\">\n <h4><i class=\"fa-solid fa-list\"></i> Available Dashboards</h4>\n <div class=\"dashboard-list\"\n cdkDropList\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableDashboards\"\n [cdkDropListConnectedTo]=\"[configuredList]\"\n (cdkDropListDropped)=\"onDrop($event)\">\n\n @if (availableDashboards.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-info-circle\"></i>\n All dashboards are configured\n </div>\n }\n\n @for (dashboard of availableDashboards; track dashboard.ID) {\n <div class=\"dashboard-item available-item\"\n cdkDrag\n [cdkDragData]=\"dashboard\">\n <div class=\"dashboard-item-content\">\n <i class=\"fa-solid fa-grip-vertical drag-handle\"></i>\n <div class=\"dashboard-info\">\n <span class=\"dashboard-name\">{{ dashboard.Name }}</span>\n @if (dashboard.Description) {\n <span class=\"dashboard-description\">{{ dashboard.Description }}</span>\n }\n </div>\n <button type=\"button\"\n class=\"add-button\"\n (click)=\"addDashboard(dashboard)\"\n title=\"Add to configured dashboards\">\n <i class=\"fa-solid fa-plus\"></i>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Configured Dashboards Panel -->\n <div class=\"panel configured-panel\">\n <h4><i class=\"fa-solid fa-list-ol\"></i> Configured Dashboards</h4>\n <div class=\"dashboard-list\"\n cdkDropList\n #configuredList=\"cdkDropList\"\n [cdkDropListData]=\"configuredDashboards\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n (cdkDropListDropped)=\"onDrop($event)\">\n\n @if (configuredDashboards.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-info-circle\"></i>\n No dashboards configured\n </div>\n }\n\n @for (dashboard of configuredDashboards; track dashboard.ID; let i = $index) {\n <div class=\"dashboard-item configured-item\"\n cdkDrag\n [cdkDragData]=\"dashboard\">\n <div class=\"dashboard-item-content\">\n <i class=\"fa-solid fa-grip-vertical drag-handle\"></i>\n <span class=\"order-number\">{{ i + 1 }}</span>\n <div class=\"dashboard-info\">\n <span class=\"dashboard-name\">{{ dashboard.Name }}</span>\n @if (dashboard.Description) {\n <span class=\"dashboard-description\">{{ dashboard.Description }}</span>\n }\n </div>\n <button type=\"button\"\n class=\"remove-button\"\n (click)=\"removeDashboard(dashboard)\"\n title=\"Remove from configured dashboards\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n <mj-dialog-actions>\n <button type=\"button\"\n class=\"btn btn-secondary\"\n (click)=\"onCancel()\">\n <i class=\"fa-solid fa-times\"></i> Cancel\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"!hasChanges || saving\"\n (click)=\"onSave()\">\n @if (saving) {\n <mj-loading [showText]=\"false\" size=\"small\"></mj-loading>\n Saving...\n } @else {\n <i class=\"fa-solid fa-check\"></i> Save Changes\n }\n </button>\n </mj-dialog-actions>\n</div>\n</mj-dialog>\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, Input } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "@
|
|
4
|
-
import * as i2 from "@memberjunction/ng-
|
|
3
|
+
import * as i1 from "@memberjunction/ng-record-changes";
|
|
4
|
+
import * as i2 from "@memberjunction/ng-ui-components";
|
|
5
5
|
function FormToolbarComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
6
6
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
7
7
|
i0.ɵɵelementStart(0, "button", 2);
|
|
@@ -56,7 +56,7 @@ function FormToolbarComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
|
56
56
|
export class FormToolbarComponent {
|
|
57
57
|
form;
|
|
58
58
|
static ɵfac = function FormToolbarComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormToolbarComponent)(); };
|
|
59
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FormToolbarComponent, selectors: [["mj-form-toolbar"]], inputs: { form: "form" }, standalone: false, decls: 8, vars: 7, consts: [["
|
|
59
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FormToolbarComponent, selectors: [["mj-form-toolbar"]], inputs: { form: "form" }, standalone: false, decls: 8, vars: 7, consts: [["mjButton", ""], [3, "record"], ["mjButton", "", 3, "click"], [3, "dialogClosed", "record"]], template: function FormToolbarComponent_Template(rf, ctx) { if (rf & 1) {
|
|
60
60
|
i0.ɵɵconditionalCreate(0, FormToolbarComponent_Conditional_0_Template, 2, 0, "button", 0);
|
|
61
61
|
i0.ɵɵconditionalCreate(1, FormToolbarComponent_Conditional_1_Template, 2, 0, "button", 0);
|
|
62
62
|
i0.ɵɵconditionalCreate(2, FormToolbarComponent_Conditional_2_Template, 2, 0, "button", 0);
|
|
@@ -79,28 +79,28 @@ export class FormToolbarComponent {
|
|
|
79
79
|
i0.ɵɵconditional((ctx.form.EntityInfo == null ? null : ctx.form.EntityInfo.TrackRecordChanges) ? 5 : -1);
|
|
80
80
|
i0.ɵɵadvance(2);
|
|
81
81
|
i0.ɵɵconditional(ctx.form.isHistoryDialogOpen ? 7 : -1);
|
|
82
|
-
} }, dependencies: [i1.
|
|
82
|
+
} }, dependencies: [i1.RecordChangesComponent, i2.MJButtonDirective], styles: ["button[_ngcontent-%COMP%] { margin-right: 10px; }"] });
|
|
83
83
|
}
|
|
84
84
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormToolbarComponent, [{
|
|
85
85
|
type: Component,
|
|
86
86
|
args: [{ standalone: false, selector: 'mj-form-toolbar', template: `
|
|
87
87
|
@if (!this.form.EditMode && this.form.UserCanEdit) {
|
|
88
|
-
<button
|
|
88
|
+
<button mjButton (click)="this.form.StartEditMode()">Edit Record</button>
|
|
89
89
|
}
|
|
90
90
|
@if (this.form.EditMode) {
|
|
91
|
-
<button
|
|
91
|
+
<button mjButton (click)="this.form.SaveRecord(true)">Save Record</button>
|
|
92
92
|
}
|
|
93
93
|
@if (this.form.EditMode) {
|
|
94
|
-
<button
|
|
94
|
+
<button mjButton (click)="this.form.CancelEdit()">Cancel</button>
|
|
95
95
|
}
|
|
96
96
|
@if (this.form.FavoriteInitDone && this.form.IsFavorite) {
|
|
97
|
-
<button
|
|
97
|
+
<button mjButton (click)="this.form.RemoveFavorite()">Remove Favorite</button>
|
|
98
98
|
}
|
|
99
99
|
@if (this.form.FavoriteInitDone && !this.form.IsFavorite) {
|
|
100
|
-
<button
|
|
100
|
+
<button mjButton (click)="this.form.MakeFavorite()">Make Favorite</button>
|
|
101
101
|
}
|
|
102
102
|
@if (this.form.EntityInfo?.TrackRecordChanges) {
|
|
103
|
-
<button
|
|
103
|
+
<button mjButton (click)="this.form.handleHistoryDialog()">History</button>
|
|
104
104
|
}
|
|
105
105
|
<hr />
|
|
106
106
|
@if (this.form.isHistoryDialogOpen) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-toolbar.js","sourceRoot":"","sources":["../../../src/lib/generic/form-toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;;IAUvC,
|
|
1
|
+
{"version":3,"file":"form-toolbar.js","sourceRoot":"","sources":["../../../src/lib/generic/form-toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;;IAUvC,iCAAqD;IAApC,wLAAS,2BAAyB,KAAC;IAAC,2BAAW;IAAA,iBAAS;;;;IAGzE,iCAAsD;IAArC,wLAAS,uBAAqB,IAAI,CAAC,KAAC;IAAC,2BAAW;IAAA,iBAAS;;;;IAG1E,iCAAkD;IAAjC,wLAAS,wBAAsB,KAAC;IAAC,sBAAM;IAAA,iBAAS;;;;IAGjE,iCAAsD;IAArC,wLAAS,4BAA0B,KAAC;IAAC,+BAAe;IAAA,iBAAS;;;;IAG9E,iCAAoD;IAAnC,wLAAS,0BAAwB,KAAC;IAAC,6BAAa;IAAA,iBAAS;;;;IAG1E,iCAA2D;IAA1C,wLAAS,iCAA+B,KAAC;IAAC,uBAAO;IAAA,iBAAS;;;;IAI3E,4CAAgG;IAAjD,iNAAgB,iCAA+B,KAAC;IAAC,iBAAoB;;;IAAjG,2CAA2B;;AAIxD,MAAM,OAAO,oBAAoB;IACpB,IAAI,CAAqB;8GADzB,oBAAoB;6DAApB,oBAAoB;YAxBzB,yFAAoD;YAGpD,yFAA0B;YAG1B,yFAA0B;YAG1B,yFAA0D;YAG1D,yFAA2D;YAG3D,yFAAgD;YAGhD,qBAAM;YACN,oGAAqC;;YAnBrC,qEAEC;YACD,cAEC;YAFD,4CAEC;YACD,cAEC;YAFD,4CAEC;YACD,cAEC;YAFD,2EAEC;YACD,cAEC;YAFD,4EAEC;YACD,cAEC;YAFD,wGAEC;YAED,eAEC;YAFD,uDAEC;;;iFAGI,oBAAoB;cA7BhC,SAAS;6BACI,KAAK,YACL,iBAAiB,YAEjB;;;;;;;;;;;;;;;;;;;;;;;SAuBL;;kBAGJ,KAAK;;kFADG,oBAAoB","sourcesContent":["import { Component, Input } from '@angular/core';\nimport { BaseFormComponent } from '@memberjunction/ng-base-forms';\n\n\n@Component({\n standalone: false,\n selector: 'mj-form-toolbar',\n styles: [`button { margin-right: 10px; }`],\n template: `\n @if (!this.form.EditMode && this.form.UserCanEdit) {\n <button mjButton (click)=\"this.form.StartEditMode()\">Edit Record</button>\n }\n @if (this.form.EditMode) {\n <button mjButton (click)=\"this.form.SaveRecord(true)\">Save Record</button>\n }\n @if (this.form.EditMode) {\n <button mjButton (click)=\"this.form.CancelEdit()\">Cancel</button>\n }\n @if (this.form.FavoriteInitDone && this.form.IsFavorite) {\n <button mjButton (click)=\"this.form.RemoveFavorite()\">Remove Favorite</button>\n }\n @if (this.form.FavoriteInitDone && !this.form.IsFavorite) {\n <button mjButton (click)=\"this.form.MakeFavorite()\">Make Favorite</button>\n }\n @if (this.form.EntityInfo?.TrackRecordChanges) {\n <button mjButton (click)=\"this.form.handleHistoryDialog()\">History</button>\n }\n <hr />\n @if (this.form.isHistoryDialogOpen) {\n <mj-record-changes [record]=\"this.form.record\" (dialogClosed)=\"this.form.handleHistoryDialog()\"></mj-record-changes>\n }\n `\n})\nexport class FormToolbarComponent {\n @Input() form!: BaseFormComponent;\n}\n"]}
|
|
@@ -14,8 +14,8 @@ import { Component } from '@angular/core';
|
|
|
14
14
|
import { Metadata } from '@memberjunction/core';
|
|
15
15
|
import * as i0 from "@angular/core";
|
|
16
16
|
import * as i1 from "@angular/router";
|
|
17
|
-
import * as i2 from "@
|
|
18
|
-
import * as i3 from "@memberjunction/ng-
|
|
17
|
+
import * as i2 from "@memberjunction/ng-shared-generic";
|
|
18
|
+
import * as i3 from "@memberjunction/ng-ui-components";
|
|
19
19
|
function OAuthCallbackComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
20
20
|
i0.ɵɵelementStart(0, "div", 2);
|
|
21
21
|
i0.ɵɵelement(1, "mj-loading", 5);
|
|
@@ -70,7 +70,7 @@ function OAuthCallbackComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
70
70
|
i0.ɵɵadvance(2);
|
|
71
71
|
i0.ɵɵconditional(ctx_r0.IsRetryable ? 9 : -1);
|
|
72
72
|
i0.ɵɵadvance();
|
|
73
|
-
i0.ɵɵproperty("
|
|
73
|
+
i0.ɵɵproperty("variant", ctx_r0.IsRetryable ? "outline" : "secondary");
|
|
74
74
|
} }
|
|
75
75
|
function OAuthCallbackComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
76
76
|
i0.ɵɵelementStart(0, "div", 4)(1, "div", 16);
|
|
@@ -385,7 +385,7 @@ export class OAuthCallbackComponent {
|
|
|
385
385
|
this.router.navigate(['/app/admin/MCP']);
|
|
386
386
|
}
|
|
387
387
|
static ɵfac = function OAuthCallbackComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OAuthCallbackComponent)(i0.ɵɵdirectiveInject(i1.ActivatedRoute), i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
388
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: OAuthCallbackComponent, selectors: [["mj-oauth-callback"]], standalone: false, decls: 5, vars: 3, consts: [[1, "oauth-callback-container"], [1, "oauth-callback-card"], [1, "oauth-status", "loading"], [1, "oauth-status", "error"], [1, "oauth-status", "success"], [3, "text"], [1, "icon-container", "error-icon"], [1, "fa-solid", "fa-circle-exclamation"], [1, "error-code"], [1, "error-message"], [1, "button-group"], ["
|
|
388
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: OAuthCallbackComponent, selectors: [["mj-oauth-callback"]], standalone: false, decls: 5, vars: 3, consts: [[1, "oauth-callback-container"], [1, "oauth-callback-card"], [1, "oauth-status", "loading"], [1, "oauth-status", "error"], [1, "oauth-status", "success"], [3, "text"], [1, "icon-container", "error-icon"], [1, "fa-solid", "fa-circle-exclamation"], [1, "error-code"], [1, "error-message"], [1, "button-group"], ["mjButton", "", "variant", "secondary"], ["mjButton", "", 3, "click", "variant"], [1, "fa-solid", "fa-arrow-left"], ["mjButton", "", "variant", "secondary", 3, "click"], [1, "fa-solid", "fa-rotate-right"], [1, "icon-container", "success-icon"], [1, "fa-solid", "fa-circle-check"]], template: function OAuthCallbackComponent_Template(rf, ctx) { if (rf & 1) {
|
|
389
389
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
390
390
|
i0.ɵɵconditionalCreate(2, OAuthCallbackComponent_Conditional_2_Template, 2, 2, "div", 2);
|
|
391
391
|
i0.ɵɵconditionalCreate(3, OAuthCallbackComponent_Conditional_3_Template, 13, 4, "div", 3);
|
|
@@ -398,11 +398,11 @@ export class OAuthCallbackComponent {
|
|
|
398
398
|
i0.ɵɵconditional(ctx.HasError ? 3 : -1);
|
|
399
399
|
i0.ɵɵadvance();
|
|
400
400
|
i0.ɵɵconditional(!ctx.IsLoading && !ctx.HasError ? 4 : -1);
|
|
401
|
-
} }, dependencies: [i2.
|
|
401
|
+
} }, dependencies: [i2.LoadingComponent, i3.MJButtonDirective], styles: [".oauth-callback-container[_ngcontent-%COMP%] {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100vh;\n background: var(--mj-brand-primary);\n padding: 1rem;\n}\n\n.oauth-callback-card[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface);\n padding: 3rem;\n border-radius: 1rem;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n text-align: center;\n max-width: 450px;\n width: 100%;\n}\n\n.oauth-status[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n}\n\n.oauth-status[_ngcontent-%COMP%] h2[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 1.5rem;\n font-weight: 600;\n}\n\n.oauth-status[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0;\n color: var(--mj-text-muted);\n line-height: 1.6;\n}\n\n\n\n.icon-container[_ngcontent-%COMP%] {\n width: 80px;\n height: 80px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 0.5rem;\n}\n\n.icon-container[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 3rem;\n}\n\n.success-icon[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n}\n\n.success-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-status-success);\n}\n\n.error-icon[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n}\n\n.error-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-status-error);\n}\n\n\n\n.oauth-status.success[_ngcontent-%COMP%] h2[_ngcontent-%COMP%] {\n color: var(--mj-status-success);\n}\n\n\n\n.oauth-status.error[_ngcontent-%COMP%] h2[_ngcontent-%COMP%] {\n color: var(--mj-status-error);\n}\n\n.error-code[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-error) 5%, var(--mj-bg-surface));\n color: var(--mj-status-error);\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n font-family: monospace;\n font-size: 0.875rem;\n}\n\n.error-message[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n padding: 1rem;\n border-radius: 0.5rem;\n font-size: 0.9rem;\n color: var(--mj-text-secondary);\n width: 100%;\n}\n\n\n\n.button-group[_ngcontent-%COMP%] {\n display: flex;\n gap: 0.75rem;\n margin-top: 1rem;\n}\n\n.button-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n\n\n.oauth-status.loading[_ngcontent-%COMP%] {\n padding: 2rem 0;\n}\n\n\n\n@media (max-width: 480px) {\n .oauth-callback-card[_ngcontent-%COMP%] {\n padding: 2rem 1.5rem;\n }\n\n .button-group[_ngcontent-%COMP%] {\n flex-direction: column;\n width: 100%;\n }\n\n .button-group[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n width: 100%;\n justify-content: center;\n }\n}"] });
|
|
402
402
|
}
|
|
403
403
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OAuthCallbackComponent, [{
|
|
404
404
|
type: Component,
|
|
405
|
-
args: [{ standalone: false, selector: 'mj-oauth-callback', template: "<div class=\"oauth-callback-container\">\n <div class=\"oauth-callback-card\">\n <!-- Loading State -->\n @if (IsLoading) {\n <div class=\"oauth-status loading\">\n <mj-loading text=\"{{ StatusMessage }}\"></mj-loading>\n </div>\n }\n\n <!-- Error State -->\n @if (HasError) {\n <div class=\"oauth-status error\">\n <div class=\"icon-container error-icon\">\n <i class=\"fa-solid fa-circle-exclamation\"></i>\n </div>\n <h2>Authorization Failed</h2>\n @if (ErrorCode) {\n <div class=\"error-code\">{{ ErrorCode }}</div>\n }\n <p class=\"error-message\">{{ ErrorMessage }}</p>\n <div class=\"button-group\">\n @if (IsRetryable) {\n <button
|
|
405
|
+
args: [{ standalone: false, selector: 'mj-oauth-callback', template: "<div class=\"oauth-callback-container\">\n <div class=\"oauth-callback-card\">\n <!-- Loading State -->\n @if (IsLoading) {\n <div class=\"oauth-status loading\">\n <mj-loading text=\"{{ StatusMessage }}\"></mj-loading>\n </div>\n }\n\n <!-- Error State -->\n @if (HasError) {\n <div class=\"oauth-status error\">\n <div class=\"icon-container error-icon\">\n <i class=\"fa-solid fa-circle-exclamation\"></i>\n </div>\n <h2>Authorization Failed</h2>\n @if (ErrorCode) {\n <div class=\"error-code\">{{ ErrorCode }}</div>\n }\n <p class=\"error-message\">{{ ErrorMessage }}</p>\n <div class=\"button-group\">\n @if (IsRetryable) {\n <button mjButton variant=\"secondary\" (click)=\"onRetry()\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n Try Again\n </button>\n }\n <button mjButton [variant]=\"IsRetryable ? 'outline' : 'secondary'\" (click)=\"onClose()\">\n <i class=\"fa-solid fa-arrow-left\"></i>\n Return to Dashboard\n </button>\n </div>\n </div>\n }\n\n <!-- Success State (brief - redirects quickly) -->\n @if (!IsLoading && !HasError) {\n <div class=\"oauth-status success\">\n <div class=\"icon-container success-icon\">\n <i class=\"fa-solid fa-circle-check\"></i>\n </div>\n <h2>Authorization Successful</h2>\n <p>{{ StatusMessage }}</p>\n </div>\n }\n </div>\n</div>\n", styles: [".oauth-callback-container {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100vh;\n background: var(--mj-brand-primary);\n padding: 1rem;\n}\n\n.oauth-callback-card {\n background: var(--mj-bg-surface);\n padding: 3rem;\n border-radius: 1rem;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n text-align: center;\n max-width: 450px;\n width: 100%;\n}\n\n.oauth-status {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n}\n\n.oauth-status h2 {\n margin: 0;\n font-size: 1.5rem;\n font-weight: 600;\n}\n\n.oauth-status p {\n margin: 0;\n color: var(--mj-text-muted);\n line-height: 1.6;\n}\n\n/* Icon containers */\n.icon-container {\n width: 80px;\n height: 80px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 0.5rem;\n}\n\n.icon-container i {\n font-size: 3rem;\n}\n\n.success-icon {\n background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n}\n\n.success-icon i {\n color: var(--mj-status-success);\n}\n\n.error-icon {\n background: color-mix(in srgb, var(--mj-status-error) 15%, var(--mj-bg-surface));\n}\n\n.error-icon i {\n color: var(--mj-status-error);\n}\n\n/* Success state */\n.oauth-status.success h2 {\n color: var(--mj-status-success);\n}\n\n/* Error state */\n.oauth-status.error h2 {\n color: var(--mj-status-error);\n}\n\n.error-code {\n background: color-mix(in srgb, var(--mj-status-error) 5%, var(--mj-bg-surface));\n color: var(--mj-status-error);\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n font-family: monospace;\n font-size: 0.875rem;\n}\n\n.error-message {\n background: var(--mj-bg-surface-sunken);\n padding: 1rem;\n border-radius: 0.5rem;\n font-size: 0.9rem;\n color: var(--mj-text-secondary);\n width: 100%;\n}\n\n/* Buttons */\n.button-group {\n display: flex;\n gap: 0.75rem;\n margin-top: 1rem;\n}\n\n.button-group button {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n/* Loading state */\n.oauth-status.loading {\n padding: 2rem 0;\n}\n\n/* Responsive */\n@media (max-width: 480px) {\n .oauth-callback-card {\n padding: 2rem 1.5rem;\n }\n\n .button-group {\n flex-direction: column;\n width: 100%;\n }\n\n .button-group button {\n width: 100%;\n justify-content: center;\n }\n}\n"] }]
|
|
406
406
|
}], () => [{ type: i1.ActivatedRoute }, { type: i1.Router }, { type: i0.ChangeDetectorRef }], null); })();
|
|
407
407
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(OAuthCallbackComponent, { className: "OAuthCallbackComponent", filePath: "src/lib/oauth/oauth-callback.component.ts", lineNumber: 51 }); })();
|
|
408
408
|
//# sourceMappingURL=oauth-callback.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-callback.component.js","sourceRoot":"","sources":["../../../src/lib/oauth/oauth-callback.component.ts","../../../src/lib/oauth/oauth-callback.component.html"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAwC,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;;;;;;ICXpC,8BAAkC;IAC9B,gCAAoD;IACxD,iBAAM;;;IADU,cAA0B;IAA1B,sBAAA,sCAA0B,CAAA;;;IAYlC,8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,aACD;YAE7B,wFAAiB;YAOjB,yFAAgB;YA0BhB,wFAA+B;YAUvC,AADI,iBAAM,EACJ;;YA3CE,eAIC;YAJD,wCAIC;YAGD,cAuBC;YAvBD,uCAuBC;YAGD,cAQC;YARD,0DAQC;;;iFDMI,sBAAsB;cANlC,SAAS;6BACI,KAAK,YACL,mBAAmB;;kFAIpB,sBAAsB","sourcesContent":["/**\n * @fileoverview OAuth Callback Component\n *\n * Handles OAuth provider redirects in the frontend. When an OAuth provider\n * redirects back to the application after user authorization, this component:\n * 1. Waits for the user's session to be restored (authentication)\n * 2. Extracts the code and state from URL query parameters\n * 3. Calls the backend /oauth/exchange endpoint to complete the token exchange\n * 4. Redirects to the original page with success/error notification\n *\n * @module OAuth Callback\n */\n\nimport { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Metadata } from '@memberjunction/core';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\n\n/**\n * Response from the OAuth exchange endpoint\n */\ninterface OAuthExchangeResponse {\n success: boolean;\n connectionId?: string;\n errorCode?: string;\n errorMessage?: string;\n isRetryable?: boolean;\n}\n\n/** Maximum time to wait for provider initialization (30 seconds) */\nconst MAX_WAIT_TIME_MS = 30000;\n/** Polling interval for checking provider readiness (500ms) */\nconst POLL_INTERVAL_MS = 500;\n\n/**\n * OAuth Callback Component\n *\n * Handles the redirect from OAuth providers after user authorization.\n * This component is loaded at /oauth/callback and processes the\n * authorization code to complete the OAuth flow.\n *\n * The component waits for authentication to complete before attempting\n * the code exchange, since the user's session needs to be restored first.\n */\n@Component({\n standalone: false,\n selector: 'mj-oauth-callback',\n templateUrl: './oauth-callback.component.html',\n styleUrls: ['./oauth-callback.component.css']\n})\nexport class OAuthCallbackComponent implements OnInit, OnDestroy {\n /** Loading state while processing OAuth callback */\n public IsLoading = true;\n\n /** Error state */\n public HasError = false;\n\n /** Error message to display */\n public ErrorMessage = '';\n\n /** Error code from OAuth provider or exchange */\n public ErrorCode = '';\n\n /** Whether the error is retryable */\n public IsRetryable = false;\n\n /** Status message shown during processing */\n public StatusMessage = 'Restoring session...';\n\n /** Timer for polling provider readiness */\n private pollTimer: ReturnType<typeof setInterval> | null = null;\n\n /** Flag to prevent double processing */\n private isProcessing = false;\n\n constructor(\n private route: ActivatedRoute,\n private router: Router,\n private cdr: ChangeDetectorRef\n ) {}\n\n async ngOnInit(): Promise<void> {\n // Wait for the GraphQL provider to be ready, then process the callback\n await this.waitForProviderAndProcess();\n }\n\n ngOnDestroy(): void {\n // Clean up the polling timer\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n }\n\n /**\n * Waits for the GraphQL provider to be initialized (indicating auth is complete)\n * then processes the OAuth callback.\n */\n private async waitForProviderAndProcess(): Promise<void> {\n const startTime = Date.now();\n\n // Check if provider is already ready\n if (this.isProviderReady()) {\n await this.safeProcessCallback();\n return;\n }\n\n // Poll for provider readiness\n this.StatusMessage = 'Waiting for authentication...';\n this.cdr.detectChanges();\n\n return new Promise<void>((resolve) => {\n this.pollTimer = setInterval(async () => {\n const elapsed = Date.now() - startTime;\n\n if (this.isProviderReady()) {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n await this.safeProcessCallback();\n resolve();\n return;\n }\n\n if (elapsed >= MAX_WAIT_TIME_MS) {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n this.showError(\n 'timeout',\n 'Timed out waiting for authentication. Please try logging in again.',\n true\n );\n resolve();\n return;\n }\n\n // Update status message with progress\n const secondsRemaining = Math.ceil((MAX_WAIT_TIME_MS - elapsed) / 1000);\n this.StatusMessage = `Waiting for authentication... (${secondsRemaining}s)`;\n this.cdr.detectChanges();\n }, POLL_INTERVAL_MS);\n });\n }\n\n /**\n * Checks if the GraphQL provider is initialized and has a valid token\n */\n private isProviderReady(): boolean {\n try {\n const provider = Metadata.Provider as GraphQLDataProvider;\n if (!provider) {\n return false;\n }\n const configData = provider.ConfigData;\n if (!configData || !configData.Token || !configData.URL) {\n return false;\n }\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Safely processes the callback, preventing double execution\n */\n private async safeProcessCallback(): Promise<void> {\n if (this.isProcessing) {\n return;\n }\n this.isProcessing = true;\n\n try {\n await this.processOAuthCallback();\n } catch (error) {\n console.error('[OAuth Callback] Error in processOAuthCallback:', error);\n this.showError('component_error', error instanceof Error ? error.message : String(error), true);\n }\n }\n\n /**\n * Process the OAuth callback by extracting params and exchanging the code\n */\n private async processOAuthCallback(): Promise<void> {\n const params = this.route.snapshot.queryParams;\n\n // Check for error from OAuth provider\n if (params['error']) {\n this.showError(\n params['error'] as string,\n params['error_description'] as string || 'Authorization was denied or failed'\n );\n return;\n }\n\n const code = params['code'] as string;\n const state = params['state'] as string;\n\n // Validate required parameters\n if (!code) {\n this.showError('missing_code', 'No authorization code received from the OAuth provider');\n return;\n }\n\n if (!state) {\n this.showError('missing_state', 'No state parameter received from the OAuth provider');\n return;\n }\n\n // Exchange the code for tokens\n this.StatusMessage = 'Exchanging authorization code...';\n this.cdr.detectChanges();\n\n try {\n const result = await this.exchangeCode(code, state);\n\n if (result.success) {\n this.handleSuccess(result.connectionId);\n } else {\n this.showError(\n result.errorCode || 'exchange_failed',\n result.errorMessage || 'Failed to complete authorization',\n result.isRetryable\n );\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : 'An unexpected error occurred';\n this.showError('network_error', message, true);\n }\n }\n\n /**\n * Call the backend to exchange the authorization code for tokens\n */\n private async exchangeCode(code: string, state: string): Promise<OAuthExchangeResponse> {\n // Get the GraphQL provider - we know it's ready at this point\n const gqlProvider = Metadata.Provider as GraphQLDataProvider;\n const configData = gqlProvider.ConfigData;\n\n // Build the exchange endpoint URL from the GraphQL URL\n // Handle both cases: URL with /graphql suffix and URL without\n let apiUrl = configData.URL;\n if (apiUrl.includes('/graphql')) {\n apiUrl = apiUrl.replace('/graphql', '/oauth/exchange');\n } else {\n // URL doesn't have /graphql, append /oauth/exchange\n apiUrl = apiUrl.replace(/\\/$/, '') + '/oauth/exchange';\n }\n\n try {\n const response = await fetch(apiUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${configData.Token}`\n },\n body: JSON.stringify({ code, state })\n });\n\n // Parse response regardless of status code\n const data = await response.json();\n return data as OAuthExchangeResponse;\n } catch (fetchError) {\n return {\n success: false,\n errorCode: 'fetch_error',\n errorMessage: fetchError instanceof Error ? fetchError.message : 'Network error during token exchange'\n };\n }\n }\n\n /**\n * Handle successful OAuth completion\n */\n private handleSuccess(connectionId?: string): void {\n this.IsLoading = false;\n this.StatusMessage = 'Authorization successful! Redirecting...';\n this.cdr.detectChanges();\n\n // Get the stored return URL - try both localStorage and sessionStorage\n const storedUrl = localStorage.getItem('oauth_return_url');\n const storedPath = localStorage.getItem('oauth_return_path');\n const sessionUrl = sessionStorage.getItem('oauth_return_url');\n const sessionPath = sessionStorage.getItem('oauth_return_path');\n\n let returnUrl = storedUrl || sessionUrl || storedPath || sessionPath;\n\n // Clean up all possible storage locations\n this.clearStoredReturnUrls();\n\n // Default to MCP dashboard if no return URL found\n const defaultPath = '/app/admin/MCP';\n if (!returnUrl || returnUrl.trim() === '' || returnUrl === '/') {\n returnUrl = defaultPath;\n }\n\n // Build the final navigation path\n const finalPath = this.buildFinalPath(returnUrl, connectionId, defaultPath);\n\n // Use window.location for reliable navigation after OAuth\n setTimeout(() => {\n window.location.href = finalPath;\n }, 500);\n }\n\n /**\n * Builds the final navigation path with success query params\n */\n private buildFinalPath(returnUrl: string, connectionId: string | undefined, defaultPath: string): string {\n try {\n let finalPath: string;\n\n // If it's a full URL, extract just the path and search\n if (returnUrl.startsWith('http://') || returnUrl.startsWith('https://')) {\n const url = new URL(returnUrl);\n finalPath = url.pathname + url.search;\n } else {\n finalPath = returnUrl;\n }\n\n // Ensure we have a valid path (not empty or just \"/\")\n if (!finalPath || finalPath.trim() === '' || finalPath === '/') {\n finalPath = defaultPath;\n }\n\n // Add success query params\n const separator = finalPath.includes('?') ? '&' : '?';\n finalPath = `${finalPath}${separator}oauth=success`;\n if (connectionId) {\n finalPath += `&connectionId=${connectionId}`;\n }\n\n return finalPath;\n } catch (e) {\n console.error('[OAuth Callback] Error parsing return URL:', e);\n return `${defaultPath}?oauth=success${connectionId ? `&connectionId=${connectionId}` : ''}`;\n }\n }\n\n /**\n * Clears all stored return URLs from storage\n */\n private clearStoredReturnUrls(): void {\n localStorage.removeItem('oauth_return_url');\n localStorage.removeItem('oauth_return_path');\n sessionStorage.removeItem('oauth_return_url');\n sessionStorage.removeItem('oauth_return_path');\n }\n\n /**\n * Show error state\n */\n private showError(errorCode: string, message: string, isRetryable = false): void {\n this.IsLoading = false;\n this.HasError = true;\n this.ErrorCode = errorCode;\n this.ErrorMessage = message;\n this.IsRetryable = isRetryable;\n this.cdr.detectChanges();\n }\n\n /**\n * Handle retry button click\n */\n public onRetry(): void {\n // Get the stored return URL and redirect there to start fresh\n const returnUrl = localStorage.getItem('oauth_return_url') || '/app/admin/MCP';\n this.clearStoredReturnUrls();\n this.router.navigateByUrl(returnUrl);\n }\n\n /**\n * Handle close button click (return to MCP dashboard)\n */\n public onClose(): void {\n this.clearStoredReturnUrls();\n this.router.navigate(['/app/admin/MCP']);\n }\n}\n","<div class=\"oauth-callback-container\">\n <div class=\"oauth-callback-card\">\n <!-- Loading State -->\n @if (IsLoading) {\n <div class=\"oauth-status loading\">\n <mj-loading text=\"{{ StatusMessage }}\"></mj-loading>\n </div>\n }\n\n <!-- Error State -->\n @if (HasError) {\n <div class=\"oauth-status error\">\n <div class=\"icon-container error-icon\">\n <i class=\"fa-solid fa-circle-exclamation\"></i>\n </div>\n <h2>Authorization Failed</h2>\n @if (ErrorCode) {\n <div class=\"error-code\">{{ ErrorCode }}</div>\n }\n <p class=\"error-message\">{{ ErrorMessage }}</p>\n <div class=\"button-group\">\n @if (IsRetryable) {\n <button kendoButton (click)=\"onRetry()\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n Try Again\n </button>\n }\n <button kendoButton [look]=\"IsRetryable ? 'outline' : 'default'\" (click)=\"onClose()\">\n <i class=\"fa-solid fa-arrow-left\"></i>\n Return to Dashboard\n </button>\n </div>\n </div>\n }\n\n <!-- Success State (brief - redirects quickly) -->\n @if (!IsLoading && !HasError) {\n <div class=\"oauth-status success\">\n <div class=\"icon-container success-icon\">\n <i class=\"fa-solid fa-circle-check\"></i>\n </div>\n <h2>Authorization Successful</h2>\n <p>{{ StatusMessage }}</p>\n </div>\n }\n </div>\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"oauth-callback.component.js","sourceRoot":"","sources":["../../../src/lib/oauth/oauth-callback.component.ts","../../../src/lib/oauth/oauth-callback.component.html"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAwC,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;;;;;;ICXpC,8BAAkC;IAC9B,gCAAoD;IACxD,iBAAM;;;IADU,cAA0B;IAA1B,sBAAA,sCAA0B,CAAA;;;IAYlC,8BAAwB;IAAA,YAAe;IAAA,iBAAM;;;IAArB,cAAe;IAAf,sCAAe;;;;IAKnC,kCAAyD;IAApB,yMAAS,gBAAS,KAAC;IACpD,wBAAwC;IACxC,2BACJ;IAAA,iBAAS;;;;IAbjB,AADJ,8BAAgC,aACW;IACnC,uBAA8C;IAClD,iBAAM;IACN,0BAAI;IAAA,oCAAoB;IAAA,iBAAK;IAC7B,sGAAiB;IAGjB,4BAAyB;IAAA,YAAkB;IAAA,iBAAI;IAC/C,+BAA0B;IACtB,0GAAmB;IAMnB,mCAAuF;IAApB,2LAAS,gBAAS,KAAC;IAClF,yBAAsC;IACtC,sCACJ;IAER,AADI,AADI,iBAAS,EACP,EACJ;;;IAhBF,eAEC;IAFD,2CAEC;IACwB,eAAkB;IAAlB,yCAAkB;I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AE,WAAW,GAAG,KAAK;QACrE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,OAAO;QACV,8DAA8D;QAC9D,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,gBAAgB,CAAC;QAC/E,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC7C,CAAC;gHA1UQ,sBAAsB;6DAAtB,sBAAsB;YCjD/B,AADJ,8BAAsC,aACD;YAE7B,wFAAiB;YAOjB,yFAAgB;YA0BhB,wFAA+B;YAUvC,AADI,iBAAM,EACJ;;YA3CE,eAIC;YAJD,wCAIC;YAGD,cAuBC;YAvBD,uCAuBC;YAGD,cAQC;YARD,0DAQC;;;iFDMI,sBAAsB;cANlC,SAAS;6BACI,KAAK,YACL,mBAAmB;;kFAIpB,sBAAsB","sourcesContent":["/**\n * @fileoverview OAuth Callback Component\n *\n * Handles OAuth provider redirects in the frontend. When an OAuth provider\n * redirects back to the application after user authorization, this component:\n * 1. Waits for the user's session to be restored (authentication)\n * 2. Extracts the code and state from URL query parameters\n * 3. Calls the backend /oauth/exchange endpoint to complete the token exchange\n * 4. Redirects to the original page with success/error notification\n *\n * @module OAuth Callback\n */\n\nimport { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Metadata } from '@memberjunction/core';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\n\n/**\n * Response from the OAuth exchange endpoint\n */\ninterface OAuthExchangeResponse {\n success: boolean;\n connectionId?: string;\n errorCode?: string;\n errorMessage?: string;\n isRetryable?: boolean;\n}\n\n/** Maximum time to wait for provider initialization (30 seconds) */\nconst MAX_WAIT_TIME_MS = 30000;\n/** Polling interval for checking provider readiness (500ms) */\nconst POLL_INTERVAL_MS = 500;\n\n/**\n * OAuth Callback Component\n *\n * Handles the redirect from OAuth providers after user authorization.\n * This component is loaded at /oauth/callback and processes the\n * authorization code to complete the OAuth flow.\n *\n * The component waits for authentication to complete before attempting\n * the code exchange, since the user's session needs to be restored first.\n */\n@Component({\n standalone: false,\n selector: 'mj-oauth-callback',\n templateUrl: './oauth-callback.component.html',\n styleUrls: ['./oauth-callback.component.css']\n})\nexport class OAuthCallbackComponent implements OnInit, OnDestroy {\n /** Loading state while processing OAuth callback */\n public IsLoading = true;\n\n /** Error state */\n public HasError = false;\n\n /** Error message to display */\n public ErrorMessage = '';\n\n /** Error code from OAuth provider or exchange */\n public ErrorCode = '';\n\n /** Whether the error is retryable */\n public IsRetryable = false;\n\n /** Status message shown during processing */\n public StatusMessage = 'Restoring session...';\n\n /** Timer for polling provider readiness */\n private pollTimer: ReturnType<typeof setInterval> | null = null;\n\n /** Flag to prevent double processing */\n private isProcessing = false;\n\n constructor(\n private route: ActivatedRoute,\n private router: Router,\n private cdr: ChangeDetectorRef\n ) {}\n\n async ngOnInit(): Promise<void> {\n // Wait for the GraphQL provider to be ready, then process the callback\n await this.waitForProviderAndProcess();\n }\n\n ngOnDestroy(): void {\n // Clean up the polling timer\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n }\n\n /**\n * Waits for the GraphQL provider to be initialized (indicating auth is complete)\n * then processes the OAuth callback.\n */\n private async waitForProviderAndProcess(): Promise<void> {\n const startTime = Date.now();\n\n // Check if provider is already ready\n if (this.isProviderReady()) {\n await this.safeProcessCallback();\n return;\n }\n\n // Poll for provider readiness\n this.StatusMessage = 'Waiting for authentication...';\n this.cdr.detectChanges();\n\n return new Promise<void>((resolve) => {\n this.pollTimer = setInterval(async () => {\n const elapsed = Date.now() - startTime;\n\n if (this.isProviderReady()) {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n await this.safeProcessCallback();\n resolve();\n return;\n }\n\n if (elapsed >= MAX_WAIT_TIME_MS) {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n this.showError(\n 'timeout',\n 'Timed out waiting for authentication. Please try logging in again.',\n true\n );\n resolve();\n return;\n }\n\n // Update status message with progress\n const secondsRemaining = Math.ceil((MAX_WAIT_TIME_MS - elapsed) / 1000);\n this.StatusMessage = `Waiting for authentication... (${secondsRemaining}s)`;\n this.cdr.detectChanges();\n }, POLL_INTERVAL_MS);\n });\n }\n\n /**\n * Checks if the GraphQL provider is initialized and has a valid token\n */\n private isProviderReady(): boolean {\n try {\n const provider = Metadata.Provider as GraphQLDataProvider;\n if (!provider) {\n return false;\n }\n const configData = provider.ConfigData;\n if (!configData || !configData.Token || !configData.URL) {\n return false;\n }\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Safely processes the callback, preventing double execution\n */\n private async safeProcessCallback(): Promise<void> {\n if (this.isProcessing) {\n return;\n }\n this.isProcessing = true;\n\n try {\n await this.processOAuthCallback();\n } catch (error) {\n console.error('[OAuth Callback] Error in processOAuthCallback:', error);\n this.showError('component_error', error instanceof Error ? error.message : String(error), true);\n }\n }\n\n /**\n * Process the OAuth callback by extracting params and exchanging the code\n */\n private async processOAuthCallback(): Promise<void> {\n const params = this.route.snapshot.queryParams;\n\n // Check for error from OAuth provider\n if (params['error']) {\n this.showError(\n params['error'] as string,\n params['error_description'] as string || 'Authorization was denied or failed'\n );\n return;\n }\n\n const code = params['code'] as string;\n const state = params['state'] as string;\n\n // Validate required parameters\n if (!code) {\n this.showError('missing_code', 'No authorization code received from the OAuth provider');\n return;\n }\n\n if (!state) {\n this.showError('missing_state', 'No state parameter received from the OAuth provider');\n return;\n }\n\n // Exchange the code for tokens\n this.StatusMessage = 'Exchanging authorization code...';\n this.cdr.detectChanges();\n\n try {\n const result = await this.exchangeCode(code, state);\n\n if (result.success) {\n this.handleSuccess(result.connectionId);\n } else {\n this.showError(\n result.errorCode || 'exchange_failed',\n result.errorMessage || 'Failed to complete authorization',\n result.isRetryable\n );\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : 'An unexpected error occurred';\n this.showError('network_error', message, true);\n }\n }\n\n /**\n * Call the backend to exchange the authorization code for tokens\n */\n private async exchangeCode(code: string, state: string): Promise<OAuthExchangeResponse> {\n // Get the GraphQL provider - we know it's ready at this point\n const gqlProvider = Metadata.Provider as GraphQLDataProvider;\n const configData = gqlProvider.ConfigData;\n\n // Build the exchange endpoint URL from the GraphQL URL\n // Handle both cases: URL with /graphql suffix and URL without\n let apiUrl = configData.URL;\n if (apiUrl.includes('/graphql')) {\n apiUrl = apiUrl.replace('/graphql', '/oauth/exchange');\n } else {\n // URL doesn't have /graphql, append /oauth/exchange\n apiUrl = apiUrl.replace(/\\/$/, '') + '/oauth/exchange';\n }\n\n try {\n const response = await fetch(apiUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${configData.Token}`\n },\n body: JSON.stringify({ code, state })\n });\n\n // Parse response regardless of status code\n const data = await response.json();\n return data as OAuthExchangeResponse;\n } catch (fetchError) {\n return {\n success: false,\n errorCode: 'fetch_error',\n errorMessage: fetchError instanceof Error ? fetchError.message : 'Network error during token exchange'\n };\n }\n }\n\n /**\n * Handle successful OAuth completion\n */\n private handleSuccess(connectionId?: string): void {\n this.IsLoading = false;\n this.StatusMessage = 'Authorization successful! Redirecting...';\n this.cdr.detectChanges();\n\n // Get the stored return URL - try both localStorage and sessionStorage\n const storedUrl = localStorage.getItem('oauth_return_url');\n const storedPath = localStorage.getItem('oauth_return_path');\n const sessionUrl = sessionStorage.getItem('oauth_return_url');\n const sessionPath = sessionStorage.getItem('oauth_return_path');\n\n let returnUrl = storedUrl || sessionUrl || storedPath || sessionPath;\n\n // Clean up all possible storage locations\n this.clearStoredReturnUrls();\n\n // Default to MCP dashboard if no return URL found\n const defaultPath = '/app/admin/MCP';\n if (!returnUrl || returnUrl.trim() === '' || returnUrl === '/') {\n returnUrl = defaultPath;\n }\n\n // Build the final navigation path\n const finalPath = this.buildFinalPath(returnUrl, connectionId, defaultPath);\n\n // Use window.location for reliable navigation after OAuth\n setTimeout(() => {\n window.location.href = finalPath;\n }, 500);\n }\n\n /**\n * Builds the final navigation path with success query params\n */\n private buildFinalPath(returnUrl: string, connectionId: string | undefined, defaultPath: string): string {\n try {\n let finalPath: string;\n\n // If it's a full URL, extract just the path and search\n if (returnUrl.startsWith('http://') || returnUrl.startsWith('https://')) {\n const url = new URL(returnUrl);\n finalPath = url.pathname + url.search;\n } else {\n finalPath = returnUrl;\n }\n\n // Ensure we have a valid path (not empty or just \"/\")\n if (!finalPath || finalPath.trim() === '' || finalPath === '/') {\n finalPath = defaultPath;\n }\n\n // Add success query params\n const separator = finalPath.includes('?') ? '&' : '?';\n finalPath = `${finalPath}${separator}oauth=success`;\n if (connectionId) {\n finalPath += `&connectionId=${connectionId}`;\n }\n\n return finalPath;\n } catch (e) {\n console.error('[OAuth Callback] Error parsing return URL:', e);\n return `${defaultPath}?oauth=success${connectionId ? `&connectionId=${connectionId}` : ''}`;\n }\n }\n\n /**\n * Clears all stored return URLs from storage\n */\n private clearStoredReturnUrls(): void {\n localStorage.removeItem('oauth_return_url');\n localStorage.removeItem('oauth_return_path');\n sessionStorage.removeItem('oauth_return_url');\n sessionStorage.removeItem('oauth_return_path');\n }\n\n /**\n * Show error state\n */\n private showError(errorCode: string, message: string, isRetryable = false): void {\n this.IsLoading = false;\n this.HasError = true;\n this.ErrorCode = errorCode;\n this.ErrorMessage = message;\n this.IsRetryable = isRetryable;\n this.cdr.detectChanges();\n }\n\n /**\n * Handle retry button click\n */\n public onRetry(): void {\n // Get the stored return URL and redirect there to start fresh\n const returnUrl = localStorage.getItem('oauth_return_url') || '/app/admin/MCP';\n this.clearStoredReturnUrls();\n this.router.navigateByUrl(returnUrl);\n }\n\n /**\n * Handle close button click (return to MCP dashboard)\n */\n public onClose(): void {\n this.clearStoredReturnUrls();\n this.router.navigate(['/app/admin/MCP']);\n }\n}\n","<div class=\"oauth-callback-container\">\n <div class=\"oauth-callback-card\">\n <!-- Loading State -->\n @if (IsLoading) {\n <div class=\"oauth-status loading\">\n <mj-loading text=\"{{ StatusMessage }}\"></mj-loading>\n </div>\n }\n\n <!-- Error State -->\n @if (HasError) {\n <div class=\"oauth-status error\">\n <div class=\"icon-container error-icon\">\n <i class=\"fa-solid fa-circle-exclamation\"></i>\n </div>\n <h2>Authorization Failed</h2>\n @if (ErrorCode) {\n <div class=\"error-code\">{{ ErrorCode }}</div>\n }\n <p class=\"error-message\">{{ ErrorMessage }}</p>\n <div class=\"button-group\">\n @if (IsRetryable) {\n <button mjButton variant=\"secondary\" (click)=\"onRetry()\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n Try Again\n </button>\n }\n <button mjButton [variant]=\"IsRetryable ? 'outline' : 'secondary'\" (click)=\"onClose()\">\n <i class=\"fa-solid fa-arrow-left\"></i>\n Return to Dashboard\n </button>\n </div>\n </div>\n }\n\n <!-- Success State (brief - redirects quickly) -->\n @if (!IsLoading && !HasError) {\n <div class=\"oauth-status success\">\n <div class=\"icon-container success-icon\">\n <i class=\"fa-solid fa-circle-check\"></i>\n </div>\n <h2>Authorization Successful</h2>\n <p>{{ StatusMessage }}</p>\n </div>\n }\n </div>\n</div>\n"]}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "@angular/common";
|
|
3
|
-
import * as i2 from "@
|
|
4
|
-
import * as i3 from "@memberjunction/ng-shared-generic";
|
|
3
|
+
import * as i2 from "@memberjunction/ng-shared-generic";
|
|
5
4
|
/**
|
|
6
5
|
* OAuth Module - provides dependencies for OAuth callback handling.
|
|
7
6
|
* The OAuthCallbackComponent itself is declared in ExplorerCoreModule.
|
|
8
7
|
*/
|
|
9
8
|
export declare class OAuthModule {
|
|
10
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<OAuthModule, never>;
|
|
11
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<OAuthModule, never, [typeof i1.CommonModule, typeof i2.
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<OAuthModule, never, [typeof i1.CommonModule, typeof i2.SharedGenericModule], never>;
|
|
12
11
|
static ɵinj: i0.ɵɵInjectorDeclaration<OAuthModule>;
|
|
13
12
|
}
|
|
14
13
|
//# sourceMappingURL=oauth.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.module.d.ts","sourceRoot":"","sources":["../../../src/lib/oauth/oauth.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oauth.module.d.ts","sourceRoot":"","sources":["../../../src/lib/oauth/oauth.module.ts"],"names":[],"mappings":";;;AAkBA;;;GAGG;AACH,qBAMa,WAAW;yCAAX,WAAW;0CAAX,WAAW;0CAAX,WAAW;CAAI"}
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { NgModule } from '@angular/core';
|
|
15
15
|
import { CommonModule } from '@angular/common';
|
|
16
|
-
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
17
16
|
import { SharedGenericModule } from '@memberjunction/ng-shared-generic';
|
|
18
17
|
import * as i0 from "@angular/core";
|
|
19
18
|
/**
|
|
@@ -24,7 +23,6 @@ export class OAuthModule {
|
|
|
24
23
|
static ɵfac = function OAuthModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OAuthModule)(); };
|
|
25
24
|
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: OAuthModule });
|
|
26
25
|
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
27
|
-
ButtonsModule,
|
|
28
26
|
SharedGenericModule] });
|
|
29
27
|
}
|
|
30
28
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OAuthModule, [{
|
|
@@ -32,12 +30,10 @@ export class OAuthModule {
|
|
|
32
30
|
args: [{
|
|
33
31
|
imports: [
|
|
34
32
|
CommonModule,
|
|
35
|
-
ButtonsModule,
|
|
36
33
|
SharedGenericModule
|
|
37
34
|
]
|
|
38
35
|
}]
|
|
39
36
|
}], null, null); })();
|
|
40
37
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(OAuthModule, { imports: [CommonModule,
|
|
41
|
-
ButtonsModule,
|
|
42
38
|
SharedGenericModule] }); })();
|
|
43
39
|
//# sourceMappingURL=oauth.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.module.js","sourceRoot":"","sources":["../../../src/lib/oauth/oauth.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"oauth.module.js","sourceRoot":"","sources":["../../../src/lib/oauth/oauth.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;;AAExE;;;GAGG;AAOH,MAAM,OAAO,WAAW;qGAAX,WAAW;4DAAX,WAAW;gEAJhB,YAAY;YACZ,mBAAmB;;iFAGd,WAAW;cANvB,QAAQ;eAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,mBAAmB;iBACtB;aACJ;;wFACY,WAAW,cAJhB,YAAY;QACZ,mBAAmB","sourcesContent":["/**\n * @fileoverview OAuth Module\n *\n * Provides the OAuth callback handling functionality for MJExplorer.\n * This module handles OAuth provider redirects and completes the\n * authorization flow by exchanging codes for tokens.\n *\n * NOTE: The OAuthCallbackComponent is declared in ExplorerCoreModule and\n * routed directly (not lazy-loaded) because lazy loading doesn't work\n * correctly when routes are defined in a library rather than the main app.\n *\n * @module OAuth Module\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SharedGenericModule } from '@memberjunction/ng-shared-generic';\n\n/**\n * OAuth Module - provides dependencies for OAuth callback handling.\n * The OAuthCallbackComponent itself is declared in ExplorerCoreModule.\n */\n@NgModule({\n imports: [\n CommonModule,\n SharedGenericModule\n ]\n})\nexport class OAuthModule { }\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
|
-
import { Router } from '@angular/router';
|
|
1
|
+
import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
|
3
2
|
import { CompositeKey } from '@memberjunction/core';
|
|
4
3
|
import { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';
|
|
5
4
|
import { ResourceData } from '@memberjunction/core-entities';
|
|
@@ -16,9 +15,10 @@ export declare class ChatCollectionsResource extends BaseResourceComponent imple
|
|
|
16
15
|
private artifactPermissionService;
|
|
17
16
|
collectionState: CollectionStateService;
|
|
18
17
|
private navigationService;
|
|
19
|
-
private
|
|
18
|
+
private cdr;
|
|
20
19
|
currentUser: any;
|
|
21
20
|
isArtifactPanelOpen: boolean;
|
|
21
|
+
activeCollectionId: string | null;
|
|
22
22
|
activeArtifactId: string | null;
|
|
23
23
|
activeVersionNumber: number | null;
|
|
24
24
|
canShareActiveArtifact: boolean;
|
|
@@ -31,21 +31,11 @@ export declare class ChatCollectionsResource extends BaseResourceComponent imple
|
|
|
31
31
|
private resizeStartWidth;
|
|
32
32
|
private destroy$;
|
|
33
33
|
private skipUrlUpdate;
|
|
34
|
-
|
|
35
|
-
constructor(artifactState: ArtifactStateService, artifactPermissionService: ArtifactPermissionService, collectionState: CollectionStateService, navigationService: NavigationService, router: Router);
|
|
34
|
+
constructor(artifactState: ArtifactStateService, artifactPermissionService: ArtifactPermissionService, collectionState: CollectionStateService, navigationService: NavigationService, cdr: ChangeDetectorRef);
|
|
36
35
|
ngOnInit(): void;
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
private parseUrlState;
|
|
42
|
-
/**
|
|
43
|
-
* Apply URL state to collection services.
|
|
44
|
-
*/
|
|
45
|
-
private applyUrlState;
|
|
46
|
-
/**
|
|
47
|
-
* Apply navigation parameters from configuration.
|
|
48
|
-
* This handles deep-linking from other resources (e.g., clicking a link in Conversations).
|
|
37
|
+
* Apply initial state from tab configuration.
|
|
38
|
+
* The shell populates queryParams from the URL, and nav params come from cross-resource linking.
|
|
49
39
|
*/
|
|
50
40
|
private applyNavigationParams;
|
|
51
41
|
/**
|
|
@@ -57,15 +47,6 @@ export declare class ChatCollectionsResource extends BaseResourceComponent imple
|
|
|
57
47
|
* Uses NavigationService for proper URL management that respects app-scoped routes.
|
|
58
48
|
*/
|
|
59
49
|
private updateUrl;
|
|
60
|
-
/**
|
|
61
|
-
* Handle external navigation (back/forward buttons).
|
|
62
|
-
* Parses the URL and applies the state without triggering a new navigation.
|
|
63
|
-
*/
|
|
64
|
-
private onExternalNavigation;
|
|
65
|
-
/**
|
|
66
|
-
* Parse URL state from a URL string (used for external navigation).
|
|
67
|
-
*/
|
|
68
|
-
private parseUrlFromString;
|
|
69
50
|
/**
|
|
70
51
|
* Update the tab/browser title based on the active collection.
|
|
71
52
|
*/
|