diff --git a/packages/webui/src/public/packs.js b/packages/webui/src/public/packs.js index 9c6009563..3a9777614 100644 --- a/packages/webui/src/public/packs.js +++ b/packages/webui/src/public/packs.js @@ -125,7 +125,8 @@ s.status = `Applied. Added ${added}. Proposed hires are recorded for the chief to raise as decisions.`; } } catch (error) { s.status = error.message; } - redraw(org); + // A preview the page cannot draw says so, instead of leaving the button disabled with nothing shown. + try { redraw(org); } catch { s.preview = null; s.status = 'The preview could not be shown.'; redraw(org); } }); window.MosaicPacks = { load, section }; })(); diff --git a/packages/webui/src/public/workflows.js b/packages/webui/src/public/workflows.js index f83523b70..6fa82f5f4 100644 --- a/packages/webui/src/public/workflows.js +++ b/packages/webui/src/public/workflows.js @@ -10,7 +10,9 @@ const base = org => `/api/orgs/${encodeURIComponent(org)}`; const STATES = [['todo', 'To do'], ['in-progress', 'In progress'], ['in-review', 'Review'], ['blocked', 'Blocked'], ['done', 'Done']]; const STATE_LABEL = Object.fromEntries(STATES); - const NAME = /^[a-z0-9][a-z0-9._-]{0,63}$/; + // The writer's workflow name rule (organization.mjs PLAN_NAME); a name it would refuse is refused here first. + const NAME = /^[a-z][a-z0-9-]{0,63}$/; + const NAME_RULE = 'A workflow name is 1 to 64 lowercase letters, digits or dashes, starting with a letter.'; const MISSING = 'names no current role'; const states = new Map(); const guidance = { @@ -77,7 +79,7 @@ const e = s.editing; if (!e) return ''; const scopeField = e.isNew - ? `` + ? `` : `
${e.scope ? `Project ${esc(e.scope)}` : 'Organization'}, ${esc(e.name)}