feat: implement SAVE_AS_DRAFT and TraderSavedAsDraft state#189
feat: implement SAVE_AS_DRAFT and TraderSavedAsDraft state#189ginaxu1 wants to merge 1 commit intoOpenNSW:mainfrom
Conversation
Summary of ChangesHello @ginaxu1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new "Save as Draft" feature for the simple form plugin, allowing users to save their progress on a form without immediate submission. This enhancement improves the user experience by preventing data loss and enabling partial completion of forms. The changes involve updates to both the backend, where a key action constant was renamed and new tests were added, and the frontend, where the UI and logic for saving drafts were implemented. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements the 'Save as Draft' functionality for simple forms. The changes span across the backend, frontend, and service layer to introduce the new SAVE_AS_DRAFT action and TraderSavedAsDraft state. New tests have been added for the backend plugin logic, which is great.
My review includes a couple of suggestions to improve maintainability and clarity:
- In
SimpleForm.tsx, I've suggested refactoring to reduce code duplication betweenhandleSubmitand the newhandleSaveAsDraftfunction. - In
task.ts, I've pointed out a naming inconsistency between the UI-levelTaskCommand('DRAFT') and the API-levelTaskAction('SAVE_AS_DRAFT') and suggested aligning them for better readability.
Overall, this is a solid implementation of the new feature.
5a0e918 to
f560011
Compare
… corresponding tests
f560011 to
9ecd47d
Compare
There was a problem hiding this comment.
What is the reason for this change in the save as draft PR
Screen.Recording.2026-02-25.at.22.57.30.mov
Summary
Add "Save as Draft" functionality for tasks by establishing the SAVE_AS_DRAFT Task command structure spanning both the React frontend and the backend workflow engine
Changes
Frontend
SimpleForm.tsxsendCommandhelper to eliminate code duplication betweenhandleSubmitandhandleSaveAsDrafttask.ts+preConsignment.tsBackend
simple_form.gofrom DRAFT_FORM to SAVE_AS_DRAFT to map with the frontend commandTestSimpleForm_Execute_SaveAsDraftinsimple_form_test.goto cover draft execution paths including success, WriteToLocalStore failures, and invalid transition handling.consignment_service_test.go+workflow_node_service_test.goto properly account for new schema fields (outcome, unlock_configuration, end_node_id) introduced from the main branchRelated Issues
Closes #102