Skip to content

Commit

Permalink
Bugfixes for Developer Build - a30a32e
Browse files Browse the repository at this point in the history
  • Loading branch information
markszutor committed Feb 5, 2024
1 parent a30a32e commit c4df52a
Show file tree
Hide file tree
Showing 18 changed files with 700 additions and 463 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import Card from '../../../../UtilComponents/Card/Card';
import { SelectGroup, SelectItem } from '../../../../UtilComponents/Form/Select';
import { SeatMapWidget } from './SeatMapWidget';
import { PromptModal, useModals } from '../../../../UtilComponents/Modals/Modals';
import { setPayloadImported } from '../../../../Store/features/simBrief';
import { useAppDispatch } from '../../../../Store/store';

interface A320Props {
simbriefUnits: string,
Expand All @@ -23,6 +25,7 @@ interface A320Props {
simbriefBag: number,
simbriefFreight: number,
simbriefDataLoaded: boolean,
payloadImported: boolean,
massUnitForDisplay: string,
isOnGround: boolean,

Expand All @@ -39,6 +42,7 @@ export const A21NLEAPPayload: React.FC<A320Props> = ({
simbriefBag,
simbriefFreight,
simbriefDataLoaded,
payloadImported,
massUnitForDisplay,
isOnGround,
boardingStarted,
Expand Down Expand Up @@ -146,6 +150,15 @@ export const A21NLEAPPayload: React.FC<A320Props> = ({
COMPLETED: 6,
};

const dispatch = useAppDispatch();

useEffect(() => {
if (simbriefDataLoaded === true && payloadImported === false) {
setSimBriefValues();
dispatch(setPayloadImported(true));
}
}, []);

const setSimBriefValues = () => {
if (simbriefUnits === 'kgs') {
setPaxBagWeight(simbriefBagWeight);
Expand Down Expand Up @@ -500,10 +513,10 @@ export const A21NLEAPPayload: React.FC<A320Props> = ({
</div>
<CargoWidget cargo={cargo} cargoDesired={cargoDesired} cargoMap={cargoMap} onClickCargo={onClickCargo} />

<div className="flex relative right-0 flex-row justify-between px-4 mt-16">
<div className="flex flex-col flex-grow pr-24">
<div className="flex flex-row w-full">
<Card className="w-full col-1" childrenContainerClassName={`w-full ${simbriefDataLoaded ? 'rounded-r-none' : ''}`}>
<div className="relative right-0 mt-16 flex flex-row justify-between px-4">
<div className="flex grow flex-col pr-24">
<div className="flex w-full flex-row">
<Card className="col-1 w-full" childrenContainerClassName={`w-full ${simbriefDataLoaded ? 'rounded-r-none' : ''}`}>
<PayloadInputTable
loadsheet={Loadsheet}
emptyWeight={emptyWeight}
Expand Down Expand Up @@ -532,7 +545,7 @@ export const A21NLEAPPayload: React.FC<A320Props> = ({
setDisplayZfw={setDisplayZfw}
/>
<hr className="mb-4 border-gray-700" />
<div className="flex flex-row justify-start items-center">
<div className="flex flex-row items-center justify-start">
<MiscParamsInput
disable={gsxPayloadSyncEnabled === 1 && boardingStarted}
minPaxWeight={Math.round(Loadsheet.specs.pax.minPaxWeight)}
Expand All @@ -556,9 +569,9 @@ export const A21NLEAPPayload: React.FC<A320Props> = ({
&& (
<TooltipWrapper text={t('Ground.Payload.TT.FillPayloadFromSimbrief')}>
<div
className={`flex justify-center items-center px-2 h-auto text-theme-body
hover:text-theme-highlight bg-theme-highlight hover:bg-theme-body
rounded-md rounded-l-none border-2 border-theme-highlight transition duration-100`}
className={`text-theme-body hover:text-theme-highlight bg-theme-highlight hover:bg-theme-body border-theme-highlight flex
h-auto items-center justify-center
rounded-md rounded-l-none border-2 px-2 transition duration-100`}
onClick={setSimBriefValues}
>
<CloudArrowDown size={26} />
Expand All @@ -567,12 +580,12 @@ export const A21NLEAPPayload: React.FC<A320Props> = ({
)}
</div>
{(gsxPayloadSyncEnabled !== 1) && (
<div className="flex flex-row mt-4">
<Card className="w-full h-full" childrenContainerClassName="flex flex-col w-full h-full">
<div className="flex flex-row justify-between items-center">
<div className="mt-4 flex flex-row">
<Card className="h-full w-full" childrenContainerClassName="flex flex-col w-full h-full">
<div className="flex flex-row items-center justify-between">
<div className="flex font-medium">
{t('Ground.Payload.BoardingTime')}
<span className="flex relative flex-row items-center ml-2 text-sm font-light">
<span className="relative ml-2 flex flex-row items-center text-sm font-light">
(
{remainingTimeString()}
)
Expand Down Expand Up @@ -616,12 +629,12 @@ export const A21NLEAPPayload: React.FC<A320Props> = ({
</div>
)}
{gsxPayloadSyncEnabled === 1 && (
<div className="pt-6 pl-2">
<div className="pl-2 pt-6">
{t('Ground.Payload.GSXPayloadSyncEnabled')}
</div>
)}
</div>
<div className="border border-theme-accent col-1">
<div className="border-theme-accent col-1 border">
<ChartWidget
width={525}
height={511}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import Card from '../../../../UtilComponents/Card/Card';
import { SelectGroup, SelectItem } from '../../../../UtilComponents/Form/Select';
import { SeatMapWidget } from './SeatMapWidget';
import { PromptModal, useModals } from '../../../../UtilComponents/Modals/Modals';
import { setPayloadImported } from '../../../../Store/features/simBrief';
import { useAppDispatch } from '../../../../Store/store';

interface A320Props {
simbriefUnits: string,
Expand All @@ -23,6 +25,7 @@ interface A320Props {
simbriefBag: number,
simbriefFreight: number,
simbriefDataLoaded: boolean,
payloadImported: boolean,
massUnitForDisplay: string,
isOnGround: boolean,

Expand All @@ -39,6 +42,7 @@ export const A21NLEAPFLEXPayload: React.FC<A320Props> = ({
simbriefBag,
simbriefFreight,
simbriefDataLoaded,
payloadImported,
massUnitForDisplay,
isOnGround,
boardingStarted,
Expand Down Expand Up @@ -146,6 +150,15 @@ export const A21NLEAPFLEXPayload: React.FC<A320Props> = ({
COMPLETED: 6,
};

const dispatch = useAppDispatch();

useEffect(() => {
if (simbriefDataLoaded === true && payloadImported === false) {
setSimBriefValues();
dispatch(setPayloadImported(true));
}
}, []);

const setSimBriefValues = () => {
if (simbriefUnits === 'kgs') {
setPaxBagWeight(simbriefBagWeight);
Expand Down Expand Up @@ -491,19 +504,19 @@ export const A21NLEAPFLEXPayload: React.FC<A320Props> = ({

return (
<div>
<div className="relative h-content-section-reduced">
<div className="h-content-section-reduced relative">
<div className="mb-10">
<div className="flex relative flex-col">
<div className="relative flex flex-col">
<SeatOutlineBg stroke={getTheme(theme)[0]} highlight="#69BD45" />
<SeatMapWidget seatMap={seatMap} desiredFlags={desiredFlags} activeFlags={activeFlags} onClickSeat={onClickSeat} theme={getTheme(theme)} isMainDeck canvasX={243} canvasY={78} />
</div>
</div>
<CargoWidget cargo={cargo} cargoDesired={cargoDesired} cargoMap={cargoMap} onClickCargo={onClickCargo} />

<div className="flex relative right-0 flex-row justify-between px-4 mt-16">
<div className="flex flex-col flex-grow pr-24">
<div className="flex flex-row w-full">
<Card className="w-full col-1" childrenContainerClassName={`w-full ${simbriefDataLoaded ? 'rounded-r-none' : ''}`}>
<div className="relative right-0 mt-16 flex flex-row justify-between px-4">
<div className="flex grow flex-col pr-24">
<div className="flex w-full flex-row">
<Card className="col-1 w-full" childrenContainerClassName={`w-full ${simbriefDataLoaded ? 'rounded-r-none' : ''}`}>
<PayloadInputTable
loadsheet={Loadsheet}
emptyWeight={emptyWeight}
Expand Down Expand Up @@ -532,7 +545,7 @@ export const A21NLEAPFLEXPayload: React.FC<A320Props> = ({
setDisplayZfw={setDisplayZfw}
/>
<hr className="mb-4 border-gray-700" />
<div className="flex flex-row justify-start items-center">
<div className="flex flex-row items-center justify-start">
<MiscParamsInput
disable={gsxPayloadSyncEnabled === 1 && boardingStarted}
minPaxWeight={Math.round(Loadsheet.specs.pax.minPaxWeight)}
Expand All @@ -556,9 +569,9 @@ export const A21NLEAPFLEXPayload: React.FC<A320Props> = ({
&& (
<TooltipWrapper text={t('Ground.Payload.TT.FillPayloadFromSimbrief')}>
<div
className={`flex justify-center items-center px-2 h-auto text-theme-body
hover:text-theme-highlight bg-theme-highlight hover:bg-theme-body
rounded-md rounded-l-none border-2 border-theme-highlight transition duration-100`}
className={`text-theme-body hover:text-theme-highlight bg-theme-highlight hover:bg-theme-body border-theme-highlight flex
h-auto items-center justify-center
rounded-md rounded-l-none border-2 px-2 transition duration-100`}
onClick={setSimBriefValues}
>
<CloudArrowDown size={26} />
Expand All @@ -567,12 +580,12 @@ export const A21NLEAPFLEXPayload: React.FC<A320Props> = ({
)}
</div>
{(gsxPayloadSyncEnabled !== 1) && (
<div className="flex flex-row mt-4">
<Card className="w-full h-full" childrenContainerClassName="flex flex-col w-full h-full">
<div className="flex flex-row justify-between items-center">
<div className="mt-4 flex flex-row">
<Card className="h-full w-full" childrenContainerClassName="flex flex-col w-full h-full">
<div className="flex flex-row items-center justify-between">
<div className="flex font-medium">
{t('Ground.Payload.BoardingTime')}
<span className="flex relative flex-row items-center ml-2 text-sm font-light">
<span className="relative ml-2 flex flex-row items-center text-sm font-light">
(
{remainingTimeString()}
)
Expand Down Expand Up @@ -616,12 +629,12 @@ export const A21NLEAPFLEXPayload: React.FC<A320Props> = ({
</div>
)}
{gsxPayloadSyncEnabled === 1 && (
<div className="pt-6 pl-2">
<div className="pl-2 pt-6">
{t('Ground.Payload.GSXPayloadSyncEnabled')}
</div>
)}
</div>
<div className="border border-theme-accent col-1">
<div className="border-theme-accent col-1 border">
<ChartWidget
width={525}
height={511}
Expand Down
Loading

0 comments on commit c4df52a

Please sign in to comment.