Added Save button for inactive automations#28055
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR adds a Save action for inactive automations: AutomationHeader gains save-button props and renders Save only when status === 'inactive'. AutomationEditor introduces a 'saving' edit state, resets failure states on edit, refactors a unified save(newStatus?) helper that sets mutate.payload.status, derives Save-button UI (enabled/variant/label) from editState, and wires publish/save/turn-off to call save(...) consistently. Tests cover saving an inactive automation and assert Save is absent for active automations. Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9e282f7 to
894eebb
Compare
134dd80 to
b2fbd8e
Compare
b2fbd8e to
51d1dd0
Compare
51d1dd0 to
7dcee66
Compare
closes https://linear.app/ghost/issue/NY-1257 This was largely written by GPT-5.5 (High) with the following prompt: > Currently, the Automations editor has no way to save an inactive > automation without publishing it. For example, if you're working on an > automation and haven't finished but need to walk away, you want to > click Save, not Publish. Let's add this. > > When an automation is inactive, add a secondary "Save" button to the > left of the publish button in `<AutomationHeader>`. Clicking this > button should call `editMutation.mutate()` like we already do in > `Automations/editor.tsx`, but it shouldn't change the `status`. > > When an automation is active, I don't want it to look any different > from today. There should be no "Save" button or anything different in > that part of the UI. > > Use red/green TDD to accomplish this. I manually cleaned up a small amount afterward.
7dcee66 to
0387f66
Compare
closes https://linear.app/ghost/issue/NY-1257
Screencast.mp4
This was largely written by GPT-5.5 (High) with the following prompt:
I manually cleaned up a small amount afterward.