mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
fix: fix forking raw apps and summary setting in deploy drawer (#7792)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -696,7 +696,7 @@ export const getAppTools = memo((): Tool<AppAIChatHelpers>[] => [
|
||||
})
|
||||
const lintResult = await helpers.setBackendRunnable(parsedArgs.key, runnable)
|
||||
toolCallbacks.setToolStatus(toolId, {
|
||||
content: `Backend runnable '${parsedArgs.key}' analyzed`,
|
||||
content: `Backend runnable '${parsedArgs.key}' set successfully.`,
|
||||
result: 'Success'
|
||||
})
|
||||
return formatLintResultResponse(
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
} from './dataTableRefUtils'
|
||||
|
||||
interface Props {
|
||||
initFiles: Record<string, string>
|
||||
initRunnables: Record<string, Runnable>
|
||||
files?: Record<string, string>
|
||||
runnables?: Record<string, Runnable>
|
||||
/** Data configuration including tables and creation policy */
|
||||
initData: RawAppData | undefined
|
||||
data?: RawAppData
|
||||
newApp: boolean
|
||||
policy: Policy
|
||||
summary?: string
|
||||
@@ -57,9 +57,9 @@
|
||||
}
|
||||
|
||||
let {
|
||||
initFiles,
|
||||
initRunnables,
|
||||
initData,
|
||||
files = $bindable({}),
|
||||
runnables = $bindable({}),
|
||||
data = $bindable(DEFAULT_DATA),
|
||||
newApp,
|
||||
policy,
|
||||
summary = $bindable(''),
|
||||
@@ -70,23 +70,8 @@
|
||||
}: Props = $props()
|
||||
export const version: number | undefined = undefined
|
||||
|
||||
let runnables = $state(initRunnables)
|
||||
|
||||
// Data configuration with tables and creation policy
|
||||
let data: RawAppData = $state(initData ?? DEFAULT_DATA)
|
||||
|
||||
// Convert to object format for child components
|
||||
let dataTableRefsObjects = $derived(data.tables.map(parseDataTableRef))
|
||||
let initRunnablesContent = Object.fromEntries(
|
||||
Object.entries(initRunnables).map(([key, runnable]) => {
|
||||
if (isRunnableByName(runnable)) {
|
||||
return [key, runnable?.inlineScript?.content ?? '']
|
||||
}
|
||||
return [key, '']
|
||||
})
|
||||
)
|
||||
|
||||
let files: Record<string, string> | undefined = $state(initFiles)
|
||||
|
||||
// Initialize history manager
|
||||
const historyManager = new RawAppHistoryManager({
|
||||
@@ -175,7 +160,9 @@
|
||||
let iframeLoaded = $state(false) // @hmr:keep
|
||||
|
||||
function populateFiles() {
|
||||
setFilesInIframe(initFiles)
|
||||
if (files) {
|
||||
setFilesInIframe(files)
|
||||
}
|
||||
}
|
||||
function setFilesInIframe(newFiles: Record<string, string>) {
|
||||
const files = Object.fromEntries(
|
||||
@@ -604,8 +591,8 @@
|
||||
// Normalize Windows-style path separators to Linux-style
|
||||
function normalizeFilePaths(
|
||||
filesObj: Record<string, string> | undefined
|
||||
): Record<string, string> | undefined {
|
||||
if (!filesObj) return filesObj
|
||||
): Record<string, string> {
|
||||
if (!filesObj) return {}
|
||||
return Object.fromEntries(
|
||||
Object.entries(filesObj).map(([path, content]) => [path.replace(/\\/g, '/'), content])
|
||||
)
|
||||
@@ -681,7 +668,7 @@
|
||||
})
|
||||
})
|
||||
$effect(() => {
|
||||
iframe && iframeLoaded && initFiles && populateFiles()
|
||||
iframe && iframeLoaded && files && populateFiles()
|
||||
})
|
||||
$effect(() => {
|
||||
iframe && iframeLoaded && runnables && populateRunnables()
|
||||
@@ -895,7 +882,6 @@
|
||||
<RawAppInlineScriptsPanel
|
||||
appPath={path}
|
||||
{selectedRunnable}
|
||||
{initRunnablesContent}
|
||||
bind:runnables
|
||||
onSelectionChange={(selection) => {
|
||||
console.log('handle selection', selection)
|
||||
|
||||
@@ -712,7 +712,7 @@
|
||||
{appPath}
|
||||
{onLatest}
|
||||
{savedApp}
|
||||
{summary}
|
||||
bind:summary
|
||||
bind:customPath
|
||||
bind:deploymentMsg
|
||||
bind:customPathError
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
runnables: Record<string, Runnable>
|
||||
selectedRunnable: string | undefined
|
||||
appPath: string
|
||||
initRunnablesContent: Record<string, string>
|
||||
/** Called when code is selected in the editor */
|
||||
onSelectionChange?: (
|
||||
selection: {
|
||||
|
||||
@@ -588,12 +588,12 @@
|
||||
on:savedNewAppPath={(event) => {
|
||||
goto(`/apps_raw/edit/${event.detail}`)
|
||||
}}
|
||||
initFiles={files}
|
||||
initRunnables={runnables}
|
||||
initData={data}
|
||||
bind:files
|
||||
bind:runnables
|
||||
bind:data
|
||||
{policy}
|
||||
path={''}
|
||||
{summary}
|
||||
bind:summary
|
||||
newApp
|
||||
/>
|
||||
{/key}
|
||||
|
||||
@@ -231,10 +231,10 @@
|
||||
newPath = event.detail
|
||||
}}
|
||||
on:restore={onRestore}
|
||||
initFiles={files}
|
||||
initRunnables={runnables}
|
||||
initData={data}
|
||||
{summary}
|
||||
bind:files
|
||||
bind:runnables
|
||||
bind:data
|
||||
bind:summary
|
||||
{newPath}
|
||||
path={page.params.path ?? ''}
|
||||
{policy}
|
||||
|
||||
Reference in New Issue
Block a user