Skip to content
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

IBX-3524: Removed icon and added default none to dropdown placeholder #622

Merged
merged 1 commit into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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