Derive field label from its 'name' property in the finder schema #2906
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.
Whilst developing a finder recently, I was surprised that my 'name' wasn't having any effect on what was showing in the admin UI. I believe until now, the 'name' is only used in finder-frontend itself.
The label was derived from the key instead of the name, but this often wasn't suitable, meaning we had a lot of
label:
overrides (as keys had to be namespaced, but labels can afford to use more generic language).I've tweaked the templates to derive the label from the 'name' instead, which is already a curated human-readable name for the thing - so we no longer need to try to guess from the key. We still have the freedom to use explicit label overrides where needed (indeed, I've left several untouched in the _licences.html.erb file, as the name was quite different to what was configured in that view).
Trello: https://trello.com/c/5RZhjdWe/3211-specialist-finder-for-the-data-ethics-guidance
Follow these steps if you are doing a Rails upgrade.