feat(plugin-id/ui): i18n labels and icons for delegate type selectors#29
Merged
Merged
Conversation
Per Fabrice's review (18 mai 13h30): the type selectors on the Delegate
edit view (recipient type and resource type) were showing raw enum
values (USER / GROUP / COMPANY / TREE) without translation or visual
cue. Add i18n labels (fr + en) and MDI icons.
Icons are rendered via:
- prepend-inner-icon bound to a computed that maps the v-model value
to the icon name (for the field showing the selected value)
- the #item slot + <v-list-item> #prepend slot (for the dropdown rows)
This sidesteps the #selection slot which, combined with object items
holding an icon field, triggered "Maximum recursive updates exceeded"
inside v-select. TYPE_ICONS lives at module scope (constant, never
reactive) so the lookup is stable across renders.
Items stay as { value, titleKey } objects; v-model still holds the raw
enum value via item-value="value", keeping the save() payload contract
unchanged.
Plugin-local i18n keys follow the pattern established in PR
norman/feat-delete-confirm-bold-name: keys live in plugin-id's
ui/src/i18n/{en,fr}.js and are merged into the host store via
useI18nStore().merge() in install(). When delete-confirm lands first
the two PRs will conflict on the i18n files — trivial textual merge,
both extend the same maps.
…delegate-types-i18n-icons # Conflicts: # ui/src/i18n/en.js # ui/src/i18n/fr.js
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Translate and add icons to the recipient type and resource type
selectors on DelegateEditView.
Previously these showed raw uppercase enum values (USER/GROUP/COMPANY/
TREE) with no translation or visual cue.
Result
and in the dropdown items: USER → mdi-account,
GROUP → mdi-account-group, COMPANY → mdi-domain, TREE → mdi-file-tree
Implementation
save() payload (raw enum) unchanged
"Maximum recursive updates exceeded" loop in v-select. The
prepend-inner-icon approach side-steps it.
Bonus fix
Some existing delegates store type values in lowercase
(receiverType: "company"). The v-model then matched no item,
re-triggering the recursion. Fixed by normalizing to uppercase at form
init (idempotent on save).
Plugin-local i18n
Same pattern as PR norman/feat-delete-confirm-bold-name.
Conflict note
Conflicts with PR norman/feat-delete-confirm-bold-name expected on
ui/src/i18n/{en,fr}.js and ui/src/index.js — trivial concat.
Files
4 files, +86/-6.