Upstream sync

This commit is contained in:
Senad Uka
2018-05-29 17:02:50 +02:00
parent 3969863cbf
commit 8e52651172
24 changed files with 657 additions and 252 deletions

View File

@@ -5,10 +5,6 @@ import Footer from 'components/Footer';
import Notifications from 'components/Notifications';
import Notification from 'components/Shared/Notification';
import GeolocationService from './Geolocation';
import {
loggedUser,
visitReporter,
} from 'utils/authorization';
class MainApp extends React.Component {
constructor(props) {
@@ -57,9 +53,8 @@ class MainApp extends React.Component {
<Footer />
</div>
</section>
{!loggedUser.anyOf(visitReporter) &&
<Notifications user={this.state.user} onRideUpdate={this.handleRide} />
}
<Notifications user={this.state.user} onRideUpdate={this.handleRide} />
{/* <Notification user={this.state.user} onRideUpdate={this.handleRide} /> */}
</div>
);
}

View File

@@ -151,9 +151,7 @@ export class NEMTLocation extends React.Component {
long: 0,
name: '',
address: '',
},
searchingProvider: false,
providerList: [],
}
}
this.addCustomLabel = this.addCustomLabel.bind(this);
@@ -259,7 +257,7 @@ export class NEMTLocation extends React.Component {
return p;
});
this.setState(Object.assign(this.state, { nearbyPlaces: nearByPlaces, providers: providers, providerList: nearByPlaces }));
this.setState(Object.assign(this.state, { nearbyPlaces: nearByPlaces, providers: providers }));
}
});
} else {
@@ -345,7 +343,7 @@ export class NEMTLocation extends React.Component {
buttonText = buttonText.substring(0, self.state.textSize);
buttonText += '...';
}
self.setState(Object.assign(self.state, { buttonValue: buttonText, inputValue: name.address, searchingProvider: false, providerList: [] }));
self.setState(Object.assign(self.state, { buttonValue: buttonText, inputValue: name.address }));
}).catch(console.error);
}
@@ -571,7 +569,7 @@ export class NEMTLocation extends React.Component {
updateTextSearch(searchText, dtSource, params) {
let self = this;
self.setState(Object.assign(self.state, { inputValue: searchText, searchingProvider: true }));
self.setState(Object.assign(self.state, { inputValue: searchText }));
if (searchText.length >= 3) {
let lat = 0;
let long = 0;
@@ -620,11 +618,9 @@ export class NEMTLocation extends React.Component {
clickResult.npi = p.fivePartKeyGroups[0].providerNum;
}
var listItem = (<ListItem primaryText={p.providerName} secondaryText={clickResult.address} key={p.mukId} rightIcon={<MapsLocalHospital />} onClick={(event) => this.handlePlaceChanged(clickResult)} />)
return listItem;
return p;
});
this.setState(Object.assign(this.state, { providerList: providers }));
this.setState(Object.assign(this.state, { providers: providers }));
dtSource = self.state.providers;
}
});
@@ -1335,14 +1331,14 @@ export class NEMTLocation extends React.Component {
{customAddresses}
<ListItem primaryText="Add Custom Shortcut" rightIcon={<ArrowDropRight />} leftIcon={<MapsLocalHospital />} onClick={(e) => this.handleAddAddress(e, 'custom')} />
</List>)
autosuggest = (<AutoComplete dataSourceConfig={datasourceConfig} dataSource={this.state.providers} filter={this.filterResults} maxSearchResults={50} onUpdateInput={this.updateTextSearch} fullWidth={true} floatingLabelText="Enter the Provider's name or address" onNewRequest={this.handleAutocomplete} searchText={this.state.inputValue} />)
autosuggest = (<AutoComplete dataSourceConfig={datasourceConfig} dataSource={this.state.providers} filter={this.filterResults} maxSearchResults={5} onUpdateInput={this.updateTextSearch} fullWidth={true} floatingLabelText="Enter the Provider's name or address" onNewRequest={this.handleAutocomplete} searchText={this.state.inputValue} />)
} else {
autosuggest = (<AutoComplete dataSourceConfig={datasourceConfig} dataSource={this.state.providers} filter={this.filterResults} maxSearchResults={50} onUpdateInput={this.updateTextSearch} fullWidth={true} floatingLabelText="Enter the Member's address or a nearby intersection or public place" onNewRequest={this.handleAutocomplete} searchText={this.state.inputValue} />)
autosuggest = (<AutoComplete dataSourceConfig={datasourceConfig} dataSource={this.state.providers} filter={this.filterResults} maxSearchResults={5} onUpdateInput={this.updateTextSearch} fullWidth={true} floatingLabelText="Enter the Member's address or a nearby intersection or public place" onNewRequest={this.handleAutocomplete} searchText={this.state.inputValue} />)
}
let listItem = (
<div className="" id="container">
<AutoComplete dataSourceConfig={datasourceConfig} dataSource={this.state.locations} filter={this.filterResults} maxSearchResults={50} onUpdateInput={this.updateLocationValue} fullWidth={true} floatingLabelText="Center Location" onNewRequest={this.handleAutoCompleteLocation} searchText={this.state.locationValue} />
<AutoComplete dataSourceConfig={datasourceConfig} dataSource={this.state.locations} filter={this.filterResults} maxSearchResults={5} onUpdateInput={this.updateLocationValue} fullWidth={true} floatingLabelText="Center Location" onNewRequest={this.handleAutoCompleteLocation} searchText={this.state.locationValue} />
{autosuggest}
<List>
{this.state.currentLocation}
@@ -1356,21 +1352,8 @@ export class NEMTLocation extends React.Component {
<List style={customListStyle}>
{this.state.nearbyPlaces}
</List>
</div>
</div >
)
if (this.state.searchingProvider) {
listItem = (
<div className="" id="container">
<AutoComplete dataSourceConfig={datasourceConfig} dataSource={this.state.locations} filter={this.filterResults} maxSearchResults={50} onUpdateInput={this.updateLocationValue} fullWidth={true} floatingLabelText="Center Location" onNewRequest={this.handleAutoCompleteLocation} searchText={this.state.locationValue} />
{autosuggest}
<List style={customListStyle}>
{this.state.providerList}
</List>
</div>
)
}
if (this.state.addLocation) {
listItem = (
<div className="" id="container">