diff --git a/ui/src/copy/errors/workflows.ts b/ui/src/copy/errors/workflows.ts index 13a05470f..ce039295c 100644 --- a/ui/src/copy/errors/workflows.ts +++ b/ui/src/copy/errors/workflows.ts @@ -7,6 +7,7 @@ export const workflows = { }, bindEvent: { formNotLoaded: "Couldn't load the bind form", + eventsNotLoaded: "Couldn't load recent events", bindingsNotLoaded: "The bindings list did not load, so this edit cannot tell whether the mapping is shared. Retry the load first.", blocker: { pickSource: "pick a source", @@ -37,6 +38,7 @@ export const workflows = { restartFailed: "Restart failed", draftNotSaved: "Draft not saved. Your edit is still in the editor.", stepIdTaken: (id: string) => `Another step is already called ${id}.`, + stepTypesUnavailable: "Step types didn't load, so steps can't be opened or checked.", draftChangedElsewhere: "This draft changed in another tab or by Archie. Your edit is still in the editor.", draftNotRemoved: "Published, but the old draft wasn't removed. Discard it from the menu.", recentRunsNotLoaded: (detail: string) => `Could not load recent runs: ${detail}`, diff --git a/ui/src/workflows/BindEvent.vue b/ui/src/workflows/BindEvent.vue index 91758be58..92a550543 100644 --- a/ui/src/workflows/BindEvent.vue +++ b/ui/src/workflows/BindEvent.vue @@ -82,9 +82,17 @@ const revealed = ref(null); const error = ref(""); const status = ref(props.binding?.status ?? ""); +// A failed read keeps the events already shown and says so, rather than +// emptying the list into "No events". +const capturesError = ref(""); async function loadCaptures(): Promise { - const listed = await api.captures<{ captures?: Capture[] }>(100).catch(() => null); - captures.value = keepRows(captures.value, listed?.captures ?? []); + try { + const listed = await api.captures<{ captures?: Capture[] }>(100); + captures.value = keepRows(captures.value, listed?.captures ?? []); + capturesError.value = ""; + } catch { + capturesError.value = errors.workflows.bindEvent.eventsNotLoaded; + } } async function loadAll(): Promise { @@ -307,6 +315,7 @@ const resume = () => transition(api.bindingResume, "pending_approval"); #{{ c.id }} · {{ c.event_type ? "" : " · unidentified" }} +

No events

diff --git a/ui/src/workflows/WorkflowEditor.vue b/ui/src/workflows/WorkflowEditor.vue index fedbabe89..fa3e56b31 100644 --- a/ui/src/workflows/WorkflowEditor.vue +++ b/ui/src/workflows/WorkflowEditor.vue @@ -117,7 +117,7 @@ async function restartFrom(from: string): Promise { } const { triggers, reload: reloadTriggers, error: triggersError } = useWorkflowTriggers(selected); -const { revisions, error: historyError, reload: reloadHistory } = useWorkflowHistory(selected); +const { revisions, error: historyError, loaded: historyLoaded, reload: reloadHistory } = useWorkflowHistory(selected); const historyRevision = ref(0); const historyMode = ref("yaml"); // The revision a run used, matched by the definition it pinned. @@ -360,6 +360,9 @@ async function remove(): Promise { // of one parse, so they cannot disagree about the same text. Step settings are // not served, so a save the server refuses still reports its own reason below. const vocabulary = computed(() => workflows.stepTypes); +// The definitions loaded but carried no step types: cards can't open and YAML +// can't be checked, which must not look like an empty, valid workflow. +const stepTypesMissing = computed(() => !!workflows.state.resource && !vocabulary.value.length); const parsed = computed(() => parseWorkflowYaml(yaml.value, vocabulary.value)); const stored = computed(() => collection.value.definitions.find((entry) => entry.id === selected.value)?.yaml); const dirty = computed(() => yaml.value !== (stored.value ?? "")); @@ -576,7 +579,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect()); - + @@ -639,6 +642,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect()); + {{ errors.workflows.editor.stepTypesUnavailable }} {{ errors.workflows.editor.draftChangedElsewhere }} diff --git a/ui/src/workflows/WorkflowHistory.vue b/ui/src/workflows/WorkflowHistory.vue index f31e7efd2..ab3a2edf5 100644 --- a/ui/src/workflows/WorkflowHistory.vue +++ b/ui/src/workflows/WorkflowHistory.vue @@ -13,7 +13,7 @@ import { cn } from "@/lib/utils"; import WorkflowCanvas from "./WorkflowCanvas.vue"; import { lineDiff, stepMarks, type WorkflowRevision } from "./workflow-revisions"; -const props = defineProps<{ revisions: WorkflowRevision[]; current: string; error?: string; locked?: boolean }>(); +const props = defineProps<{ revisions: WorkflowRevision[]; current: string; error?: string; loaded?: boolean; locked?: boolean }>(); const emit = defineEmits<{ restore: [yaml: string]; retry: [] }>(); const selected = defineModel("selected", { default: 0 }); const mode = defineModel("mode", { default: "yaml" }); @@ -55,9 +55,11 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr {{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · -
  • + +
  • +
  • Loading…
  • No recorded changes
  • diff --git a/ui/src/workflows/WorkflowsPage.vue b/ui/src/workflows/WorkflowsPage.vue index 0405344ed..11ac95513 100644 --- a/ui/src/workflows/WorkflowsPage.vue +++ b/ui/src/workflows/WorkflowsPage.vue @@ -62,6 +62,9 @@ const data = shallowRef({}); const error = ref(null); const loading = ref(true); +// Statistics are known once a read has returned them; until then, or after a +// failed read, a row says nothing about its runs rather than "Never run". +const statsKnown = ref(false); const statsOf = (id: string) => JSON.stringify(data.value.workflows?.find((w) => w.workflow === id) ?? null); async function load() { @@ -72,6 +75,7 @@ async function load() { const before = statsOf(selected.value); data.value = keepValue(data.value, (await api.workflows()) ?? {}); error.value = null; + statsKnown.value = true; // The runs page only changes when the workflow's own statistics do. if (runsFor !== selected.value || statsOf(selected.value) !== before) void loadWorkflowRuns(); } catch (err) { @@ -268,7 +272,7 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total : {{ row.running }} running {{ statusLabel(row.last_status) }} - Never run + Never run @@ -311,7 +315,9 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :