diff --git a/src/components/ProfileType/ProfileTypeFormMultiChoice.tsx b/src/components/ProfileType/ProfileTypeFormMultiChoice.tsx index 60ff6609caf94f75a16197172a25bc109c4a387e..1924a877d52b7955f3af21d9ddbda75375c98668 100644 --- a/src/components/ProfileType/ProfileTypeFormMultiChoice.tsx +++ b/src/components/ProfileType/ProfileTypeFormMultiChoice.tsx @@ -89,7 +89,9 @@ const ProfileTypeFormMultiChoice: React.FC<ProfileTypeFormMultiChoiceProps> = ({ `profile_type.${ProfileTypeStepForm[step].toLowerCase()}.question` )} </div> - <span>{t('profile_type.multi_choices')}</span> + <span className="profile-question-hint"> + {t('profile_type.multi_choices')} + </span> {answerType.choices.map( (value: ProfileTypeAnswerChoices, index: number) => { return value ? ( diff --git a/src/components/ProfileType/profileTypeForm.scss b/src/components/ProfileType/profileTypeForm.scss index c7a487fadbe90a59c59f3f096b9f1fc28d8aaf5c..62dd76b00aca103ddb641f5004fc4bf21ef0ef11 100644 --- a/src/components/ProfileType/profileTypeForm.scss +++ b/src/components/ProfileType/profileTypeForm.scss @@ -13,19 +13,27 @@ line-height: 150%; padding: 1rem 0; } - +.profile-question-hint { + font-size: 1rem; + color: $grey-bright; + display: block; + margin-bottom: 1rem; + font-style: italic; +} .profile-question-answers { display: flex; } -.profile-question-answers-radio-long { +.profile-question-answers-radio-long { flex-wrap: wrap; } .profile-question-answers-other { flex-direction: column; } -.radio_short, .radio_long, .checkbox { - background: linear-gradient(180deg, #323339 0%, #25262B 100%); +.radio_short, +.radio_long, +.checkbox { + background: linear-gradient(180deg, #323339 0%, #25262b 100%); box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.55); margin: 0.5rem 0; display: flex; @@ -52,44 +60,52 @@ border-radius: 1px; } } -.radio_short, .checkbox { - padding: 1.2rem; - border-radius: 4px; +.radio_short, +.checkbox { + padding: 1.2rem; + border-radius: 4px; } .radio_long { - padding: .5rem 1rem; - border-radius: 20px; + padding: 0.5rem 1rem; + border-radius: 4px; text-align: center; } .answer-checked { - background: radial-gradient(105.25% 64.58% at 49.68% 70.83%, rgba(226, 137, 4, 0.5) 0%, rgba(255, 255, 255, 0) 100%), #F1C017; + background: radial-gradient( + 105.25% 64.58% at 49.68% 70.83%, + rgba(226, 137, 4, 0.5) 0%, + rgba(255, 255, 255, 0) 100% + ), + #f1c017; color: $dark-light-2; input { - &:before, &:after { - content: ''; - position: absolute; - display: inline-block; - background: $gold-shadow; - border-radius: 0.5rem; - } - &:before { - width: 3px; - height: 12px; - left: 10px; - top: 4px; - transform: rotate(41deg); - } - &:after { - width: 3px; - height: 6px; - left: 5px; - top: 8px; - transform: rotate(133deg); + &:before, + &:after { + content: ''; + position: absolute; + display: inline-block; + background: $gold-shadow; + border-radius: 0.5rem; + } + &:before { + width: 3px; + height: 12px; + left: 10px; + top: 4px; + transform: rotate(41deg); + } + &:after { + width: 3px; + height: 6px; + left: 5px; + top: 8px; + transform: rotate(133deg); + } } - } } -.text, .number { +.text, +.number { font-size: 1.25rem; input { margin: 0.5rem; @@ -124,9 +140,9 @@ margin: 0.5rem; &:focus { - outline:none; + outline: none; } } button:disabled { opacity: 0.5; -} \ No newline at end of file +} diff --git a/src/constants/consumptionConstants/electricSpecific.json b/src/constants/consumptionConstants/electricSpecific.json index 0e5bf5ddf7863ef29185716049e238993391b967..86968545b046c8466cde29e61440f29b08f56234 100644 --- a/src/constants/consumptionConstants/electricSpecific.json +++ b/src/constants/consumptionConstants/electricSpecific.json @@ -4,13 +4,15 @@ "between_1948_and_1974": 3130, "between_1975_and_1989": 2900, "between_1990_and_1998": 3230, - "after_1999": 2900 + "after_1999": 2900, + "unknown": 2900 }, "appartment": { "before_1948": 1120, "between_1948_and_1974": 1880, "between_1975_and_1989": 1780, "between_1990_and_1998": 1670, - "after_1999": 2060 + "after_1999": 2060, + "unknown": 1780 } } diff --git a/src/constants/consumptionConstants/heating.json b/src/constants/consumptionConstants/heating.json index 1bfd6996204431ddb5536bb03bd4b4860337cb98..a4c49b014fb37664d9edf0675f4d68e70e9aa15d 100644 --- a/src/constants/consumptionConstants/heating.json +++ b/src/constants/consumptionConstants/heating.json @@ -5,14 +5,16 @@ "between_1948_and_1974": 184, "between_1975_and_1989": 140, "between_1990_and_1998": 129, - "after_1999": 106 + "after_1999": 106, + "unknown": 140 }, "appartment": { "before_1948": 119, "between_1948_and_1974": 150, "between_1975_and_1989": 105, "between_1990_and_1998": 73, - "after_1999": 74 + "after_1999": 74, + "unknown": 105 } }, "adjustment_outisde_facing_walls": { @@ -87,6 +89,16 @@ "window_replacement_and_roof_insulation": 0, "roof_and_wall_insulation": 0, "window_replacement_and_roof_and_wall_insulation": 0 + }, + "unknown": { + "none": 0, + "roof_insulation": 0, + "window_replacement": -0.06, + "wall_insulation": -0.2, + "window_replacement_and_wall_insulation": -0.25, + "window_replacement_and_roof_insulation": -0.07, + "roof_and_wall_insulation": -0.2, + "window_replacement_and_roof_and_wall_insulation": -0.25 } }, "adjustment_facilities": { diff --git a/src/enum/profileType.enum.ts b/src/enum/profileType.enum.ts index be91724175e06405f086cc525586bf83f623cd2c..76b288f4292631fceb458b71828fe8baf43f1ca5 100644 --- a/src/enum/profileType.enum.ts +++ b/src/enum/profileType.enum.ts @@ -22,6 +22,7 @@ export enum ConstructionYear { BETWEEN_1975_AND_1989 = 'between_1975_and_1989', BETWEEN_1990_AND_1998 = 'between_1990_and_1998', AFTER_1999 = 'after_1999', + UNKNOWN = 'unknown', } export enum IndividualOrCollective { diff --git a/src/locales/fr.json b/src/locales/fr.json index 46515581c570f754fa07573c477e03ec17976577..597d69db5966ced0bc3e2b9ce58eb638bc44a246 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -428,7 +428,8 @@ "between_1948_and_1974": "Entre 1975 et 1989", "between_1975_and_1989": "Entre 1975 et 1989", "between_1990_and_1998": "Entre 1990 et 1998", - "after_1999": "Après 1999" + "after_1999": "Après 1999", + "unknown": "Je ne sais pas" }, "area": { "title": "Surface", @@ -440,7 +441,11 @@ }, "outside_facing_walls": { "title": "Murs extérieurs", - "question": "Combien de façades donnent sur l'extérieur ?" + "question": "Combien de façades donnent sur l’extérieur ?", + "1": "1 façade", + "2": "2 façades", + "3": "3 façades", + "4": "4 façades" }, "floor": { "title": "Étage", @@ -474,7 +479,7 @@ }, "ventilation": { "title": "Ventilation double flux", - "question": "Etes-vous équipé d'une ventialtion double flux ?", + "question": "Etes-vous équipé d'une ventilation double flux ?", "yes": "Oui", "no": "Non", "unknown": "Je ne sais pas" diff --git a/src/services/profileType.service.ts b/src/services/profileType.service.ts index 3a9cf3f90427bc3aa827ba2607cd5b0badefced1..756b76654c8436a3afa372dd0acae96dd4c2dab4 100644 --- a/src/services/profileType.service.ts +++ b/src/services/profileType.service.ts @@ -591,9 +591,9 @@ export default class ProfileTypeService { } case ProfileTypeStepForm.OUTSIDE_FACING_WALLS: return { - type: ProfileTypeFormType.NUMBER_SELECTION, + type: ProfileTypeFormType.SINGLE_CHOICE, attribute: 'outsideFacingWalls', - choices: [1, 2, 3, 4], + choices: Object.values(OutsideFacingWalls), } case ProfileTypeStepForm.FLOOR: return { diff --git a/test/__mocks__/profileType.mock.ts b/test/__mocks__/profileType.mock.ts index 6c8d1907ad3eb766b30548a89ab147db563c8723..7fcdccf9c0c67a3ac35f798fa4d9e4b5d251c807 100644 --- a/test/__mocks__/profileType.mock.ts +++ b/test/__mocks__/profileType.mock.ts @@ -299,9 +299,9 @@ export const mockProfileTypeAnswers: ProfileTypeAnswer[] = [ choices: Object.values(ConstructionYear), }, { - type: ProfileTypeFormType.NUMBER_SELECTION, + type: ProfileTypeFormType.SINGLE_CHOICE, attribute: 'outsideFacingWalls', - choices: [1, 2, 3, 4], + choices: Object.values(OutsideFacingWalls), }, { type: ProfileTypeFormType.SINGLE_CHOICE,