Skip to content

Commit

Permalink
format mission id and improve default val
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseflorig committed Mar 20, 2023
1 parent 71f784b commit 0d66740
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dashboard/src/AirTaskingOrderCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ MissionStatus.propTypes = {

export default function AirTaskingOrderCard({msnData}){
const {intel} = msnData
const {msn_id: msnId} = intel
const {msn_id: msnId = "unk"} = intel

return (
<Card px={4} py={2}>
<Stack spacing={6}>
<Heading size="lg">{`Mission ${msnId}`}</Heading>
<Heading size="lg">{`Mission ${msnId.toUpperCase()}`}</Heading>
<MissionStatus states={msnData} />
<MissionMeta intel={intel}/>
</Stack>
Expand Down
14 changes: 5 additions & 9 deletions msn-data-server/msn-data-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,11 @@ def do_GET(self):
data = {}
shopData = json.load(file)

# If not intel, delete msn meta data
if SHOP != "intel":
del shopData['msn_id']
del shopData['msn_takeoff']
del shopData['msn_return']
del shopData['msn_platform']
del shopData['msn_target']

data[SHOP] = shopData
# If not intel, strip msn meta data
if SHOP == "intel":
data[SHOP] = shopData
else:
data[SHOP] = {key:shopData[key] for key in shopData if key == 'status'}

self._set_headers()
self.wfile.write(json.dumps(data).encode('utf-8'))
Expand Down

0 comments on commit 0d66740

Please sign in to comment.