@@ -10,6 +10,7 @@ import FormCheckbox from "../../../util/forms/form-checkbox";
1010import {
1111 formatDate ,
1212 getHeaders ,
13+ getSingleSearchOptions ,
1314 loadDropdownOptionsPromise ,
1415} from "./poster-helper" ;
1516
@@ -51,6 +52,8 @@ function PosterSingle({ configurationChange, feedSource, configuration }) {
5152 const optionsEndpoint = firstAdminEntry . endpointOption ?? null ;
5253 const entityEndpoint = firstAdminEntry . endpointEntity ?? null ;
5354
55+ const singleSearchTypeOptions = getSingleSearchOptions ( t ) ;
56+
5457 const removeSingleSelected = ( ) => {
5558 configurationChange ( {
5659 targets : [
@@ -66,34 +69,6 @@ function PosterSingle({ configurationChange, feedSource, configuration }) {
6669 } ) ;
6770 } ;
6871
69- const singleSearchTypeOptions = [
70- {
71- key : "singleSearchTypeOptions1" ,
72- value : "title" ,
73- title : t ( "single-search-type-title" ) ,
74- } ,
75- {
76- key : "singleSearchTypeOptions2" ,
77- value : "url" ,
78- title : t ( "single-search-type-url" ) ,
79- } ,
80- {
81- key : "singleSearchTypeOptions3" ,
82- value : "organizations" ,
83- title : t ( "single-search-type-organization" ) ,
84- } ,
85- {
86- key : "singleSearchTypeOptions4" ,
87- value : "locations" ,
88- title : t ( "single-search-type-location" ) ,
89- } ,
90- {
91- key : "singleSearchTypeOptions5" ,
92- value : "tags" ,
93- title : t ( "single-search-type-tag" ) ,
94- } ,
95- ] ;
96-
9772 const handleSelectEvent = ( eventId , occurrenceIds = [ ] ) => {
9873 if ( ! eventId ) {
9974 return ;
@@ -214,7 +189,7 @@ function PosterSingle({ configurationChange, feedSource, configuration }) {
214189 const timeoutRef = useRef ( null ) ;
215190
216191 const debounceOptions = ( inputValue ) => {
217- // Debounce promise .
192+ // Debounce result to avoid searching while typing .
218193 return new Promise ( ( resolve , reject ) => {
219194 if ( timeoutRef . current ) {
220195 clearTimeout ( timeoutRef . current ) ;
0 commit comments