mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-06 08:01:35 +00:00
refactor: share the disabled-field reset toast between the two run forms
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
import InputSelectedBadge from './schema/InputSelectedBadge.svelte'
|
||||
import { untrack } from 'svelte'
|
||||
import { processSecretArgs } from './secretArgUtils'
|
||||
import { enforceDisabledDefaults } from './job_args'
|
||||
import { enforceDisabledDefaults, resetKeysToast } from './job_args'
|
||||
import PowerShellCommonParams from './PowerShellCommonParams.svelte'
|
||||
|
||||
let reloadArgs = $state(0)
|
||||
@@ -63,9 +63,7 @@
|
||||
let processedArgs: Record<string, any>
|
||||
const { args: withDefaults, resetKeys } = enforceDisabledDefaults(args ?? {}, runnable?.schema)
|
||||
if (resetKeys.length > 0) {
|
||||
sendUserToast(
|
||||
`Disabled field${resetKeys.length > 1 ? 's' : ''} ${resetKeys.map((k) => `'${k}'`).join(', ')} reset to default value${resetKeys.length > 1 ? 's' : ''}`
|
||||
)
|
||||
sendUserToast(resetKeysToast(resetKeys))
|
||||
}
|
||||
try {
|
||||
processedArgs = await processSecretArgs(withDefaults, runnable?.schema)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import Button from '$lib/components/common/button/Button.svelte'
|
||||
import SchemaForm from '$lib/components/SchemaForm.svelte'
|
||||
import { processSecretArgs } from '$lib/components/secretArgUtils'
|
||||
import { enforceDisabledDefaults } from '$lib/components/job_args'
|
||||
import { enforceDisabledDefaults, resetKeysToast } from '$lib/components/job_args'
|
||||
import { sendUserToast } from '$lib/utils'
|
||||
import { getAiChatManager } from './aiChatManagerContext'
|
||||
import { PLAN_MODE_MESSAGES } from './planModeMessages'
|
||||
@@ -74,9 +74,7 @@
|
||||
// JSON editor to holds keys no schema names, and they are still theirs.
|
||||
const { args: enforced, resetKeys } = enforceDisabledDefaults(args ?? {}, schema)
|
||||
if (resetKeys.length > 0) {
|
||||
sendUserToast(
|
||||
`Disabled field${resetKeys.length > 1 ? 's' : ''} ${resetKeys.map((k) => `'${k}'`).join(', ')} reset to default value${resetKeys.length > 1 ? 's' : ''}`
|
||||
)
|
||||
sendUserToast(resetKeysToast(resetKeys))
|
||||
}
|
||||
let processed: Record<string, any>
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user