Commit 5cd1b3b
Forms: Refactor feedback status tracking and add unread count refresh (#46505)
* Forms: Refactor feedback status tracking and add tests
Replaces track_spam_status_change with track_feedback_status_change to handle feedback post status transitions, including spam and publish. Adds private helpers for spam meta and unread count recalculation. Comprehensive unit tests added for feedback status changes, spam meta updates, unread count recalculation, and non-feedback post handling.
* Add change log
* Fix the frontend as well.
* Update projects/packages/forms/src/contact-form/class-contact-form-plugin.php
Co-authored-by: Copilot <[email protected]>
* Fixing typos
Co-authored-by: Copilot <[email protected]>
* Add tests for updateMenuCounter and updateMenuCounterOptimistically
* fix typos
* Add js tests
* Update actions.tsx
* Refactor processStatusChange to separate module
Moved the processStatusChange logic from actions.tsx to a new process-status-change.ts file for better modularity and maintainability. Updated imports accordingly and enhanced tests to cover error handling and revert logic for menu counter updates.
* use shutdown hook instead
* Fix typo
Co-authored-by: Copilot <[email protected]>
* Move withTimeout to utils
* minor fixes
* fix changelog
* minor remove comment
* make the tests pass again
* update changelog
* minor fixes to comments
* Improve the class calling for readability
* Improve tests. Check that the action in registered
* Making undo work
---------
Co-authored-by: Copilot <[email protected]>1 parent a7c8882 commit 5cd1b3b
File tree
9 files changed
+735
-122
lines changed- projects/packages/forms
- changelog
- src
- contact-form
- dashboard/inbox
- stage
- tests
- js/dashboard/inbox
- php/contact-form
9 files changed
+735
-122
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 62 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
| 323 | + | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
3610 | 3610 | | |
3611 | 3611 | | |
3612 | 3612 | | |
| 3613 | + | |
| 3614 | + | |
3613 | 3615 | | |
3614 | 3616 | | |
| 3617 | + | |
| 3618 | + | |
3615 | 3619 | | |
3616 | 3620 | | |
3617 | 3621 | | |
| |||
3622 | 3626 | | |
3623 | 3627 | | |
3624 | 3628 | | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
3625 | 3663 | | |
3626 | 3664 | | |
3627 | 3665 | | |
3628 | | - | |
| 3666 | + | |
3629 | 3667 | | |
3630 | 3668 | | |
3631 | | - | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
3632 | 3690 | | |
3633 | 3691 | | |
3634 | 3692 | | |
| |||
Lines changed: 18 additions & 118 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 135 | | |
156 | 136 | | |
157 | 137 | | |
| |||
176 | 156 | | |
177 | 157 | | |
178 | 158 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | 159 | | |
275 | 160 | | |
276 | 161 | | |
| |||
417 | 302 | | |
418 | 303 | | |
419 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
420 | 308 | | |
421 | 309 | | |
422 | 310 | | |
| |||
551 | 439 | | |
552 | 440 | | |
553 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
554 | 445 | | |
555 | 446 | | |
556 | 447 | | |
| |||
678 | 569 | | |
679 | 570 | | |
680 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
681 | 576 | | |
682 | 577 | | |
683 | 578 | | |
| |||
818 | 713 | | |
819 | 714 | | |
820 | 715 | | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
821 | 721 | | |
822 | 722 | | |
823 | 723 | | |
| |||
0 commit comments