-
Notifications
You must be signed in to change notification settings - Fork 14
Update confirmation #2443
base: master
Are you sure you want to change the base?
Update confirmation #2443
Conversation
This pull request introduces 5 alerts when merging cd0d4e0 into 4e3e45a - view on LGTM.com new alerts:
|
If you click "Edit" and go to a page, do nothing and come back, it shows "Edited", but actually user changed nothing. I don't know if in that case, we should still display "Edited". |
Here is an easy one. |
Yes, this is something I struggled with. How much logic should we use to display this message? @ngosset @stephaniemgauthier @TarekTraboulsi @barrhayl @Cassista Any thoughts? Note: the field is only labeled 'Edited' if the user selects the 'Continue' button, selecting 'Go Back' will not label the field 'Edited'. |
Yes, this was resolved in another commit. This causes a failed check due to linting errors. It is now resolved. |
/> | ||
</Flex> | ||
|
||
{containsData(howdiditstart) ? ( | ||
{howdiditstart.howDidTheyReachYou.length ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to use containsData? It's being used everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containsData simply checks if the object contains anything. In this case if the field is flagged as edited it will render an empty confirmation summary. This way it will render "No information provided." unless a selection has been made.
label="confirmationPage.ImpactTitle.edit" | ||
path="/whatwasaffected" | ||
edited={impact.edited} | ||
/> | ||
</Flex> | ||
{containsData(impact) ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know containsData is overly complex. But for string operation, it makes sense to have a check that the string is not empty.
str is not undefined, is not null, size is not zero and doesn't just contain white spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend to close this PR for now, it touched many files. We may not catch the Azure migration in couple of hours. All the work already in the branch which will go to Azure. Once azure is done, you can recreate PR so have more time to clean up. Rush to master may cause more request coming.
The edit link looks good. |
containsData has only been replaced where it would cause a blank summary to be displayed. I can change the code to use containsData more specifically if you think that would be more appropriate. |
Tha's OK, just feel a bit rushed for a Friday and migration day The latter reads much better. |
I will work on an update to evaluate form contents and only mark as edited if the contents are different. This PR will be left open to collect more feedback. |
If making "Edited" accurately reflects if the form is actually edited or not involves too complicated logic but little business value , maybe turn the link of "Edit" to purple is good enough for now. |
I agree we should have a separate PR to discuss this. If this is the correct way to do things, we should change the logic in PDF report together. After all, this has nothing to with "Edited" function. |
This is related to marking confirmation summaries as edited. containsData will evaluate the object and return true if it contains anything. If an object contains the property edited: true it will display an empty summary. This code change is limited to the confirmation summaries that will be affected by containsData. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all pages works well except anonymous location page. the edit button don't change to purple , and the( Eddited ) don't show up after editing the page
Fixes #2316
Description
Confirmation summary will indicate which fields have been updated. Links that have been visited will now be displayed in a different colour similarly to other Government of Canada sites.
Any new packages installed?
N/A
Required followup work
N/A
Checklist: