-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix(T33788): display only unique fields in the error message #634
Fix(T33788): display only unique fields in the error message #634
Conversation
…ue fields. However it does not work correctly with demosplan core, use filter() function instead
const nonEmptyFieldNames = validatedForm.invalidFields | ||
.map(field => field.getAttribute('data-dp-validate-error-fieldname')) | ||
.filter(Boolean) | ||
const nonEmptyUniqueFieldNames = nonEmptyFieldNames.filter((field, idx) => nonEmptyFieldNames.indexOf(field) === idx) |
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.
see below
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.
thx, done here 8847423
const nonEmptyFieldNames = validatedForm.invalidFields | ||
.map(field => field.getAttribute('data-dp-validate-error-fieldname')) | ||
.filter(Boolean) | ||
const nonEmptyUniqueFieldNames = nonEmptyFieldNames.filter((field, idx) => nonEmptyFieldNames.indexOf(field) === idx) |
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 think we can extract that to an own small method since the exact same Code is used twice.
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.
would it be also ok? --> 8847423#diff-fdc53ff4f95d479db51dcfdf0f2706e9b4974251ed0b258d11a27da73051073bR53
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.
It looks like. Although I wonder why sonarcloud is not complaining...
Co-authored-by: salisdemos <40487461+salisdemos@users.noreply.github.com>
…variable directly, remove an extra variable
Ticket: https://yaits.demos-deutschland.de/T33137 --> 1.PLZ wird 2x angezeigt (nur beim Feld PLZ tritt der Fehler auf
Description: This PR fixes the issue with incorrect field names in the error message: [object Set]
JavaScript
Set
was used for storing a collection of unique fields. However it does not work correctly after installing a new version of demosplan-ui in demosplan core..