diff --git a/src/Data/Textile/Simulator.elm b/src/Data/Textile/Simulator.elm index a5836efca..b8896d944 100644 --- a/src/Data/Textile/Simulator.elm +++ b/src/Data/Textile/Simulator.elm @@ -739,7 +739,7 @@ computeTotalTransportImpacts simulator = computeTrims : Db -> Simulator -> Result String Simulator -computeTrims db simulator = +computeTrims db ({ durability } as simulator) = simulator.inputs.trims |> Component.compute db.textile |> Result.map Component.extractImpacts @@ -750,6 +750,7 @@ computeTrims db simulator = Impact.sumImpacts [ simulator.impacts , trimsImpacts + |> Impact.divideBy (Unit.floatDurabilityFromHolistic durability) ] , trimsImpacts = trimsImpacts } diff --git a/src/Views/Comparator.elm b/src/Views/Comparator.elm index ee86825a7..1310ec4b6 100644 --- a/src/Views/Comparator.elm +++ b/src/Views/Comparator.elm @@ -4,7 +4,6 @@ module Views.Comparator exposing ) import Data.Bookmark as Bookmark exposing (Bookmark) -import Data.Color as Color import Data.Component as Component import Data.Food.Recipe as Recipe import Data.Impact as Impact @@ -261,7 +260,6 @@ dataForIndividualImpacts definitions chartsData = , "Utilisation de ressources en eau" , "Utilisation de ressources fossiles" , "Utilisation de ressources minérales et métalliques" - , "Accessoires" ] |> List.indexedMap (\index label -> ( label, index )) |> Dict.fromList @@ -290,7 +288,7 @@ dataForIndividualImpacts definitions chartsData = in chartsData |> List.map - (\{ complementsImpact, impacts, label, stepsImpacts } -> + (\{ complementsImpact, impacts, label } -> let complementImpacts = Impact.complementsImpactAsChartEntries complementsImpact @@ -298,15 +296,6 @@ dataForIndividualImpacts definitions chartsData = entries = impacts |> Impact.getAggregatedScoreData definitions .ecoscoreData - -- Add an specific entry for trims impacts - |> (::) - { color = Color.grey ++ "bb" - , name = "Accessoires" - , value = - stepsImpacts.trims - |> Maybe.map Unit.impactToFloat - |> Maybe.withDefault 0 - } |> List.sortWith labelComparison reversed = diff --git a/src/Views/ImpactTabs.elm b/src/Views/ImpactTabs.elm index 3fd59765c..b49a9acc7 100644 --- a/src/Views/ImpactTabs.elm +++ b/src/Views/ImpactTabs.elm @@ -69,12 +69,6 @@ view definitions { activeImpactsTab, complementsImpact, impactDefinition, onStep , name = "Complément microfibres" , value = -(Unit.impactToFloat complementsImpact.microfibers) } - - -- Textile trims - , { entryAttributes = [] - , name = "Accessoires" - , value = Unit.impactToFloat (Maybe.withDefault Unit.noImpacts stepsImpacts.trims) - } ] |> List.sortBy .value |> List.reverse diff --git a/tests/e2e-textile.json b/tests/e2e-textile.json index 62203d18b..416c94ffb 100644 --- a/tests/e2e-textile.json +++ b/tests/e2e-textile.json @@ -298,27 +298,27 @@ "trims[]=0e8ea799-9b06-490c-a925-37564746c454;1" ], "impacts": { - "acd": 0.200213, - "cch": 26.8352, - "etf": 406.86, - "etf-c": 1001.58, - "fru": 270.868, - "fwe": 0.0135519, - "htc": 1.386e-8, - "htc-c": 6.09348e-9, - "htn": 2.4326e-7, - "htn-c": 1.03751e-7, - "ior": 16.2609, - "ldu": 315.242, - "mru": 0.00020443, - "ozd": 0.00008241, - "pco": 0.0831674, - "pma": 0.00000196483, - "swe": 0.0859008, - "tre": 0.462931, - "wtu": 6.86743, - "ecs": 4828.67, - "pef": 2978.38 + "acd": 0.202355, + "cch": 26.866, + "etf": 409.943, + "etf-c": 1004.68, + "fru": 271.256, + "fwe": 0.0137218, + "htc": 1.42642e-8, + "htc-c": 6.1128e-9, + "htn": 2.71796e-7, + "htn-c": 1.06436e-7, + "ior": 16.2646, + "ldu": 315.942, + "mru": 0.000233825, + "ozd": 0.0000824104, + "pco": 0.083605, + "pma": 0.00000196985, + "swe": 0.0860145, + "tre": 0.464481, + "wtu": 6.87353, + "ecs": 4869.96, + "pef": 3027.52 } }, {