-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bug/roe 2018 roe 1507 fix duplication of trust #717
Open
mouhajer-ch
wants to merge
17
commits into
main
Choose a base branch
from
bug/roe-2018-roe-1507-fix-duplication-of-trust
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ffdc464
Check appdata before errorlist for trust validation and fix linting f…
mouhajer-ch e932ce3
Improve logic to fix Trust issue
mouhajer-ch c54f290
Improving logic
mouhajer-ch 5134254
Fix trust information message
mouhajer-ch 47bc3d5
Remove comments
mouhajer-ch 35977ad
Fix unit tests after changes - first part
mouhajer-ch 8b5245c
Fix test unit
mouhajer-ch 8270e18
Fix unit test for trust
mouhajer-ch 22baa17
Remove only test method from trust information tests
mouhajer-ch a27f23f
Fix default params for trust validation - moved to last
mouhajer-ch d887e85
Add trust object when validation error
mouhajer-ch f928428
ROE_1507 Trust information count and validation bug
mattch1 d798692
Merge from main
mattch1 ece00ad
ROE-1507 Hide submit when 0 trusts are added
mattch1 2afd84d
ROE-1507 Use gov uk group for trusts json textarea
mattch1 0b9d6bd
ROE-1507 Remove extra tag
mattch1 4d0f92f
ROE-1507 Only assess tursts var if no errors
mattch1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ export enum ErrorMessages { | |
|
||
// Trusts | ||
TRUST_DATA_EMPTY = "Paste the trust information from the Excel document into the box", | ||
TRUST_DATA_INVALID_FORMAT = "Format of trust information is invalid", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we'll need to check the content of this message with UX or an analyst. |
||
TRUST_NAME = "Enter the trust name", | ||
TRUST_NAME_2 = "Enter the name of the trust", | ||
TRUST_CREATION_DATE = "Enter the trust creation date", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
import { body } from "express-validator"; | ||
import { checkAtLeastOneFieldHasValue, checkTrustFields } from "./custom.validation"; | ||
|
||
import { ErrorMessages } from "./error.messages"; | ||
import { checkTrustBOs, checkTrustFields } from "./custom.validation"; | ||
|
||
export const trustInformation = [ | ||
body("beneficialOwners").custom((value, { req }) => | ||
checkAtLeastOneFieldHasValue(ErrorMessages.TRUST_BO_CHECKBOX, req.body.beneficialOwners)), | ||
|
||
body("trusts") | ||
.not().isEmpty({ ignore_whitespace: true }).withMessage(ErrorMessages.TRUST_DATA_EMPTY) | ||
.custom((value, { req }) => | ||
checkTrustFields(req.body.trusts)) | ||
body("beneficialOwners").custom((_, { req }) => checkTrustBOs(req)), | ||
body("trusts").custom((_, { req }) => checkTrustFields(req)) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
looks like moving the submit redirect here means that it will ignore json posted in the json field on teh page and won't add it to the model. This is different behaviour from what was there previously, it might be ok, we'll have to check with the PO tomorrow in the office. It also allows us to move to the check your answers screen with 0 trusts added, so perhaps we should only allow the user to move forward if there is at least one trust in the model/session data. Can discuss in office tomorrow.