mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-17 08:03:06 +00:00
feat: assets-only delete in both modes, why it is blocked, and a Show scripts toggle
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4f8e069337
commit
090da05c50
@@ -211,7 +211,7 @@
|
||||
* canvas is embedded inline inside a scrollable container, so a wheel
|
||||
* gesture over it scrolls the container instead of being captured. */
|
||||
scrollZoom?: boolean
|
||||
/** Offer the "Assets only" switch, which folds scripts and triggers into the
|
||||
/** Offer the "Show scripts and triggers" switch; off folds scripts and triggers into the
|
||||
* assets they produce. */
|
||||
assetsOnlyToggle?: boolean
|
||||
/** The pipeline folder, when the toggle's state should be remembered for it. */
|
||||
@@ -1088,7 +1088,15 @@
|
||||
deleteCount: toDelete.trigger ? 2 : 1,
|
||||
onDeleteUpstream: () => onDeleteAssetUpstream?.(toDelete)
|
||||
}
|
||||
: {})
|
||||
: onDeleteAssetUpstream && u
|
||||
? {
|
||||
deleteBlocked: !u.multiple
|
||||
? 'its script builds other assets too'
|
||||
: u.runnableIds.length > 1
|
||||
? 'several scripts build it'
|
||||
: 'its script has several triggers'
|
||||
}
|
||||
: {})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1625,11 +1633,12 @@
|
||||
class="!m-3"
|
||||
>
|
||||
<Toggle
|
||||
bind:checked={assetsOnly}
|
||||
checked={!assetsOnly}
|
||||
size="xs"
|
||||
options={{ right: 'Assets only' }}
|
||||
options={{ right: 'Show scripts and triggers' }}
|
||||
on:change={(e) => {
|
||||
if (assetsOnlyFolder != undefined) setAssetsOnlyFolder(assetsOnlyFolder, e.detail)
|
||||
assetsOnly = !e.detail
|
||||
if (assetsOnlyFolder != undefined) setAssetsOnlyFolder(assetsOnlyFolder, assetsOnly)
|
||||
}}
|
||||
/>
|
||||
</Panel>
|
||||
|
||||
@@ -154,6 +154,8 @@
|
||||
* asset shares; `deleteCount` is how many that is. */
|
||||
onDeleteUpstream?: () => void
|
||||
deleteCount?: number
|
||||
/** Why nothing can be deleted, when the producer is shared. */
|
||||
deleteBlocked?: string
|
||||
}
|
||||
// SvelteFlow injects this on the node component when the user clicks
|
||||
// the node. Combined with our own `hovered` state to drive the
|
||||
@@ -219,7 +221,15 @@
|
||||
action: () => data.onDeleteUpstream?.()
|
||||
}
|
||||
]
|
||||
: []
|
||||
: data.deleteBlocked
|
||||
? [
|
||||
{
|
||||
displayName: `Can't delete: ${data.deleteBlocked}`,
|
||||
icon: Trash2,
|
||||
disabled: true
|
||||
}
|
||||
]
|
||||
: []
|
||||
)
|
||||
let upstream = $derived(data.upstream)
|
||||
const CHIP_CLASS =
|
||||
|
||||
@@ -2918,7 +2918,7 @@
|
||||
onAddScriptForAsset={mode === 'edit' ? handleAddScriptForAsset : undefined}
|
||||
onAddPipelineScript={mode === 'edit' ? handleAddPipelineScript : undefined}
|
||||
onRunnableMenuRemove={mode === 'edit' ? handleRunnableMenuRemove : undefined}
|
||||
onDeleteAssetUpstream={mode === 'edit' ? (t) => (assetDeleteTarget = t) : undefined}
|
||||
onDeleteAssetUpstream={(t) => (assetDeleteTarget = t)}
|
||||
onRunProducer={mode === 'edit' ? handleRunProducer : undefined}
|
||||
onRequestEdit={isOperator ? undefined : () => setMode('edit')}
|
||||
canRunByPath={openScriptHasDataUpload}
|
||||
|
||||
Reference in New Issue
Block a user