Skip to content

feat(plugin-id/ui): i18n labels and icons for delegate type selectors#29

Merged
fdaugan merged 2 commits into
feature/vuejsfrom
norman/feat-delegate-types-i18n-icons
May 22, 2026
Merged

feat(plugin-id/ui): i18n labels and icons for delegate type selectors#29
fdaugan merged 2 commits into
feature/vuejsfrom
norman/feat-delegate-types-i18n-icons

Conversation

@Terracosmos
Copy link
Copy Markdown
Collaborator

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

  • FR : Utilisateur / Groupe / Entité / Arborescence
  • EN : User / Group / Company / Tree
  • Each type has an MDI icon shown both in the field (selected value)
    and in the dropdown items: USER → mdi-account,
    GROUP → mdi-account-group, COMPANY → mdi-domain, TREE → mdi-file-tree

Implementation

  • Items as objects { value, titleKey }; item-value="value" keeps the
    save() payload (raw enum) unchanged
  • Field icon via prepend-inner-icon bound to a computed
  • Dropdown icons via #item slot + v-list-item #prepend slot
  • No #selection slot — that combination with object items triggered a
    "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.

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.
@Terracosmos Terracosmos requested a review from fdaugan May 20, 2026 08:08
…delegate-types-i18n-icons

# Conflicts:
#	ui/src/i18n/en.js
#	ui/src/i18n/fr.js
@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

@fdaugan fdaugan merged commit 478901c into feature/vuejs May 22, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants