diff --git a/src/components/Connection/EPGLConnect/EpglForm.tsx b/src/components/Connection/EPGLConnect/EpglForm.tsx index 14ba3dd2c8b8fb66ccac624b268666b7f2acacc4..7191e963194e170835f4c0ab1c57bb3251afb7e2 100644 --- a/src/components/Connection/EPGLConnect/EpglForm.tsx +++ b/src/components/Connection/EPGLConnect/EpglForm.tsx @@ -100,7 +100,6 @@ const EpglForm = ({ hasCreatedAccount }: { hasCreatedAccount: boolean }) => { type="number" className={classNames('inputText', { error: error !== '' })} label={t(`auth.eglgrandlyon.connect_form.login`)} - name="login" onChange={e => changeLogin(e.target.value)} value={login} inputMode="numeric" @@ -110,7 +109,6 @@ const EpglForm = ({ hasCreatedAccount }: { hasCreatedAccount: boolean }) => { <TextField variant="outlined" id={'idFieldPassword' + fluidName} - name="password" type={showPassword ? 'text' : 'password'} className={classNames('inputText', { error: error !== '' })} label={t(`auth.eglgrandlyon.connect_form.password`)} diff --git a/src/components/Connection/GRDFConnect/StepConsent.tsx b/src/components/Connection/GRDFConnect/StepConsent.tsx index ac9c00dea6cea9d96aca4382038ab404dd4cab01..b6e982ad8a22c485107be4ce809c7bdb50d91e59 100644 --- a/src/components/Connection/GRDFConnect/StepConsent.tsx +++ b/src/components/Connection/GRDFConnect/StepConsent.tsx @@ -28,11 +28,10 @@ const StepConsent = ({ <li>{t('auth.grdfgrandlyon.consentLi1')}</li> <li>{t('auth.grdfgrandlyon.consentLi2')}</li> </ul> - <label className="inline"> + <label htmlFor="dataConsentGrdf" className="inline"> <input - id="dataConsent" + id="dataConsentGrdf" type="checkbox" - name="Data-consent-validation" className="inputCheckbox" checked={formConsent.dataConsent} onChange={e => @@ -45,11 +44,10 @@ const StepConsent = ({ }} /> </label> - <label className="inline"> + <label htmlFor="pceConfirm" className="inline"> <input - id="pdlConfirm" + id="pceConfirm" type="checkbox" - name="Data-consent-validation" className="inputCheckbox" checked={formConsent.pceConfirm} onChange={e => diff --git a/src/components/Connection/GRDFConnect/StepIdentity.tsx b/src/components/Connection/GRDFConnect/StepIdentity.tsx index ff7db3b2755c3aa716809a0c8577faa300e78dcf..53ca42370b82c0ddcbcf75cf205944b9b90195b9 100644 --- a/src/components/Connection/GRDFConnect/StepIdentity.tsx +++ b/src/components/Connection/GRDFConnect/StepIdentity.tsx @@ -23,7 +23,6 @@ export const StepIdentity = ({ variant="outlined" type="text" id="firstName" - name="firstName" value={formData.firstname} onChange={e => setFormData(prev => ({ ...prev, firstname: e.target.value })) @@ -36,7 +35,6 @@ export const StepIdentity = ({ variant="outlined" type="text" id="lastName" - name="lastName" required value={formData.lastname} onChange={e => @@ -49,7 +47,6 @@ export const StepIdentity = ({ variant="outlined" type="email" id="email" - name="email" required value={formData.email} onChange={e => @@ -62,7 +59,6 @@ export const StepIdentity = ({ variant="outlined" type="number" id="zipCode" - name="zipCode" required value={formData.postalCode} onChange={e => @@ -76,7 +72,6 @@ export const StepIdentity = ({ label={t('auth.grdfgrandlyon.pceLabel')} variant="outlined" id="pce" - name="pce" type="number" inputMode="numeric" required diff --git a/src/components/Connection/SGEConnect/StepAddress.tsx b/src/components/Connection/SGEConnect/StepAddress.tsx index dfbcc2d51dd3dfc20d9cea6d97fedfbd9efba956..b2971c47ff4576ca71dc2fda239fe26ed0bb40d4 100644 --- a/src/components/Connection/SGEConnect/StepAddress.tsx +++ b/src/components/Connection/SGEConnect/StepAddress.tsx @@ -21,7 +21,6 @@ const StepAddress = ({ sgeState, onChange }: StepAddressProps) => { variant="outlined" type="text" id="address" - name="address" value={sgeState.address} onChange={e => onChange('address', e.target.value)} required @@ -31,7 +30,6 @@ const StepAddress = ({ sgeState, onChange }: StepAddressProps) => { variant="outlined" type="number" id="zipCode" - name="zipCode" value={sgeState.zipCode ?? undefined} onChange={e => onChange('zipCode', e.target.value, 5)} required @@ -41,7 +39,6 @@ const StepAddress = ({ sgeState, onChange }: StepAddressProps) => { variant="outlined" type="text" id="city" - name="city" value={sgeState.city} onChange={e => onChange('city', e.target.value)} required diff --git a/src/components/Connection/SGEConnect/StepConsent.tsx b/src/components/Connection/SGEConnect/StepConsent.tsx index 33988363d12cafb532a43b721be00e1a02027e4a..d411ee838a4c8a6d2a144e0dfbe7fe1377798cc3 100644 --- a/src/components/Connection/SGEConnect/StepConsent.tsx +++ b/src/components/Connection/SGEConnect/StepConsent.tsx @@ -24,11 +24,10 @@ const StepConsent = ({ sgeState, onChange }: StepConsentProps) => { <li>{t('auth.enedissgegrandlyon.consentLi3')}</li> <li>{t('auth.enedissgegrandlyon.consentLi4')}</li> </ul> - <label className="inline"> + <label htmlFor="dataConsentSge" className="inline"> <input - id="dataConsent" + id="dataConsentSge" type="checkbox" - name="Data-consent-validation" className="inputCheckbox" onChange={e => onChange('dataConsent', e.target.checked)} checked={sgeState.dataConsent} @@ -39,11 +38,10 @@ const StepConsent = ({ sgeState, onChange }: StepConsentProps) => { }} /> </label> - <label className="inline"> + <label htmlFor="pdlConfirm" className="inline"> <input id="pdlConfirm" type="checkbox" - name="Data-consent-validation" className="inputCheckbox" onChange={e => onChange('pdlConfirm', e.target.checked)} checked={sgeState.pdlConfirm} diff --git a/src/components/Connection/SGEConnect/StepIdentityAndPdl.tsx b/src/components/Connection/SGEConnect/StepIdentityAndPdl.tsx index 6a79150325643d1b99fa30281eab1545aa26a632..c55c0ec6095019bcbc8f72c0f715a370d6fd74df 100644 --- a/src/components/Connection/SGEConnect/StepIdentityAndPdl.tsx +++ b/src/components/Connection/SGEConnect/StepIdentityAndPdl.tsx @@ -31,7 +31,6 @@ const StepIdentityAndPdl = ({ variant="outlined" type="text" id="firstName" - name="firstName" value={sgeState.firstName} onChange={e => onChange('firstName', e.target.value)} required @@ -41,7 +40,6 @@ const StepIdentityAndPdl = ({ variant="outlined" type="text" id="lastName" - name="lastName" value={sgeState.lastName} onChange={e => onChange('lastName', e.target.value)} required @@ -51,7 +49,6 @@ const StepIdentityAndPdl = ({ label={t('auth.enedissgegrandlyon.pdlLabel')} variant="outlined" id="pdl" - name="pdl" type="number" value={sgeState.pdl ? sgeState.pdl : undefined} onChange={e => onChange('pdl', e.target.value, 14)} diff --git a/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap b/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap index 9f0d7974e575da0f03b17f4c17a34f7f2153abdd..94a59e9e898428b659711ca25597d55927508475 100644 --- a/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap +++ b/src/components/Connection/SGEConnect/__snapshots__/SgeConnectView.spec.tsx.snap @@ -118,7 +118,6 @@ exports[`SgeConnectView component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="firstName" - name="firstName" required="" type="text" value="" @@ -163,7 +162,6 @@ exports[`SgeConnectView component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="lastName" - name="lastName" required="" type="text" value="" @@ -214,7 +212,6 @@ exports[`SgeConnectView component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="pdl" - name="pdl" required="" type="number" value="" diff --git a/src/components/Connection/SGEConnect/__snapshots__/StepAddress.spec.tsx.snap b/src/components/Connection/SGEConnect/__snapshots__/StepAddress.spec.tsx.snap index 9333648f773064e1c9f2b800faca207d7e80aa25..1e960609d47e012e634b5b704ae56d88290a8c40 100644 --- a/src/components/Connection/SGEConnect/__snapshots__/StepAddress.spec.tsx.snap +++ b/src/components/Connection/SGEConnect/__snapshots__/StepAddress.spec.tsx.snap @@ -35,7 +35,6 @@ exports[`StepAddress component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="address" - name="address" required="" type="text" value="" @@ -80,7 +79,6 @@ exports[`StepAddress component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="zipCode" - name="zipCode" required="" type="number" value="" @@ -125,7 +123,6 @@ exports[`StepAddress component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="city" - name="city" required="" type="text" value="" diff --git a/src/components/Connection/SGEConnect/__snapshots__/StepConsent.spec.tsx.snap b/src/components/Connection/SGEConnect/__snapshots__/StepConsent.spec.tsx.snap index 12291fade1d0270bf8dd71711888143f63131886..3b013e643b852ecda7e8fc260ed35bf4bc19ba74 100644 --- a/src/components/Connection/SGEConnect/__snapshots__/StepConsent.spec.tsx.snap +++ b/src/components/Connection/SGEConnect/__snapshots__/StepConsent.spec.tsx.snap @@ -33,11 +33,11 @@ exports[`StepConsent component should be rendered correctly 1`] = ` </ul> <label class="inline" + for="dataConsentSge" > <input class="inputCheckbox" - id="dataConsent" - name="Data-consent-validation" + id="dataConsentSge" type="checkbox" /> <span> @@ -46,11 +46,11 @@ exports[`StepConsent component should be rendered correctly 1`] = ` </label> <label class="inline" + for="pdlConfirm" > <input class="inputCheckbox" id="pdlConfirm" - name="Data-consent-validation" type="checkbox" /> <span> diff --git a/src/components/Connection/SGEConnect/__snapshots__/StepIdentityAndPdl.spec.tsx.snap b/src/components/Connection/SGEConnect/__snapshots__/StepIdentityAndPdl.spec.tsx.snap index 2eaf41d731643a98e6a4fa75ba5903fcaad55e04..f03a152d9d6bd82a52084beb3054dd008bfeb356 100644 --- a/src/components/Connection/SGEConnect/__snapshots__/StepIdentityAndPdl.spec.tsx.snap +++ b/src/components/Connection/SGEConnect/__snapshots__/StepIdentityAndPdl.spec.tsx.snap @@ -35,7 +35,6 @@ exports[`StepIdentityAndPdl component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="firstName" - name="firstName" required="" type="text" value="" @@ -80,7 +79,6 @@ exports[`StepIdentityAndPdl component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="lastName" - name="lastName" required="" type="text" value="" @@ -131,7 +129,6 @@ exports[`StepIdentityAndPdl component should be rendered correctly 1`] = ` aria-invalid="false" class="MuiInputBase-input MuiOutlinedInput-input" id="pdl" - name="pdl" required="" type="number" value="" diff --git a/src/components/EcogestureForm/EcogestureFormSingleChoice/EcogestureFormSingleChoice.tsx b/src/components/EcogestureForm/EcogestureFormSingleChoice/EcogestureFormSingleChoice.tsx index 5bafacadc17325471e9b481f95332591da58a019..2e94a1abf89b92eac86b6356ad924d15c75c3fab 100644 --- a/src/components/EcogestureForm/EcogestureFormSingleChoice/EcogestureFormSingleChoice.tsx +++ b/src/components/EcogestureForm/EcogestureFormSingleChoice/EcogestureFormSingleChoice.tsx @@ -50,10 +50,11 @@ const EcogestureFormSingleChoice = ({ `ecogesture_form.${EcogestureStepForm[step].toLowerCase()}.question` )} </div> - {answerType.choices.map(value => { + {answerType.choices.map((value, index) => { if (value === null) return null return ( <label + htmlFor={`answer-${index}`} key={value.toString()} className={classNames({ ['radio_short']: answerType.choices.length < 5, @@ -62,9 +63,9 @@ const EcogestureFormSingleChoice = ({ })} > <input + id={`answer-${index}`} type="radio" value={value} - name={value.toString()} onChange={() => setAnswer(value)} checked={answer === value} className={answer === value ? 'checked-input' : ''} diff --git a/src/components/EcogestureForm/EcogestureFormSingleChoice/__snapshots__/EcogestureFormSingleChoice.spec.tsx.snap b/src/components/EcogestureForm/EcogestureFormSingleChoice/__snapshots__/EcogestureFormSingleChoice.spec.tsx.snap index cc1a100279b74d343909aae9111fc9fb8203cc6b..ec3bc7d2a14a67a8cf17ce3f3d48449d466b2b6d 100644 --- a/src/components/EcogestureForm/EcogestureFormSingleChoice/__snapshots__/EcogestureFormSingleChoice.spec.tsx.snap +++ b/src/components/EcogestureForm/EcogestureFormSingleChoice/__snapshots__/EcogestureFormSingleChoice.spec.tsx.snap @@ -15,11 +15,12 @@ exports[`EcogestureFormSingleChoice component should be rendered correctly 1`] = </div> <label class="radio_short answer-checked" + for="answer-0" > <input checked="" class="checked-input" - name="individual" + id="answer-0" type="radio" value="individual" /> @@ -27,10 +28,11 @@ exports[`EcogestureFormSingleChoice component should be rendered correctly 1`] = </label> <label class="radio_short" + for="answer-1" > <input class="" - name="collective" + id="answer-1" type="radio" value="collective" /> diff --git a/src/components/EcogestureForm/__snapshots__/EcogestureFormView.spec.tsx.snap b/src/components/EcogestureForm/__snapshots__/EcogestureFormView.spec.tsx.snap index cc7a4efcff4ffc7673b77c576192b49459abcb1a..6cdf7d888e238978521d8866bff70a2f6883e4bf 100644 --- a/src/components/EcogestureForm/__snapshots__/EcogestureFormView.spec.tsx.snap +++ b/src/components/EcogestureForm/__snapshots__/EcogestureFormView.spec.tsx.snap @@ -22,10 +22,11 @@ exports[`EcogestureFormView component should be rendered correctly 1`] = ` </div> <label class="radio_short" + for="answer-0" > <input class="" - name="individual" + id="answer-0" type="radio" value="individual" /> @@ -33,10 +34,11 @@ exports[`EcogestureFormView component should be rendered correctly 1`] = ` </label> <label class="radio_short" + for="answer-1" > <input class="" - name="collective" + id="answer-1" type="radio" value="collective" /> diff --git a/src/components/Options/ExportData/ExportData.tsx b/src/components/Options/ExportData/ExportData.tsx index c8fc07003e0b0a8a6bd860901fa99336195132e8..488dc64b9c7fac27435d87b156719e42f73edfd7 100644 --- a/src/components/Options/ExportData/ExportData.tsx +++ b/src/components/Options/ExportData/ExportData.tsx @@ -66,12 +66,12 @@ const ExportData = () => { const fluidCheckbox = () => exportableFluids.map(fluidType => ( - <label key={fluidType}> + <label htmlFor={`export-${fluidType}`} key={fluidType}> <input + id={`export-${fluidType}`} type="checkbox" className="inputCheckbox" value={fluidType} - name={t(`FLUID.${FluidType[fluidType]}.LABEL`)} onChange={() => handleChange(fluidType)} checked={answer.includes(fluidType)} /> diff --git a/src/components/ProfileType/ProfileTypeFormMultiChoice/ProfileTypeFormMultiChoice.tsx b/src/components/ProfileType/ProfileTypeFormMultiChoice/ProfileTypeFormMultiChoice.tsx index 07f1895e9dc293df45da3d0b99395d4207457680..80f0876d1b639794ea64aa6ca57345af8169077e 100644 --- a/src/components/ProfileType/ProfileTypeFormMultiChoice/ProfileTypeFormMultiChoice.tsx +++ b/src/components/ProfileType/ProfileTypeFormMultiChoice/ProfileTypeFormMultiChoice.tsx @@ -82,15 +82,16 @@ const ProfileTypeFormMultiChoice = ({ const stringValue = value.toString() return ( <label + htmlFor={`answer${index}`} key={index} className={classNames('checkbox', { ['answer-checked']: answer.includes(stringValue), })} > <input + id={`answer${index}`} type="checkbox" value={stringValue} - name={stringValue} onChange={() => handleChange(stringValue)} checked={isChecked(stringValue)} /> diff --git a/src/components/ProfileType/ProfileTypeFormNumberSelection/ProfileTypeFormNumberSelection.tsx b/src/components/ProfileType/ProfileTypeFormNumberSelection/ProfileTypeFormNumberSelection.tsx index 06b84201e2e01bb60d1abaf69b3b1d89726861e9..25fddf04484ebe5cf320a1a68d0cfa888c37d3e9 100644 --- a/src/components/ProfileType/ProfileTypeFormNumberSelection/ProfileTypeFormNumberSelection.tsx +++ b/src/components/ProfileType/ProfileTypeFormNumberSelection/ProfileTypeFormNumberSelection.tsx @@ -83,7 +83,6 @@ const ProfileTypeFormNumberSelection = ({ type="tel" className="inputNumberIncrements" value={answer.toString()} - name={answerType.attribute} size="small" /> <Button diff --git a/src/components/ProfileType/ProfileTypeFormSingleChoice/ProfileTypeFormSingleChoice.tsx b/src/components/ProfileType/ProfileTypeFormSingleChoice/ProfileTypeFormSingleChoice.tsx index 0f5216e8f7f333c02c64627bb3c0046e710f016d..08755a2863e29040b7cd5cb808e1eaa2f7fa012b 100644 --- a/src/components/ProfileType/ProfileTypeFormSingleChoice/ProfileTypeFormSingleChoice.tsx +++ b/src/components/ProfileType/ProfileTypeFormSingleChoice/ProfileTypeFormSingleChoice.tsx @@ -76,6 +76,7 @@ const ProfileTypeFormSingleChoice = ({ return ( <label + htmlFor={`answer-${index}`} key={index} className={classNames({ ['radio_short']: answerType.choices.length < 5, @@ -84,9 +85,9 @@ const ProfileTypeFormSingleChoice = ({ })} > <input + id={`answer-${index}`} type="radio" value={value.toString()} - name={value.toString()} onChange={() => setAnswer(value)} checked={answer === value ? true : false} /> diff --git a/src/components/Terms/TermsView.tsx b/src/components/Terms/TermsView.tsx index d7262d8fc8f6677f3b65914683fed9701ce294e0..1ee54c07923b169c5e9ff0769b53dd57350e1a83 100644 --- a/src/components/Terms/TermsView.tsx +++ b/src/components/Terms/TermsView.tsx @@ -44,21 +44,20 @@ const TermsView = () => { <> <div className="terms-content"> <DataShareConsentContent /> - <label className="inline"> + <label htmlFor="dataConsent" className="inline"> <input + id="dataConsent" type="checkbox" - name="Data-consent-validation" className="inputCheckbox" onChange={e => setDataConsentValidation(e.target.checked)} checked={dataConsentValidation} /> {t('dataShare.validDataConsent')} </label> - <label className="inline"> + <label htmlFor="gcu" className="inline"> <input id="gcu" type="checkbox" - name="GCU-validation" className="inputCheckbox" onChange={e => setGCUValidation(e.target.checked)} checked={GCUValidation} diff --git a/src/components/Terms/__snapshots__/TermsView.spec.tsx.snap b/src/components/Terms/__snapshots__/TermsView.spec.tsx.snap index 0783bbe8bd4baac1ffc15c47ee7fddf4c20c265d..dca3c7f1da7cb73f6b9042d7c9f2fd641050a7f3 100644 --- a/src/components/Terms/__snapshots__/TermsView.spec.tsx.snap +++ b/src/components/Terms/__snapshots__/TermsView.spec.tsx.snap @@ -102,21 +102,22 @@ exports[`TermsView component should be rendered correctly 1`] = ` </div> <label class="inline" + for="dataConsent" > <input class="inputCheckbox" - name="Data-consent-validation" + id="dataConsent" type="checkbox" /> dataShare.validDataConsent </label> <label class="inline" + for="gcu" > <input class="inputCheckbox" id="gcu" - name="GCU-validation" type="checkbox" /> <div>