Develop/fixes/dlsv2 652 spurious validation error on remove unsupervised user #1402
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA link
https://hee-dls.atlassian.net/jira/software/projects/DLSV2/boards/1?assignee=6321797ece3e476e42ac8a00&selectedIssue=DLSV2-652
Description
On page Supervisor>My Staff if you click the 'Remove staff member' for a person that does not have any self assessments, the following page displayed a spurious error on load (see attached screenshot).
This was caused by an error occuring in the viewmodel validation because in SupervisorDelegateViewModel.cs the property ActionConfirmed is validated as must be true (via the [BooleanMustBeTrue] decorator).
However in this edge case this ActionConfirmed = false is a valid model state, because the user has not ticked the confirmation checkbox on the 'confirm remove' page.
The solution was to clear the spurious error on this field (see attached screenshot for correct loading of the 'Confirm Remove Staff Member' page.
Screenshots
See attached before and after screenshots.
Developer checks
I have: