diff --git a/src/components/Projects/DropdownMenuItem.vue b/src/components/Projects/DropdownMenuItem.vue index 0173fcc1315dc155a246020a816928f54fa2b6c2..ca14155ddc25bc5ebab21572e8638037d0f29bd5 100644 --- a/src/components/Projects/DropdownMenuItem.vue +++ b/src/components/Projects/DropdownMenuItem.vue @@ -19,6 +19,9 @@ @remove="remove" @close="close" > + <template slot="option" slot-scope="props"> + <span :title="props.option.label">{{ props.option.label }}</span> + </template> <template v-if="multiple" slot="selection" @@ -98,7 +101,12 @@ export default { created() { this.selection = this.options[0]; if (this.defaultFilter) { - const selectFilter = (filter) => this.select(this.options.find(option => option.value === filter)); + const selectFilter = (filter) => { + const defaultOption = this.options.find(option => option.value === filter); + if (defaultOption) { + this.select(defaultOption); + } + }; // Specific process if multiple values type and has more than one values if (this.multiple && this.defaultFilter.includes(',')) { // make an array from the string diff --git a/src/components/Projects/ProjectsMenu.vue b/src/components/Projects/ProjectsMenu.vue index a5d4607621c87616a41d894e7cc15508c5b765c6..191bbf9ddc2480f66c7cafd607f995001da35a1d 100644 --- a/src/components/Projects/ProjectsMenu.vue +++ b/src/components/Projects/ProjectsMenu.vue @@ -1,7 +1,7 @@ <template> <div - id="filters-container" v-if="displayedClassicFilters || displayedAttributeFilters" + id="filters-container" class="margin-bottom" > <div @@ -59,7 +59,7 @@ </label> <DropdownMenuItem :options="attribute.options" - :multiple="attribute.field_type === 'multi_choices_list'" + :multiple="attribute.field_type.includes('list')" :current-selection="attributesFilter[attribute.id]" :default-filter="attribute.default_filter_enabled ? attribute.default_filter_value : null" @filter="updateAttributeFilter" @@ -297,7 +297,7 @@ export default { // Retrieve the attribute type information to determine how to handle the update const attribute = this.getProjectAttribute(filter); // Check if the attribute allows multiple selections - const isMultiChoice = attribute.field_type === 'multi_choices_list'; + const isMultiChoice = attribute.field_type.includes('list'); if (isMultiChoice) { // For multi-choice attributes, manage the values as an array to allow multiple selections