-
Notifications
You must be signed in to change notification settings - Fork 35
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
Connect to new endpoint for fetching specifically task markers #2356
base: main
Are you sure you want to change the base?
Connect to new endpoint for fetching specifically task markers #2356
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2356 +/- ##
==========================================
- Coverage 23.51% 23.47% -0.04%
==========================================
Files 649 649
Lines 22502 22543 +41
Branches 6928 6962 +34
==========================================
+ Hits 5292 5293 +1
- Misses 14398 14425 +27
- Partials 2812 2825 +13 ☔ View full report in Codecov by Sentry. |
6d15d50
to
6d12185
Compare
1ec4d33
to
cd66497
Compare
cd66497
to
7054879
Compare
7054879
to
f231806
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions on how to simplify the code and reduce dependence on Lodash.
src/services/Task/BoundedTask.js
Outdated
// If we are searching within map bounds we need to ensure the parent | ||
// challenge is also within those bounds | ||
if (filters.location === CHALLENGE_LOCATION_WITHIN_MAPBOUNDS) { | ||
if (_isArray(criteria.boundingBox)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array.isArray()
would work here
src/services/Task/BoundedTask.js
Outdated
return { | ||
tasks, | ||
totalCount | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does fetchBoundedTaskMarkers
need to return both the array of tasks and the array's length? Seems redundant.
src/services/Task/BoundedTask.js
Outdated
* criteria, which should at least include a boundingBox field, and may | ||
* optionally include a filters field with additional constraints | ||
*/ | ||
export const fetchBoundedTaskMarkers = function(criteria, limit = 50, skipDispatch = false, ignoreLocked = true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you can write export function fetchBoundedTaskMarkers(criteria, ...) {
instead; it's shorter.
Co-authored-by: Jake Low <[email protected]>
Co-authored-by: Jake Low <[email protected]>
Co-authored-by: Jake Low <[email protected]>
Co-authored-by: Jake Low <[email protected]>
Co-authored-by: Jake Low <[email protected]>
Co-authored-by: Jake Low <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for making the changes I suggested
resolves: #2354
Paired with and dependent on: maproulette/maproulette-backend#1130
Issue: The old endpoint used for fetching task markers was needlessly complex and slow.
This PR connect to the simpler endpoint used to fetch specifically marker data.