web: create a pipeline from a template — validate then submit (P5)
A template detail now offers "Create pipeline from this template". Its
dialog ("Create from {name}", one required field "New pipeline name
(required)", the note that it creates a draft and does not run, Create /
Cancel with Cancel reading Close after a success) validates the
template's source first and, only when it parses, submits it create-only
with the trimmed name. Create is disabled while the name is blank or
while sending; the field locks while sending and after a success. A
refusal shows the server's own error in the still-open dialog; a success
shows `Created "{name}". It is in the Pipelines list.` and refreshes
list_pipelines so the new row is visible.
Pure helpers + both request shapes are unit-tested; the flow is captured
against a scratch server with its own throwaway database. The live
server's pipeline list is never touched: the default ui-smoke run sends
no submit and create runs only under its --scratch flag. Wording matches
android/.../TemplateDetailScreen.kt and PipelinesRepository.kt.
This commit is contained in:
@@ -16,6 +16,12 @@ export const Protocol = Object.freeze({
|
||||
VALIDATE: "validate",
|
||||
VALIDATED: "validated",
|
||||
|
||||
// Publishing a new create-only draft from a source (internal/protocol/message.go
|
||||
// Submit/Submitted; mirrors PipelinesRepository.createPipeline). The reply
|
||||
// carries the new pipeline `detail`.
|
||||
SUBMIT: "submit",
|
||||
SUBMITTED: "submitted",
|
||||
|
||||
LIST_RUNS: "list_runs",
|
||||
RUNS: "runs",
|
||||
GET_RUN: "get_run",
|
||||
|
||||
Reference in New Issue
Block a user