From 6cd710a7360aa960cecee32f99c480013edbc178 Mon Sep 17 00:00:00 2001 From: Romain CREY <ext.sopra.rcrey@grandlyon.com> Date: Mon, 1 Jun 2020 10:52:35 +0200 Subject: [PATCH] fix: half hour warning --- .../FluidChartContainer.tsx | 36 ++++++++++--------- src/services/consumptionDataManagerService.ts | 2 +- src/styles/components/_fluid.scss | 25 +++++++++---- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx b/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx index 5837e30ee..f29bf24da 100644 --- a/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx +++ b/src/components/ContainerComponents/FluidChartContainer/FluidChartContainer.tsx @@ -52,6 +52,8 @@ const FluidChartContainer: React.FC<FluidChartContainerProps> = ({ FluidType.ELECTRICITY, TimeStep.HALF_AN_HOUR )) + console.log(activateHalfHourLoad) + const data = await consumptionDataManager.fetchLastDateData(fluidTypes) const dataWithAllFluids = await consumptionDataManager.fetchLastDateData( fluidTypes, @@ -112,23 +114,25 @@ const FluidChartContainer: React.FC<FluidChartContainerProps> = ({ return ( <> {isLoaded ? ( - <div className="fc-root"> - <div className="fc-content"> - {isMinuteBlocked && timeStep === 10 && <ActivateHalfHourLoad />} - <FluidChartContent - referenceDate={referenceDate} - lastDataDate={lastDataDate} - lastDateWithAllData={lastDateWithAllData} - fluidTypes={fluidTypes} - timeStep={timeStep} - multiFluid={multiFluid} - currentChallenge={challenge} - consumptionDataManager={consumptionDataManager} - isDataLoaded={isLoaded} - handleDetailedDate={handleDetailedDate} - ></FluidChartContent> + <> + {isMinuteBlocked && timeStep === 10 && <ActivateHalfHourLoad />} + <div className="fc-root"> + <div className="fc-content"> + <FluidChartContent + referenceDate={referenceDate} + lastDataDate={lastDataDate} + lastDateWithAllData={lastDateWithAllData} + fluidTypes={fluidTypes} + timeStep={timeStep} + multiFluid={multiFluid} + currentChallenge={challenge} + consumptionDataManager={consumptionDataManager} + isDataLoaded={isLoaded} + handleDetailedDate={handleDetailedDate} + ></FluidChartContent> + </div> </div> - </div> + </> ) : null} </> ) diff --git a/src/services/consumptionDataManagerService.ts b/src/services/consumptionDataManagerService.ts index ff2d6ec33..b203ecb49 100644 --- a/src/services/consumptionDataManagerService.ts +++ b/src/services/consumptionDataManagerService.ts @@ -292,7 +292,7 @@ export default class ConsumptionDataManager implements IConsumptionDataManager { timeStep: TimeStep ): Promise<boolean> { const queryResult = await this._queryRunner.getEntries(fluideType, timeStep) - if (queryResult.length > 0) { + if (queryResult.data.length > 0) { return true } return false diff --git a/src/styles/components/_fluid.scss b/src/styles/components/_fluid.scss index e918cf6a5..eefc82bf4 100644 --- a/src/styles/components/_fluid.scss +++ b/src/styles/components/_fluid.scss @@ -90,7 +90,7 @@ } } } - + .fv-footer-challenge { width: 100%; max-width: 58.75rem; @@ -129,18 +129,24 @@ // Enedis Half Hour Load Activation .cta-box { - background-color:rgba(18, 18, 18, 0.7); + background-color: rgba(18, 18, 18, 0.8); position: absolute; - + left: 0; + width: calc(100vw - 220px); padding: 0rem 1rem 0rem 0rem; z-index: 1; display: flex; justify-content: center; + align-items: center; flex-direction: column; + height: 37.5rem; @media #{$large-phone} { - height: 26.5rem; + height: 29rem; + width: 100vw; + } + @media #{$tablet} { + width: 100vw; } - height: 34.5rem; .cta-box-header { text-align: center; @@ -148,10 +154,17 @@ letter-spacing: 0.2px; margin-bottom: 1.5em; color: $text-bright; + width: 50%; + @media #{$large-phone} { + width: 80%; + } } .cta-box-button { margin-left: auto; margin-right: auto; - width: 80%; + width: 50%; + @media #{$large-phone} { + width: 80%; + } } } -- GitLab