Add labels to membership type metadata, allowing for addField method to be used #12132
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.
Overview
As a follow on from #12124 this adds a metadata option to specify the html label and alters some fields to use it.
Before
No change
After
No change. Coding methodology for metadata flexibility on labels established
(I will update docs once merged)
Technical Details
If we switch fields to use the (recommended) addField the labels can sometimes change. Arguably we should update the existing 'title field' in the xml to reflect the desired html label. However, these labels tend to have information about the entity - possibly intended to disambiguate Membership Type.is_active from Option_group.is_active in a flattish array - perhaps in views or the api explorer. Introducing an override label option specific to the html representation saves us (for better & worse) from having to fully explore these computing uses.
Comments
@colemanw this is per your suggestion. It keeps the labels the same (although arguably in some cases not for the better). Looking at the form I still see that description could be taken from the metadata & that might be a next step - ie.
name.description in the tpl "e.g. 'Student', 'Senior', 'Honor Society'..."
name.description in the xml - none
description.description in the xml Description of Membership Type
description.description in the tpl 'Description of this membership type for internal use. May include eligibility, benefits, terms, etc.'
In both those cases I would be inclined to update the xml with the tpl description. However, I presume there would be cases where it makes sense to be able to define
The other notable thing in the form that could be defined by metadata is the rules - ie.
I wondered about adding a tag - either within or as a sister to