-
Notifications
You must be signed in to change notification settings - Fork 40
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
Update task creation form #743
Conversation
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
… names Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
…waypoint options only for that type Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #743 +/- ##
==========================================
- Coverage 54.65% 54.52% -0.14%
==========================================
Files 263 263
Lines 6528 6548 +20
Branches 862 865 +3
==========================================
+ Hits 3568 3570 +2
- Misses 2820 2838 +18
Partials 140 140
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
This looks really great!
I just left a small comment that you might consider
The code looks nice too!
Thanks, Aaron!
LGTM!
for (const level of buildingMap.levels) { | ||
for (const graphs of level.nav_graphs) { | ||
for (const vertex of graphs.vertices) { | ||
if (vertex.name) { | ||
const place: Place = { level: level.name, vertex }; | ||
for (const p of vertex.params) { | ||
if (p.name === DEFAULT_PICKUP_POINT_PARAM_NAME) { | ||
pickupPoints.set(vertex.name, place); | ||
} | ||
if (p.name === DEFAULT_DROPOFF_POINT_PARAM_NAME) { | ||
dropoffPoints.set(vertex.name, place); | ||
} | ||
if (p.name === DEFAULT_CLEANING_ZONE_PARAM_NAME) { | ||
cleaningZones.set(vertex.name, place); | ||
} | ||
} | ||
places.set(vertex.name, place); | ||
} | ||
} | ||
} | ||
} |
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: Maybe we can use destructuring and switch here
for (const level of buildingMap.levels) { | |
for (const graphs of level.nav_graphs) { | |
for (const vertex of graphs.vertices) { | |
if (vertex.name) { | |
const place: Place = { level: level.name, vertex }; | |
for (const p of vertex.params) { | |
if (p.name === DEFAULT_PICKUP_POINT_PARAM_NAME) { | |
pickupPoints.set(vertex.name, place); | |
} | |
if (p.name === DEFAULT_DROPOFF_POINT_PARAM_NAME) { | |
dropoffPoints.set(vertex.name, place); | |
} | |
if (p.name === DEFAULT_CLEANING_ZONE_PARAM_NAME) { | |
cleaningZones.set(vertex.name, place); | |
} | |
} | |
places.set(vertex.name, place); | |
} | |
} | |
} | |
} | |
for (const level of buildingMap.levels) { | |
for (const graphs of level.nav_graphs) { | |
for (const vertex of graphs.vertices) { | |
const { name, params } = vertex; | |
if (!name) { | |
continue; | |
} | |
const place: Place = { level: level.name, vertex }; | |
for (const p of params) { | |
switch (p.name) { | |
case DEFAULT_PICKUP_POINT_PARAM_NAME: | |
pickupPoints.set(name, place); | |
break; | |
case DEFAULT_DROPOFF_POINT_PARAM_NAME: | |
dropoffPoints.set(name, place); | |
break; | |
case DEFAULT_CLEANING_ZONE_PARAM_NAME: | |
cleaningZones.set(name, place); | |
break; | |
} | |
} | |
places.set(name, place); | |
} | |
} | |
} |
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.
I've just refactored the if case! Thanks for catching that, @Angatupyry!
Although the repeated if cases look ugly, I think I'll keep it that way since we have no guarantees that a single waypoint can't have multiple of these params (e.g. all 3), also I believe switch statements should be reserved for enums or simple number and chars, I don't think we should be comparing strings that way.
I'll go ahead and merge this now! Thanks!
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
What's new
Loop
toPatrol
Self-checks