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
Require value for dropdown choices #17732
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Found a few more spots where we might want to add this: displays/formatted-value Other than that, looking good. |
I have implemented most of the ones Nitwel mentioned except |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just recalled that we should probably add this for Field Name Translations and Collection Name Translations to prevent unintentional empty records there
However for Collection Name Translations, maybe "singular" and "plural" doesn't need to be required
-
Field:
Lines 34 to 64 in 0154878
:fields="[ { field: 'language', type: 'string', name: t('language'), meta: { interface: 'system-language', width: 'half', display: 'formatted-value', display_options: { font: 'monospace', color: 'var(--foreground-subdued)', }, }, schema: { default_value: 'en-US', }, }, { field: 'translation', type: 'string', name: t('translation'), meta: { interface: 'input', width: 'half', options: { placeholder: t('translation_placeholder'), }, }, }, ]" -
Collection:
directus/api/src/database/system-data/fields/collections.yaml
Lines 60 to 99 in 0154878
- field: translations special: - cast-json interface: list options: template: '{{ translation }} ({{ language }})' fields: - field: language name: $t:language type: string schema: default_value: en-US meta: interface: system-language width: half - field: translation name: $t:field_options.directus_collections.collection_name type: string meta: interface: input width: half options: placeholder: $t:field_options.directus_collections.translation_placeholder - field: singular name: $t:field_options.directus_collections.singular_unit type: string meta: interface: input width: half options: placeholder: $t:field_options.directus_collections.translation_placeholder - field: plural name: $t:field_options.directus_collections.plural_unit type: string meta: interface: input width: half options: placeholder: $t:field_options.directus_collections.translation_placeholder width: full
Added those 2 @azrikahar |
* updated value to be required * applied to other interfaces * Made dropdown labels required too * added required fields for other interfaces * added required fields for field/collection translations
* updated value to be required * applied to other interfaces * Made dropdown labels required too * added required fields for other interfaces * added required fields for field/collection translations
Description
Makes the
value
of dropdown choices requiredApplied to the following interfaces:
Note: I have made the text/label required too. leaving that empty wont break the app as such but you can question the logic of having empty labels to choose from which use different values.
Fixes ENG-89
Type of Change
Requirements Checklist
If adding a new feature: