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

IBX-4339: Input validation - wrong style #658

Merged
merged 5 commits into from
Feb 21, 2023
Merged

Conversation

GrabowskiM
Copy link
Contributor

Question Answer
Tickets https://issues.ibexa.co/browse/IBX-4339
Bug fix? yes
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@sonarcloud
Copy link

sonarcloud bot commented Nov 24, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -84,8 +84,9 @@
const dataContainer = this.fieldContainer.querySelector('.ibexa-field-edit__data');
const isFileFieldEmpty = fileField.files && !fileField.files.length && dataContainer && !dataContainer.hasAttribute('hidden');
const { isRequired } = event.target.dataset;
const alreadyIsError = this.fieldContainer.classList.contains(this.classInvalid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have more price variable name:

Suggested change
const alreadyIsError = this.fieldContainer.classList.contains(this.classInvalid);
const isInvalidatedByOtherValidator = this.fieldContainer.classList.contains(this.classInvalid);

@@ -113,7 +114,7 @@
eventName: 'blur',
callback: 'validateAltInput',
invalidStateSelectors: ['.ibexa-data-source__field--alternativeText'],
errorNodeSelectors: [`${SELECTOR_ALT_WRAPPER} .ibexa-data-source__label-wrapper`],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: isn't this BC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, especially as this selector is incorrect, as errors shouldn't be displayed in label block

<use xlink:href="{{ ibexa_icon_path('warning-triangle') }}"></use>
</svg>
{{ error.message }}
</em>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</em>
</em>

@GrabowskiM GrabowskiM force-pushed the IBX-4339-input-validation-fixes branch from 6284d95 to 871df5c Compare December 1, 2022 09:38
@GrabowskiM GrabowskiM changed the base branch from 4.2 to 4.3 December 1, 2022 09:47
@tomaszszopinski
Copy link
Contributor

I found a problem in this and related pr's (ie. in measurement). Validation error notifications are doubled and they do not disappear - as in the picture:
Zrzut ekranu 2022-12-7 o 11 45 02

@bogusez bogusez self-assigned this Dec 22, 2022
@GrabowskiM GrabowskiM force-pushed the IBX-4339-input-validation-fixes branch from edd2542 to b8dc87a Compare December 22, 2022 10:46
@bogusez
Copy link
Contributor

bogusez commented Dec 22, 2022

Object states, incorrect validation message for empty fields

Screenshot 2022-12-22 at 12 50 54

@bogusez
Copy link
Contributor

bogusez commented Dec 22, 2022

Sections, incorrect validation message for empty fields

Screenshot 2022-12-22 at 12 52 04

@bogusez
Copy link
Contributor

bogusez commented Dec 22, 2022

Roles, incorrect validation message for empty fields

Screenshot 2022-12-22 at 12 54 22

@bogusez
Copy link
Contributor

bogusez commented Dec 22, 2022

URL management, incorrect validation message for empty fields

Screenshot 2022-12-22 at 12 55 28

@bogusez
Copy link
Contributor

bogusez commented Dec 22, 2022

Languages, incorrect validation message for empty fields

Screenshot 2022-12-22 at 12 56 49

@bogusez
Copy link
Contributor

bogusez commented Dec 22, 2022

Segments, incorrect validation message for empty fields

Screenshot 2022-12-22 at 12 57 33

@bogusez
Copy link
Contributor

bogusez commented Dec 23, 2022

User settings, incorrect validation message for empty fields

Screenshot 2022-12-23 at 08 50 01

Screenshot 2022-12-23 at 08 49 41

@bogusez
Copy link
Contributor

bogusez commented Dec 23, 2022

Content query field type (fields - Items per page, Parameters), Missing validation message

Screenshot 2022-12-23 at 13 15 41

@sonarcloud
Copy link

sonarcloud bot commented Jan 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@GrabowskiM
Copy link
Contributor Author

Object states, incorrect validation message for empty fields

Screenshot 2022-12-22 at 12 50 54

according to all issues with this particular way of displaying error - it would be better to create new task for this and leave it currently as it is, as it would be much bigger change, all these forms would have to have "novalidate" option and implemented our custom validation (also, at least in create content type there's no backend validation...), it could possibly be BC, so it will be probably postoponed after 4.4.0

@GrabowskiM GrabowskiM force-pushed the IBX-4339-input-validation-fixes branch from 7f33e54 to 91f4e03 Compare February 20, 2023 12:36
@sonarcloud
Copy link

sonarcloud bot commented Feb 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bogusez
Copy link
Contributor

bogusez commented Feb 21, 2023

Regression tests passed on recent changes:
ibexa/experience#144
ibexa/commerce#220

@dew326 dew326 merged commit 0ccff6e into 4.3 Feb 21, 2023
@dew326 dew326 deleted the IBX-4339-input-validation-fixes branch February 21, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants