feat(web): manage independent schedules and restore recorded stage navigation
This commit is contained in:
+14
-4
@@ -14,6 +14,8 @@
|
||||
// Timestamps and durations (ui/Format.kt)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
import { pipelineScheduleState, matchesScheduleState } from "./scheduleOrigin.js";
|
||||
|
||||
/**
|
||||
* Parses an RFC3339 timestamp to epoch millis, or null when blank or
|
||||
* unparseable. The single parser every time-reading helper shares, so a bad
|
||||
@@ -335,8 +337,14 @@ export const RUN_PRESENCES = [
|
||||
{ key: "no_runs", label: "No runs" },
|
||||
];
|
||||
|
||||
export const PIPELINE_SCHEDULE_FILTERS = [
|
||||
{ key: "any", label: "Any schedule" },
|
||||
{ key: "scheduled", label: "Has schedules" },
|
||||
{ key: "unscheduled", label: "No schedules" },
|
||||
];
|
||||
|
||||
/** The default, no-narrowing pipeline filter. */
|
||||
export const EMPTY_PIPELINE_FILTERS = { presence: "any", lastRunStatuses: [], name: "" };
|
||||
export const EMPTY_PIPELINE_FILTERS = { presence: "any", lastRunStatuses: [], name: "", scheduled: "any" };
|
||||
|
||||
/** Whether a run-history facet (presence or last-run status) is set. */
|
||||
export function hasRunFacets(filters) {
|
||||
@@ -345,7 +353,7 @@ export function hasRunFacets(filters) {
|
||||
|
||||
/** True when the filters actually narrow anything. */
|
||||
export function pipelineFiltersActive(filters) {
|
||||
return hasRunFacets(filters) || String(filters?.name ?? "").trim() !== "";
|
||||
return hasRunFacets(filters) || String(filters?.name ?? "").trim() !== "" || ["scheduled", "unscheduled"].includes(filters?.scheduled);
|
||||
}
|
||||
|
||||
/** The number of active facets, used for the control's badge. */
|
||||
@@ -353,7 +361,8 @@ export function pipelineFilterCount(filters) {
|
||||
return (
|
||||
((filters?.presence ?? "any") !== "any" ? 1 : 0) +
|
||||
((filters?.lastRunStatuses ?? []).length > 0 ? 1 : 0) +
|
||||
(String(filters?.name ?? "").trim() !== "" ? 1 : 0)
|
||||
(String(filters?.name ?? "").trim() !== "" ? 1 : 0) +
|
||||
(["scheduled", "unscheduled"].includes(filters?.scheduled) ? 1 : 0)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -402,6 +411,7 @@ export function filterPipelines(pipelines, filters, latestRuns = new Map(), runs
|
||||
latestRuns instanceof Map ? latestRuns.get(pipeline.id) : latestRuns[pipeline.id];
|
||||
return all.filter((pipeline) => {
|
||||
if (!pipelineMatchesName(filters?.name, pipeline.name)) return false;
|
||||
if (!matchesScheduleState(pipelineScheduleState(pipeline), filters?.scheduled)) return false;
|
||||
if (runFacets && runsKnown) {
|
||||
const latestRun = getRun(pipeline) ?? null;
|
||||
if (!pipelineMatchesPresence(filters.presence, latestRun != null)) return false;
|
||||
@@ -424,7 +434,7 @@ export function pipelineListEmptyState(all, items, filters) {
|
||||
}
|
||||
const name = String(filters?.name ?? "");
|
||||
const message =
|
||||
name.trim() !== "" && !hasRunFacets(filters)
|
||||
name.trim() !== "" && !hasRunFacets(filters) && !["scheduled", "unscheduled"].includes(filters?.scheduled)
|
||||
? `No pipelines match "${name}".`
|
||||
: "No pipelines match the current filters.";
|
||||
return { message, clearAction: "Clear filters" };
|
||||
|
||||
Reference in New Issue
Block a user