- Issue created by @wim leers
- First commit to issue fork.
- Status changed to Needs work
about 1 year ago 11:41am 20 October 2023 - ๐ฌ๐งUnited Kingdom Eli-T Manchester
Initial commit adds validation for color_hex base type, and hence covers base_primary_color.
- Merge request !5070Issue #3395555: ๐ฆบ add constraint configuration for... โ (Open) created by Eli-T
44:59 42:24 Running- Status changed to Needs review
about 1 year ago 12:41pm 20 October 2023 15:39 7:28 Running- Status changed to RTBC
about 1 year ago 2:33pm 20 October 2023 - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
All feedback has been resolved with @see comments.
Before:
olivero.settings 83%After:
olivero.settings 100%I validated that the choices described in the schema constraints are the ones available at the form.
This looks great to me.A doubt that I have is:
If e.g. I had to alter a form for adding an extra option in olivero settings form in my custom module, I probably need to implement hook_config_schema_info_alter to alter that constraint. I'm not sure if we have already docs/change records including that, but probably this is something worth to document. - ๐ง๐ชBelgium borisson_ Mechelen, ๐ง๐ช
Changes look great, rtbc ++
If e.g. I had to alter a form for adding an extra option in olivero settings form in my custom module, I probably need to implement hook_config_schema_info_alter to alter that constraint. I'm not sure if we have already docs/change records including that, but probably this is something worth to document.
This is a general issue with a lot of the validation constraints we are adding, I agree this makes some things more difficult.
I'm not sure how we can make this more strict and also keep the freedom the add extra options there. @Wim Leers might have an idea. - last update
about 1 year ago 30,426 pass - Status changed to Needs work
about 1 year ago 8:06am 23 October 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Sorry, I spotted a few small problems ๐
If e.g. I had to alter a form for adding an extra option in olivero settings form in my custom module, I probably need to implement hook_config_schema_info_alter to alter that constraint. I'm not sure if we have already docs/change records including that, but probably this is something worth to document.
+
I'm not sure how we can make this more strict and also keep the freedom the add extra options there. @Wim Leers might have an idea.
This is another reason that using the
Choice
constraint is so great: that makes it easy to declaratively add additional valid choices :) - Status changed to Postponed
about 1 year ago 8:56am 23 October 2023 - ๐ฌ๐งUnited Kingdom Eli-T Manchester
Have created โจ Allow three character hex colour definitions in Olivero settings Active to discuss making Olivero consistent with Image module's colour validation.
Postponing this issue based on the outcome of that one.
- Status changed to Needs work
about 1 year ago 1:54pm 23 October 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Whilst 3 character HEX codes are a thing, Olivero does not currently accept them
Well in that case โฆ we don't need to wait for that! ๐
What matters is that the validation constraints match the expectations of the logic. ๐
Marking for that leading
:
in the message. - ๐ฌ๐งUnited Kingdom Eli-T Manchester
@wim-leers I think this still should be postponed, because this MR adds validation to the core config type of colour-hex.
That is used in two different places with different logic. Therefore we can't match the expectations of the logic until they are synchronised in โจ Allow three character hex colour definitions in Olivero settings Active .
If we proceeded as-is with this change, config that used three character codes in image style configuration would suddenly become invalid.
- last update
about 1 year ago 30,427 pass - Status changed to Postponed
about 1 year ago 3:00pm 23 October 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Oh, that makes sense โ I didn't realize that ๐ ! Thanks, @Eli-T ๐
- Status changed to Needs work
11 months ago 8:21am 5 January 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This now needs the
FullyValidatable
constraint to be added toolivero.settings
. See https://www.drupal.org/node/3404425 โ . - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Note: we should update this to use
#config_target
in Olivero's settings form (which only became usable after that MR was originally created, see the CR at https://www.drupal.org/node/3373502 โ ), and remove the validation logic from the form. - Status changed to Needs review
10 months ago 7:03am 14 January 2024 - ๐ง๐ชBelgium borisson_ Mechelen, ๐ง๐ช
I've removed the
FullyValidatable
from olivero, judging from the test failures, we first need to take care oftheme_settings
, but I don't think this issue needs to wait for that. - Status changed to RTBC
10 months ago 7:30am 16 January 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
It's a bit odd that
mobile_menu_all_widths
istype: integer
. I thinktype: boolean
would make more sense. But that'd be both unnecessary and scope creep.I've removed the
FullyValidatable
from olivero, judging from the test failures, we first need to take care oftheme_settings
, but I don't think this issue needs to wait for that.I first wanted to disagree ๐๐ค But then I looked at the test failures and was forced to agree with you! ๐ Once
type: theme_settings
is fully validatable, we'll indeed be able to markolivero.settings
as fully validatable too ๐ - Status changed to Needs work
10 months ago 7:50am 16 January 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Oops! I forgot the
#config_target
bit I mentioned in #20, and which convinced @longwave to land the blocker at โจ Allow three character hex colour definitions in Olivero settings Active ๐This MR should therefore update
olivero_form_system_theme_settings_alter()
to use#config_target
to use constraint-based validation. Which also means we should be able to removeolivero_theme_settings_validate()
here. - Status changed to Needs review
10 months ago 5:06pm 16 January 2024 - Status changed to Needs work
10 months ago 8:27am 17 January 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Since this is the first theme settings form using this, and
Colors must be 7-character string specifying a color hexadecimal format.
does not occur in any test, let's add a functional test to prove that the validation error correctly appears. That will also help with converting
type: theme_settings
to use validation constraints (especially given Olivero is the default front end theme) ๐ - ๐ฎ๐ณIndia Akhil Babu Chengannur
Akhil Babu โ made their first commit to this issueโs fork.
- Status changed to Needs review
10 months ago 12:28pm 18 January 2024 - ๐ฎ๐ณIndia Akhil Babu Chengannur
I have updated the regex and added a test to valiate the hex codes.
- Status changed to RTBC
10 months ago 1:54pm 18 January 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Excellent work here, @Akhil Babu! ๐ Thanks for writing those tests!
There's one thing to nitpick (the assertion for the message could be more precise and hence more robust), but that's IMHO not commit-blocking. ๐
- ๐ฎ๐ณIndia Akhil Babu Chengannur
Thanks @Wim Leers.
Updated the method but now there is a strange Nightwatch test failure.
https://git.drupalcode.org/issue/drupal-3395555/-/jobs/661127 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
That looks like a random test failure โ
chromedriver
-powered tests are notoriously fickle.Re-running the Nightwatch tests โ I expect those to pass now.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Turns out that single failure was a regression in Drupal core, and the commit has since been reverted: #3413665-10: Enable modules through Nightwatch API when not testing module enabling โ .
Green CI again! ๐
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
For
type: theme_settings
: ๐ Add validation constraints to `type: theme_settings` Active . - Status changed to Needs review
9 months ago 11:30am 9 February 2024 - ๐ฌ๐งUnited Kingdom catch
Nearly committed this but actually have one question on the MR.
- Status changed to RTBC
9 months ago 11:36am 9 February 2024 - Status changed to Needs work
9 months ago 12:02pm 9 February 2024 - ๐ฌ๐งUnited Kingdom catch
OK those are good reasons, but let's add them to the comment.
- Status changed to RTBC
9 months ago 1:02pm 9 February 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Re-RTBC'ing โ I didn't touch this MR, I was only a reviewer. I provided the rationale for me RTBC'ing it despite the thing @catch rightfully questioned, and added that as a comment ๐
- Status changed to Fixed
9 months ago 10:31pm 9 February 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Yay!
This inspired a follow-up ๐ค โ see [#3420770.
Automatically closed - issue fixed for 2 weeks with no activity.