Skip to content

Commit a4ab952

Browse files
authored
Merge pull request #485 from visualize-admin/feat/compliance
feat/compliance
2 parents 5aa14b6 + c79e5ff commit a4ab952

File tree

2 files changed

+15
-30
lines changed

2 files changed

+15
-30
lines changed

src/components/sunshine-selectors/base.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ export const SunshineSelectorsBase = ({
5151
getPeerGroupLabel = (id) => id,
5252
saidiSaifiType,
5353
setSaidiSaifiType,
54-
complianceType,
55-
complianceTypes,
5654
setComplianceType,
5755
saidiSaifiTypes,
5856
indicator,
@@ -91,8 +89,18 @@ export const SunshineSelectorsBase = ({
9189
<Combobox
9290
id="indicator"
9391
label={t({ id: "selector.indicator", message: "Indicator" })}
94-
items={indicatorOptions}
95-
getItemLabel={getItemLabel}
92+
items={indicatorOptions.filter((x) => {
93+
return x !== "outageInfo" && x !== "daysInAdvanceOutageNotification";
94+
})}
95+
getItemLabel={(id) => {
96+
// The client has decided for franc-rule to be directly in the indicator selector
97+
// instead of compliance, so we map it here. It should be changed if in the future,
98+
// we show more "compliance" types on the map.
99+
if (id === "compliance") {
100+
return getItemLabel("franc-rule");
101+
}
102+
return getItemLabel(id);
103+
}}
96104
selectedItem={indicator}
97105
setSelectedItem={setIndicator}
98106
infoDialogSlug="help-indicator"
@@ -108,17 +116,6 @@ export const SunshineSelectorsBase = ({
108116
infoDialogSlug="help-saidi-saifi-type"
109117
/>
110118
) : null}
111-
{indicator === "compliance" ? (
112-
<Combobox<QueryStateSunshineComplianceType>
113-
id="typology"
114-
label={t({ id: "selector.compliance-type", message: "Typology" })}
115-
items={complianceTypes}
116-
getItemLabel={getItemLabel}
117-
selectedItem={complianceType}
118-
setSelectedItem={setComplianceType}
119-
infoDialogSlug="help-compliance"
120-
/>
121-
) : null}
122119

123120
{indicator === "networkCosts" ? (
124121
<Combobox<NetworkLevelId>

src/e2e/map.spec.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,10 @@ test.describe("Map Details Table Information", () => {
209209
notExpectedFields: ["Network level", "Category"],
210210
},
211211
{
212-
indicatorName: "Compliance",
213-
indicatorPattern: /Compliance/i,
214-
expectedFields: ["Year", "Typology"],
215-
notExpectedFields: ["Network level", "Category"],
216-
},
217-
{
218-
indicatorName: "Outage information",
219-
indicatorPattern: /Outage information/i,
212+
indicatorName: "Franc Rule",
213+
indicatorPattern: /Franc Rule/i,
220214
expectedFields: ["Year"],
221-
notExpectedFields: ["Network level", "Category", "Typology"],
222-
},
223-
{
224-
indicatorName: "Days in advance",
225-
indicatorPattern: /Days in advance outage notification/i,
226-
expectedFields: ["Year"],
227-
notExpectedFields: ["Network level", "Category", "Typology"],
215+
notExpectedFields: ["Network level", "Category"],
228216
},
229217
];
230218

0 commit comments

Comments
 (0)