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

Highlight required fields #291

Closed
saulipurhonen opened this issue May 5, 2021 · 5 comments
Closed

Highlight required fields #291

saulipurhonen opened this issue May 5, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@saulipurhonen
Copy link
Contributor

Describe the bug

Highlighting of required fields doesn't work properly.
It seems that WizardJSONSchemaParser doesn't handle required attribute as it should.

To Reproduce

Steps to reproduce the behavior:

  1. Create new submission
  2. Click Analysis
  3. Analysis Type dropdown isn't highlighted

Expected behavior

All required fields should be highlighted.

@saulipurhonen saulipurhonen added the bug Something isn't working label May 5, 2021
@saulipurhonen saulipurhonen added this to the Beta - User Interaction milestone May 5, 2021
@saulipurhonen saulipurhonen changed the title Not all required fields are Highlight required fields May 5, 2021
@saulipurhonen saulipurhonen self-assigned this May 5, 2021
@saulipurhonen
Copy link
Contributor Author

saulipurhonen commented May 5, 2021

I'm having some problems with Experiment object type.
We have design as required property, but:

There isn't any required field under design. Same situation with referenced fields. What's the purpose of having design as required property ?

Another one one that I'm not able to get is if Experiment/Study Reference is missing an Accession Id field we get a response from backend that Validation failed, details: Provided input does not seem correct because: ''design' is a required property'. I think it would make sense to have a message that points to Study Reference instead.

I've been trying to study the model from the metadata-submitter docs, but haven't found any clues yet.

@blankdots, any ideas how to go from here?

@saulipurhonen
Copy link
Contributor Author

For the original issue the problem is that oneOf fields don't have handling for required attribute.

@blankdots
Copy link
Contributor

blankdots commented May 5, 2021

@saulipurhonen sometimes whole sections of a from are required and not individual fields. Just in case I will review the schemas again and get the required fields, or remove some of them. Will come back with a detailed answer

@blankdots
Copy link
Contributor

blankdots commented May 5, 2021

the schema of Experiment is such that design and study reference are required, but is fields are not required so in practice an empty object could be sent, although not ideal. For design I identified some required fields and I placed them in develop backend branch and should show in UI (hopefully).

the way I see it there are 2 options when we have sections that are required but their fields are not:

  1. we send an empty object - not ideal, but a good start
  2. we restrict it the UI that at least one field is filled in - so that we don't break schemas

If we were to add more restrictions to the schemas it will break the XML Schema <-> JSON Schema parity

the fields which I identified are, that suffer from similar issues:

  1. experiment -> study reference
  2. policy -> DAC reference
  3. run -> experiment reference

@saulipurhonen
Copy link
Contributor Author

I think it would make most sense that user is required to add some data to required section if the section is a required property in the schema. I'll add the first field of the section as required for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants