Skip to content

Conversation

@flomillot
Copy link
Contributor

@flomillot flomillot commented Dec 26, 2025

To merge before #3626

Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
display: 'inline-flex',
},
}}
onClick={(e) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be better in a separated method ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renderOption is getting big, it could even become a separated component. I expect it to grow even more soon. But it is not important yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I will create a new component for render option
For the onclick method I'm not sure it's useful to extract it

);
break;
default:
content = <OverflowableText text={label} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be width="100%" like the case for Generic-Filter ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need here, for the other one it's because it was alongside an icon in the same block

@Mathieu-Deharbe Mathieu-Deharbe self-requested a review January 6, 2026 16:37
Copy link
Contributor

@Mathieu-Deharbe Mathieu-Deharbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine. Only some optional remarks.

display: 'inline-flex',
},
}}
onClick={(e) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renderOption is getting big, it could even become a separated component. I expect it to grow even more soon. But it is not important yet.

Comment on lines 304 to 305
selectedGlobalFilters.find((f) => f.uuid === option.uuid) &&
onChange(selectedGlobalFilters.filter((f) => f.uuid !== option.uuid));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this syntax less clear than a good old if.

Suggested change
selectedGlobalFilters.find((f) => f.uuid === option.uuid) &&
onChange(selectedGlobalFilters.filter((f) => f.uuid !== option.uuid));
if (selectedGlobalFilters.find((f) => f.uuid === option.uuid)) {
onChange(selectedGlobalFilters.filter((f) => f.uuid !== option.uuid));
}

But I am old. Do as you wish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I will change it

dispatch(removeFromRecentGlobalFilters(option.uuid as UUID)); // generic filter so has uuid
}}
>
<DeleteIcon fontSize="small" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that Stéphane want this icon to be small ? Usually when we use it it is always regularly sized.

Suggested change
<DeleteIcon fontSize="small" />
<DeleteIcon />

(I know it would mean a slight change in the option css)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried both and I think it looks better like that, no ?

Image Image

flomillot and others added 2 commits January 8, 2026 12:08
Co-authored-by: Mathieu Deharbe <148252167+Mathieu-Deharbe@users.noreply.github.com>
- Extract `RenderOption` and `formatVoltageRange` into standalone components for better readability and reusability.
- Remove the inline `renderOption` logic.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants