@@ -2,7 +2,6 @@ import React from 'react';
22
33import './LocationInput.scss' ;
44import Checkbox from 'components/Checkbox' ;
5- import { StyledSelect } from 'components/SelectField' ;
65
76const locations = [
87 {
@@ -42,10 +41,7 @@ const locations = [
4241 }
4342] ;
4443
45- // const tags = ['DCL', 'KENNEY', 'SIEBEL0', 'SIEBEL1', 'SIEBEL2', 'ECEB1', 'ECEB2', 'ECEB3'];
46- const tags = [ 'SIEBEL0' , 'SIEBEL1' , 'SIEBEL2' , 'CIF' , 'UNION' , 'LEGENDS' ] ;
47-
48- const blankLocation = { description : '' , latitude : 0 , longitude : 0 , tags : [ ] } ;
44+ const blankLocation = { description : '' , latitude : 0 , longitude : 0 } ;
4945
5046export default function LocationCheckbox ( { field, form } ) {
5147 // Note: The description of a selectedLocation may include additional details ("DCL Basement and 1st floor")
@@ -54,16 +50,14 @@ export default function LocationCheckbox({ field, form }) {
5450 const selectedLocations = field . value || [ ] ;
5551
5652 const addLocation = ( location , otherInfo = { } ) => {
57- // otherInfo may be only updating a single field (e.g. tags ) so we set the current
53+ // otherInfo may be only updating a single field (e.g. description ) so we set the current
5854 // values of the other fields as the defaults
5955 const {
6056 details = getDetails ( location ) ,
61- tags = getTags ( location )
6257 } = otherInfo ;
6358
6459 const newLocation = Object . assign ( { } , location ) ;
6560 newLocation . description += ` ${ details } ` ;
66- newLocation . tags = tags ;
6761
6862 // First remove any existing selectedLocations corresponding to this location (for editing details)
6963 form . setFieldValue ( field . name , selectedLocations
@@ -93,8 +87,6 @@ export default function LocationCheckbox({ field, form }) {
9387 return selectedDescription . replace ( location . description , '' ) . trimStart ( ) ;
9488 }
9589
96- const getTags = location => findSelectedLocation ( location . description ) . tags ;
97-
9890 return (
9991 < div className = "location-input" >
10092 {
@@ -113,21 +105,6 @@ export default function LocationCheckbox({ field, form }) {
113105 disabled = { ! isSelected ( location ) }
114106 onChange = { e => addLocation ( location , { details : e . target . value } ) }
115107 />
116-
117- < StyledSelect
118- className = "tags-select"
119- placeholder = "Tags"
120- value = { getTags ( location ) . map ( tag => ( { value : tag , label : tag } ) ) }
121- options = { tags . map ( tag => ( { value : tag , label : tag } ) ) }
122- onChange = { selected => addLocation ( location , { tags : ( selected || [ ] ) . map ( x => x . value ) } ) }
123- isDisabled = { ! isSelected ( location ) }
124- menuPlacement = "top"
125- isMulti = { true }
126- controlShouldRenderValue = { false }
127- hideSelectedOptions = { false }
128- closeMenuOnSelect = { false }
129- isClearable = { false }
130- />
131108 </ div >
132109 ) )
133110 }
0 commit comments