Skip to content

Commit

Permalink
IBX-3524: Removed icon and added default none to dropdown placeholder (
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 authored Nov 2, 2022
1 parent 6f62f2a commit 6cb5825
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/bundle/Resources/translations/messages.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,6 @@
<target state="new">Search...</target>
<note>key: content_type.view.edit.search</note>
</trans-unit>
<trans-unit id="6cf3d774e8b9e13d11f9f7525f1a6eaa6a892320" resname="content_type.view.edit.seo">
<source>SEO</source>
<target state="new">SEO</target>
<note>key: content_type.view.edit.seo</note>
</trans-unit>
<trans-unit id="803a61fc8cf4e7bdfcf27432bb35e379a4971134" resname="content_type.view.list.action.add">
<source>Add new</source>
<target state="new">Add new</target>
Expand Down Expand Up @@ -306,6 +301,11 @@
<target state="new">No options available</target>
<note>key: dropdown.placeholder.empty</note>
</trans-unit>
<trans-unit id="40f8da5227ff717dc8e4d57dc26c074c25c00d3a" resname="dropdown.placeholder.empty.label">
<source>None</source>
<target state="new">None</target>
<note>key: dropdown.placeholder.empty.label</note>
</trans-unit>
<trans-unit id="272e650f8667b4f4fcb7032b85b98ef4a9974f0f" resname="dropdown.search">
<source>Search...</source>
<target state="new">Search...</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@
</li>
{% else %}
{% if placeholder is defined and placeholder is not none %}
{% set default_label = 'dropdown.placeholder'|trans()|desc('Choose an option') %}

{% include '@ibexadesign/ui/component/dropdown/dropdown_selected_item.html.twig' with {
value: '',
label: _self.get_translated_label(placeholder, translation_domain),
label: _self.get_translated_label(placeholder, translation_domain)|trim|default(default_label),
} %}
{% else %}
{% set first_choice = choices_flat|first %}
Expand Down Expand Up @@ -145,11 +147,13 @@
})|e('html_attr') }}"
>
{% if not multiple and placeholder is defined and placeholder is not none %}
{% set default_label = 'dropdown.placeholder.empty.label'|trans|desc('None') %}
{% set placeholder_choice = {
value: '',
label: _self.get_translated_label(placeholder, translation_domain),
label: _self.get_translated_label(placeholder, translation_domain)|trim|default(default_label),
} %}
{% include '@ibexadesign/ui/component/dropdown/dropdown_item.html.twig' with { choice: placeholder_choice, custom_form: true, icon: 'interface-block' } %}

{% include '@ibexadesign/ui/component/dropdown/dropdown_item.html.twig' with { choice: placeholder_choice, custom_form: true } %}
{% endif %}
{% for choice in preferred_choices %}
{% include '@ibexadesign/ui/component/dropdown/dropdown_item.html.twig' with { choice, preferred_choice: true, custom_form, icon: item_icon, icon_class: item_icon_class } %}
Expand Down

0 comments on commit 6cb5825

Please sign in to comment.