Skip to content
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

Develop/fixes/dlsv2 652 spurious validation error on remove unsupervised user #1402

Conversation

martinfoster-hee
Copy link
Contributor

@martinfoster-hee martinfoster-hee commented Sep 22, 2022

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:

  • Run the formatter and made sure there are no IDE errors (see info on Text Editor settings to avoid whitespace changes)
  • Written tests for the changes (accessibility tests, unit tests for controller, data services, services, view models, etc)
  • Manually tested my work with and without JavaScript
  • Tested any Views or partials created or changed with Wave Chrome plugin and addressed any valid accessibility issues
  • Updated/added documentation in Confluence and/or GitHub Readme. List of documentation links added/changed:
  • Updated my Jira ticket with information about other parts of the system that were touched as part of the MR and have to be sanity tested to ensure nothing’s broken
  • Scanned over my own MR to ensure everything is as expected and it looks right in the browser

bug652issue
bug652fixed

Override upervisorDelegateViewModel.ActionConfirmed must be true validation as ModelState.IsValid = false causes spurious validation error on next 'Confirm Remove' page.
@kevwhitt-hee kevwhitt-hee merged commit 17ca6f9 into master Sep 23, 2022
@kevwhitt-hee kevwhitt-hee deleted the Develop/Fixes/DLSV2-652-SpuriousValidationErrorOnRemoveUnsupervisedUser branch September 23, 2022 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants