Commit 97a59da
Forms: add read/unread state to the UI (#45350)
* Update the feedback class to have is_unread property
* Add new endpoint that lets us marks things as read and unread
* Update the UI that lets us shows us things that are unread and mark them as read once they are viewed
* Add DataView actions
* changelog
* Update the style
* Make things bold
* Swap icons and add back indicator dot
* Update the sidebar counter to match
Replaces legacy unread feedback count logic with new static methods in Contact_Form_Plugin and Feedback classes, storing the count in a new option. Updates backend to recalculate and return the unread count after marking feedback as read/unread. Frontend now updates the admin menu counter dynamically using the new count from the server, improving accuracy and consistency.
* Clarify JS comments
* Move menu updated to utils
* Always output counter badge
* Make the dot red.
* Add mark as read buttons
* Update the option name
* Update the tests to remove untestable code
* Add read unread buttons to each inbox header
* Fix typescript error
* fix phan
* More tests.
* More tests...
---------
Co-authored-by: Mikael Korpela <[email protected]>1 parent d5795ab commit 97a59da
File tree
16 files changed
+957
-67
lines changed- projects
- packages/forms
- changelog
- src
- contact-form
- dashboard
- hooks
- inbox
- dataviews
- tests/php/contact-form
- plugins/jetpack/changelog
16 files changed
+957
-67
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
257 | 280 | | |
258 | 281 | | |
259 | 282 | | |
| |||
488 | 511 | | |
489 | 512 | | |
490 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
491 | 524 | | |
492 | 525 | | |
493 | 526 | | |
| |||
631 | 664 | | |
632 | 665 | | |
633 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
634 | 671 | | |
635 | 672 | | |
636 | 673 | | |
| |||
1033 | 1070 | | |
1034 | 1071 | | |
1035 | 1072 | | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1036 | 1112 | | |
1037 | 1113 | | |
1038 | 1114 | | |
| |||
Lines changed: 71 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1406 | 1406 | | |
1407 | 1407 | | |
1408 | 1408 | | |
1409 | | - | |
1410 | | - | |
1411 | 1409 | | |
1412 | | - | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
| 1410 | + | |
1434 | 1411 | | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1438 | 1416 | | |
1439 | | - | |
| 1417 | + | |
| 1418 | + | |
1440 | 1419 | | |
1441 | | - | |
1442 | | - | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1443 | 1431 | | |
1444 | | - | |
1445 | 1432 | | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
| 1433 | + | |
| 1434 | + | |
1451 | 1435 | | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
1452 | 1449 | | |
1453 | 1450 | | |
1454 | | - | |
1455 | 1451 | | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
1467 | 1465 | | |
| 1466 | + | |
1468 | 1467 | | |
1469 | 1468 | | |
1470 | 1469 | | |
1471 | 1470 | | |
1472 | 1471 | | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1473 | 1496 | | |
1474 | 1497 | | |
1475 | 1498 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1934 | 1934 | | |
1935 | 1935 | | |
1936 | 1936 | | |
1937 | | - | |
1938 | | - | |
1939 | | - | |
| 1937 | + | |
1940 | 1938 | | |
1941 | 1939 | | |
1942 | 1940 | | |
| |||
0 commit comments