mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 16:09:39 +00:00
fix(frontend): Remove output when deleting a component (#1397)
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
app,
|
||||
mode,
|
||||
connectingInput,
|
||||
runnableComponents,
|
||||
summary,
|
||||
focusedGrid,
|
||||
parentWidth,
|
||||
@@ -39,40 +38,6 @@
|
||||
.flatMap((id) => dfs($app.grid, id, $app.subgrids ?? {}))
|
||||
.filter((x) => x != undefined) as string[]
|
||||
}
|
||||
|
||||
function removeGridElement(component) {
|
||||
if (component) {
|
||||
$app.grid = $app.grid.filter((gridComponent) => {
|
||||
if (gridComponent.data.id === component.id) {
|
||||
if (
|
||||
gridComponent.data.componentInput?.type === 'runnable' &&
|
||||
gridComponent.data.componentInput?.runnable?.type === 'runnableByName' &&
|
||||
gridComponent.data.componentInput?.runnable.inlineScript
|
||||
) {
|
||||
const { name, inlineScript } = gridComponent.data.componentInput?.runnable
|
||||
|
||||
if (!$app.unusedInlineScripts) {
|
||||
$app.unusedInlineScripts = []
|
||||
}
|
||||
|
||||
$app.unusedInlineScripts.push({
|
||||
name,
|
||||
inlineScript
|
||||
})
|
||||
|
||||
$app = $app
|
||||
}
|
||||
}
|
||||
|
||||
return gridComponent.data.id !== component?.id
|
||||
})
|
||||
|
||||
delete $runnableComponents[component.id]
|
||||
$runnableComponents = $runnableComponents
|
||||
|
||||
$selectedComponent = undefined
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="relative w-full z-20 overflow-visible">
|
||||
@@ -135,7 +100,6 @@
|
||||
component={dataItem.data}
|
||||
selected={Boolean($selectedComponent?.includes(dataItem.id))}
|
||||
locked={isFixed(dataItem)}
|
||||
on:delete={() => removeGridElement(dataItem.data)}
|
||||
on:lock={() => {
|
||||
const gridItem = findGridItem($app, dataItem.id)
|
||||
if (gridItem) {
|
||||
|
||||
@@ -79,7 +79,6 @@
|
||||
{component}
|
||||
{selected}
|
||||
shouldHideActions={$connectingInput.opened}
|
||||
on:delete
|
||||
on:lock
|
||||
on:expand
|
||||
{locked}
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
push(history, $app)
|
||||
|
||||
if (componentSettings?.item.id) {
|
||||
delete $worldStore.outputsById[componentSettings?.item.id]
|
||||
$errorByComponent = clearErrorByComponentId(componentSettings?.item.id, $errorByComponent)
|
||||
$jobs = clearJobsByComponentId(componentSettings?.item.id, $jobs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user