Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"history": "^1.17.0",
"html5-uploader": "^0.1.1",
"isomorphic-fetch": "^2.2.1",
"js-cookie": "^2.1.4",
"linkify-it": "^2.0.3",
"lodash": "^4.16.4",
"moment": "^2.14.1",
Expand Down
18 changes: 13 additions & 5 deletions src/components/SelectDropdown/SelectDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ class SelectDropdown extends Component {
}

componentWillMount() {
let selectedOption = _.find(this.props.options, (o) => o.value === this.props.value)
if (!selectedOption) {
selectedOption = this.props.options[0]
}
this.setState({
selectedOption: this.props.selectedOption || this.props.options[0]
}, function() {
this.props.setValue(this.state.selectedOption)
})
selectedOption
}/*, function() {
// FIXME intentionally commented because it was causing multiple renders when used in mobility testing template
// Need to further analyze
// It does not seem to add any value either in both of its usage (it is used in App Screens section
// for design projects and in mobility testing projects)
this.props.setValue(this.state.selectedOption.value)
}*/)
}

handleClick(option) {
Expand All @@ -25,7 +33,7 @@ class SelectDropdown extends Component {
this.props.onSelect(this.state.selectedOption)
}
})
this.props.setValue(option)
this.props.setValue(option.value)
}

render() {
Expand Down
6 changes: 5 additions & 1 deletion src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,8 @@ export const LS_INCOMPLETE_PROJECT = 'incompleteProject'

export const CONNECT_MESSAGE_API_URL = process.env.CONNECT_MESSAGE_API_URL || TC_API_URL

export const NEW_PROJECT_PATH = '/new-project'
export const NEW_PROJECT_PATH = '/new-project'

// Analytics constants
export const GA_CLICK_ID = '_gclid'
export const GA_CLIENT_ID = '_gacid'
Loading