Skip to content

Commit 67d8a1c

Browse files
Remove tags from location
1 parent 2d90158 commit 67d8a1c

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

src/scenes/Events/EventEditPopup/LocationInput.jsx

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22

33
import './LocationInput.scss';
44
import Checkbox from 'components/Checkbox';
5-
import { StyledSelect } from 'components/SelectField';
65

76
const 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

5046
export 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
}
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'constants.scss';
1+
@import "constants.scss";
22

33
.location-input {
44
margin: 0 5px;
@@ -11,12 +11,6 @@
1111
@include form-field;
1212
flex: 2;
1313
margin: 0 10px 0 15px;
14-
15-
}
16-
17-
.tags-select {
18-
min-width: 100px;
19-
flex: 1;
2014
}
2115
}
22-
}
16+
}

0 commit comments

Comments
 (0)