Upstream sync
This commit is contained in:
@@ -5,6 +5,10 @@ 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) {
|
||||
@@ -53,8 +57,9 @@ class MainApp extends React.Component {
|
||||
<Footer />
|
||||
</div>
|
||||
</section>
|
||||
<Notifications user={this.state.user} onRideUpdate={this.handleRide} />
|
||||
{/* <Notification user={this.state.user} onRideUpdate={this.handleRide} /> */}
|
||||
{!loggedUser.anyOf(visitReporter) &&
|
||||
<Notifications user={this.state.user} onRideUpdate={this.handleRide} />
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,9 @@ export class NEMTLocation extends React.Component {
|
||||
long: 0,
|
||||
name: '',
|
||||
address: '',
|
||||
}
|
||||
},
|
||||
searchingProvider: false,
|
||||
providerList: [],
|
||||
}
|
||||
|
||||
this.addCustomLabel = this.addCustomLabel.bind(this);
|
||||
@@ -257,7 +259,7 @@ export class NEMTLocation extends React.Component {
|
||||
return p;
|
||||
});
|
||||
|
||||
this.setState(Object.assign(this.state, { nearbyPlaces: nearByPlaces, providers: providers }));
|
||||
this.setState(Object.assign(this.state, { nearbyPlaces: nearByPlaces, providers: providers, providerList: nearByPlaces }));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -343,7 +345,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 }));
|
||||
self.setState(Object.assign(self.state, { buttonValue: buttonText, inputValue: name.address, searchingProvider: false, providerList: [] }));
|
||||
}).catch(console.error);
|
||||
}
|
||||
|
||||
@@ -569,7 +571,7 @@ export class NEMTLocation extends React.Component {
|
||||
|
||||
updateTextSearch(searchText, dtSource, params) {
|
||||
let self = this;
|
||||
self.setState(Object.assign(self.state, { inputValue: searchText }));
|
||||
self.setState(Object.assign(self.state, { inputValue: searchText, searchingProvider: true }));
|
||||
if (searchText.length >= 3) {
|
||||
let lat = 0;
|
||||
let long = 0;
|
||||
@@ -618,9 +620,11 @@ export class NEMTLocation extends React.Component {
|
||||
clickResult.npi = p.fivePartKeyGroups[0].providerNum;
|
||||
}
|
||||
|
||||
return p;
|
||||
var listItem = (<ListItem primaryText={p.providerName} secondaryText={clickResult.address} key={p.mukId} rightIcon={<MapsLocalHospital />} onClick={(event) => this.handlePlaceChanged(clickResult)} />)
|
||||
return listItem;
|
||||
});
|
||||
this.setState(Object.assign(this.state, { providers: providers }));
|
||||
|
||||
this.setState(Object.assign(this.state, { providerList: providers }));
|
||||
dtSource = self.state.providers;
|
||||
}
|
||||
});
|
||||
@@ -1331,14 +1335,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={5} 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={50} 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={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} />)
|
||||
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} />)
|
||||
}
|
||||
|
||||
let listItem = (
|
||||
<div className="" id="container">
|
||||
<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} />
|
||||
<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>
|
||||
{this.state.currentLocation}
|
||||
@@ -1352,8 +1356,21 @@ 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">
|
||||
|
||||
@@ -715,18 +715,42 @@ class VerticalNonLinear extends React.Component {
|
||||
"gender": self.state.user.gender,
|
||||
"member": self.state.user.member,
|
||||
"birthdate": self.state.user.birthdate,
|
||||
"type": self.state.user.type,
|
||||
"type": "S",
|
||||
"email": self.state.user.email,
|
||||
"phonenumber": self.state.user.phonenumber
|
||||
},
|
||||
"visit_datetime": self.state.visitTime,
|
||||
"pickup_datetime": self.state.pickupTime,
|
||||
"external_id": self.state.visit_external_id,
|
||||
"provider": self.state.destination.raw
|
||||
"raw_provider": self.state.destination.raw
|
||||
};
|
||||
|
||||
Instance.getRawConn().post('/v1/nemt/visits/', visit).then(function (res) {
|
||||
window.location.href = '/#/app/table/visits';
|
||||
const returnMessage = [
|
||||
{
|
||||
message: `Member: ${res.data.user.name} (${res.data.user.member}`
|
||||
},
|
||||
{
|
||||
message: `Gender: ${res.data.user.gender}`
|
||||
},
|
||||
{
|
||||
message: `Birth date: ${visit.user.type}`
|
||||
},
|
||||
{
|
||||
message: `Member Type: ${res.data.user.birthdate}`
|
||||
},
|
||||
{
|
||||
message: `Provider: ${res.data.provider.name}`
|
||||
},
|
||||
{
|
||||
message: `Date: ${res.data.visit_datetime}`
|
||||
}]
|
||||
|
||||
self.setState(Object.assign(self.state, {
|
||||
showValidationErrors: true,
|
||||
validationErrors: returnMessage,
|
||||
errorTitle: "Visit Added"
|
||||
}));
|
||||
}).catch(console.error);
|
||||
break;
|
||||
default:
|
||||
@@ -860,7 +884,7 @@ class VerticalNonLinear extends React.Component {
|
||||
)}
|
||||
{step === 2 && (
|
||||
<RaisedButton
|
||||
label="Confirm"
|
||||
label="Add Visit"
|
||||
disableTouchRipple
|
||||
disableFocusRipple
|
||||
primary
|
||||
@@ -1093,7 +1117,7 @@ class VerticalNonLinear extends React.Component {
|
||||
<div className="box-body padding-xs">
|
||||
|
||||
<div style={{ maxWidth: 380, margin: 'auto' }}>
|
||||
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} />
|
||||
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} errorTitle={this.state.errorTitle} />
|
||||
<Stepper
|
||||
activeStep={this.state.stepIndex}
|
||||
linear={false}
|
||||
@@ -1156,7 +1180,7 @@ class VerticalNonLinear extends React.Component {
|
||||
|
||||
|
||||
{/* <TabsSection /> */}
|
||||
{this.renderStepActions(1, this)}
|
||||
{this.renderStepActions(2, this)}
|
||||
</StepContent>
|
||||
</Step>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ const getDTList = function (member) {
|
||||
member.forEach((r, i) => {
|
||||
let bookRide = '';
|
||||
if (r.trip_type.key === 'no_trip') {
|
||||
bookRide = (<a href={`/#/app/form/visitride/${r.visit_uuid}`}>Book Ride</a>)
|
||||
bookRide = (<a href={`/#/app/form/visitride/${r.visit_uuid}`}>Book Ride </a>)
|
||||
}
|
||||
|
||||
list.push(
|
||||
@@ -48,8 +48,8 @@ const getDTList = function (member) {
|
||||
<td>{moment(r.visit_datetime).format('MM/DD/YYYY - h:mm a')}</td>
|
||||
<td><a href={""}>{r.provider.name}</a></td>
|
||||
<td><a href={"/#/app/member/" + r.user.useruuid}>{r.user.name}</a></td>
|
||||
<td>{bookRide}</td>
|
||||
<td><RoadTripLink rides={r.rides} isOpened={false} currentRide={null} visit={r} onRideClick={handleRide} /></td>
|
||||
|
||||
<td> <RoadTripLink rides={r.rides} isOpened={false} currentRide={null} visit={r} onRideClick={handleRide} /> {bookRide} </td>
|
||||
<td><a href={"/#/app/member/" + r.user.useruuid}>{r.user.member}</a></td>
|
||||
<td>{r.provider.provider_uuid}</td>
|
||||
<td>{r.visit_uuid}</td>
|
||||
@@ -236,7 +236,7 @@ class DatatableComponent extends React.Component {
|
||||
<th>Visit Time</th>
|
||||
<th>Provider</th>
|
||||
<th>Member </th>
|
||||
<th>Ride</th>
|
||||
{/* <th>Ride</th> */}
|
||||
<th>Rides </th>
|
||||
<th>Subscriber ID</th>
|
||||
<th>Provider ID</th>
|
||||
|
||||
Reference in New Issue
Block a user