Repository navigation
feat(sales): Draft Contract asks first; its result says the contract was created (#2914) - #2925
Merged
objectstack-fleet[bot] merged 1 commit intoDec 2, 2026
Conversation
…was created (#2914) The order's Draft Contract action carries confirmText, so Cancel starts no run. The flow's result screen is titled Contract Created, says closing it does not undo the contract, and labels the contract link Open Contract. zh-CN / ja-JP / es-ES copy, in-app Orders page, and a test with ablation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Author
|
repo:hotcrm#1 · huangyiirene · session_01J8VVAk8tegvAi1ECkgCFfc ACCEPT · 2026-12-02T10:19ZHead-sha: 维护者速读
席位核对
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Irene · project thread
Fixes #2914
Clause-②: no
Metadata-protocol: none
Metadata-impact: reviewer
维护者速读
What changes
draft_contract(order record page) declaresconfirmText: Draft a contract from order {{ record.order_number }}? Its amount is taken from the order total. The console's action runner asks before it starts the flow; Cancel starts no run, so no contract is written.sales_order_draft_contract's result screen: title Contract Created (was the node label Contract Drafted), the description now says the contract is saved and closing the window does not undo it, and the record link is labelled Open Contract.confirmText, as Confirm Order's does).Platform gap — the "Done" button. Option A asked for Open Contract (primary) and Close buttons. On 19.0.0-next.3 a flow screen cannot name its buttons:
ScreenConfigSchema(@objectstack/spec/automation) is strict and carriestitle,description,fields,waitForInput,objectName,idVariable,mode,recordId,defaults: no button-label or primary-action key.useConsoleActionRuntime) draws a display-only screen's single button ascommon.done("Done" / 完成), unconditionally.onSuccess.navigateis refused at a paused screen by its own contract ("a run that pauses at a screen ... performs no navigation"), and dropping the screen to navigate straight to the contract would remove the Close choice the ruling kept.So this PR does what the platform allows: the record link carries "open the contract" (one click, measured below), and the copy states that closing does not undo. The seat files the objectstack card for author-named screen buttons / a record-open primary action; nothing here routes around it.
Tests
test/sales-order-draft-contract.test.tsgains a describe of two tests: the confirm copy rendered through the platform's template engine names the order; and a real run as a sales rep pauses on a screen titled Contract Created whosecontractLinkis{ label: 'Open Contract', type: 'record_link', reference: 'crm_contract', defaultValue: CONTRACT_ID }.Ablation: both new tests fail with the action and flow edits reverted
Restored:
Tests 20 passed (20).Acceptance notes
/_console/apps/app.objectstack.hotcrm/crm_contract/record/CONTRACT_IDand clicking it opened the contract; after closing, Draft Contract is gone from the header and the order's Contracts tab lists the draft.content/docs/(product)/sales/orders*.mdxare not touched (outside this claim's file surface; sibling claims Rename the "Framework Contract" form to "Multi-Order Contract" (display name only; valueframeworkunchanged) #2916 / An order may link only an Activated multi-order contract of the same account (checked when a person changes the field; system writes exempt) #2917 hold those pages). The product page does not describe the dialog today.src/sales/translations/*/_shared.ts, but that file holds only values shared by more than one family (its own header); the action's row lives in*/objects.commerce.tsand the flow screen copy in*/app.ts, where this PR edits them (one row block each).Verification
Read first:
src/sales/flows/sales-order-draft-contract.flow.ts(result screen node),src/sales/actions/sales_order.actions.ts(confirmText),src/sales/translations/zh-CN/app.ts.Two-minute check:
pnpm dev, open any order without a contract → Draft Contract → expect a confirm naming the order; Cancel → nothing; confirm → dialog titled Contract Created with an Open Contract link.Gates on the final head
All on head
d9416b8d:pnpm validateexit 0 ·pnpm typecheckexit 0 ·pnpm lint(os lint --strict) exit 0 ·pnpm hygieneexit 0 (source hygiene clean)vitest run --shard=N/6through the shared verify lock, eachVERDICT command-exit 0:pnpm buildnot run locally (CI).🤖 Generated with Claude Code
https://claude.ai/code/session_01J8VVAk8tegvAi1ECkgCFfc