-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identification of changed information during edit #3815
Labels
Milestone
Comments
Next steps.... clearly map exception data. Be aware of cross functions. Making additional ticket to show edit history and that will proceed before this ticket. |
Joshua-Lakusta
added
Dev & Architecture
Development and Architecture
and removed
Business
Items under Business Consideration
labels
Dec 10, 2024
@Joshua-Lakusta in an upcoming ticket, should we alert the Ministry user if no changes happen between the application versions? |
Samples for a layout proposalExample for course information where the second item has 2 changes and the list length is the same.Example of the dependent list when at least one item was removed from the list and some other fields were updated.Please note the difference in the label that would indicate the list had items removed. Regular questions changed |
andrewsignori-aot
added a commit
that referenced
this issue
Jan 13, 2025
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 13, 2025
## New method `compareApplicationData` - Created a new helper method with the sole intention of executing the comparison between two application dynamic data JSONB data. - The method will detect changes as below - Added/removed/updated properties - Added/removed array items - Used `JSON.stringify` a simple solution to perform a deep equality between two objects. During the tests, the comparison of two part-time applications took less than a millisecond to execute. - Method created at lib level to allow its usage in future comparison in application data by other apps than API. ## Form.io considerations - The Form.io [event](https://help.form.io/developers/form-development/form-renderer#form-events) `render` was used instead of `load` because the lists are not fully created right after the loading stage which means that not all the children will be present to have the highlight style applied. - Form.io component tree for lists contains only the "first child" and the regular `document.getElementById` was used to ensure that a child component in a list would receive the highlight style. ## Other changes - Adjusted the Ministry controller to execute the application data comparison in the application read-only versions that is the data being displayed to the users where the changes should be detected. _Note:_ The `compareApplicationData` would also be able to detect changes in the non-read-only application dynamic data. ### Sample API result ```json [ { "key": "dependants", "changeType": "itemsRemoved", "changes": [ { "index": 0, "changeType": "updated", "changes": [ { "key": "fullName", "changeType": "updated" }, { "key": "dateOfBirth", "changeType": "updated" } ] } ] }, { "key": "citizenship", "changeType": "updated" }, { "key": "courseDetails", "changeType": "updated", "changes": [ { "index": 1, "changeType": "updated", "changes": [ { "key": "courseCode", "changeType": "updated" }, { "key": "courseStartDate", "changeType": "updated" } ] } ] }, { "key": "studentNumber", "changeType": "updated" }, { "key": "studentHomeAddress", "changeType": "updated" }, { "key": "applicationPDPPDStatus", "changeType": "updated" }, { "key": "hasSignificantDegreeOfIncome", "changeType": "updated" }, { "key": "partTimeAwardTypesToBeConsidered", "changeType": "updated" }, { "key": "reasonsignificantdecreaseInIncome", "changeType": "updated" }, { "key": "decreaseInIncomeSupportingDocuments", "changeType": "itemsRemoved" }, { "key": "currentYearIncomeApplicationException", "changeType": "updated" }, { "key": "selectedLocationName", "changeType": "updated" }, { "key": "selectedOfferingName", "changeType": "updated" } ] ``` ### Sample UI Changes ![image](https://github.com/user-attachments/assets/722d248f-5eff-47b7-b17c-44db59b076bd) ![image](https://github.com/user-attachments/assets/76ab4379-9a88-4c2f-9fce-60a45b2b5b6c) ![image](https://github.com/user-attachments/assets/cc6961ac-9ea1-48cc-aeb7-5a8838dccbce) ![image](https://github.com/user-attachments/assets/6510e429-29fb-4d0f-9bdb-be3cf254ce7b) ![image](https://github.com/user-attachments/assets/7d117db6-bc27-4d6a-afb9-83cf0ac98a00) ### Non-PR-related changes - Added a new option for VS Code debug `Unit tests - Current test file` following the same idea from other available. - Extracted the jest configurations from packages.json and moved to a file to allow the reference using the `--config` while executing the `npm commands`, following the same idea from the E2E tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a ministry I want the edit process to be able to identify what information has changed and have this validation be viewable in some way when looking at an edit. I want the view of each element that has been changed to be highlighted.
Acceptance Criteria
Additional Context
This will be attached to the concept of editing before and after COE and will need to be used in order to flag what has been changed from one submission to the next and highlight it in some way.
Technical
Note: starting with the comparison effort and build the unit test around it can be a good way to have a first PR and to the devs be aware about the approach.
The text was updated successfully, but these errors were encountered: