diff --git a/src/components/Analysis/analysisConsumption.scss b/src/components/Analysis/analysisConsumption.scss index b0861c5208727edb719805ea27b5cc5af37f395d..06fa3f75cce10f4294ffcfd8ff2d1bd93fc0cffa 100644 --- a/src/components/Analysis/analysisConsumption.scss +++ b/src/components/Analysis/analysisConsumption.scss @@ -48,12 +48,14 @@ display: flex; align-items: center; flex-direction: column; + gap: 1rem; div { text-align: center; color: $white; } button { max-width: $width-small-phone; + margin-top: 0; } } diff --git a/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss b/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss index 8fcebce3b8f63d4dda175dbdc8ad4f6bef358b08..1c91ccaf086d8e266c051b1869760209b3c2bc92 100644 --- a/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss +++ b/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss @@ -82,7 +82,7 @@ } .showmodal { cursor: pointer; - margin: 1.5rem 0 1rem 0; + margin: 1.5rem 0 0.5rem; text-align: center; color: $grey-bright; text-decoration: underline; diff --git a/src/components/Connection/SGEConnect/SgeConnectView.tsx b/src/components/Connection/SGEConnect/SgeConnectView.tsx index 0997681185bdede2cdc3dd98f053a3a2d2ff279f..0850fd8433fbfb87f2a491e02a44446cfbb480cf 100644 --- a/src/components/Connection/SGEConnect/SgeConnectView.tsx +++ b/src/components/Connection/SGEConnect/SgeConnectView.tsx @@ -134,8 +134,9 @@ const SgeConnectView: React.FC = () => { handlePrevious={handlePrev} handleNext={handleNext} disableNextButton={!isNextValid()} - isEcogesture={false} + disablePrevButton={currentStep === SgeStep.IdentityAndPDL} isLastConnectStep={currentStep === SgeStep.Consent} + isEcogesture={false} /> </div> </Content> diff --git a/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap b/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap index 547f2248cc2817e52a3d4d25d25c1f665ae3709d..62c7251fe07609d54efaad5ba93d4cb175bc2c3f 100644 --- a/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap +++ b/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap @@ -1090,6 +1090,7 @@ exports[`SgeConnectView component should be rendered correctly 1`] = ` </div> <FormNavigation disableNextButton={true} + disablePrevButton={true} handleNext={[Function]} handlePrevious={[Function]} isEcogesture={false} diff --git a/src/components/Ecogesture/SingleEcogesture.spec.tsx b/src/components/Ecogesture/SingleEcogesture.spec.tsx index b70a8f41f32171d533b46b873cf88b5f394aed6b..892407ba79da1ed814d8262439feedb4b8161774 100644 --- a/src/components/Ecogesture/SingleEcogesture.spec.tsx +++ b/src/components/Ecogesture/SingleEcogesture.spec.tsx @@ -56,11 +56,10 @@ jest.mock('react-router-dom', () => ({ useLocation: jest.fn().mockReturnValue({ state: { selectionCompleted: true }, }), + useHistory: () => jest.fn(), })) describe('SingleEcogesture component', () => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - it('should be rendered correctly', async () => { const store = mockStore({ ecolyo: { @@ -70,7 +69,6 @@ describe('SingleEcogesture component', () => { }) mockgetEcogesturesByIds.mockResolvedValue([ecogesturesData[0]]) - const wrapper = mount( <Provider store={store}> <SingleEcogesture @@ -81,9 +79,9 @@ describe('SingleEcogesture component', () => { </Provider> ) await waitForComponentToPaint(wrapper) - expect(toJson(wrapper)).toMatchSnapshot() }) + it('should change doing status', async () => { const store = mockStore({ ecolyo: { @@ -106,7 +104,6 @@ describe('SingleEcogesture component', () => { </Provider> ) await waitForComponentToPaint(wrapper) - wrapper.find('.doing-btn').first().simulate('click') await waitForComponentToPaint(wrapper) @@ -135,7 +132,6 @@ describe('SingleEcogesture component', () => { </Provider> ) await waitForComponentToPaint(wrapper) - wrapper.find('.objective-btn').first().simulate('click') await waitForComponentToPaint(wrapper) expect(mockupdateEcogesture).toHaveBeenCalledWith(updatedEcogesture) diff --git a/src/components/Ecogesture/SingleEcogesture.tsx b/src/components/Ecogesture/SingleEcogesture.tsx index d5dad471b750d687e8b8396bc510e18e468ef3d6..4f089add5159c554e6ae9988add975ee4bfc3332 100644 --- a/src/components/Ecogesture/SingleEcogesture.tsx +++ b/src/components/Ecogesture/SingleEcogesture.tsx @@ -24,7 +24,7 @@ import { useClient } from 'cozy-client' import ErrorPage from 'components/CommonKit/ErrorPage/ErrorPage' import StyledSpinner from 'components/CommonKit/Spinner/StyledSpinner' import { FluidType } from 'enum/fluid.enum' -import { useLocation } from 'react-router-dom' +import { useHistory, useLocation } from 'react-router-dom' import { Location } from 'history' interface SingleEcogestureProps { @@ -36,6 +36,7 @@ const SingleEcogesture: React.FC<SingleEcogestureProps> = ({ }: SingleEcogestureProps) => { const { t } = useI18n() const client = useClient() + const history = useHistory() const location: Location<any> = useLocation<any>() const [ecogesture, setEcogesture] = useState<Ecogesture>() const [ecogestureIcon, setEcogestureIcon] = useState<string>('') @@ -144,6 +145,7 @@ const SingleEcogesture: React.FC<SingleEcogestureProps> = ({ titleKey={t('common.title_ecogesture')} isNotKey={true} displayBackArrow={true} + backFunction={() => history.push('/ecogestures')} /> <Header setHeaderHeight={defineHeaderHeight} @@ -174,7 +176,7 @@ const SingleEcogesture: React.FC<SingleEcogestureProps> = ({ <div className="styled-container"> <div className="long-name text-18-bold">{ecogesture.longName}</div> <div - className={classNames('description text-18-normal-150', { + className={classNames('description text-16-normal-150', { ['block']: isMoreDetail === true, })} > diff --git a/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap b/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap index 74d690fb4bb3ebbeb961c77fe06678c21f34eb0c..23aaff6f392f44a743614f35dc94f361e2ac6136 100644 --- a/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap +++ b/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap @@ -23,6 +23,7 @@ exports[`SingleEcogesture component should be rendered correctly 1`] = ` } > <Component + backFunction={[Function]} displayBackArrow={true} isNotKey={true} titleKey="common.title_ecogesture" @@ -87,7 +88,7 @@ exports[`SingleEcogesture component should be rendered correctly 1`] = ` Je baisse le chauffage en mode hors gel lorsque je m'absente plus de 2 jours. </div> <div - className="description text-18-normal-150" + className="description text-16-normal-150" > On se demande parfois si cela vaut le coup de "couper le chauffage" quand on s’absente… dès qu’il s’agit d’un week-end la réponse est « oui sûrement » ! Attention cependant au retour à ne pas faire de la surchauffe ! L’idéal est bien évidemment de régler sa programmation pour que le chauffage se relance quelques heures avant votre retour… </div> diff --git a/src/components/Ecogesture/ecogestureEmptyList.scss b/src/components/Ecogesture/ecogestureEmptyList.scss index 08a6ade8e032f81643da044b480f9e24a7b9eb96..49974c072391ef74e2f70d34753e48d9ea40ea66 100644 --- a/src/components/Ecogesture/ecogestureEmptyList.scss +++ b/src/components/Ecogesture/ecogestureEmptyList.scss @@ -7,20 +7,27 @@ .ec-empty-content { color: $grey-bright; text-align: center; - padding: 0 0.5rem; + padding: 0 1.5rem; + display: flex; + gap: 1rem; + flex-direction: column; + align-items: center; margin: 0 auto; - max-width: 80%; + @media (min-width: $width-phone) { max-width: 45%; } @media (min-width: $width-desktop) { max-width: 35%; } - .text { - margin: 1rem 0; - } + .btn-container { + margin-top: 1rem; display: flex; + gap: 1rem; + button { + margin: 0; + } button.btn2 { margin-left: 1rem; } diff --git a/src/components/Ecogesture/ecogestureReinitModal.scss b/src/components/Ecogesture/ecogestureReinitModal.scss index a73ec8a1c8f733a2f3253102806b6c692c012ab3..01939fe7946009a67ee1dd35755ebca3c87bd958 100644 --- a/src/components/Ecogesture/ecogestureReinitModal.scss +++ b/src/components/Ecogesture/ecogestureReinitModal.scss @@ -1,28 +1,26 @@ @import '../../styles/base/color'; .eg-reinit-modal { + display: flex; + flex-direction: column; + gap: 1rem; + align-items: center; color: $grey-bright; - margin: 1rem 0; - text-align: center; .title { + text-align: center; color: $white; } .warn-title { color: $orange; margin: 0 0.3rem; } - .text { - margin: 1rem 0; - text-align: left; - } .buttons-container { display: flex; + gap: 1rem; + width: 100%; button { + margin: 0; min-height: 45px; - cursor: pointer; - } - button.btn1 { - margin-right: 1rem; } } } diff --git a/src/components/Ecogesture/singleEcogesture.scss b/src/components/Ecogesture/singleEcogesture.scss index 555733dccd5512536ecf76bc0b7e04dccf27d5d7..f6707548e35b190ed48e90f6b6d26527f36b6b9a 100644 --- a/src/components/Ecogesture/singleEcogesture.scss +++ b/src/components/Ecogesture/singleEcogesture.scss @@ -44,24 +44,16 @@ } .styled-container { line-height: 150%; - background: radial-gradient( - 60.65% 30.62% at 50% 3.13%, - #2a2b30 0%, - #1b1c22 100% - ); - border: 3px solid $blue-40; - padding: 1.5rem 0.6rem; - border-radius: 50px 1px 50px 1px; + padding: 1rem; margin: 1.5rem 0 1rem; max-width: 500px; .long-name { text-align: center; - font-weight: bold; color: white; } .description { display: none; - margin: 0.5rem; + margin: 1.5rem 0.5rem 0.5rem 0.5rem; text-align: left; } .block { @@ -75,17 +67,20 @@ } } .buttons-selection { - display: flex; width: 100%; + display: flex; + gap: 0.5rem; justify-content: center; - button.btn-secondary-negative { - height: 45px; - max-width: 160px; - width: 100%; - border-radius: 4px; + button { + margin: 0; + &.btn-secondary-negative { + height: 45px; + max-width: 160px; + width: 100%; + border-radius: 4px; + } } .objective-btn { - margin-right: 0.5rem; span { color: $grey-bright; } diff --git a/src/components/EcogestureSelection/EcogestureSelection.tsx b/src/components/EcogestureSelection/EcogestureSelection.tsx index f0749606ee9f75d5cba721a0621af4a4f99c0bf9..866bb07954f3b228000766ed24dd77102b885c49 100644 --- a/src/components/EcogestureSelection/EcogestureSelection.tsx +++ b/src/components/EcogestureSelection/EcogestureSelection.tsx @@ -16,10 +16,12 @@ import EcogestureSelectionRestart from 'components/EcogestureSelection/Ecogestur import EcogestureSelectionEnd from 'components/EcogestureSelection/EcogestureSelectionEnd' import StyledSpinner from 'components/CommonKit/Spinner/StyledSpinner' import { FluidType } from 'enum/fluid.enum' +import { useHistory } from 'react-router-dom' const EcogestureSelection: React.FC = () => { const { t } = useI18n() const client = useClient() + const history = useHistory() const [isLoading, setIsLoading] = useState(true) const [headerHeight, setHeaderHeight] = useState<number>(0) const [indexEcogesture, setIndexEcogesture] = useState<number>(0) @@ -126,15 +128,14 @@ const EcogestureSelection: React.FC = () => { <CozyBar titleKey={t('common.title_ecogestures_choice')} isNotKey={true} - displayBackArrow={indexEcogesture === 0 ? false : true} - backFunction={() => setIndexEcogesture(prev => prev - 1)} + displayBackArrow={true} + backFunction={() => history.push('/ecogestures')} /> <Header setHeaderHeight={defineHeaderHeight} desktopTitleKey={t('common.title_ecogestures_choice')} - displayBackArrow={indexEcogesture === 0 ? false : true} + displayBackArrow={true} isNotKey={true} - backFunction={() => setIndexEcogesture(prev => prev - 1)} > <div className="eg-selection-header"> {indexEcogesture <= ecogestureList.length - 1 diff --git a/src/components/EcogestureSelection/EcogestureSelectionDetail.spec.tsx b/src/components/EcogestureSelection/EcogestureSelectionDetail.spec.tsx index b3503365c5ff2d2eed4b8b788b18af26c627cdb8..5b8e36a2047a075b2e62837bf748dbf4791d1683 100644 --- a/src/components/EcogestureSelection/EcogestureSelectionDetail.spec.tsx +++ b/src/components/EcogestureSelection/EcogestureSelectionDetail.spec.tsx @@ -37,6 +37,7 @@ describe('EcogestureSelectionDetail component', () => { <EcogestureSelectionDetail ecogesture={ecogesturesData[0]} validate={mockValidate} + title={ecogesturesData[0].shortName} /> ) await waitForComponentToPaint(wrapper) @@ -49,6 +50,7 @@ describe('EcogestureSelectionDetail component', () => { <EcogestureSelectionDetail ecogesture={ecogesturesData[0]} validate={mockValidate} + title={ecogesturesData[0].shortName} /> ) wrapper.find(Button).at(0).simulate('click') @@ -62,6 +64,7 @@ describe('EcogestureSelectionDetail component', () => { <EcogestureSelectionDetail ecogesture={ecogesturesData[0]} validate={mockValidate} + title={ecogesturesData[0].shortName} /> ) wrapper.find(Button).at(1).simulate('click') @@ -75,6 +78,7 @@ describe('EcogestureSelectionDetail component', () => { <EcogestureSelectionDetail ecogesture={ecogesturesData[0]} validate={mockValidate} + title={ecogesturesData[0].shortName} /> ) wrapper.find(Button).at(2).simulate('click') diff --git a/src/components/EcogestureSelection/EcogestureSelectionEnd.tsx b/src/components/EcogestureSelection/EcogestureSelectionEnd.tsx index 13a515bc70c3dda147ad62af835f1f2c7bc3418e..5bfd2f9b896f94ab42ed0cbbb9fa75342c8c00a8 100644 --- a/src/components/EcogestureSelection/EcogestureSelectionEnd.tsx +++ b/src/components/EcogestureSelection/EcogestureSelectionEnd.tsx @@ -16,7 +16,7 @@ const EcogestureSelectionEnd: React.FC = () => { return ( <div className="eg-selection-end-container"> <div className="content"> - <div className="title text-21-bold"> + <div className="title text-28-bold"> {t('ecogesture_selection.title_final')} </div> <StyledIcon icon={icon} size={120} /> diff --git a/src/components/EcogestureSelection/__snapshots__/EcogestureSelection.spec.tsx.snap b/src/components/EcogestureSelection/__snapshots__/EcogestureSelection.spec.tsx.snap index 7bf5a2890a74340c966a3baadba5fb0b89517315..5680d8025e4e8999108f259e115c2fe00035c465 100644 --- a/src/components/EcogestureSelection/__snapshots__/EcogestureSelection.spec.tsx.snap +++ b/src/components/EcogestureSelection/__snapshots__/EcogestureSelection.spec.tsx.snap @@ -16,14 +16,13 @@ exports[`EcogestureSelection component should be rendered correctly 1`] = ` <EcogestureSelection> <mock-cozybar backFunction={[Function]} - displayBackArrow={false} + displayBackArrow={true} isNotKey={true} titleKey="common.title_ecogestures_choice" /> <mock-header - backFunction={[Function]} desktopTitleKey="common.title_ecogestures_choice" - displayBackArrow={false} + displayBackArrow={true} isNotKey={true} setHeaderHeight={[Function]} > diff --git a/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionDetail.spec.tsx.snap b/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionDetail.spec.tsx.snap index b75cf8e8a6fc00a05347245c6640bc9071ba725d..13d309ddfbb17765cde97b784c6f2f7bc7e221d6 100644 --- a/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionDetail.spec.tsx.snap +++ b/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionDetail.spec.tsx.snap @@ -35,6 +35,7 @@ exports[`EcogestureSelectionDetail component should be rendered correctly 1`] = "viewedInSelection": false, } } + title="Bonhomme de neige" validate={[MockFunction]} > <div @@ -78,7 +79,9 @@ exports[`EcogestureSelectionDetail component should be rendered correctly 1`] = </StyledIcon> <div className="text-22 title" - /> + > + Bonhomme de neige + </div> <div className="text text-18-bold" > diff --git a/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionEnd.spec.tsx.snap b/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionEnd.spec.tsx.snap index 82c3300b01227f80f3275354e41b5bb8886c52b0..4e0248f1f278b5686a66e12daf41c7bfa28ab2bc 100644 --- a/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionEnd.spec.tsx.snap +++ b/src/components/EcogestureSelection/__snapshots__/EcogestureSelectionEnd.spec.tsx.snap @@ -9,7 +9,7 @@ exports[`EcogestureSelectionEnd component should be rendered correctly 1`] = ` className="content" > <div - className="title text-21-bold" + className="title text-28-bold" > ecogesture_selection.title_final </div> diff --git a/src/components/EcogestureSelection/ecogestureSelectionDetail.scss b/src/components/EcogestureSelection/ecogestureSelectionDetail.scss index 332f7af6592df06e568c62b3402c3e094a1fed37..c680eaa3788c672a2073a55a949642a0b89861f0 100644 --- a/src/components/EcogestureSelection/ecogestureSelectionDetail.scss +++ b/src/components/EcogestureSelection/ecogestureSelectionDetail.scss @@ -18,15 +18,18 @@ } .content { display: flex; + gap: 0.5rem; flex-direction: column; flex: 1; justify-content: center; align-items: center; + + .title { + color: $soft-grey; + font-weight: 700; + } + .icon { - margin: 5rem 0 0; - @media #{$large-phone} { - margin: 1rem 0 0; - } @media #{$phone} { width: 50%; height: 50%; @@ -36,6 +39,7 @@ height: 30%; } } + .text { min-height: 4.875rem; display: flex; @@ -46,14 +50,15 @@ .buttons { margin: 1rem 0; display: flex; + gap: 0.5rem; flex-direction: row; justify-content: center; width: 100%; button.btn-secondary-negative { + margin: 0; padding: 0.75rem 0.25rem; - margin: 0 0.25rem; height: 7.375rem; - width: 6.5rem; + border: 1px solid $grey-bright; border-radius: 0.25rem; &:focus, &.active, @@ -71,10 +76,4 @@ background: transparent; } } - - .title { - margin-top: 1rem; - color: $soft-grey; - font-weight: 700; - } } diff --git a/src/components/EcogestureSelection/ecogestureSelectionEnd.scss b/src/components/EcogestureSelection/ecogestureSelectionEnd.scss index 1d9d3315659a459553e3761f34ac572c1d4f64b4..803a4b3aded9e9120c63c703f13e11cefde0c142 100644 --- a/src/components/EcogestureSelection/ecogestureSelectionEnd.scss +++ b/src/components/EcogestureSelection/ecogestureSelectionEnd.scss @@ -20,6 +20,7 @@ display: flex; flex-direction: column; flex: 1; + gap: 1rem; justify-content: center; align-items: center; .title { @@ -29,9 +30,6 @@ margin: 5rem; } } - .text { - margin-top: 1rem; - } } .buttons { margin: 1rem 0; diff --git a/src/components/Export/exportLoadingModal.tsx b/src/components/Export/exportLoadingModal.tsx index 6855c40349d59940b459fd58302c38d4329df8dd..37ff129504745d0d0977d978f9daacd13738188b 100644 --- a/src/components/Export/exportLoadingModal.tsx +++ b/src/components/Export/exportLoadingModal.tsx @@ -57,12 +57,14 @@ const ExportLoadingModal: React.FC<ExportLoadingModalProps> = ({ const getExportDataFluid = useCallback( async (fluidType: FluidType): Promise<any> => { const consumptionService = new ConsumptionDataManager(client) - const firstDataDate = await consumptionService.fetchAllFirstDateData([ - fluidType, - ]) - const lastDataDate = await consumptionService.fetchAllLastDateData([ - fluidType, - ]) + const firstDataDate = await consumptionService.fetchAllFirstDateData( + [fluidType], + TimeStep.MONTH + ) + const lastDataDate = await consumptionService.fetchAllLastDateData( + [fluidType], + TimeStep.MONTH + ) if (!firstDataDate[0] || !lastDataDate[0]) return null const timePeriod: TimePeriod = { diff --git a/src/components/FormGlobal/FormNavigation.tsx b/src/components/FormGlobal/FormNavigation.tsx index 085b6984ec69c9908f6f82ca76bc0da2a67e35a6..d2711c30bb04c4f18c8360ea7e55836d582aa1fc 100644 --- a/src/components/FormGlobal/FormNavigation.tsx +++ b/src/components/FormGlobal/FormNavigation.tsx @@ -13,6 +13,7 @@ interface FormNavigationProps { handlePrevious: Function handleNext: Function disableNextButton: boolean + disablePrevButton?: boolean isEcogesture?: boolean isLastConnectStep?: boolean } @@ -22,6 +23,7 @@ const FormNavigation: React.FC<FormNavigationProps> = ({ handlePrevious, handleNext, disableNextButton, + disablePrevButton, isEcogesture, isLastConnectStep, }: FormNavigationProps) => { @@ -44,7 +46,9 @@ const FormNavigation: React.FC<FormNavigationProps> = ({ aria-label={t('profile_type.accessibility.button_previous')} onClick={handlePreviousClick} className={'profile-navigation-button'} - disabled={step === ProfileTypeStepForm.HOUSING_TYPE} + disabled={ + disablePrevButton || step === ProfileTypeStepForm.HOUSING_TYPE + } classes={{ root: 'btn-profile-back', label: 'text-16-bold', diff --git a/src/components/FormGlobal/formNavigation.scss b/src/components/FormGlobal/formNavigation.scss index d3eca1a9e80d90ee26fc517a3c3951038981a41c..827eb3c93414073fa34204a33e3a0984fd155d53 100644 --- a/src/components/FormGlobal/formNavigation.scss +++ b/src/components/FormGlobal/formNavigation.scss @@ -15,9 +15,6 @@ height: 3rem; } - .disabled { - opacity: 0.5; - } button.profile-navigation-button { max-width: 12.5rem; margin: 0; diff --git a/src/components/Options/HelpLink.scss b/src/components/Options/HelpLink.scss index 9494f5d35ed23f1e58391233d104520c0398f710..6b6d881a475564c4c46cb1b3c40d3cc066ca9588 100644 --- a/src/components/Options/HelpLink.scss +++ b/src/components/Options/HelpLink.scss @@ -7,7 +7,7 @@ align-items: center; justify-content: center; padding: 0 1.5rem; - margin-top: 1rem; + margin-top: 2rem; .help-content { width: 45.75rem; a { diff --git a/src/components/Options/OptionsView.tsx b/src/components/Options/OptionsView.tsx index b180f4d13709dca030e303cc135206228c6e1f63..086a22ccffc9d100cf7cbf8f7e4bec11a22a013a 100644 --- a/src/components/Options/OptionsView.tsx +++ b/src/components/Options/OptionsView.tsx @@ -9,7 +9,7 @@ import ExportOptions from 'components/Options/exportOptions' import ReportOptions from 'components/Options/ReportOptions' import Version from 'components/Version/Version' import React, { useState } from 'react' -import HelpLink from './HelpLink' +// import HelpLink from './HelpLink' import { MatomoOptOut } from './MatomoOptOut' import ProfileTypeOptions from './ProfileTypeOptions' @@ -30,7 +30,8 @@ const OptionsView: React.FC = () => { <ExportOptions /> <ReportOptions /> <FAQLink /> - <HelpLink /> + {/* Waiting for SAU to be ready to enable button. When it's ready, remove FAQ & CGU */} + {/* <HelpLink /> */} <LegalNoticeLink /> <GCULink /> <MatomoOptOut /> diff --git a/src/components/Options/__snapshots__/OptionsView.spec.tsx.snap b/src/components/Options/__snapshots__/OptionsView.spec.tsx.snap index 91ffa63224604baf3907a4db1eab2aecc99e189b..8889596f229dbeef4341f3f654f6cb9502b91401 100644 --- a/src/components/Options/__snapshots__/OptionsView.spec.tsx.snap +++ b/src/components/Options/__snapshots__/OptionsView.spec.tsx.snap @@ -16,7 +16,6 @@ exports[`OptionsView component should be rendered correctly 1`] = ` <ExportOptions /> <ReportOptions /> <FAQLink /> - <HelpLink /> <LegalNoticeLink /> <GCULink /> <MatomoOptOut /> diff --git a/src/components/ProfileType/ProfileTypeFinished.tsx b/src/components/ProfileType/ProfileTypeFinished.tsx index b71f51309fb3c514080a8c068197d520e2af3d15..24be38a594bf271e7dd159bf2e851d53e5175dd5 100644 --- a/src/components/ProfileType/ProfileTypeFinished.tsx +++ b/src/components/ProfileType/ProfileTypeFinished.tsx @@ -131,7 +131,7 @@ const ProfileTypeFinished: React.FC<ProfileTypeFinishedProps> = ({ onClick={handleClick} className={'profile-type-finished-button'} classes={{ - root: 'btn-secondary-negative', + root: 'btn-primary-positive', label: 'text-16-normal', }} > diff --git a/src/components/Splash/SplashRoot.tsx b/src/components/Splash/SplashRoot.tsx index a17087d6376bb8094dc9cf15eb50b62c5b0d6e92..db60f3bacedc0217adbe02bd591e180f15aae9d8 100644 --- a/src/components/Splash/SplashRoot.tsx +++ b/src/components/Splash/SplashRoot.tsx @@ -264,7 +264,11 @@ const SplashRoot = ({ fadeTimer = 1000, children }: SplashRootProps) => { try { // Check customPopup from backoffice const customModalInfo = await customPopupService.getCustomPopup() - if (customModalInfo && today !== profile?.customPopupDate.toISO()) { + if ( + customModalInfo && + today !== profile?.customPopupDate.toISO() && + !profile?.isFirstConnection + ) { dispatch(setCustomPopup(customModalInfo)) } } catch (error) { @@ -277,7 +281,11 @@ const SplashRoot = ({ fadeTimer = 1000, children }: SplashRootProps) => { await partnersInfoService.getPartnersInfo() // If notification is activated and konnector is connected, set FluidStatus to PARTNER_ISSUE - if (partnersInfo && partnersInfo.notification_activated) { + if ( + partnersInfo && + partnersInfo.notification_activated && + !profile?.isFirstConnection + ) { const fluidService = new FluidService(client) const _updatedFluidStatus: FluidStatus[] = await fluidService.getFluidStatus(partnersInfo) diff --git a/src/locales/fr.json b/src/locales/fr.json index 66c17cee0371c55215c42aa3fc56db53d8358900..afad8021e9843f968e5bc4223f858eddf0435587 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -159,7 +159,7 @@ "consentLi2": "L'historique et le relevé de vos consommations au pas de temps 30 minutes", "consentLi3": "Les puissances maximales atteintes quotidiennement", "consentLi4": "Les données contractuelles (début de contrat et puissance souscrite)", - "consentCheck1": "Je consens à partager les données personnelles ci-dessus pour une durée d'<span>un an</span>", + "consentCheck1": "Je consens à partager les données personnelles ci-dessus pour une durée d'<span>un\u00a0an</span>", "consentCheck2": "J’atteste être le titulaire du point de livraison (PDL) renseigné à l’étape précédente", "modalHint": { "accessibility": "Titre de la modale", @@ -320,7 +320,7 @@ "release_notes_modal": { "title": "Du nouveau sur Ecolyo !", "message": "Les mises à jour suivantes ont été effectuées sur votre application\u00a0:", - "go_back": "Retour", + "go_back": "J'ai compris", "accessibility": { "window_title": "Fenêtre de notifications", "button_go_back": "J'ai compris" @@ -517,7 +517,7 @@ "ecogesture_selection": { "header": "Sélection des astuces", "title": "Vous avez parcouru un groupe de %{smart_count} astuces", - "text": "Voulez-vous continuer sur votre lancée ou remettre cette sélection à plus tard\u00a0??", + "text": "Voulez-vous continuer sur votre lancée ou remettre cette sélection à plus tard\u00a0?", "title_final": "Félicitations !", "text_final_1": "Vous avez terminé la sélection des astuces adaptées à votre consommation.", "text_final_2": "Vous pouvez les retrouver dans les sections “Objectifs” et “Je fais déjà” selon que vous les pratiquiez déjà ou non.", diff --git a/src/services/consumption.service.ts b/src/services/consumption.service.ts index d43d3533e431c6288438417767be601ebd980e85..1da49be579942209febfab89a1010d083d8800e9 100644 --- a/src/services/consumption.service.ts +++ b/src/services/consumption.service.ts @@ -332,18 +332,25 @@ export default class ConsumptionDataManager { } public async fetchAllFirstDateData( - fluidTypes: FluidType[] + fluidTypes: FluidType[], + timeStep?: TimeStep ): Promise<(DateTime | null)[]> { let firstDay = null const firstDays = [] if (fluidTypes.length === 1) { firstDay = - (await this._queryRunnerService.getFirstDateData(fluidTypes[0])) || null + (await this._queryRunnerService.getFirstDateData( + fluidTypes[0], + timeStep + )) || null firstDays.push(firstDay) } else if (fluidTypes.length > 1) { for (const fluidType of fluidTypes) { firstDay = - (await this._queryRunnerService.getFirstDateData(fluidType)) || null + (await this._queryRunnerService.getFirstDateData( + fluidType, + timeStep + )) || null firstDays.push(firstDay) } } @@ -351,18 +358,25 @@ export default class ConsumptionDataManager { } public async fetchAllLastDateData( - fluidTypes: FluidType[] + fluidTypes: FluidType[], + timeStep?: TimeStep ): Promise<(DateTime | null)[]> { let lastDay = null const lastDays = [] if (fluidTypes.length === 1) { lastDay = - (await this._queryRunnerService.getLastDateData(fluidTypes[0])) || null + (await this._queryRunnerService.getLastDateData( + fluidTypes[0], + timeStep + )) || null lastDays.push(lastDay) } else if (fluidTypes.length > 1) { for (const fluidType of fluidTypes) { lastDay = - (await this._queryRunnerService.getLastDateData(fluidType)) || null + (await this._queryRunnerService.getLastDateData( + fluidType, + timeStep + )) || null lastDays.push(lastDay) } } diff --git a/src/services/queryRunner.service.ts b/src/services/queryRunner.service.ts index e27c295fb66b9e3ef487eafe3908327c295c8178..25437e189a76813c81f96ca47f0586671c9c319c 100644 --- a/src/services/queryRunner.service.ts +++ b/src/services/queryRunner.service.ts @@ -70,8 +70,12 @@ export default class QueryRunner { .sortBy([{ load: 'desc' }]) } - private buildFirstDateQuery(fluidType: FluidType, limit: number) { - const doctype = this.getRelevantDoctype(fluidType, TimeStep.DAY) + private buildFirstDateQuery( + fluidType: FluidType, + limit: number, + timeStep?: TimeStep + ) { + const doctype = this.getRelevantDoctype(fluidType, timeStep || TimeStep.DAY) return Q(doctype) .where({}) .indexFields(['year', 'month', 'day']) @@ -79,8 +83,12 @@ export default class QueryRunner { .limitBy(limit) } - private buildLastDateQuery(fluidType: FluidType, limit: number) { - const doctype = this.getRelevantDoctype(fluidType, TimeStep.DAY) + private buildLastDateQuery( + fluidType: FluidType, + limit: number, + timeStep?: TimeStep + ) { + const doctype = this.getRelevantDoctype(fluidType, timeStep || TimeStep.DAY) return Q(doctype) .where({}) .indexFields(['year', 'month', 'day']) @@ -384,21 +392,26 @@ export default class QueryRunner { } public async getFirstDateData( - fluidType: FluidType + fluidType: FluidType, + timeStep?: TimeStep ): Promise<DateTime | null> { - const query: QueryDefinition = this.buildFirstDateQuery(fluidType, 1) + const query: QueryDefinition = this.buildFirstDateQuery( + fluidType, + 1, + timeStep + ) const result = await this.fetchData(query) if ( result?.data[0]?.year && result?.data[0]?.month && - result?.data[0]?.day + result?.data[0]?.day >= 0 ) { return DateTime.local( result.data[0].year, result.data[0].month, - result.data[0].day, - result.data[0].hour ? result.data[0].hour : 0, - result.data[0].minute ? result.data[0].minute : 0 + result.data[0].day === 0 ? 1 : result.data[0].day, + result.data[0].hour || 0, + result.data[0].minute || 0 ).setZone('utc', { keepLocalTime: true, }) @@ -406,20 +419,27 @@ export default class QueryRunner { return null } - public async getLastDateData(fluidType: FluidType): Promise<DateTime | null> { - const query: QueryDefinition = this.buildLastDateQuery(fluidType, 1) + public async getLastDateData( + fluidType: FluidType, + timeStep?: TimeStep + ): Promise<DateTime | null> { + const query: QueryDefinition = this.buildLastDateQuery( + fluidType, + 1, + timeStep + ) const result = await this.fetchData(query) if ( result?.data[0]?.year && result?.data[0]?.month && - result?.data[0]?.day + result?.data[0]?.day >= 0 ) { return DateTime.local( result.data[0].year, result.data[0].month, - result.data[0].day, - result.data[0].hour ? result.data[0].hour : 0, - result.data[0].minute ? result.data[0].minute : 0 + result.data[0].day === 0 ? 1 : result.data[0].day, + result.data[0].hour || 0, + result.data[0].minute || 0 ).setZone('utc', { keepLocalTime: true, }) diff --git a/src/styles/base/_mixins.scss b/src/styles/base/_mixins.scss index 40c36f8691099ad1bba4bcf60d374f515e290a9c..11c9aa1fd4cd0ed0b919837852fc0f54b09e01af 100644 --- a/src/styles/base/_mixins.scss +++ b/src/styles/base/_mixins.scss @@ -23,6 +23,7 @@ } &:disabled { cursor: not-allowed; + opacity: 0.5; } } @mixin checkBox() {