@@ -24,7 +24,6 @@ import {
2424 useStateFromPublishingSubject ,
2525} from '@kbn/presentation-publishing' ;
2626
27- import { OptionsListSelection } from '../../../../../common/options_list' ;
2827import { getCompatibleSearchTechniques } from '../../../../../common/options_list/suggestions_searching' ;
2928import { useOptionsListContext } from '../options_list_context_provider' ;
3029import { OptionsListPopoverSortingButton } from './options_list_popover_sorting_button' ;
@@ -65,8 +64,6 @@ export const OptionsListPopoverActionBar = ({
6564 api . availableOptions$
6665 ) ;
6766
68- console . log ( 'availableOptions' , availableOptions ) ;
69- console . log ( 'selectedOptions' , selectedOptions ) ;
7067 const compatibleSearchTechniques = useMemo ( ( ) => {
7168 if ( ! field ) return [ ] ;
7269 return getCompatibleSearchTechniques ( field . type ) ;
@@ -120,9 +117,9 @@ export const OptionsListPopoverActionBar = ({
120117 isDisabled = { ! availableOptions || totalCardinality < 0 || totalCardinality > 100 }
121118 onClick = { ( ) => {
122119 const availableOptionValues = (
123- availableOptions ?. map ( ( { value } ) => value ) ?? [ ]
120+ availableOptions ?. map ( ( { value } ) => value as string ) ?? [ ]
124121 ) . filter ( ( value ) => ! selectedOptions . includes ( value ) ) ;
125- availableOptionValues ? .forEach ( ( value : string ) => {
122+ availableOptionValues . forEach ( ( value : string ) => {
126123 api . makeSelection ( value , showOnlySelected ) ;
127124 } ) ;
128125 } }
@@ -135,9 +132,9 @@ export const OptionsListPopoverActionBar = ({
135132 isDisabled = { totalCardinality > 100 }
136133 onClick = { ( ) => {
137134 const availableOptionValues = (
138- availableOptions ?. map ( ( { value } ) => value ) ?? [ ]
135+ availableOptions ?. map ( ( { value } ) => value as string ) ?? [ ]
139136 ) . filter ( ( value ) => selectedOptions . includes ( value ) ) ;
140- availableOptionValues ? .forEach ( ( value : string ) => {
137+ availableOptionValues . forEach ( ( value : string ) => {
141138 api . makeSelection ( value , showOnlySelected ) ;
142139 } ) ;
143140 } }
0 commit comments