Skip to content

Commit 0e2e225

Browse files
committed
Include AUV type in the moving platform types
1 parent ae586f3 commit 0e2e225

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/components/deployments/map-legend.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
MOVING_PLATFORMS_COLORS,
1212
STATIC_PLATFORMS,
1313
} from "../../utils/platform-colors"
14+
import { MOVING_PLATFORMS } from "../../utils/constants"
1415

1516
export const LegendItem = ({
1617
name,
@@ -70,10 +71,10 @@ export const MapLegend = ({
7071
(i, index) => names.indexOf(i.name) === index
7172
)
7273
const movingPlatforms = uniquePlatforms.filter(platform =>
73-
["Jet", "Prop", "UAV", "Ships/Boats"].includes(platform.type)
74+
MOVING_PLATFORMS.includes(platform.type)
7475
)
7576
const staticPlatforms = uniquePlatforms.filter(
76-
platform => !["Jet", "Prop", "UAV", "Ships/Boats"].includes(platform.type)
77+
platform => !MOVING_PLATFORMS.includes(platform.type)
7778
)
7879

7980
return (

src/components/deployments/map.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { GlobeMap } from "../map/globe-map"
1919
import { MapLegend } from "./map-legend"
2020
import { MapViewControl } from "./map-view-control"
2121
import bbox from "@turf/bbox"
22+
import { MOVING_PLATFORMS } from "../../utils/constants"
2223

2324
const MapErrorMsg = styled.div`
2425
background: rgba(255, 255, 255, 0.1);
@@ -87,9 +88,7 @@ export const DeploymentMap = ({
8788
.map(i => ({ name: i.item.shortname, type: i.item.platformType.shortname }))
8889
.map(i => i.name)
8990
let movingPlatforms = platforms
90-
.filter(platform =>
91-
["Jet", "Prop", "UAV", "Ships/Boats"].includes(platform.type)
92-
)
91+
.filter(platform => MOVING_PLATFORMS.includes(platform.type))
9392
.map(platform => platform.name)
9493

9594
const lineColorsPaint = getLineColors(

src/components/map/globe-map.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
} from "../../utils/platform-colors"
2222
import "./deck-gl.css"
2323
import { colors } from "../../theme"
24+
import { MOVING_PLATFORMS } from "../../utils/constants"
2425

2526
const INITIAL_VIEW_STATE = {
2627
longitude: -98,
@@ -43,9 +44,7 @@ export function GlobeMap({
4344
deployments.flatMap(d => d.collectionPeriods)
4445
).map(i => ({ name: i.item.shortname, type: i.item.platformType.shortname }))
4546
const movingPlatforms = platforms
46-
.filter(platform =>
47-
["Jet", "Prop", "UAV", "Ships/Boats"].includes(platform.type)
48-
)
47+
.filter(platform => MOVING_PLATFORMS.includes(platform.type))
4948
.map(platform => platform.name)
5049

5150
useEffect(() => {

src/utils/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ export const FEEDBACK_FORM_URL =
3535

3636
export const API_DOCUMENTATION_URL =
3737
"https://nasa-impact.github.io/admg-backend/documentation/api_doc.html"
38+
39+
export const MOVING_PLATFORMS = ["Jet", "Prop", "UAV", "AUV", "Ships/Boats"]

0 commit comments

Comments
 (0)