-
Notifications
You must be signed in to change notification settings - Fork 334
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
Throw ConfigError
when component configs are invalid
#4176
Merged
Merged
Conversation
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
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-4176
September 5, 2023 09:04
Inactive
domoscargin
force-pushed
the
bk-illegal-config-error
branch
from
September 5, 2023 09:21
14bdb89
to
3cd4098
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-4176
September 5, 2023 09:21
Inactive
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for 55a54b7 |
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-4176
September 6, 2023 09:42
Inactive
packages/govuk-frontend/src/govuk/components/character-count/character-count.mjs
Outdated
Show resolved
Hide resolved
domoscargin
force-pushed
the
bk-illegal-config-error
branch
from
September 6, 2023 12:47
80881a5
to
cc5c232
Compare
govuk-design-system-ci
had a problem deploying
to
govuk-frontend-pr-4176
September 6, 2023 12:47
Failure
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-4176
September 6, 2023 12:50
Inactive
domoscargin
force-pushed
the
bk-illegal-config-error
branch
from
September 6, 2023 12:56
4c87404
to
349665f
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-4176
September 6, 2023 12:56
Inactive
domoscargin
force-pushed
the
bk-illegal-config-error
branch
from
September 6, 2023 13:53
349665f
to
ca48e66
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-4176
September 6, 2023 13:53
Inactive
6 tasks
domoscargin
force-pushed
the
bk-illegal-config-error
branch
from
September 7, 2023 14:54
ca48e66
to
abefc27
Compare
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-4176
September 7, 2023 14:55
Inactive
This was referenced Dec 11, 2023
This was referenced Dec 19, 2023
Update dependency govuk-frontend to v5
ministryofjustice/hmpps-community-accommodation-tier-2-ui#383
Closed
1 task
1 task
This was referenced Jan 24, 2024
This was referenced Feb 15, 2024
1 task
1 task
1 task
1 task
This was referenced Apr 17, 2024
1 task
This was referenced Jul 2, 2024
1 task
This was referenced Jul 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #4037
What
I've got two approaches here:
Validate within the component class
At the moment, we only need this validation on Character Count, so we could just do a specific validation in that class. Might be good enough for now.
Use a schema
It'd be nice to just use something like AJV and validate a schema, but that'd add weight to our code, so I've implemented a custom validation method on the base component that we can build on as necessary.
It'd also be nice to somehow use our YAML (or compiled JSON fixtures) here, but that's a lot trickier to unpick than is required for this work (for example: how to separate out nunjucks and JS properties, how to document more complex rules like
anyOf
, etc).Update: We've gone with the schema approach and loosely followed:
https://ajv.js.org/packages/ajv-errors.html#single-message