diff --git a/frontend/src/lib/components/ResultJobLoader.svelte b/frontend/src/lib/components/ResultJobLoader.svelte index 43ae1be916..6b13d959fc 100644 --- a/frontend/src/lib/components/ResultJobLoader.svelte +++ b/frontend/src/lib/components/ResultJobLoader.svelte @@ -1,7 +1,7 @@ + + { + jobId = e.detail + }} + {outputs} + {render} + {componentInput} + {id} + bind:initializing +> +
+
+ Flow Status +
+
+ {#if jobId} + + {:else} + No flow + {/if} +
+
+
diff --git a/frontend/src/lib/components/apps/components/display/AppLogsComponent.svelte b/frontend/src/lib/components/apps/components/display/AppLogsComponent.svelte new file mode 100644 index 0000000000..93d26ce55a --- /dev/null +++ b/frontend/src/lib/components/apps/components/display/AppLogsComponent.svelte @@ -0,0 +1,66 @@ + + + + + { + testJobLoader?.watchJob(e.detail) + }} + {outputs} + {render} + {componentInput} + {id} + bind:initializing +> +
+
+ Logs +
+
+ +
+
+
diff --git a/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte b/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte index 6ca3b9a143..93b296c9f8 100644 --- a/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte +++ b/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte @@ -210,8 +210,6 @@ return } - loading = true - try { let njob = await resultJobLoader?.abstractRun(() => { const nonStaticRunnableInputs = {} @@ -281,6 +279,7 @@ } async function setResult(res: any, jobId: string | undefined) { + dispatch('done') const hasRes = res !== undefined && res !== null if (transformer) { @@ -410,6 +409,10 @@ {/if} { + loading = true + dispatch('started', e.detail) + }} workspaceOverride={workspace} on:done={(e) => { lastJobId = e.detail.id diff --git a/frontend/src/lib/components/apps/components/helpers/RunnableWrapper.svelte b/frontend/src/lib/components/apps/components/helpers/RunnableWrapper.svelte index 61e51cbc4b..beb7c073f8 100644 --- a/frontend/src/lib/components/apps/components/helpers/RunnableWrapper.svelte +++ b/frontend/src/lib/components/apps/components/helpers/RunnableWrapper.svelte @@ -53,10 +53,6 @@ const { staticExporter, noBackend, componentControl, runnableComponents } = getContext('AppViewerContext') - $: if (initializing && result != undefined) { - initializing = false - } - if (noBackend && componentInput?.type == 'runnable') { result = componentInput?.['value'] } @@ -156,6 +152,8 @@ wrapperClass={runnableClass} wrapperStyle={runnableStyle} {render} + on:started + on:done={() => (initializing = false)} on:success={() => handleSideEffect(true)} on:handleError={(e) => handleSideEffect(false, e.detail)} {outputs} diff --git a/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte index e283e6ab00..cef8d71bc0 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppRangeInput.svelte @@ -14,7 +14,6 @@ export let verticalAlignment: 'top' | 'center' | 'bottom' | undefined = undefined export let customCss: ComponentCustomCSS<'rangecomponent'> | undefined = undefined export let render: boolean - export let initializing: boolean = true const { app, worldStore } = getContext('AppViewerContext') let min = 0 @@ -48,12 +47,7 @@ - (initializing = false)} - {id} - input={configuration.defaultHigh} - bind:value={values[1]} -/> + diff --git a/frontend/src/lib/components/apps/components/inputs/AppSliderInputs.svelte b/frontend/src/lib/components/apps/components/inputs/AppSliderInputs.svelte index e7b78e6e59..9abb0452ca 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppSliderInputs.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppSliderInputs.svelte @@ -14,7 +14,6 @@ export let verticalAlignment: 'top' | 'center' | 'bottom' | undefined = undefined export let customCss: ComponentCustomCSS<'slidercomponent'> | undefined = undefined export let render: boolean - export let initializing: boolean = true const { app, worldStore, selectedComponent } = getContext('AppViewerContext') let min = 0 @@ -79,12 +78,7 @@ - (initializing = false)} - {id} - input={configuration.defaultValue} - bind:value={values[0]} -/> + diff --git a/frontend/src/lib/components/apps/editor/component/Component.svelte b/frontend/src/lib/components/apps/editor/component/Component.svelte index c6ae43034d..bc8f7c4c54 100644 --- a/frontend/src/lib/components/apps/editor/component/Component.svelte +++ b/frontend/src/lib/components/apps/editor/component/Component.svelte @@ -46,6 +46,8 @@ import AppConditionalWrapper from '../../components/layout/AppConditionalWrapper.svelte' import AppSelectStep from '../../components/inputs/AppSelectStep.svelte' import AppDownload from '../../components/display/AppDownload.svelte' + import AppLogsComponent from '../../components/display/AppLogsComponent.svelte' + import AppFlowStatusComponent from '../../components/display/AppFlowStatusComponent.svelte' export let component: AppComponent export let selected: boolean @@ -138,6 +140,22 @@ componentInput={component.componentInput} {render} /> + {:else if component.type === 'logcomponent'} + + {:else if component.type === 'flowstatuscomponent'} + {:else if component.type === 'barchartcomponent'} @@ -368,7 +385,6 @@ configuration={component.configuration} id={component.id} customCss={component.customCss} - bind:initializing {render} /> {:else if component.type === 'horizontaldividercomponent'} @@ -398,7 +414,6 @@ id={component.id} customCss={component.customCss} {render} - bind:initializing /> {:else if component.type === 'tabscomponent' && component.tabs} & { } export type AggridComponent = BaseComponent<'aggridcomponent'> export type DisplayComponent = BaseComponent<'displaycomponent'> +export type LogComponent = BaseComponent<'logcomponent'> +export type FlowStatusComponent = BaseComponent<'flowstatuscomponent'> export type ImageComponent = BaseComponent<'imagecomponent'> export type InputComponent = BaseComponent<'inputcomponent'> export type SelectComponent = BaseComponent<'selectcomponent'> & RecomputeOthersSource @@ -127,6 +129,8 @@ export type SelectStepComponent = BaseComponent<'selectstepcomponent'> export type TypedComponent = | DisplayComponent + | LogComponent + | FlowStatusComponent | TextInputComponent | TextareaInputComponent | PasswordInputComponent @@ -298,7 +302,8 @@ const onSuccessClick = { fieldType: 'text', type: 'static', value: '', - placeholder: 'Hello there' + placeholder: 'Hello there', + noVariablePicker: true } } } @@ -399,6 +404,42 @@ export const components = { configuration: {} } }, + logcomponent: { + name: 'Log', + icon: Monitor, + dims: '2:8-6:8' as AppComponentDimensions, + customCss: { + header: { class: '', style: '' }, + container: { class: '', style: '' } + }, + initialData: { + configuration: {}, + componentInput: { + type: 'runnable', + fieldType: 'any', + fields: {}, + runnable: undefined + } + } + }, + flowstatuscomponent: { + name: 'Flow Status', + icon: Monitor, + dims: '2:8-6:8' as AppComponentDimensions, + customCss: { + header: { class: '', style: '' }, + container: { class: '', style: '' } + }, + initialData: { + configuration: {}, + componentInput: { + type: 'runnable', + fieldType: 'any', + fields: {}, + runnable: undefined + } + } + }, containercomponent: { name: 'Container', icon: BoxSelect, diff --git a/frontend/src/lib/components/apps/editor/component/sets.ts b/frontend/src/lib/components/apps/editor/component/sets.ts index bbcac551b3..751104ae69 100644 --- a/frontend/src/lib/components/apps/editor/component/sets.ts +++ b/frontend/src/lib/components/apps/editor/component/sets.ts @@ -57,7 +57,9 @@ const display: ComponentSet = { 'mapcomponent', 'htmlcomponent', 'pdfcomponent', - 'displaycomponent' + 'displaycomponent', + 'logcomponent', + 'flowstatuscomponent' ] } as const diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts b/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts index da98ca0e28..f4a8dc53f3 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts +++ b/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts @@ -632,6 +632,14 @@ export const quickStyleProperties: Record< header: [...containerDefaultProps, typographyGrouping], container: containerDefaultProps }, + logcomponent: { + header: [...containerDefaultProps, typographyGrouping], + container: containerDefaultProps + }, + flowstatuscomponent: { + header: [...containerDefaultProps, typographyGrouping], + container: containerDefaultProps + }, barchartcomponent: { container: containerDefaultProps }, diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte index 5cd9fc899f..0b9e5212ee 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte @@ -3,7 +3,7 @@ import FlowModuleScript from '$lib/components/flows/content/FlowModuleScript.svelte' import FlowPathViewer from '$lib/components/flows/content/FlowPathViewer.svelte' import { emptySchema } from '$lib/utils' - import { getContext } from 'svelte' + import { getContext, tick } from 'svelte' import type { ConnectedAppInput, RowAppInput, @@ -99,10 +99,11 @@ variant="border" size="xs" startIcon={{ icon: faRefresh }} - on:click={() => { + on:click={async () => { sendUserToast('Refreshing inputs') refresh() $stateId = $stateId + 1 + await tick() }} > Refresh diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte index 996bbeac35..19758ff330 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte @@ -140,7 +140,7 @@
{#if component.componentInput} - The runnable inputs of a button component are not settable by the user. They - must be defined statically or connected. + The runnable inputs are inferred from the inputs of the flow or script + parameters this component is attached to. diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/GridCondition.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/GridCondition.svelte index 8a9361c170..8381794b24 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/GridCondition.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/GridCondition.svelte @@ -168,6 +168,7 @@ placeholder={condition?.['placeholder']} customTitle={condition?.['customTitle']} displayType={false} + noVariablePicker={true} />
diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte index 37f85fc4e4..800612de1a 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecEditor.svelte @@ -32,6 +32,7 @@ export let placeholder: string | undefined export let customTitle: string | undefined = undefined export let displayType: boolean = false + export let noVariablePicker: boolean | undefined = undefined const { connectingInput, app } = getContext('AppViewerContext') @@ -129,6 +130,7 @@ {selectOptions} {format} {placeholder} + noVariablePicker={noVariablePicker ?? false} bind:componentInput /> diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte index 06c9d5cf41..0c29155833 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte @@ -50,6 +50,7 @@ fileUpload={meta?.['fileUpload']} placeholder={meta?.['placeholder']} customTitle={meta?.['customTitle']} + noVariablePicker={meta?.['noVariablePicker']} {displayType} /> {/if} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte index d3e0193a13..592b67e905 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte @@ -70,6 +70,7 @@ placeholder={config?.['placeholder']} onlyStatic={config?.['onlyStatic']} customTitle={config?.['customTitle']} + noVariablePicker={config?.['noVariablePicker']} /> {/if} {/each} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte index a1575624c9..6f9a629261 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte @@ -32,5 +32,10 @@ {#if isScriptByPathDefined(appInput) || isScriptByNameDefined(appInput)} {:else if appInput !== undefined} - onPick(e.detail)} /> + onPick(e.detail)} + /> {/if} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte index 7784f8f951..c6334f9925 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte @@ -17,8 +17,9 @@ export let defaultUserInput = false export let hideCreateScript = false + export let onlyFlow = false - let tab: Tab = 'inlinescripts' + let tab: Tab = onlyFlow ? 'workspaceflows' : 'inlinescripts' let filter: string = '' let picker: Drawer @@ -132,30 +133,34 @@
- -
- - Detached Inline Scripts -
-
- -
- - Workspace Scripts -
-
+ {#if !onlyFlow} + +
+ + Detached Inline Scripts +
+
+ +
+ + Workspace Scripts +
+
+ {/if}
Workspace Flows
- -
- - Hub Scripts -
-
+ {#if !onlyFlow} + +
+ + Hub Scripts +
+
+ {/if}
@@ -202,6 +207,6 @@ startIcon={{ icon: faMousePointer }} btnClasses="truncate w-full" > - Select a script or flow + {#if onlyFlow}Select a flow{:else}Select a script or flow{/if}