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
@@ -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