mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-29 08:12:56 +00:00
* feat: edit variables, resources and triggers in their own session tab Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: take a trigger's flow kind from its config and name the written trigger Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * refactor: one operating-workspace context for editors acting on a session's workspace Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: reload page item tabs only in sessions acting on the tool's workspace Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: resolve open in workspace for every preview tab kind in one place Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: guard every component under a session editor against the navigation workspace Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: show a page item tab whose item is gone instead of mounting its editor Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: follow a saved page item in the tab's own workspace and restore in-frame rows Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat: close a page item tab from its editor header Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: judge trigger permissions by the user acting in the session workspace Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: judge every session-editor permission by the user acting in that workspace Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: keep session permissions reactive to the acting role and restore tabs as last seen Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix: default Path's owner controls to the user acting in its workspace Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
81 lines
1.9 KiB
Svelte
81 lines
1.9 KiB
Svelte
<script lang="ts">
|
|
import Toggle from '$lib/components/Toggle.svelte'
|
|
|
|
import { FlowService, ScriptService } from '$lib/gen'
|
|
import { sendUserToast } from '$lib/toast'
|
|
import { useOperatingWorkspace } from '$lib/components/operatingWorkspace.svelte'
|
|
|
|
const operatingWorkspace = useOperatingWorkspace()
|
|
|
|
interface Props {
|
|
kind: 'script' | 'flow'
|
|
scriptOrFlowPath: string
|
|
errorHandlerMuted: boolean | undefined
|
|
textDisabled?: boolean
|
|
color?: 'nord' | 'red' | 'blue' | undefined
|
|
}
|
|
|
|
let {
|
|
kind,
|
|
scriptOrFlowPath,
|
|
errorHandlerMuted = $bindable(),
|
|
textDisabled = false,
|
|
color = undefined
|
|
}: Props = $props()
|
|
|
|
let toggleState = $state(errorHandlerMuted)
|
|
|
|
async function toggleErrorHandler(): Promise<void> {
|
|
toggleState = !toggleState
|
|
if ($operatingWorkspace !== undefined) {
|
|
try {
|
|
if (kind === 'flow') {
|
|
await FlowService.toggleWorkspaceErrorHandlerForFlow({
|
|
workspace: $operatingWorkspace,
|
|
path: scriptOrFlowPath,
|
|
requestBody: {
|
|
muted: !errorHandlerMuted
|
|
}
|
|
})
|
|
} else {
|
|
await ScriptService.toggleWorkspaceErrorHandlerForScript({
|
|
workspace: $operatingWorkspace,
|
|
path: scriptOrFlowPath,
|
|
requestBody: {
|
|
muted: !errorHandlerMuted
|
|
}
|
|
})
|
|
}
|
|
} catch (error) {
|
|
sendUserToast(
|
|
`Error while toggling Workspace Error Handler: ${error.body || error.message}`,
|
|
true
|
|
)
|
|
toggleState = false
|
|
return
|
|
}
|
|
errorHandlerMuted = !errorHandlerMuted
|
|
toggleState = errorHandlerMuted
|
|
sendUserToast(
|
|
errorHandlerMuted ? 'Workspace error handler muted' : 'Workspace error handler active',
|
|
false
|
|
)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<Toggle
|
|
textClass="font-medium"
|
|
{color}
|
|
size="xs"
|
|
checked={toggleState}
|
|
on:change={toggleErrorHandler}
|
|
options={{
|
|
right: 'Mute',
|
|
rightTooltip: 'Disable workspace error handler, EE only',
|
|
rightDocumentationLink:
|
|
'https://www.windmill.dev/docs/core_concepts/error_handling#workspace-error-handler'
|
|
}}
|
|
{textDisabled}
|
|
/>
|