-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Domestic/Foreign toggle to affect summary results #30
Conversation
…f letters in "<strong>"
…autocomplete locations
@@ -51,7 +51,7 @@ export default class LocationList extends Typeahead { | |||
this.typeahead.list = this.props.autocompleteLocations; | |||
|
|||
this.props.autocompleteLocations.forEach((value) => { | |||
let key = `<strong>${value.place}</strong><br>${_.upperCase(value.place_type)}`; | |||
let key = `<b>${value.place}</b><br>${_.upperCase(value.place_type)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing this in a new story, since this will affect several filters
@@ -14,7 +14,8 @@ const initialState = { | |||
timePeriodFY: new Set(), | |||
timePeriodStart: null, | |||
timePeriodEnd: null, | |||
selectedLocations: new Set() | |||
selectedLocations: new Set(), | |||
locationDomesticForeign: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the default be all
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, added
{selectedLocations} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default connect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now a container, not a component. The container-related code (anything that has to do with API calls or manipulating data that's not directly display-related) needs to be moved to its parent container (LocationSearchContainer
). Components are not allowed to be connected to Redux directly.
Please refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this all back to LocationListContainer
super(props); | ||
|
||
this.state = { | ||
locationOption: 'all', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Redux now tracks the locationDomesticForeign
value, the autocomplete location scope should be controlled by Redux (ie, read from the props, write via the action rather than maintain its own state).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
placeHolder="State, City, County, ZIP, or District" | ||
ref={(input) => { | ||
this.locationList = input; | ||
}} /> | ||
); | ||
} | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has this container been disconnected from Redux? If a container is no longer required, delete the entire file and just use the child component. However, remember that components should be dumb, in other words they do not directly make API calls, they only perform logic related to display and layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved Redux implementation back to this container
… radio button labels, handled country selection toggle completely through Redux instead of a component state, set default option for locationDomesticForeign
No description provided.