Skip to content
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

feat(efb): flyPadOS v2 🚀 #4026

Merged
merged 68 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
65ae522
squash: flyPad ui overhaul (flyPadOS v2)
Mar 5, 2021
6cbfc51
fix: merge conflicts
ZigTag Apr 24, 2021
dec222a
quick transitions 🗼
Apr 24, 2021
6701ac3
fix: eslint errors
ZigTag Apr 24, 2021
982931f
fix: layout adaption of throttle config (#4662)
Saschl May 1, 2021
4496e2a
final changes 🚨
May 3, 2021
260e4ef
apply requested changes 🎉
May 4, 2021
a2329a7
add error handling 🥟
May 4, 2021
03852c5
fix peristence 🥖
May 4, 2021
1320a74
fix lint 😡
May 6, 2021
658d44f
feat(efb): EFB Landing Performance ⚡ (#3581)
matt-winfield May 17, 2021
3c25aca
fix issues and ui consistency 🍚
hiaaryan Jun 1, 2021
3b2b605
Merge branch 'master' into flypados-v2
hiaaryan Jun 1, 2021
e3b7fd2
fix lint 🍻
hiaaryan Jun 1, 2021
9ac0662
build: re-add replace entries for flyPadOS 2
Benjozork Jun 3, 2021
e7bc465
fix lint 🍕
hiaaryan Jun 3, 2021
8a21085
fix navigraph env require 🥗
hiaaryan Jun 3, 2021
bd7864f
fix lint 🍠
hiaaryan Jun 3, 2021
aa0d382
Merge branch 'master' into flypados-v2
hiaaryan Jun 3, 2021
3a02880
fix issues 🥨
hiaaryan Jun 3, 2021
d0e47df
Merge branch 'master' into flypados-v2
hiaaryan Jun 3, 2021
053c77c
fix: Fixed compillation errors
ZigTag Jun 3, 2021
4402537
fix readability & dotenv import 🏣
hiaaryan Jun 3, 2021
b32b9fe
fix lint 🚀
hiaaryan Jun 3, 2021
6cf81d1
Merge branch 'master' into flypados-v2
Snapmatics Jun 3, 2021
6a16f68
update settings page 🚨
hiaaryan Jun 4, 2021
c5e10c0
Merge branch 'master' into flypados-v2
hiaaryan Jun 5, 2021
6a964bc
Merge branch 'master' into flypados-v2
hiaaryan Jun 5, 2021
058d3d2
more changes to weather and settings 🎉
hiaaryan Jun 5, 2021
7d0dd77
Merge branch 'master' into flypados-v2
hiaaryan Jun 6, 2021
33fe29e
major changes, ui consistency & layout rewrites 🎁
hiaaryan Jun 6, 2021
da3e8bc
Merge branch 'master' into flypados-v2
hiaaryan Jun 7, 2021
bbdfcee
Merge branch 'master' into flypados-v2
hiaaryan Jun 8, 2021
69f1664
Merge branch 'master' into flypados-v2
hiaaryan Jun 9, 2021
1054c1f
Merge branch 'master' into flypados-v2
Snapmatics Jun 9, 2021
c77f087
Merge branch 'master' into flypados-v2
hiaaryan Jun 10, 2021
6a0c08b
Merge branch 'master' into flypados-v2
hiaaryan Jun 12, 2021
dac0a03
fix keybind trigger 🎉
hiaaryan Jun 13, 2021
914d183
fix focusOut function 🥽
hiaaryan Jun 13, 2021
594e01f
Add monospace font to EFB (#5102)
bouveng Jun 13, 2021
17b36c7
Add flypad themed simbrief maps to EFB (#5106)
bouveng Jun 14, 2021
f376375
navigraph zoom & font fixes 🎉
hiaaryan Jun 14, 2021
c49fce9
Merge branch 'master' into flypados-v2
hiaaryan Jun 14, 2021
0ac4751
Merge branch 'master' into flypados-v2
Snapmatics Jun 15, 2021
75339dc
fix(efb): state persistence update for landing perf (#5104)
antonyisoardi Jun 15, 2021
0253db0
Merge branch 'master' into flypados-v2
hiaaryan Jun 16, 2021
bd8cf0f
feat: EFB page with the list of ATCs from VATSIM and IVAO (#4919)
ZeroKaa Jun 17, 2021
60b91d7
Merge branch 'master' into flypados-v2
hiaaryan Jun 18, 2021
60ba1fd
build: switch to postcss8, fix purging
Benjozork Jun 19, 2021
01cb251
Merge branch 'master' into flypados-v2
Benjozork Jun 19, 2021
eee18bf
build: add A32NX_PRODUCTION_BUILD in dotenv
Benjozork Jun 20, 2021
6688a97
fix: include react-components used classes in purging
Benjozork Jun 20, 2021
c6953ca
Some ESLint fixes
wpine215 Jun 20, 2021
51d02a8
Merge branch 'master' into flypados-v2
hiaaryan Jun 20, 2021
5493291
enable tailwindcss jit ⚡
hiaaryan Jun 20, 2021
b544013
fix: bad tailwind safelist path
Benjozork Jun 21, 2021
3ab916c
Merge branch 'master' into flypados-v2
hiaaryan Jun 21, 2021
39d9c95
fix: actually fix react-components classes purging this time
Benjozork Jun 21, 2021
56699f5
Merge branch 'master' into flypados-v2
hiaaryan Jun 22, 2021
3413adb
Merge branch 'master' into flypados-v2
hiaaryan Jun 30, 2021
de8b46c
Merge branch 'master' into flypados-v2
hiaaryan Jul 3, 2021
c1a269c
feat(efb): Fix refresh of atc list issue during flight (#5186)
ZeroKaa Jul 3, 2021
f36a219
Merge branch 'master' into flypados-v2
2hwk Jul 9, 2021
5c50cc3
fix lint 🌌
hiaaryan Jul 12, 2021
d3e3596
disable JIT, because rollup 🎱
hiaaryan Jul 12, 2021
216c294
fix fuel page layout ⚡
hiaaryan Jul 12, 2021
e89a8f3
fix button font size ☁️
hiaaryan Jul 12, 2021
2af8cb9
Merge branch 'master' into flypados-v2
hiaaryan Jul 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
1. [TEXTURE] Added a white dot to the test button and corrected DISCH alignment on the fire panel - @ImenesFBW (Imenes)
1. [ECAM] Added ISA DEV to ECAM - @BlueberryKing (BlueberryKing#6641)
1. [AOC] Reworked airport handling on AOC Weather Request Page - @MisterChocker (Leon)
1. [EFB] Add flypad themed simbrief maps to EFB/OFP - @bouveng (Johan Bouveng)
1. [SOUND] Added blue and yellow electric hydraulic pump sounds - @hotshotp (Boris)
1. [SOUND] Further improved ambience and engine sounds - @hotshotp (Boris)
1. [ELEC] Improve electrical system implementation to allow for implementing advanced scenarios - @davidwalschots (David Walschots)
Expand Down Expand Up @@ -239,6 +240,7 @@
1. [MISC] Added registration decal - @tyler58546(tyler58546), @DarkOfNova (DarkOfNova)
1. [OVHD] Implement even more additional overhead button/switch functionality (MASK MAN ON, EMER ELEC PWR MAN ON, Cargo smoke DISCH, etc.) - @ErickSharp (Erick Torres)
1. [CDU] Fix ILS frequencies not autofilling - @pareil6 (pareil6)
1. [EFB] Landing performance calculations page - @matt-winfield (TheMightyMat#0585)
1. [LIGHTS] Improved Exterior Lights - @Snapmatics (Harry)
1. [SOUND] Added custom sounds to multiple buttons and Throttle Lever Reverse Locks - @ImenesFBW (Imenes)
1. [MCDU] Added custom MCDU font - @tyler58546 (tyler58546)
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/autopilot-custom-fpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
uses: actions/checkout@v2
- name: Set BUILT_DATE_TIME
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV
- name: Create .env file
run: |
echo A32NX_PRODUCTION_BUILD=1 >> .env
echo CLIENT_ID=${{ secrets.NAVIGRAPH_CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.NAVIGRAPH_CLIENT_SECRET }} >> .env
echo CHARTFOX_SECRET=${{ secrets.CHARTFOX_SECRET }} >> .env
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
uses: actions/checkout@v2
- name: Set BUILT_DATE_TIME
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV
- name: Create .env file
run: |
echo A32NX_PRODUCTION_BUILD=1 >> .env
echo CLIENT_ID=${{ secrets.NAVIGRAPH_CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.NAVIGRAPH_CLIENT_SECRET }} >> .env
echo CHARTFOX_SECRET=${{ secrets.CHARTFOX_SECRET }} >> .env
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
uses: actions/checkout@v2
- name: Set BUILT_DATE_TIME
run: echo "BUILT_DATE_TIME=$(date -u -Iseconds)" >> $GITHUB_ENV
- name: Create .env file
run: |
echo A32NX_PRODUCTION_BUILD=1 >> .env
echo CLIENT_ID=${{ secrets.NAVIGRAPH_CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.NAVIGRAPH_CLIENT_SECRET }} >> .env
echo CHARTFOX_SECRET=${{ secrets.CHARTFOX_SECRET }} >> .env
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Create .env file
run: |
echo A32NX_PRODUCTION_BUILD=1 >> .env
echo CLIENT_ID=${{ secrets.NAVIGRAPH_CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.NAVIGRAPH_CLIENT_SECRET }} >> .env
echo CHARTFOX_SECRET=${{ secrets.CHARTFOX_SECRET }} >> .env
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Create .env file
run: |
echo A32NX_PRODUCTION_BUILD=1 >> .env
echo CLIENT_ID=${{ secrets.NAVIGRAPH_CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.NAVIGRAPH_CLIENT_SECRET }} >> .env
echo CHARTFOX_SECRET=${{ secrets.CHARTFOX_SECRET }} >> .env
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Create .env file
run: |
echo A32NX_PRODUCTION_BUILD=1 >> .env
echo CLIENT_ID=${{ secrets.NAVIGRAPH_CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.NAVIGRAPH_CLIENT_SECRET }} >> .env
echo CHARTFOX_SECRET=${{ secrets.CHARTFOX_SECRET }} >> .env
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ node_modules
/src/fdr2csv/*.exe
/src/fbw/obj/
/src/fdr2csv/build/
.env
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@flybywiresim/igniter": "^1.1.4",
"@flybywiresim/rnp": "^2.1.0",
"@flybywiresim/rollup-plugin-msfs": "~0.3.0",
"@navigraph/pkce": "^1.0.0",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-image": "~2.0.6",
Expand All @@ -38,37 +39,40 @@
"@types/react-router-dom": "~5.1.6",
"@typescript-eslint/eslint-plugin": "~4.14.2",
"@typescript-eslint/parser": "~4.14.2",
"ts-loader": "^9.2.2",
"css-loader": "^5.0.1",
"dotenv": "^8.2.0",
"eslint": "7.21.0",
"file-loader": "^6.2.0",
"jsdom": "^16.4.0",
"lint-staged": "10.4.0",
"prettier": "2.1.2",
"postcss": "^8.3.5",
"redux-devtools-extension": "^2.13.8",
"rollup": "^2.32.0",
"rollup-plugin-copy": "~3.3.0",
"rollup-plugin-css-only": "^2.1.0",
"rollup-plugin-livereload": "~2.0.0",
"rollup-plugin-postcss": "~4.0.0",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-serve": "~1.1.0",
"rollup-plugin-typescript-paths": "^1.3.0",
"sass-loader": "^10.1.0",
"style-loader": "^2.0.0",
"ts-loader": "^9.2.2",
"typescript": "^4.3.2",
"webpack": "^5.12.2",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.1"
},
"dependencies": {
"@flybywiresim/api-client": "~0.7.0",
"@flybywiresim/api-client": "^0.13.0",
"@flybywiresim/react-components": "^0.3.0",
"@flybywiresim/tailwind-config": "^0.5.0",
"@tabler/icons": "^1.41.2",
"@tailwindcss/postcss7-compat": "^2.0.2",
"aewx-metar-parser": "~0.10.1",
"byte-data": "^19.0.1",
"classnames": "^2.2.6",
"immer": "^9.0.3",
"lodash": "^4.17.20",
"qrcode.react": "^1.0.1",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-leaflet": "~3.0.5",
Expand All @@ -79,7 +83,7 @@
"redux-thunk": "^2.3.0",
"rollup-plugin-scss": "^2.6.1",
"sass": "~1.30.0",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
"tailwindcss": "^2.2.2",
"type-to-reducer": "^1.2.0"
}
}
2 changes: 2 additions & 0 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,7 @@ module.exports = {
Simplane: 'readonly',
SimVar: 'readonly',
Utils: 'readonly',
JSX: 'readonly',
Coherent: 'readonly',
},
};
12 changes: 11 additions & 1 deletion src/instruments/buildSrc/plugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import { typescriptPaths } from 'rollup-plugin-typescript-paths';
import replace from '@rollup/plugin-replace';
import postcss from 'rollup-plugin-postcss';
import tailwindcss from 'tailwindcss';
import dotenv from 'dotenv';
import { Directories } from './directories.mjs';

const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs'];

dotenv.config();

function babel() {
return babelPlugin({
presets: [
Expand Down Expand Up @@ -61,7 +64,14 @@ export function baseCompile(instrumentName, instrumentFolder) {
tsConfigPath: join(Directories.src, 'tsconfig.json'),
preserveExtensions: true,
}),
replace({ 'process.env.NODE_ENV': '"production"' }),
replace({
'preventAssignment': true,
'process.env.NODE_ENV': JSON.stringify('production'),
'process.env.CLIENT_ID': JSON.stringify(process.env.CLIENT_ID),
'process.env.CLIENT_SECRET': JSON.stringify(process.env.CLIENT_SECRET),
'process.env.CHARTFOX_SECRET': JSON.stringify(process.env.CHARTFOX_SECRET),
'process.env.SIMVAR_DISABLE': 'false',
}),
postCss(instrumentName, instrumentFolder),
];
}
65 changes: 65 additions & 0 deletions src/instruments/src/Common/metarTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* eslint-disable camelcase */
// Disable eslint camelcase as these are types for external library
export type MetarParserType = {
raw_text: string,
raw_parts: [string],
icao: string,
observed: Date,
wind: Wind,
visibility: Visibility,
conditions: [ConditionCode],
clouds: [Cloud],
ceiling: Ceiling,
temperature: Temperature,
dewpoint: Dewpoint,
humidity_percent: number,
barometer: Barometer,
flight_category: string,
}

export type Wind = {
degrees: number,
speed_kts: number,
speed_mps: number,
gust_kts: number,
gust_mps: number,
};

export type Visibility = {
miles: string,
miles_float: number,
meters: string,
meters_float: number,
};

export type ConditionCode = {
code: string,
};

export type Cloud = {
code: string,
base_feet_agl: number,
base_meters_agl: number,
};

export type Ceiling = {
code: string,
feet_agl: number,
meters_agl: number,
};

export type Temperature = {
celsius: number,
fahrenheit: number,
};

export type Dewpoint = {
celsius: number,
fahrenheit: number,
};

export type Barometer = {
hg: number,
kpa: number,
mb: number,
};
21 changes: 19 additions & 2 deletions src/instruments/src/Common/persistence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export class NXDataStore {
* @param defaultVal The default value if the property is not set
*/
static get(key: string, defaultVal?: string) {
if (process.env.SIMVAR_DISABLE) {
const val = window.localStorage.getItem(`A32NX_${key}`);
if (!val) {
return defaultVal;
}
return val;
}

const val = GetStoredData(`A32NX_${key}`);
if (!val) {
return defaultVal;
Expand All @@ -29,6 +37,11 @@ export class NXDataStore {
* @param val The value to assign to the property
*/
static set(key: string, val: string) {
if (process.env.SIMVAR_DISABLE) {
window.localStorage.setItem(`A32NX_${key}`, val);
return;
}

SetStoredData(`A32NX_${key}`, val);
}
}
Expand All @@ -38,8 +51,12 @@ export class NXDataStore {
*
* Note: The value of the persistent property does not automatically refresh for now
*/
export const usePersistentProperty = (propertyName: string): [string, (string) => void] => {
const [propertyValue, rawPropertySetter] = useState(() => NXDataStore.get(propertyName));
export const usePersistentProperty = (propertyName: string, defaultValue?: string): [string, (string) => void] => {
const [propertyValue, rawPropertySetter] = useState(() => NXDataStore.get(propertyName, defaultValue));

if (defaultValue !== undefined && propertyValue === undefined) {
hiaaryan marked this conversation as resolved.
Show resolved Hide resolved
rawPropertySetter(defaultValue);
}

const propertySetter = (value: string) => {
NXDataStore.set(propertyName, value);
Expand Down
8 changes: 8 additions & 0 deletions src/instruments/src/Common/simVars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ export const useSimVar = (
maxStaleness = 0,
): [SimVarValue, (newValueOrSetter: SimVarValue | SimVarSetter
) => void] => {
if (process.env.SIMVAR_DISABLE) {
return [0, () => {}];
}

const value = useSimVarValue(name, unit, maxStaleness);
const setter = useSimVarSetter(name, unit);
return [value, setter];
Expand Down Expand Up @@ -406,6 +410,10 @@ export const useSplitSimVar = (
maxStaleness = 0,
): [SimVarValue, (newValueOrSetter: SimVarValue | SimVarSetter
) => void] => {
if (process.env.SIMVAR_DISABLE) {
return [0, () => {}];
}

const value = useSimVarValue(readName, readUnit, maxStaleness);
const setter = useSimVarSetter(readName, writeUnit || readUnit, writeName);
return [value, setter];
Expand Down
40 changes: 40 additions & 0 deletions src/instruments/src/Common/useInterval.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useRef, useEffect } from 'react';

type UseIntervalOptions = Partial<{
runOnStart: boolean,
additionalDeps: any[],
}>

function useInterval(callback: () => void, delay: number | null, options?: UseIntervalOptions): void {
const savedCallback = useRef<() => void | null>();

const deps = [delay];
if (options?.additionalDeps) {
deps.push(...options.additionalDeps);
}

// Remember the latest callback.
useEffect(() => {
savedCallback.current = callback;
});

// Set up the interval.
// eslint-disable-next-line consistent-return
useEffect(() => {
function tick() {
if (savedCallback && typeof savedCallback.current !== 'undefined') {
savedCallback.current();
}
}

if (options?.runOnStart) {
tick();
}

if (delay !== null) {
const id = setInterval(tick, delay);
return () => clearInterval(id);
}
}, deps);
}
export default useInterval;
Loading