Fixes access to undefined filterTypeOptions in text autocomplete scenario.

This commit is contained in:
mateuswetah 2024-05-23 11:22:00 -03:00
parent 2ec978de23
commit a90fbc813d
5 changed files with 22 additions and 24 deletions

View File

@ -9,7 +9,7 @@
border: 0; } border: 0; }
/** /**
* Swiper 11.1.1 * Swiper 11.1.3
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -17,7 +17,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: April 9, 2024 * Released on: May 13, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

View File

@ -9,7 +9,7 @@
border: 0; } border: 0; }
/** /**
* Swiper 11.1.1 * Swiper 11.1.3
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -17,7 +17,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: April 9, 2024 * Released on: May 13, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

View File

@ -9,7 +9,7 @@
border: 0; } border: 0; }
/** /**
* Swiper 11.1.1 * Swiper 11.1.3
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -17,7 +17,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: April 9, 2024 * Released on: May 13, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

View File

@ -1,5 +1,5 @@
/** /**
* Swiper 11.1.1 * Swiper 11.1.3
* Most modern mobile touch slider and framework with hardware accelerated transitions * Most modern mobile touch slider and framework with hardware accelerated transitions
* https://swiperjs.com * https://swiperjs.com
* *
@ -7,7 +7,7 @@
* *
* Released under the MIT License * Released under the MIT License
* *
* Released on: April 9, 2024 * Released on: May 13, 2024
*/ */
@font-face { @font-face {
font-family: 'swiper-icons'; font-family: 'swiper-icons';

View File

@ -268,31 +268,30 @@ export const dynamicFilterTypeMixin = {
} }
} }
if (this.shouldAddOptions === true && this.searchResults && this.searchResults.length) if ( this.shouldAddOptions === true && this.searchResults && this.searchResults.length )
this.searchResults = this.searchResults.concat(sResults); this.searchResults = this.searchResults.concat(sResults);
else else
this.searchResults = sResults; this.searchResults = sResults;
if (opts) { if ( opts ) {
if (this.shouldAddOptions === true && this.options && this.options.length) if (this.shouldAddOptions === true && this.options && this.options.length)
this.options = this.options.concat(opts) this.options = this.options.concat(opts)
else else
this.options = opts; this.options = opts;
} }
else if(!search) else if ( !search )
this.noMorePage = 1; this.noMorePage = 1;
if (this.options.length < this.maxNumOptionsCheckboxList && !search) if ( this.options.length < this.maxNumOptionsCheckboxList && !search )
this.noMorePage = 1; this.noMorePage = 1;
if ((this.filterTypeOptions.use_max_options == true && this.filter.max_options) && this.options.length >= this.filter.max_options) { if ( ( this.filterTypeOptions && this.filterTypeOptions.use_max_options == true && this.filter.max_options ) && this.options.length >= this.filter.max_options ) {
let showViewAllButton = true; let showViewAllButton = true;
if (this.options.length === this.filter.max_options){ if ( this.options.length === this.filter.max_options )
this.options[this.filter.max_options-1].showViewAllButton = showViewAllButton; this.options[this.filter.max_options-1].showViewAllButton = showViewAllButton;
} else { else
this.options[this.options.length-1].showViewAllButton = showViewAllButton; this.options[this.options.length-1].showViewAllButton = showViewAllButton;
}
} }
}, },
prepareOptionsForRelationship(items, search, valuesToIgnore, isInCheckboxModal) { prepareOptionsForRelationship(items, search, valuesToIgnore, isInCheckboxModal) {
@ -340,32 +339,31 @@ export const dynamicFilterTypeMixin = {
} }
} }
if (this.shouldAddOptions === true && this.searchResults && this.searchResults.length) if ( this.shouldAddOptions === true && this.searchResults && this.searchResults.length )
this.searchResults = this.searchResults.concat(sResults); this.searchResults = this.searchResults.concat(sResults);
else else
this.searchResults = sResults; this.searchResults = sResults;
if (opts) { if ( opts ) {
if (this.shouldAddOptions === true && this.options && this.options.length) if (this.shouldAddOptions === true && this.options && this.options.length)
this.options = this.options.concat(opts) this.options = this.options.concat(opts)
else else
this.options = opts; this.options = opts;
} }
else if(!search) else if ( !search )
this.noMorePage = 1; this.noMorePage = 1;
if (this.options.length < this.maxNumOptionsCheckboxList) if ( this.options.length < this.maxNumOptionsCheckboxList )
this.noMorePage = 1; this.noMorePage = 1;
if ((this.filterTypeOptions.use_max_options == true && this.filter.max_options) && this.options.length >= this.filter.max_options) { if ( ( this.filterTypeOptions && this.filterTypeOptions.use_max_options == true && this.filter.max_options ) && this.options.length >= this.filter.max_options ) {
let showViewAllButton = true; let showViewAllButton = true;
if(this.options.length === this.filter.max_options){ if ( this.options.length === this.filter.max_options )
this.options[this.filter.max_options-1].showViewAllButton = showViewAllButton; this.options[this.filter.max_options-1].showViewAllButton = showViewAllButton;
} else { else
this.options[this.options.length-1].showViewAllButton = showViewAllButton; this.options[this.options.length-1].showViewAllButton = showViewAllButton;
}
} }
}, },
}, },