Commit 4c21df9
authored
Added Save button for inactive automations (#28055)
closes https://linear.app/ghost/issue/NY-1257
https://github.com/user-attachments/assets/fc9315d4-f7f4-49f6-ac71-f059bf5c1ce1
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.1 parent f1ed307 commit 4c21df9
4 files changed
Lines changed: 83 additions & 8 deletions
File tree
- apps/posts
- src/views/Automations
- components
- test/unit/views/automations
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| 28 | + | |
24 | 29 | | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
| 33 | + | |
27 | 34 | | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
70 | | - | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
77 | | - | |
| 82 | + | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| |||
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| |||
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
101 | 121 | | |
102 | 122 | | |
| 123 | + | |
103 | 124 | | |
104 | 125 | | |
105 | 126 | | |
| |||
112 | 133 | | |
113 | 134 | | |
114 | 135 | | |
| 136 | + | |
115 | 137 | | |
116 | 138 | | |
117 | 139 | | |
| |||
123 | 145 | | |
124 | 146 | | |
125 | 147 | | |
| 148 | + | |
126 | 149 | | |
127 | 150 | | |
128 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
129 | 156 | | |
130 | 157 | | |
131 | 158 | | |
| |||
141 | 168 | | |
142 | 169 | | |
143 | 170 | | |
| 171 | + | |
144 | 172 | | |
145 | 173 | | |
146 | 174 | | |
147 | 175 | | |
| 176 | + | |
148 | 177 | | |
149 | 178 | | |
150 | 179 | | |
| |||
167 | 196 | | |
168 | 197 | | |
169 | 198 | | |
| 199 | + | |
170 | 200 | | |
171 | 201 | | |
172 | 202 | | |
173 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
174 | 207 | | |
175 | 208 | | |
176 | 209 | | |
| |||
197 | 230 | | |
198 | 231 | | |
199 | 232 | | |
200 | | - | |
| 233 | + | |
201 | 234 | | |
202 | 235 | | |
203 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
354 | 378 | | |
355 | 379 | | |
356 | 380 | | |
| |||
362 | 386 | | |
363 | 387 | | |
364 | 388 | | |
| 389 | + | |
365 | 390 | | |
366 | 391 | | |
367 | 392 | | |
| |||
0 commit comments