Skip to content

Commit

Permalink
dev: Set id on "UI select" of multiselect actors
Browse files Browse the repository at this point in the history
This allows to give a label to the multiselect actors component. The
"technical select" has the same id, suffixed by "-data".
  • Loading branch information
marien-probesys committed Jun 4, 2024
1 parent 6e4dd2f commit d1cc409
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions templates/tickets/filters/_multiselect_actors.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<div data-controller="multiselect-actors">
<select
id="{{ id }}"
id="{{ id }}-data"
name="{{ name }}"
multiple
data-multiselect-actors-target="data"
Expand All @@ -15,9 +15,9 @@
>
{% for user in users %}
{% set isCurrentUser = user.id == app.user.id %}
{% set id = isCurrentUser ? '@me' : user.id %}
{% set userId = isCurrentUser ? '@me' : user.id %}

<option value="{{ isCurrentUser ? id : '#' ~ id }}" {{ id in selected ? 'selected' }}>
<option value="{{ isCurrentUser ? userId : '#' ~ userId }}" {{ userId in selected ? 'selected' }}>
{{ user.displayName }}

{% if user.id == app.user.id %}
Expand All @@ -29,6 +29,7 @@

<div class="flow">
<select
id="{{ id }}"
data-multiselect-actors-target="select"
data-action="multiselect-actors#select"
>
Expand Down
2 changes: 1 addition & 1 deletion templates/tickets/filters/edit_actors.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
value="no"
{{ null in ticketFilter.filter('assignee') ? 'checked' }}
data-checkboxes-target="control"
data-checkboxes-control="#filter-assignee"
data-checkboxes-control="#filter-assignee-data"
data-action="checkboxes#switchDisabled"
/>

Expand Down

0 comments on commit d1cc409

Please sign in to comment.