Skip to content

Commit

Permalink
Merge branch 'main' into add_voltage_levels_to_the_request_when_getin…
Browse files Browse the repository at this point in the history
…g_equipment_infos
  • Loading branch information
sBouzols authored Jul 11, 2024
2 parents ba95390 + b53ef9d commit 5d4bb90
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { EquipmentType } from '@gridsuite/commons-ui';
import { EquipmentType, FILTER_EQUIPMENTS } from '@gridsuite/commons-ui';
import { Search, SearchOff, Tune } from '@mui/icons-material';
import {
AutocompleteRenderInputParams,
Expand Down Expand Up @@ -79,7 +79,14 @@ export const TopBarEquipmentSearchInput = (
onDelete={() => setEquipmentType(null)}
label={
<FormattedMessage
id={equipmentType.toString()}
id={
Object.values(
FILTER_EQUIPMENTS
).find(
(eq) =>
eq.id === equipmentType
)?.label
}
/>
}
sx={styles.chip}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,17 @@ export const TopBarEquipmentSearchPopover = (
<HorizontalRule />
<FormattedMessage id="NoFilter" />
</Box>
{Object.values(FILTER_EQUIPMENTS)
.map((type) => type.id)
.map((type) => {
return (
<FormControlLabel
key={type.toString()}
value={type.toString()}
control={<Radio />}
sx={styles.radioButtonColor}
label={
<FormattedMessage
id={type.toString()}
/>
}
/>
);
})}
{Object.values(FILTER_EQUIPMENTS).map((type) => {
return (
<FormControlLabel
key={type.id}
value={type.id}
control={<Radio />}
sx={styles.radioButtonColor}
label={<FormattedMessage id={type.label} />}
/>
);
})}
</RadioGroup>
</FormControl>
</Box>
Expand Down

0 comments on commit 5d4bb90

Please sign in to comment.