Skip to content
Snippets Groups Projects
Commit 8ba80c2a authored by Aurélie HAUTBOIS's avatar Aurélie HAUTBOIS
Browse files

Merge branch 'features/US387-Update-profileType' into 'dev'

Features/us387 update profile type

See merge request web-et-numerique/llle_project/ecolyo!262
parents 12370ce5 da1b4b29
No related branches found
No related tags found
1 merge request!262Features/us387 update profile type
...@@ -10,6 +10,7 @@ import profileIcon from 'assets/icons/ico/profile.svg' ...@@ -10,6 +10,7 @@ import profileIcon from 'assets/icons/ico/profile.svg'
import { import {
HousingType, HousingType,
IndividualInsulationWork, IndividualInsulationWork,
IndividualOrCollective,
ThreeChoicesAnswer, ThreeChoicesAnswer,
} from 'enum/profileType.enum' } from 'enum/profileType.enum'
...@@ -87,6 +88,7 @@ describe('ProfileTypeOptions component', () => { ...@@ -87,6 +88,7 @@ describe('ProfileTypeOptions component', () => {
const profileTypeCompleted = { const profileTypeCompleted = {
...profileData, ...profileData,
} }
profileTypeCompleted.profileType.heating = IndividualOrCollective.INDIVIDUAL
profileTypeCompleted.isProfileTypeCompleted = true profileTypeCompleted.isProfileTypeCompleted = true
profileTypeCompleted.profileType.housingType = HousingType.APPARTMENT profileTypeCompleted.profileType.housingType = HousingType.APPARTMENT
profileTypeCompleted.profileType.hasInstalledVentilation = profileTypeCompleted.profileType.hasInstalledVentilation =
......
...@@ -9,7 +9,6 @@ import { ...@@ -9,7 +9,6 @@ import {
HousingType, HousingType,
ThreeChoicesAnswer, ThreeChoicesAnswer,
OutsideFacingWalls, OutsideFacingWalls,
ConstructionYear,
} from 'enum/profileType.enum' } from 'enum/profileType.enum'
import { FluidType } from 'enum/fluid.enum' import { FluidType } from 'enum/fluid.enum'
import { useHistory } from 'react-router-dom' import { useHistory } from 'react-router-dom'
...@@ -82,8 +81,7 @@ const ProfileTypeOptions: React.FC = () => { ...@@ -82,8 +81,7 @@ const ProfileTypeOptions: React.FC = () => {
`profile_type.housing_type.${profile.profileType.housingType}` `profile_type.housing_type.${profile.profileType.housingType}`
)} )}
</div> </div>
{profile.profileType.constructionYear !== {profile.profileType.constructionYear && (
ConstructionYear.UNKNOWN && (
<div className="value"> <div className="value">
{t( {t(
`profile_type.construction_year.${'text_' + `profile_type.construction_year.${'text_' +
......
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
"between_1975_and_1989": 1780, "between_1975_and_1989": 1780,
"between_1990_and_1998": 1670, "between_1990_and_1998": 1670,
"after_1999": 2060, "after_1999": 2060,
"unknown": 1780 "unknown": 2060
} }
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"between_1975_and_1989": 140, "between_1975_and_1989": 140,
"between_1990_and_1998": 129, "between_1990_and_1998": 129,
"after_1999": 106, "after_1999": 106,
"unknown": 140 "unknown": 106
}, },
"appartment": { "appartment": {
"before_1948": 119, "before_1948": 119,
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"between_1975_and_1989": 105, "between_1975_and_1989": 105,
"between_1990_and_1998": 73, "between_1990_and_1998": 73,
"after_1999": 74, "after_1999": 74,
"unknown": 105 "unknown": 74
} }
}, },
"adjustment_outisde_facing_walls": { "adjustment_outisde_facing_walls": {
...@@ -93,12 +93,12 @@ ...@@ -93,12 +93,12 @@
"unknown": { "unknown": {
"none": 0, "none": 0,
"roof_insulation": 0, "roof_insulation": 0,
"window_replacement": -0.06, "window_replacement": 0,
"wall_insulation": -0.2, "wall_insulation": 0,
"window_replacement_and_wall_insulation": -0.25, "window_replacement_and_wall_insulation": 0,
"window_replacement_and_roof_insulation": -0.07, "window_replacement_and_roof_insulation": 0,
"roof_and_wall_insulation": -0.2, "roof_and_wall_insulation": 0,
"window_replacement_and_roof_and_wall_insulation": -0.25 "window_replacement_and_roof_and_wall_insulation": 0
} }
}, },
"adjustment_facilities": { "adjustment_facilities": {
......
...@@ -451,6 +451,7 @@ ...@@ -451,6 +451,7 @@
"text_between_1975_and_1989": "Construit entre 1975 et 1989", "text_between_1975_and_1989": "Construit entre 1975 et 1989",
"text_between_1990_and_1998": "Construit entre 1990 et 1998", "text_between_1990_and_1998": "Construit entre 1990 et 1998",
"text_after_1999": "Construit après 1999", "text_after_1999": "Construit après 1999",
"text_unknown": "Construit après 1999",
"before_1948": "Avant 1948", "before_1948": "Avant 1948",
"between_1948_and_1974": "Entre 1975 et 1989", "between_1948_and_1974": "Entre 1975 et 1989",
"between_1975_and_1989": "Entre 1975 et 1989", "between_1975_and_1989": "Entre 1975 et 1989",
......
...@@ -10,7 +10,6 @@ import { ...@@ -10,7 +10,6 @@ import {
Floor, Floor,
HotWaterEquipment, HotWaterEquipment,
HousingType, HousingType,
IndividualInsulationWork,
IndividualOrCollective, IndividualOrCollective,
OutsideFacingWalls, OutsideFacingWalls,
ThreeChoicesAnswer, ThreeChoicesAnswer,
...@@ -32,25 +31,22 @@ const initialState: Profile = { ...@@ -32,25 +31,22 @@ const initialState: Profile = {
monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'), monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'),
isProfileTypeCompleted: false, isProfileTypeCompleted: false,
profileType: { profileType: {
housingType: HousingType.INDIVIDUAL_HOUSE, housingType: HousingType.APPARTMENT,
constructionYear: ConstructionYear.BETWEEN_1975_AND_1989, constructionYear: ConstructionYear.AFTER_1999,
area: 100, area: 35,
occupantsNumber: 4, occupantsNumber: 1,
outsideFacingWalls: OutsideFacingWalls.TWO, outsideFacingWalls: OutsideFacingWalls.ONE,
floor: Floor.NOT_APPLICABLE, floor: Floor.INTERMEDIATE_FLOOR,
heating: IndividualOrCollective.INDIVIDUAL, heating: IndividualOrCollective.COLLECTIVE,
coldWater: IndividualOrCollective.INDIVIDUAL, coldWater: IndividualOrCollective.INDIVIDUAL,
hotWater: IndividualOrCollective.INDIVIDUAL, hotWater: IndividualOrCollective.INDIVIDUAL,
individualInsulationWork: [ individualInsulationWork: [],
IndividualInsulationWork.WINDOW_REPLACEMENT,
IndividualInsulationWork.WALL_INSULATION,
],
hasInstalledVentilation: ThreeChoicesAnswer.NO, hasInstalledVentilation: ThreeChoicesAnswer.NO,
hasReplacedHeater: ThreeChoicesAnswer.NO, hasReplacedHeater: ThreeChoicesAnswer.NO,
hotWaterEquipment: HotWaterEquipment.SOLAR, hotWaterEquipment: HotWaterEquipment.OTHER,
warmingFluid: FluidType.ELECTRICITY, warmingFluid: FluidType.ELECTRICITY,
hotWaterFluid: FluidType.ELECTRICITY, hotWaterFluid: FluidType.ELECTRICITY,
cookingFluid: FluidType.ELECTRICITY, cookingFluid: FluidType.GAS,
}, },
} }
......
...@@ -5,7 +5,6 @@ import { ...@@ -5,7 +5,6 @@ import {
IndividualOrCollective, IndividualOrCollective,
HotWaterEquipment, HotWaterEquipment,
HousingType, HousingType,
IndividualInsulationWork,
OutsideFacingWalls, OutsideFacingWalls,
ThreeChoicesAnswer, ThreeChoicesAnswer,
} from 'enum/profileType.enum' } from 'enum/profileType.enum'
...@@ -32,24 +31,22 @@ export const profileData: Profile = { ...@@ -32,24 +31,22 @@ export const profileData: Profile = {
}), }),
sendAnalysisNotification: false, sendAnalysisNotification: false,
profileType: { profileType: {
housingType: HousingType.INDIVIDUAL_HOUSE, housingType: HousingType.APPARTMENT,
constructionYear: ConstructionYear.BETWEEN_1975_AND_1989, constructionYear: ConstructionYear.AFTER_1999,
area: 100, area: 35,
occupantsNumber: 4, occupantsNumber: 1,
outsideFacingWalls: OutsideFacingWalls.TWO, outsideFacingWalls: OutsideFacingWalls.ONE,
floor: Floor.NOT_APPLICABLE, floor: Floor.INTERMEDIATE_FLOOR,
heating: IndividualOrCollective.INDIVIDUAL, heating: IndividualOrCollective.COLLECTIVE,
coldWater: IndividualOrCollective.INDIVIDUAL,
hotWater: IndividualOrCollective.INDIVIDUAL, hotWater: IndividualOrCollective.INDIVIDUAL,
individualInsulationWork: [ individualInsulationWork: [],
IndividualInsulationWork.WINDOW_REPLACEMENT,
IndividualInsulationWork.WALL_INSULATION,
],
hasReplacedHeater: ThreeChoicesAnswer.NO,
hasInstalledVentilation: ThreeChoicesAnswer.NO, hasInstalledVentilation: ThreeChoicesAnswer.NO,
hotWaterEquipment: HotWaterEquipment.SOLAR, hasReplacedHeater: ThreeChoicesAnswer.NO,
hotWaterEquipment: HotWaterEquipment.OTHER,
warmingFluid: FluidType.ELECTRICITY, warmingFluid: FluidType.ELECTRICITY,
hotWaterFluid: FluidType.ELECTRICITY, hotWaterFluid: FluidType.ELECTRICITY,
cookingFluid: FluidType.ELECTRICITY, cookingFluid: FluidType.GAS,
}, },
isProfileTypeCompleted: false, isProfileTypeCompleted: false,
} }
...@@ -4,7 +4,6 @@ import { ...@@ -4,7 +4,6 @@ import {
Floor, Floor,
HotWaterEquipment, HotWaterEquipment,
HousingType, HousingType,
IndividualInsulationWork,
IndividualOrCollective, IndividualOrCollective,
OutsideFacingWalls, OutsideFacingWalls,
ThreeChoicesAnswer, ThreeChoicesAnswer,
...@@ -105,25 +104,22 @@ export const mockInitialProfileState: Profile = { ...@@ -105,25 +104,22 @@ export const mockInitialProfileState: Profile = {
monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'), monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'),
isProfileTypeCompleted: false, isProfileTypeCompleted: false,
profileType: { profileType: {
housingType: HousingType.INDIVIDUAL_HOUSE, housingType: HousingType.APPARTMENT,
constructionYear: ConstructionYear.BETWEEN_1975_AND_1989, constructionYear: ConstructionYear.AFTER_1999,
area: 100, area: 35,
occupantsNumber: 4, occupantsNumber: 1,
outsideFacingWalls: OutsideFacingWalls.TWO, outsideFacingWalls: OutsideFacingWalls.ONE,
floor: Floor.NOT_APPLICABLE, floor: Floor.INTERMEDIATE_FLOOR,
heating: IndividualOrCollective.INDIVIDUAL, heating: IndividualOrCollective.COLLECTIVE,
coldWater: IndividualOrCollective.INDIVIDUAL, coldWater: IndividualOrCollective.INDIVIDUAL,
hotWater: IndividualOrCollective.INDIVIDUAL, hotWater: IndividualOrCollective.INDIVIDUAL,
individualInsulationWork: [ individualInsulationWork: [],
IndividualInsulationWork.WINDOW_REPLACEMENT,
IndividualInsulationWork.WALL_INSULATION,
],
hasInstalledVentilation: ThreeChoicesAnswer.NO, hasInstalledVentilation: ThreeChoicesAnswer.NO,
hasReplacedHeater: ThreeChoicesAnswer.NO, hasReplacedHeater: ThreeChoicesAnswer.NO,
hotWaterEquipment: HotWaterEquipment.SOLAR, hotWaterEquipment: HotWaterEquipment.OTHER,
warmingFluid: FluidType.ELECTRICITY, warmingFluid: FluidType.ELECTRICITY,
hotWaterFluid: FluidType.ELECTRICITY, hotWaterFluid: FluidType.ELECTRICITY,
cookingFluid: FluidType.ELECTRICITY, cookingFluid: FluidType.GAS,
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment