-
Notifications
You must be signed in to change notification settings - Fork 12
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
Dependent field validator #152
Open
bianca
wants to merge
17
commits into
ongov:ckan_2.8
Choose a base branch
from
bianca:dependent_field_validator
base: ckan_2.8
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
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
CKAN module added to hide/show fields based on the values of other fields in the package form.
Add the hide/show fields to exemption and exemption rationale fields based on the value for access level.
Add conditional save form validator that will wipe values from a field unless a different field has a particular value. This is so that exemption and exemption rationale fields can only be populated if access level is restricted.
…nale. Add conditional_save validator to exemption and exemption rationale so that they can only have values if access level is restricted.
Make javascript file available to internal and external catalogues.
Apply validators to external catalogue only.
Validators moved to dedicated file. Required_if validator added and conditional_save validator finished.
Apply conditional show behaviour to opened_date so it only shows for opened datasets.
Apply required_if validator to opened_date, because it is only needed for opened datasets.
When form_attrs is passed in the schema, the class form-control doesn't automatically get passed to the form input and needs to be deliberately passed as part of of form_attrs.
Hiding/showing fields introduces accessibility issues, among others. Switch to toggling readonly instead.
Required_if validator refactored to be neater.
Providing form_attrs in the schema overrides passing 'col-md-6' to the textarea tag, so it must be manually passed through adding to form_attrs.
Textarea doesn't have readonly styles and appears to be editable. Add readonly styles.
Using 'raise invalid' with fluent fields does not attach an error to the specific field. Using the error dict does attach an error to the specific field.
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.
This PR consists of 10 commits to make the following changes: