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

Closes: Fieldset validator for releated fields #2551

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

dkorbel
Copy link
Contributor

@dkorbel dkorbel commented Sep 13, 2024

What this PR does / why we need it:
This feature adds additional validator that work for multiply fields.

This is a new validator that works for a set of fields that are related to each other. Based on the value of one field, it can validate a subset of fields for that value.

For example, in a purchase contact information form, we need different values for a company and a person. So, we add a 'select' field where we can choose whose details we need: either a person or a company. Then, we add fields for both individuals and companies. The validator will only validate the fields indicated by the first 'select' field.

Which issue(s) this PR closes:
It comes from Fairbirds team.

Example usage:
#datasetField name title validation
responsible_party Responsible party "[{""name"":""standard_input""}]"
responsible_party_type Type "[{""name"":""standard_input""}]"
responsible_party_person_first_name First name "[{""name"":""required_by_value_dependant"",""parameters"":{""context"":[""DATASET""], ""runOnEmpty"":""true"", ""dependantField"": ""responsible_party_type"", ""dependantFieldValue"": ""person""}}]"
responsible_party_person_surnames Surname(s) "[{""name"":""required_by_value_dependant"",""parameters"":{""context"":[""DATASET""], ""runOnEmpty"":""true"", ""dependantField"": ""responsible_party_type"", ""dependantFieldValue"": ""person""}}]"
responsible_party_organization_name Organization name "[{""name"":""required_by_value_dependant"",""parameters"":{""context"":[""DATASET""], ""runOnEmpty"":""true"", ""dependantField"": ""responsible_party_type"", ""dependantFieldValue"": ""organization""}}]"
responsible_party_organization_address_city City "[{""name"":""required_by_value_dependant"",""parameters"":{""context"":[""DATASET""], ""runOnEmpty"":""true"", ""dependantField"": ""responsible_party_type"", ""dependantFieldValue"": ""organization""}}]"
responsible_party_organization_address_postal-code Postal code "[{""name"":""required_by_value_dependant"",""parameters"":{""context"":[""DATASET""], ""runOnEmpty"":""true"", ""dependantField"": ""responsible_party_type"", ""dependantFieldValue"": ""organization""}}]"
responsible_party_organization_address_administrative-area Administrative area "[{""name"":""required_by_value_dependant"",""parameters"":{""context"":[""DATASET""], ""runOnEmpty"":""true"", ""dependantField"": ""responsible_party_type"", ""dependantFieldValue"": ""organization""}}]"
responsible_party_organization_address_country Country "[{""name"":""required_by_value_dependant"",""parameters"":{""context"":[""DATASET""], ""runOnEmpty"":""true"", ""dependantField"": ""responsible_party_type"", ""dependantFieldValue"": ""organization""}}]"
responsible_party_email_address Email address "[{""name"":""standard_input""}]"
responsible_party_orcid ORCID "[{""name"":""standard_input""}]"
#controlledVocabulary DatasetField Value identifier
responsible_party_type Person person
responsible_party_type Organization organization

releatedFieldValidator.csv

@sniewczas sniewczas changed the title Closes: Fieldset_validator_for_releated_fields Closes: Fieldset validator for releated fields Sep 13, 2024
@dkorbel dkorbel force-pushed the feature/20_Fieldset_validator_for_releated_fields branch from 5ff50fd to aa5575e Compare September 13, 2024 11:55
@dkorbel dkorbel requested a review from sniewczas September 13, 2024 12:03
@madryk madryk removed their assignment Sep 16, 2024
Co-authored-by: Filipe Dias Lewandowski [email protected]
Co-authored-by: Krzysztof Mądry [email protected]
Co-authored-by: Sylwester Niewczas [email protected]

Signed-off-by: Daniel Korbel [email protected]
@dkorbel dkorbel force-pushed the feature/20_Fieldset_validator_for_releated_fields branch from 3be4a16 to a7dcffe Compare September 16, 2024 15:55
@dkorbel dkorbel requested a review from sniewczas September 16, 2024 15:56
@sniewczas sniewczas assigned dkorbel and unassigned sniewczas Sep 17, 2024
@madryk madryk merged commit 30fe55a into develop Sep 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants