Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • web-et-numerique/factory/llle_project/ecolyo
1 result
Select Git revision
Show changes
Showing
with 348 additions and 271 deletions
......@@ -38,16 +38,14 @@
}
}
.kmodal-content-text-center {
text-align: center;
}
.kmodal-info {
padding: 1rem;
text-align: center;
display: flex;
flex-direction: column;
gap: 24px;
.buttons {
display: flex;
gap: 0.825rem;
gap: 1rem;
}
.konnector-config {
align-items: center;
......@@ -58,32 +56,22 @@
gap: 1rem;
.elec-fail {
color: $grey-bright;
margin-top: 1rem;
}
&.mismatch {
.title {
color: $orange;
}
div {
margin-bottom: 1rem;
}
.info {
color: $grey-bright;
}
}
.kce-picto-txt {
color: $red-primary;
}
.kcs-picto-txt {
.headerSuccess {
color: $multi-color;
}
.commonErrors {
text-decoration: underline;
cursor: pointer;
margin: 1rem auto 0.5rem;
.headerError {
color: $red-primary;
}
.commonErrorsList {
text-align: left;
span {
......@@ -104,10 +92,10 @@
}
}
}
}
button {
margin-top: 1rem;
}
.light {
color: $grey-bright;
}
}
......
......@@ -12,7 +12,7 @@ import { Datachart, Dataload, TimePeriod } from 'models'
import React, { useCallback, useEffect } from 'react'
import ConsumptionDataManager from 'services/consumption.service'
import EnedisMonthlyAnalysisDataService from 'services/enedisMonthlyAnalysisData.service'
import { formatTwoDigits } from 'utils/utils'
import { formatTwoDigits, getFluidName } from 'utils/utils'
import * as XLSX from 'xlsx'
import './exportLoadingModal.scss'
......@@ -65,12 +65,11 @@ const ExportLoadingModal = ({
fluidType: FluidType
): Promise<ExportDataRow> => {
const dataRow: ExportDataRow = {}
const fluidName = getFluidName(fluidType)
dataRow[t('export.month')] = formatTwoDigits(dataload.date.month)
dataRow[t('export.year')] = dataload.date.year
dataRow[
`${t('export.consumption')} (${t(
`FLUID.${FluidType[fluidType]}.UNIT`
)})`
`${t('export.consumption')} (${t('FLUID.' + fluidName + '.UNIT')})`
] = dataload.value
if (fluidType === FluidType.ELECTRICITY) {
const emas = new EnedisMonthlyAnalysisDataService(client)
......
......@@ -35,7 +35,7 @@ const ReportOptions = () => {
const isWaterConnected =
fluidStatus[FluidType.WATER].status !== FluidState.NOT_CONNECTED &&
fluidStatus[FluidType.WATER].status !== FluidState.KONNECTOR_NOT_FOUND &&
fluidStatus[FluidType.WATER].status !== FluidState.ERROR_LOGIN_FAILED
fluidStatus[FluidType.WATER].status !== FluidState.LOGIN_FAILED
const setWaterLimit = (
e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>
......
......@@ -41,7 +41,7 @@ const PartnerIssueModal = ({
onClose={(event, reason): void => {
event && reason !== 'backdropClick' && handleCloseClick(issuedFluid)
}}
aria-labelledby="accessibility-title"
aria-label={t('consumption.partner_issue_modal.accessibility_title')}
classes={{
root: 'modal-root',
paper: 'modal-paper',
......
......@@ -8,6 +8,7 @@ exports[`PartnerIssueModal component should render correctly 1`] = `
aria-hidden="true"
/>
<div
aria-label="consumption.partner_issue_modal.accessibility_title"
class="MuiDialog-root modal-root"
role="presentation"
style="position: fixed; z-index: 1500; right: 0px; bottom: 0px; top: 0px; left: 0px;"
......@@ -28,7 +29,6 @@ exports[`PartnerIssueModal component should render correctly 1`] = `
tabindex="-1"
>
<div
aria-labelledby="accessibility-title"
class="MuiPaper-root MuiDialog-paper modal-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthSm MuiPaper-elevation24 MuiPaper-rounded"
role="dialog"
>
......
/* eslint-disable jsx-a11y/no-autofocus */
import { InputAdornment, OutlinedInput } from '@material-ui/core'
import FormNavigation from 'components/CommonKit/FormNavigation/FormNavigation'
import 'components/ProfileType/profileTypeForm.scss'
import { useI18n } from 'cozy-ui/transpiled/react/I18n'
......@@ -6,7 +7,6 @@ import { ProfileTypeStepForm } from 'enums'
import { ProfileType, ProfileTypeAnswer, ProfileTypeValues } from 'models'
import React, { useCallback, useEffect, useState } from 'react'
import { useAppSelector } from 'store/hooks'
import { OutlinedInput, TextField, InputAdornment } from '@material-ui/core'
interface ProfileTypeFormNumberProps {
step: ProfileTypeStepForm
......
import { render, screen } from '@testing-library/react'
import { act, render, screen, waitFor } from '@testing-library/react'
import { userEvent } from '@testing-library/user-event'
import React from 'react'
import { Provider } from 'react-redux'
......@@ -31,21 +31,23 @@ describe('TermsView component', () => {
jest.clearAllMocks()
})
it('should be rendered correctly', () => {
it('should be rendered correctly', async () => {
const { container } = render(
<Provider store={store}>
<TermsView />
</Provider>
)
await waitFor(() => null, { container })
expect(container).toMatchSnapshot()
})
it('should be unable to click "validate" button first then enable checkboxes and valid consent', async () => {
mockCreateTerm.mockResolvedValueOnce(mockUpToDateTerm)
render(
const { container } = render(
<Provider store={store}>
<TermsView />
</Provider>
)
await waitFor(() => null, { container })
const acceptButton = screen.getAllByRole('button')[2]
expect(acceptButton).toBeDisabled()
......@@ -56,6 +58,34 @@ describe('TermsView component', () => {
await userEvent.click(boxLegal)
await userEvent.click(acceptButton)
expect(mockAppDispatch).toHaveBeenCalledTimes(3)
expect(mockAppDispatch).toHaveBeenCalledTimes(4)
})
it('should open CGU modal', async () => {
render(
<Provider store={store}>
<TermsView />
</Provider>
)
await act(async () => {
await userEvent.click(
screen.getByRole('button', { name: 'dataShare.validCGU_button' })
)
})
expect(screen.getByRole('dialog')).toBeInTheDocument()
})
it('should open legal notice modal', async () => {
render(
<Provider store={store}>
<TermsView />
</Provider>
)
await act(async () => {
await userEvent.click(
screen.getByRole('button', { name: 'dataShare.validLegal_button' })
)
})
expect(screen.getByRole('dialog')).toBeInTheDocument()
})
})
......@@ -18,27 +18,24 @@ const TermsView = () => {
const navigate = useNavigate()
const dispatch = useAppDispatch()
const { termsStatus } = useAppSelector(state => state.ecolyo.global)
const [GCUValidation, setGCUValidation] = useState<boolean>(false)
const [dataConsentValidation, setDataConsentValidation] =
useState<boolean>(false)
const [openCGUModal, setOpenCGUModal] = useState<boolean>(false)
const [openLegalNoticeModal, setOpenLegalNoticeModal] =
useState<boolean>(false)
const [GCUValidation, setGCUValidation] = useState(false)
const [dataConsentValidation, setDataConsentValidation] = useState(false)
const [openCGUModal, setOpenCGUModal] = useState(false)
const [openLegalNoticeModal, setOpenLegalNoticeModal] = useState(false)
const toggleCGUModal = () => {
setOpenCGUModal(prev => !prev)
}
const toggleLegalNoticeModal = () => {
setOpenLegalNoticeModal(prev => !prev)
}
const handleGCUValidate = useCallback(() => {
const handleGCUValidate = () => {
setGCUValidation(prev => !prev)
}, [])
const handleDataConsentValidation = useCallback(() => {
}
const handleDataConsentValidation = () => {
setDataConsentValidation(prev => !prev)
}, [])
}
const handleTermValidate = useCallback(async () => {
const termsService = new TermsService(client)
......
......@@ -9,7 +9,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -32,7 +32,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Eté",
"equipment": true,
"equipmentType": ["AIR_CONDITIONING"],
......@@ -55,7 +55,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -78,7 +78,7 @@
"impactLevel": 5,
"efficiency": 2.5,
"difficulty": 1,
"room": [1],
"room": ["BATHROOM"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -101,7 +101,7 @@
"impactLevel": 5,
"efficiency": 2.5,
"difficulty": 1,
"room": [1],
"room": ["BATHROOM"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -124,7 +124,7 @@
"impactLevel": 4,
"efficiency": 2,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["COMPUTER"],
......@@ -147,7 +147,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["MICROWAVE"],
......@@ -170,7 +170,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -193,7 +193,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -216,7 +216,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 1,
"room": [1, 2],
"room": ["BATHROOM", "KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -239,7 +239,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -262,7 +262,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -285,7 +285,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["WASHING_MACHINE", "DISHWASHER"],
......@@ -308,7 +308,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR"],
......@@ -331,7 +331,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [1, 2],
"room": ["BATHROOM", "KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -354,7 +354,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -377,7 +377,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -400,7 +400,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["WASHING_MACHINE", "DISHWASHER"],
......@@ -423,7 +423,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["COOKING_PLATES"],
......@@ -446,7 +446,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["WASHING_MACHINE", "DISHWASHER"],
......@@ -469,7 +469,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["DRYER"],
......@@ -492,7 +492,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["WASHING_MACHINE", "DISHWASHER"],
......@@ -515,7 +515,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["WASHING_MACHINE", "DISHWASHER"],
......@@ -538,7 +538,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["COOKING_PLATES"],
......@@ -561,7 +561,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -584,7 +584,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -607,7 +607,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -630,7 +630,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR"],
......@@ -653,7 +653,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["WASHING_MACHINE"],
......@@ -676,7 +676,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR"],
......@@ -699,7 +699,7 @@
"impactLevel": 10,
"efficiency": 5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -722,7 +722,7 @@
"impactLevel": 10,
"efficiency": 5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -745,7 +745,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -768,7 +768,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Eté",
"equipment": true,
"equipmentType": ["AIR_CONDITIONING", "FAN"],
......@@ -791,7 +791,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Eté",
"equipment": true,
"equipmentType": ["AIR_CONDITIONING"],
......@@ -814,7 +814,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -837,7 +837,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -860,7 +860,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -906,7 +906,7 @@
"impactLevel": 7,
"efficiency": 3.5,
"difficulty": 2,
"room": [1],
"room": ["BATHROOM"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -929,7 +929,7 @@
"impactLevel": 7,
"efficiency": 3.5,
"difficulty": 2,
"room": [1],
"room": ["BATHROOM"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -952,7 +952,7 @@
"impactLevel": 7,
"efficiency": 3.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -975,7 +975,7 @@
"impactLevel": 7,
"efficiency": 3.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Eté",
"equipment": false,
"equipmentType": [],
......@@ -998,7 +998,7 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1044,7 +1044,7 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 2,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["BOILER"],
......@@ -1067,7 +1067,7 @@
"impactLevel": 4,
"efficiency": 2,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["CURTAIN"],
......@@ -1090,7 +1090,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["INTERNET_BOX"],
......@@ -1113,7 +1113,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["MICROWAVE"],
......@@ -1136,7 +1136,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["VENTILATION"],
......@@ -1159,7 +1159,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1182,7 +1182,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [3],
"room": ["LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["DRYER"],
......@@ -1205,7 +1205,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1228,7 +1228,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1251,7 +1251,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR", "FREEZER"],
......@@ -1274,7 +1274,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1297,7 +1297,7 @@
"impactLevel": 3,
"efficiency": 1.5,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["VENTILATION"],
......@@ -1320,7 +1320,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1343,7 +1343,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 2,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1366,7 +1366,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR", "FREEZER"],
......@@ -1389,7 +1389,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR", "FREEZER"],
......@@ -1412,7 +1412,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR"],
......@@ -1435,7 +1435,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR", "FREEZER"],
......@@ -1458,7 +1458,7 @@
"impactLevel": 1,
"efficiency": 0.5,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1481,7 +1481,7 @@
"impactLevel": 8,
"efficiency": 4,
"difficulty": 3,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -1504,7 +1504,7 @@
"impactLevel": 7,
"efficiency": 3.5,
"difficulty": 3,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1527,7 +1527,7 @@
"impactLevel": 7,
"efficiency": 3.5,
"difficulty": 3,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1550,7 +1550,7 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 3,
"room": [1, 2, 3],
"room": ["BATHROOM", "KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["BOILER"],
......@@ -1573,7 +1573,7 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 3,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1596,7 +1596,7 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 3,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["HYDRAULIC_HEATING"],
......@@ -1619,7 +1619,7 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 3,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": true,
"equipmentType": [],
......@@ -1642,7 +1642,7 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 3,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["HYDRAULIC_HEATING"],
......@@ -1665,7 +1665,7 @@
"impactLevel": 5,
"efficiency": 2.5,
"difficulty": 3,
"room": [0],
"room": ["ALL"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["HYDRAULIC_HEATING"],
......@@ -1688,7 +1688,7 @@
"impactLevel": 5,
"efficiency": 2.5,
"difficulty": 3,
"room": [4],
"room": ["TOILET"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1711,7 +1711,7 @@
"impactLevel": 5,
"efficiency": 2.5,
"difficulty": 3,
"room": [1],
"room": ["BATHROOM"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1734,7 +1734,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 3,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": ["REFREGIRATOR"],
......@@ -1757,7 +1757,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 3,
"room": [3],
"room": ["LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1773,14 +1773,14 @@
{
"_id": "ECOGESTURE0078",
"usage": 6,
"fluidTypes": [0,2],
"fluidTypes": [0, 2],
"shortName": "Du tout cuit",
"longName": "J'éteins mon four avant la fin de la cuisson.",
"longDescription": "Lorsque votre plat arrive en fin de cuisson, éteignez le four. Il continuera de cuire grâce à la chaleur gardée par le four. Vous pouvez économiser jusqu'à 10 % d'électricité en prenant cette habitude !",
"impactLevel": 1,
"efficiency": 2,
"difficulty": 1,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1803,7 +1803,7 @@
"impactLevel": 2,
"efficiency": 1,
"difficulty": 1,
"room": [2,3],
"room": ["KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1826,10 +1826,10 @@
"impactLevel": 5,
"efficiency": 3,
"difficulty": 2,
"room": [0],
"room": ["GARDEN"],
"season": "Eté",
"equipment": false,
"equipmentType": [],
"equipmentType": ["GARDEN"],
"equipmentInstallation": false,
"investment": null,
"action": false,
......@@ -1849,7 +1849,7 @@
"impactLevel": 3,
"efficiency": 2,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1872,10 +1872,10 @@
"impactLevel": 4,
"efficiency": 1,
"difficulty": 2,
"room": [0],
"room": ["GARDEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
"equipmentType": ["GARDEN"],
"equipmentInstallation": false,
"investment": null,
"action": false,
......@@ -1895,7 +1895,7 @@
"impactLevel": 3,
"efficiency": 2,
"difficulty": 2,
"room": [2],
"room": ["KITCHEN"],
"season": "Sans saison",
"equipment": false,
"equipmentType": [],
......@@ -1911,14 +1911,14 @@
{
"_id": "ECOGESTURE0084",
"usage": 1,
"fluidTypes": [0,2],
"fluidTypes": [0, 2],
"shortName": "Défense d'entrer",
"longName": " J’isole les coffrets des volets roulants.",
"longDescription": "Un coffre de volets roulants mal isolé engendre la formation de ponts thermiques, pouvant donc laisser l'air froid s’infiltrer. Pour empêcher cela, mieux vaut les isoler avec de la laine de roche ou de la mousse multicouche, par exemple.",
"impactLevel": 7,
"efficiency": 2,
"difficulty": 3,
"room": [0],
"room": ["ALL"],
"season": "Hiver",
"equipment": false,
"equipmentType": [],
......@@ -1934,14 +1934,14 @@
{
"_id": "ECOGESTURE0085",
"usage": 4,
"fluidTypes": [0,2],
"fluidTypes": [0, 2],
"shortName": "Ballon au Chaud",
"longName": "J'isole mon ballon d'eau chaude.",
"longDescription": "Pour éviter un maximum les pertes de chaleur, vous pouvez vous munir d'un matériau isolant, comme la laine de roche ou la mousse de polyuréthane. Il vous suffira d'entourer votre ballon d'eau chaude avec celui-ci.",
"impactLevel": 6,
"efficiency": 3,
"difficulty": 3,
"room": [2,3],
"room": ["KITCHEN", "LAUNDRY"],
"season": "Sans saison",
"equipment": true,
"equipmentType": ["BOILER"],
......@@ -1964,10 +1964,10 @@
"impactLevel": 6,
"efficiency": 3,
"difficulty": 3,
"room": [0],
"room": ["GARDEN"],
"season": "Eté",
"equipment": false,
"equipmentType": [],
"equipmentType": ["GARDEN"],
"equipmentInstallation": true,
"investment": "Pluviomètre",
"action": false,
......
......@@ -9,11 +9,12 @@ export enum Usage {
}
export enum Room {
ALL = 0,
BATHROOM = 1,
KITCHEN = 2,
LAUNDRY = 3,
TOILET = 4,
ALL = 'ALL',
BATHROOM = 'BATHROOM',
KITCHEN = 'KITCHEN',
LAUNDRY = 'LAUNDRY',
TOILET = 'TOILET',
GARDEN = 'GARDEN',
}
export enum Season {
......@@ -38,6 +39,7 @@ export enum EquipmentType {
FREEZER = 'FREEZER',
BOILER = 'BOILER',
HYDRAULIC_HEATING = 'HYDRAULIC_HEATING',
GARDEN = 'GARDEN',
}
export enum EcogestureTab {
......
......@@ -6,10 +6,10 @@ export enum FluidType {
}
export enum FluidState {
KONNECTOR_NOT_FOUND = 0,
NOT_CONNECTED = 1,
DONE = 200,
ERROR = 300,
ERROR_LOGIN_FAILED = 301,
CHALLENGE_ASKED = 400,
KONNECTOR_NOT_FOUND = 'KONNECTOR_NOT_FOUND',
NOT_CONNECTED = 'NOT_CONNECTED',
DONE = 'DONE',
ERROR = 'ERROR',
LOGIN_FAILED = 'LOGIN_FAILED',
CHALLENGE_ASKED = 'CHALLENGE_ASKED',
}
......@@ -6,11 +6,11 @@ export enum KonnectorError {
UNKNOWN_ERROR = 'UNKNOWN_ERROR',
CRITICAL = 'exit status 1',
MISSING_SECRET = "Cannot read property 'secret' of null",
USER_ACTION_NEEDED_ACCOUNT_REMOVED = 'USER_ACTION_NEEDED.ACCOUNT_REMOVED',
}
export enum KonnectorUpdate {
ERROR_UPDATE = 'error_update',
ERROR_UPDATE_OAUTH = 'error_update_oauth',
LOGIN_FAILED = 'login_failed',
ERROR_CONSENT_FORM_GAS = 'error_consent_form_gas',
}
This diff is collapsed.
import { Client } from 'cozy-client'
import {
ECOGESTURE_DOCTYPE,
EGL_DAY_DOCTYPE,
EGL_MONTH_DOCTYPE,
EGL_YEAR_DOCTYPE,
......@@ -17,7 +18,14 @@ import {
} from 'doctypes'
import { UserQuizState } from 'enums'
import { DateTime } from 'luxon'
import { DataloadEntity, Profile, ProfileType, UserChallenge } from 'models'
import {
DataloadEntity,
Ecogesture,
Profile,
ProfileType,
UserChallenge,
} from 'models'
import ecogestureData from '../db/ecogestureData.json'
import { Migration } from './migration.type'
export const SCHEMA_INITIAL_VERSION = 0
......@@ -585,4 +593,26 @@ export const migrations: Migration[] = [
})
},
},
{
baseSchemaVersion: 23,
targetSchemaVersion: 24,
appVersion: '3.0.0',
description: 'Add garden room & equipment type',
releaseNotes: null,
docTypes: ECOGESTURE_DOCTYPE,
run: async (_client: Client, ecogestures: Ecogesture[]) => {
return ecogestures.map(ecogesture => {
const ecData = ecogestureData.find(
ec => ec._id === ecogesture.id
) as Ecogesture
if (!ecData) return ecogesture
ecogesture.room = ecData.room
ecogesture.equipmentType = ecData.equipmentType
return ecogesture
})
},
},
]
......@@ -25,4 +25,6 @@ export interface Ecogesture {
_id: string
_rev?: string
_type?: string
/** computed value with efficiency, difficulty and current season */
score?: number
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.