diff --git a/frontend/src/lib/components/apps/editor/AppEditor.svelte b/frontend/src/lib/components/apps/editor/AppEditor.svelte index 0e6665d897..7ce0f22e79 100644 --- a/frontend/src/lib/components/apps/editor/AppEditor.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditor.svelte @@ -23,7 +23,7 @@ import TabContent from '$lib/components/common/tabs/TabContent.svelte' import Tabs from '$lib/components/common/tabs/Tabs.svelte' import { userStore, workspaceStore } from '$lib/stores' - import { classNames, encodeState } from '$lib/utils' + import { classNames, encodeState, sendUserToast } from '$lib/utils' import AppPreview from './AppPreview.svelte' import ComponentList from './componentsPanel/ComponentList.svelte' import ContextPanel from './contextPanel/ContextPanel.svelte' @@ -119,6 +119,7 @@ const worldStore = buildWorld(context) const previewTheme: Writable = writable(undefined) + const initialized = writable({ initialized: false, initializedComponents: [] }) $secondaryMenuRightStore.isOpen = false $secondaryMenuLeftStore.isOpen = false @@ -127,7 +128,7 @@ worldStore, app: appStore, summary: summaryStore, - initialized: writable({ initialized: false, initializedComponents: [] }), + initialized: initialized, selectedComponent, mode, connectingInput, @@ -470,6 +471,23 @@ onMount(() => { mounted = true + setTimeout(() => { + if ($initialized?.initialized === false) { + sendUserToast( + 'App is not yet initialized, please check the Troubleshoot Panel for more information', + true, + [ + { + label: 'Open Troubleshoot Panel', + callback: () => { + appEditorHeader?.openTroubleshootPanel() + } + } + ] + ) + } + }, 10000) + parseScroll() }) diff --git a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte index 4efab90896..4a066bd2e8 100644 --- a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte @@ -92,6 +92,7 @@ createUpdatePostgresInput, getPrimaryKeys } from '../components/display/dbtable/utils' + import DebugPanel from './contextPanel/DebugPanel.svelte' async function hash(message) { try { @@ -161,6 +162,7 @@ let saveDrawerOpen = false let inputsDrawerOpen = fromHub let historyBrowserDrawerOpen = false + let debugAppDrawerOpen = false let deploymentMsg: string | undefined = undefined function closeSaveDrawer() { @@ -208,7 +210,6 @@ const whereClause = (c.configuration.whereClause as any).value as unknown as | string | undefined - console.log(columnDefs) if (tableValue && resourceValue && columnDefs) { r.push({ input: createPostgresInput(resourceValue, tableValue, columnDefs, whereClause), @@ -672,6 +673,14 @@ }) }, disabled: !savedApp + }, + // App debug menu + { + displayName: 'Troubleshoot panel', + icon: Bug, + action: () => { + debugAppDrawerOpen = true + } } ] @@ -684,6 +693,10 @@ let rightColumnSelect: 'timeline' | 'detail' = 'timeline' let appReportingDrawerOpen = false + + export function openTroubleshootPanel() { + debugAppDrawerOpen = true + } @@ -936,6 +949,12 @@ + + (debugAppDrawerOpen = false)}> + + + + + > diff --git a/frontend/src/lib/components/apps/editor/contextPanel/DebugPanel.svelte b/frontend/src/lib/components/apps/editor/contextPanel/DebugPanel.svelte new file mode 100644 index 0000000000..a9e6c0e34b --- /dev/null +++ b/frontend/src/lib/components/apps/editor/contextPanel/DebugPanel.svelte @@ -0,0 +1,151 @@ + + +
+ {#if unintitializedComponents?.length === 0 && subgridsErrors?.length === 0} + + The app has no subgrid errors or uninitialized components. + + {:else} + + The app has {unintitializedComponents.length} uninitialized components and {subgridsErrors.length} + subgrid errors. +
+ Please contact Windmill support for assistance. +
+ {/if} + {#if unintitializedComponents.length > 0} +
+
+
+ There are {pluralize(unintitializedComponents.length, 'uninitialized component')} in the app. +
+ +
+ +
Component Id
+
Type
+
Status
+ + + {#each unintitializedComponents as c} + +
+ + {c} + +
+ +
+ + {findGridItem($app, c)?.data?.type || 'Unknown'} + +
+ +
+ Uninitialized +
+ {/each} +
+
+
{/if} + {#if subgridsErrors.length > 0} +
+
+
+ There are + {pluralize(subgridsErrors.length, 'subgrid')} with errors in the app. +
+ +
+ +
Subgrid Id
+
Error
+
Action
+ + + {#each subgridsErrors as s} + +
+ + {s?.subGridId} + +
+ +
+ + {s?.error} + +
+ +
+ +
+ {/each} +
+
+
+ {/if} +