Commit 85f7b97
Forms: Add Feedback and Feedback_Field classes and start using them to display data (#44121)
* Forms: Adds a new Form_Responses class
* Add tests for Form_Response::strip_tags method
* Make endpoint rendering work
* Make for submission work with the new response data
* Add test for get_render_value
* Update has_file tests
* Add tests for get_render_api_value method
* rename for clarity
* Simplify things
* Fix rendering on submit
* Rename Form_Response => Feedback
* Rename Response_Field => Feedback_Field
* Implement CSV Export
* minor update test method name
* Minor fixes
* Add reprecation
* Update the code coverage
* minor: test fixes
* Introduce Feedback_Entry class
* split constructore up, refactor form
* Add Feedback_Author Class
* Fix phan issue
* Add tests for Feedback_Author
* Fix tests
* minor refactor
* Refactor legacy content parsing in Feedback class
Modularized the parse_legacy_content method by extracting logic into helper methods for splitting content, extracting values and lines, parsing JSON and array formats, and processing fields. This improves readability, maintainability, and separation of concerns in legacy feedback parsing.
* Refactor feedback field rendering and API output
Refactored Feedback_Field to support context-aware rendering via get_render_value($context), and made get_render_api_value() private. Updated Feedback to allow flexible compiled field output shapes and context. Adjusted endpoint and tests to use the new API, improving clarity and extensibility for field rendering in different contexts.
* Add context csv
* Add more context
* Fixing php phan issues
* Improve test coverage
* Fix typo in method name for author info retrieval
Renamed get_computer_author_info to get_computed_author_info in Feedback_Author to correct a typo and ensure consistency in method naming.
* Rename legacy feedback properties in Feedback class
Renamed $feedback_id and $feedback_title to $legacy_feedback_id and $legacy_feedback_title throughout the Feedback class to clarify their legacy status and indicate they are not used in the new feedback system. Updated all references, getters, and related logic accordingly.
* Add more Feedback tests
* Add form count test
* Move the test
* More tests and phan fixes
* update baseline
* Add get_value assertions to Feedback_Field tests
Extended the test_get_render_value method to include assertions for the get_value method, ensuring both scalar and array values are correctly returned by Feedback_Field.
* Add feedback field tests
* remove unused method
* Refactor file field type handling in feedback forms
Replaces is_file_field() with a more generic is_of_type() method in Feedback_Field, simplifying type checks. Updates legacy file upload handling in Feedback to explicitly set the field type to 'file'. Adjusts and expands related unit tests to cover new logic and ensure correct file field behavior.
* Don't reimplement strip_tags method
* Export personal Data update to use FeedBack Class
* Fix typos in docblocks
- Fix "lable" → "label" in Feedback_Field class
- Fix "recieved" → "received" in Feedback class
- Fix "invividual" → "individual" in Feedback_Field class
- Complete incomplete class docblock for Feedback_Field
* Making ajax work.
* Add a test for label|value format
* Add test for get_json_data
---------
Co-authored-by: Miguel Lezama <[email protected]>1 parent 80cf0b3 commit 85f7b97
File tree
16 files changed
+4399
-856
lines changed- projects/packages/forms
- .phan
- changelog
- src/contact-form
- tests/php/contact-form
16 files changed
+4399
-856
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 15 additions & 67 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
| 533 | + | |
556 | 534 | | |
557 | 535 | | |
558 | 536 | | |
559 | | - | |
| 537 | + | |
560 | 538 | | |
561 | 539 | | |
562 | | - | |
| 540 | + | |
563 | 541 | | |
564 | 542 | | |
565 | | - | |
| 543 | + | |
566 | 544 | | |
567 | 545 | | |
568 | | - | |
| 546 | + | |
569 | 547 | | |
570 | 548 | | |
571 | | - | |
| 549 | + | |
572 | 550 | | |
573 | 551 | | |
574 | | - | |
| 552 | + | |
575 | 553 | | |
576 | 554 | | |
577 | | - | |
| 555 | + | |
578 | 556 | | |
579 | 557 | | |
580 | | - | |
| 558 | + | |
581 | 559 | | |
582 | 560 | | |
583 | | - | |
| 561 | + | |
584 | 562 | | |
585 | 563 | | |
586 | | - | |
| 564 | + | |
587 | 565 | | |
588 | 566 | | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
| 567 | + | |
| 568 | + | |
608 | 569 | | |
609 | | - | |
610 | | - | |
| 570 | + | |
| 571 | + | |
611 | 572 | | |
612 | 573 | | |
613 | 574 | | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | 575 | | |
628 | 576 | | |
629 | 577 | | |
| |||
0 commit comments