CCP-WSI / research-software-directory

The Research Software Directory is a content management system that is tailored to software.
Apache License 2.0
0 stars 1 forks source link

Dropdown menus on admin page #1

Open glpoulter opened 2 years ago

glpoulter commented 2 years ago

Once you select something from a dropdown menu on the admin page you can change your selection to something else but you can't change it so you simply don't add anything to that field.

This is the same for hardcoded arrays eg Structures, Devices & Obstacles but also when selecting for example a related project. If there aren't any related projects but you accidently select one - you can change that selection but you can't remove a selection so your stuck with an un-related related project!

glpoulter commented 2 years ago

This isn't the case with related projects because you can click the "x" to remove it.

It is only a problem with with enums that are not also arrays. You can sort of get round this by making a dropdown using an array of enums and adding "maxItems": 1 to each enum in the array (not sure that makes sense but there's an example in publication schema)

glpoulter commented 7 months ago

Different work arounds are going to be required for different situations here, for some cases like in #120 making it an array which can only have 1 item in it seems best. In others, eg Facility (for Test Cases) then just adding an N/A facility to the dropdown seems best - that would be straightforward to handle on the front end too.

glpoulter commented 6 months ago

This is a bit of an issue with Modelling Approach because it won't let you save a new project (say) or update an old one for a different metadata field without completing modelling approach - and I don't know what it should be!

glpoulter commented 6 months ago

As a workaround, have put in an empty string option for Modelling Approach so I can update other fields for existing projects. I tried to set this as the default option for new projects but the consumer of the schema doesn't appear to be set up for that.

glpoulter commented 6 months ago

Arrgghhh forgot this would add the extra option to the filters on the search page - need to think again