-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from jpedroh/release/v4.1.0
release/v4.1.0
- Loading branch information
Showing
20 changed files
with
645 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@mach/common", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "> TODO: description", | ||
"author": "Joao Pedro Henrique <[email protected]>", | ||
"homepage": "https://github.com/jpedroh/mach#readme", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@mach/database", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "> TODO: description", | ||
"author": "Joao Pedro Henrique <[email protected]>", | ||
"homepage": "https://github.com/jpedroh/mach#readme", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Flight from '@mach/common' | ||
import formatEet from '../utils/format-eet' | ||
import formatFlightRules from '../utils/format-flight-rules' | ||
|
||
const getIcaoFpl = (flight: Flight): string => { | ||
return [ | ||
`(FPL-${flight.callsign}-${formatFlightRules(flight.flightRules)}S`, | ||
`-1/${flight.aircraft.icaoCode}/${flight.aircraft.wakeTurbulence}-${flight.aircraft.equipment}/L1B1`, | ||
`-${flight.arrivalIcao}${flight.estimatedOffBlockTime}`, | ||
`-${flight.cruisingSpeed}F${flight.cruisingLevel} ${flight.route}`, | ||
`-${flight.arrivalIcao}${formatEet(flight.estimatedEnrouteMinutes)}`, | ||
`-${flight.remarks})` | ||
].join('\n') | ||
} | ||
|
||
export default getIcaoFpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import Flight from '@mach/common' | ||
import React from 'react' | ||
import Button from 'react-bootstrap/Button' | ||
import formatEet from '../utils/format-eet' | ||
import formatFlightRules from '../utils/format-flight-rules' | ||
|
||
type IvaoButtonProps = { | ||
flight: Flight | ||
} | ||
|
||
const IvaoButton: React.FC<IvaoButtonProps> = ({ flight }) => { | ||
return ( | ||
<form | ||
id="ivaoform" | ||
action="https://fpl.ivao.aero/api/fp/load" | ||
method="POST" | ||
target="_blank" | ||
> | ||
<input type="hidden" name="CALLSIGN" value={flight.callsign} /> | ||
<input | ||
type="hidden" | ||
name="RULES" | ||
value={formatFlightRules(flight.flightRules)} | ||
/> | ||
<input type="hidden" name="FLIGHTTYPE" value="S" /> | ||
<input type="hidden" name="NUMBER" value="1" /> | ||
<input type="hidden" name="ACTYPE" value={flight.aircraft.icaoCode} /> | ||
<input | ||
type="hidden" | ||
name="WAKECAT" | ||
value={flight.aircraft.wakeTurbulence} | ||
/> | ||
<input type="hidden" name="EQUIPMENT" value={flight.aircraft.equipment} /> | ||
<input type="hidden" name="TRANSPONDER" value="LB1" /> | ||
<input type="hidden" name="DEPICAO" value={flight.departureIcao} /> | ||
<input | ||
type="hidden" | ||
name="DEPTIME" | ||
value={flight.estimatedOffBlockTime} | ||
/> | ||
<input type="hidden" name="SPEEDTYPE" value="N" /> | ||
<input | ||
type="hidden" | ||
name="SPEED" | ||
value={flight.cruisingSpeed.substr(1)} | ||
/> | ||
<input type="hidden" name="LEVELTYPE" value="F" /> | ||
<input type="hidden" name="LEVEL" value={flight.cruisingLevel} /> | ||
<input type="hidden" name="ROUTE" value={flight.route} /> | ||
<input type="hidden" name="DESTICAO" value={flight.arrivalIcao} /> | ||
<input | ||
type="hidden" | ||
name="EET" | ||
value={formatEet(flight.estimatedEnrouteMinutes)} | ||
/> | ||
<input type="hidden" name="OTHER" value={flight.remarks} /> | ||
|
||
<Button type="submit" variant="primary"> | ||
File IVAO FP | ||
</Button> | ||
</form> | ||
) | ||
} | ||
|
||
export default IvaoButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
const isProd = process.env.NODE_ENV === 'production' | ||
|
||
module.exports = { | ||
basePath: '/mach', | ||
assetPrefix: '/mach/', | ||
basePath: isProd ? '/mach' : '', | ||
assetPrefix: isProd ? '/mach/' : '' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const formatEet = (eet: number) => { | ||
const hours = Math.floor(eet / 60) | ||
const minutes = eet % 60 | ||
return `${hours}`.padStart(2, '0') + `${minutes}`.padStart(2, '0') | ||
} | ||
|
||
export default formatEet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FlightRules } from '@mach/common' | ||
|
||
const formatFlightRules = (flightRule: FlightRules): string => { | ||
const mappings = {} | ||
mappings[FlightRules.IFR] = 'I' | ||
mappings[FlightRules.Y] = 'Y' | ||
mappings[FlightRules.Z] = 'Z' | ||
return mappings[flightRule] | ||
} | ||
|
||
export default formatFlightRules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Flight, { FlightRules, WakeTurbulence } from '@mach/common' | ||
|
||
const makeBlankFlight = (): Flight => ({ | ||
callsign: '', | ||
beginDate: new Date(), | ||
company: '', | ||
flightNumber: 0, | ||
aircraft: { | ||
icaoCode: '', | ||
equipment: '', | ||
wakeTurbulence: WakeTurbulence.LIGHT | ||
}, | ||
departureIcao: '', | ||
estimatedOffBlockTime: '0000', | ||
cruisingSpeed: '', | ||
weekdays: [], | ||
cruisingLevel: 0, | ||
route: '', | ||
arrivalIcao: '', | ||
estimatedEnrouteMinutes: 0, | ||
remarks: '', | ||
flightRules: FlightRules.IFR | ||
}) | ||
|
||
export default makeBlankFlight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
"contact": { | ||
"email": "[email protected]" | ||
}, | ||
"version": "4.0.0" | ||
"version": "4.1.0" | ||
}, | ||
"servers": [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@mach/rest-api", | ||
"private": true, | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "> TODO: description", | ||
"author": "Joao Pedro Henrique <[email protected]>", | ||
"homepage": "https://github.com/jpedroh/mach#readme", | ||
|
@@ -21,9 +21,9 @@ | |
"url": "https://github.com/jpedroh/mach/issues" | ||
}, | ||
"dependencies": { | ||
"express": "^4.17.1", | ||
"@mach/common": "^4.0.0", | ||
"@mach/database": "^4.0.0" | ||
"@mach/database": "^4.0.0", | ||
"express": "^4.17.1" | ||
}, | ||
"devDependencies": { | ||
"@types/express": "^4.17.7" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.