Skip to content
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

Make it easier to debug issues with draft trips #1175

Merged
merged 2 commits into from
Sep 12, 2024
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
1 change: 1 addition & 0 deletions config.cordovabuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<content src="index.html" />
<access origin="*" />
<hook src="hooks/before_prepare/download_translation.js" type="before_prepare" />
<preference name="InspectableWebview" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
Expand Down
1 change: 1 addition & 0 deletions config.serve.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<content src="index.html" />
<access origin="*" />
<hook src="hooks/before_prepare/download_translation.js" type="before_prepare" />
<preference name="InspectableWebview" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
Expand Down
17 changes: 10 additions & 7 deletions www/js/diary/timelineHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,16 @@

logDebug(`mapping trips to tripObjs of size ${rawTripObjs.length}`);
/* Filtering: we will keep trips that are 1) defined and 2) have a distance >= 100m,
or duration >= 5 minutes
https://github.com/e-mission/e-mission-docs/issues/966#issuecomment-1709112578 */
const tripObjs = rawTripObjs.filter(
(trip) => trip && (trip.distance >= 100 || trip.duration >= 300),
);
logDebug(`after filtering undefined and distance < 100m,
tripObjs size = ${tripObjs.length}`);
or duration >= 5 minutes
https://github.com/e-mission/e-mission-docs/issues/966#issuecomment-1709112578 */
const tripObjs = rawTripObjs.filter((trip) => {
if (!trip || trip.distance < 100 || trip.duration < 300) {
logDebug(`Trip ${JSON.stringify(trip)} is falsy, < 100m, or < 5 min. Dropping`);
return false;

Check warning on line 629 in www/js/diary/timelineHelper.ts

View check run for this annotation

Codecov / codecov/patch

www/js/diary/timelineHelper.ts#L628-L629

Added lines #L628 - L629 were not covered by tests
}
return true;
});
logDebug(`after filtering, tripObjs size = ${tripObjs.length}`);
// Link 0th trip to first, first to second, ...
for (let i = 0; i < tripObjs.length - 1; i++) {
linkTrips(tripObjs[i], tripObjs[i + 1]);
Expand Down
Loading