fix(ui): toast on workflow enable/disable; editor toolbar wraps instead of crushing the run picker and Publish
This commit is contained in:
5 files changed
+28
-3
No files matched your search
@@ -32,6 +32,7 @@
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"vue": "^3.5.42",
|
||||
"vue-router": "^5.3.1",
|
||||
"vue-sonner": "^2.0.9",
|
||||
"yaml": "^2.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Generated
+19
@@ -229,6 +229,9 @@ importers:
|
||||
vue-router:
|
||||
specifier: ^5.3.1
|
||||
version: 5.4.0(@vue/compiler-sfc@3.5.44)(pinia@4.1.0(@vue/devtools-api@8.2.1)(typescript@6.0.3)(vue@3.5.44(typescript@6.0.3)))(rolldown@1.2.15)(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1))(vue@3.5.44(typescript@6.0.3))
|
||||
vue-sonner:
|
||||
specifier: ^2.0.9
|
||||
version: 2.0.9
|
||||
yaml:
|
||||
specifier: ^2.9.1
|
||||
version: 2.9.1
|
||||
@@ -1382,6 +1385,20 @@ packages:
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
vue-sonner@2.0.9:
|
||||
resolution: {integrity: sha512-i6BokNlNDL93fpzNxN/LZSn6D6MzlO+i3qXt6iVZne3x1k7R46d5HlFB4P8tYydhgqOrRbIZEsnRd3kG7qGXyw==}
|
||||
peerDependencies:
|
||||
'@nuxt/kit': ^4.0.3
|
||||
'@nuxt/schema': ^4.0.3
|
||||
nuxt: ^4.0.3
|
||||
peerDependenciesMeta:
|
||||
'@nuxt/kit':
|
||||
optional: true
|
||||
'@nuxt/schema':
|
||||
optional: true
|
||||
nuxt:
|
||||
optional: true
|
||||
|
||||
vue-tsc@3.3.13:
|
||||
resolution: {integrity: sha512-jE4/bXdOMSHVxEGgQCqNllJy+9N3Gx6tfSAsg0yhFK/MAN6eXqISihupnDEKSCt12VVnjN2gI3AqLYcqoh5x/A==}
|
||||
hasBin: true
|
||||
@@ -2426,6 +2443,8 @@ snapshots:
|
||||
- unloader
|
||||
- webpack
|
||||
|
||||
vue-sonner@2.0.9: {}
|
||||
|
||||
vue-tsc@3.3.13(typescript@6.0.3):
|
||||
dependencies:
|
||||
'@volar/typescript': 2.4.28(typescript@6.0.3)
|
||||
|
||||
@@ -21,6 +21,8 @@ import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { hiddenPaths } from "@/lib/nav";
|
||||
import { loadTaskMeta } from "@/lib/task-meta";
|
||||
import { useSessionStore } from "@/stores/session";
|
||||
import { Toaster } from "vue-sonner";
|
||||
import "vue-sonner/style.css";
|
||||
|
||||
const reauthenticate=new URLSearchParams(window.location.search).has("reauth");
|
||||
const accounts=useAccountsStore();
|
||||
@@ -125,5 +127,6 @@ watch(() => accounts.status?.user, (user) => {
|
||||
dock centres over the content instead of under the sidebar. -->
|
||||
<ChatDock class="md:start-(--sidebar-width) md:peer-data-[state=collapsed]:start-(--sidebar-width-icon)" />
|
||||
</SidebarProvider>
|
||||
<Toaster position="bottom-right" rich-colors close-button />
|
||||
</TooltipProvider>
|
||||
</template>
|
||||
@@ -392,7 +392,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
|
||||
<template>
|
||||
<form class="space-y-4 max-md:flex max-md:min-h-0 max-md:flex-1 max-md:flex-col" @submit.prevent="publish">
|
||||
<Tabs v-model="view" class="space-y-1.5 max-md:min-h-0 max-md:flex-1">
|
||||
<div class="workflow-editor-toolbar flex shrink-0 items-center gap-2 max-sm:grid max-sm:grid-cols-[1fr_auto]">
|
||||
<div class="workflow-editor-toolbar flex shrink-0 flex-wrap items-center gap-2 max-sm:grid max-sm:grid-cols-[1fr_auto]">
|
||||
<div v-if="$slots.title" class="flex min-w-0 shrink items-center gap-2 max-lg:hidden"><slot name="title" /></div>
|
||||
<TabsList class="shrink-0 justify-start">
|
||||
<TabsTrigger value="canvas">Canvas</TabsTrigger>
|
||||
@@ -413,7 +413,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
|
||||
/>
|
||||
</div>
|
||||
<div v-if="runs.length && view === 'canvas'" class="flex min-w-0 items-center gap-1 max-sm:flex-1">
|
||||
<OptionSelect :model-value="watched" :options="runOptions" aria-label="Run shown on the canvas" class="min-w-0 max-w-56 max-sm:w-full *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate" @update:model-value="pick" />
|
||||
<OptionSelect :model-value="watched" :options="runOptions" aria-label="Run shown on the canvas" class="min-w-32 max-w-56 max-sm:w-full *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate" @update:model-value="pick" />
|
||||
<template v-if="watchedRun">
|
||||
<!-- One run control keeps the row short; the run's other actions
|
||||
are on the run, behind Open run in this menu. -->
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { toast } from "vue-sonner";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { computed, onMounted, ref, shallowRef, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
@@ -115,9 +116,10 @@ const enabled = computed(() => data.value.definitions?.find((d) => d.id === sele
|
||||
async function setEnabled(value: boolean) {
|
||||
try {
|
||||
await api.workflowEnabled(selected.value, value);
|
||||
toast.success(`${selected.value} ${value ? "enabled" : "disabled"}`);
|
||||
await load();
|
||||
} catch (err) {
|
||||
error.value = String((err as Error).message || err);
|
||||
toast.error(`${selected.value} not ${value ? "enabled" : "disabled"}: ${(err as Error).message || err}`);
|
||||
}
|
||||
}
|
||||
const stages = computed(() => (data.value.stages ?? []).filter((s) => s.workflow === selected.value));
|
||||
|
||||
Reference in new issue
Block a user