mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 08:02:19 +00:00
feat(frontend): add a refresh component control to the DB Studio (#3490)
* feat(frontend): add a refresh component control to the DB Studio * feat(frontend): add a refresh component control to the DB Studio * feat(frontend): clean up * feat(frontend): improve recompute to handle sub runnable * feat(frontend): clean up
This commit is contained in:
@@ -140,6 +140,7 @@ export async function eval_like(
|
||||
invalidate?: (key: string, error: string) => void
|
||||
validateAll?: () => void
|
||||
clearFiles?: () => void
|
||||
showToast?: (message: string, error?: boolean) => void
|
||||
}
|
||||
>,
|
||||
worldStore: World | undefined,
|
||||
@@ -183,6 +184,13 @@ export async function eval_like(
|
||||
controlComponents[id]?.setTab?.(index)
|
||||
},
|
||||
(id) => {
|
||||
// Check for the existence of sub-runnables:
|
||||
// For example a_count for Database Studio
|
||||
|
||||
if (runnableComponents[`${id}_count`]?.cb) {
|
||||
runnableComponents[`${id}_count`]?.cb?.forEach((f) => f())
|
||||
}
|
||||
|
||||
runnableComponents[id]?.cb?.forEach((f) => f())
|
||||
},
|
||||
(id) => {
|
||||
|
||||
@@ -126,6 +126,8 @@ export function getComponentControl(type: keyof typeof components): Array<Compon
|
||||
return [setValue, validate, validateAll, invalidate]
|
||||
case 'tablecomponent':
|
||||
return [setSelectedIndex]
|
||||
case 'dbexplorercomponent':
|
||||
return [recompute]
|
||||
default:
|
||||
if (components[type].initialData['componentInput']) {
|
||||
return [recompute]
|
||||
|
||||
@@ -258,6 +258,7 @@ export type AppViewerContext = {
|
||||
invalidate?: (key: string, error: string) => void
|
||||
validateAll?: () => void
|
||||
clearFiles?: () => void
|
||||
showToast?: (message: string, error?: boolean) => void
|
||||
}
|
||||
>
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user