Skip to content

Commit 1953f30

Browse files
critzojeremiak
andauthored
Fix rollback (#217)
Completes remaining rollback items that were missed in previous PR. Tested in FF and Chrome. Merging to expedite creation of new release tag. * Add MLab data to <InfoPanel /> table view * exclude src/vectortiles from being checked by eslint * removed residual gmaps stuff * update package-lock.json after npm install * remove attempt at quickly adding server location display * rolled back changes in lat/lon submissions to previous version in https://github.com/m-lab/piecewise/blob/37822ab3c5de19c26fd046dd81dd7ec3cd411df0/src/frontend/components/Survey.jsx * rolled back changes in lat/lon submissions to previous version in 37822ab Co-authored-by: Jeremia Kimelman <jbkimelman@gmail.com>
1 parent cad6564 commit 1953f30

File tree

9 files changed

+30094
-416
lines changed

9 files changed

+30094
-416
lines changed

docs

Submodule docs updated from c313d9f to 44547f3

package-lock.json

Lines changed: 30067 additions & 190 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
"html-loader": "^0.5.5",
172172
"html-webpack-harddisk-plugin": "^1.0.1",
173173
"html-webpack-plugin": "^3.2.0",
174-
"husky": "^2.3.0",
174+
"husky": "^6.0.0",
175175
"jest": "^25.3.0",
176176
"jest-each": "^26.1.0",
177177
"jsdoc": "^3.6.4",

src/frontend/components/App.jsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'react-form-builder2/dist/app.css';
99
import Error from './Error.jsx';
1010

1111
const Front = lazy(() => import('./Front.jsx'));
12-
const GoogleMaps = lazy(() => import('./GoogleMaps.jsx'));
1312
const Loading = lazy(() => import('./Loading.jsx'));
1413
const Login = lazy(() => import('./Login.jsx'));
1514
const Dashboard = lazy(() => import('./Dashboard.jsx'));
@@ -84,10 +83,6 @@ export default function App() {
8483
/>
8584
<Route path="/thankyou" render={props => <ThankYou {...props} />} />
8685
<Route path="/survey" render={props => <Survey {...props} />} />
87-
<Route
88-
path="/geocoder"
89-
render={props => <GoogleMaps {...props} />}
90-
/>
9186
</LazyBoundary>
9287
<Redirect to="/" />
9388
</Switch>

src/frontend/components/Front.jsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function Basic() {
8282
};
8383

8484
// handle geolocation consent
85-
const [locationConsent, setLocationConsent] = useState(false);
85+
const [locationConsent, setLocationConsent] = useState(true);
8686
// site settings
8787
const [settings, setSettings] = useState({});
8888

@@ -145,7 +145,7 @@ export default function Basic() {
145145
const handleSubmit = event => {
146146
event.preventDefault();
147147
history.push({
148-
pathname: '/geocoder',
148+
pathname: '/survey',
149149
state: { settings: settings, locationConsent: locationConsent },
150150
});
151151
};
@@ -195,6 +195,26 @@ export default function Basic() {
195195
</Col>
196196
</Row>
197197
<Form onSubmit={handleSubmit}>
198+
<fieldset>
199+
<Form.Group>
200+
<Form.Label>Do you want to use your browser location?</Form.Label>
201+
<Form.Check
202+
type="radio"
203+
name="location"
204+
id="location-yes"
205+
label="Use my browser location"
206+
onChange={() => setLocationConsent(true)}
207+
defaultChecked
208+
/>
209+
<Form.Check
210+
type="radio"
211+
name="location"
212+
id="location-no"
213+
label="Do not use my location"
214+
onChange={() => setLocationConsent(false)}
215+
/>
216+
</Form.Group>
217+
</fieldset>
198218
<Form.Group {...location}>
199219
<Form.Check.Input required type="checkbox" id="consent" />
200220
<Form.Check.Label>

src/frontend/components/GoogleMaps.jsx

Lines changed: 0 additions & 209 deletions
This file was deleted.

src/frontend/components/Survey.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import NdtWidget from './utils/NdtWidget.jsx';
1515
export default function Survey(props) {
1616
const settings = props.location.state.settings;
1717
const locationConsent = props.location.state.locationConsent;
18-
const latitude = props.location.state.latitude;
19-
const longitude = props.location.state.longitude;
2018
const [form, setForm] = React.useState(null);
2119
const [formId, setFormId] = React.useState();
2220
const [location, setLocation] = React.useState({});
@@ -53,8 +51,8 @@ export default function Survey(props) {
5351
c2sRate: results.c2sRate,
5452
s2cRate: results.s2cRate,
5553
MinRTT: results.MinRTT,
56-
latitude: latitude,
57-
longitude: longitude,
54+
latitude: location.latitude,
55+
longitude: location.longitude,
5856
fields: formData,
5957
},
6058
}),
@@ -194,8 +192,6 @@ Survey.propTypes = {
194192
state: PropTypes.shape({
195193
settings: PropTypes.object.isRequired,
196194
locationConsent: PropTypes.bool.isRequired,
197-
latitude: PropTypes.string.isRequired,
198-
longitude: PropTypes.string.isRequired,
199195
}),
200196
}),
201197
};

src/frontend/components/utils/NdtWidget.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export default function NdtWidget(props) {
219219
</Row>
220220
<Row>
221221
<Col>{text}</Col>
222-
</Row>
222+
</Row>
223223
</Container>
224224
);
225225
}

src/frontend/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
crossorigin="anonymous"
2323
/>
2424
<script src="https://api.mapbox.com/mapbox-gl-js/v1.10.1/mapbox-gl.js"></script>
25-
<script src="https://maps.googleapis.com/maps/api/js?key=%PIECEWISE_GOOGLE_KEY%&libraries=places"></script>
2625
<style id="server-side-styles"></style>
2726
</head>
2827
<body>

0 commit comments

Comments
 (0)