-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Research] OUI usage audit in the expressions
plugin
#4122
Comments
Can you explain more about why this is necessary? In your proposed solution, there's still a lot of rendering logic going on for what is a very common pattern. The panel has some initial empty state, followed by a loading state, and then a success or error state. I'm not sure I understand why we'd need the success state component (
I think a fixed-size container with scrollable contents is definitely a use-case we need to solve for in OUI, and my gut would lean toward making OuiPanel more customizable. In your proposed solution, I'm not convinced we need OuiFlexGroup or OuiFlexItem at all. Why can't LoadingChart, Progress, and Error states be children/contents of the panel? For the benefit of UX, can you provide screenshots that break down the states and phases of this expression component, so we can have a better perspective on what's happening with the DOM at each point. |
I did a little research and found that, while the |
Audit
The
expressions
plugin has 2 Sass files:index.scss
and_expression_renderer.scss
. Index just includes the other one, which defines a few classes:OpenSearch-Dashboards/src/plugins/expressions/public/_expression_renderer.scss
Lines 1 to 25 in 61ea841
Related React code:
OpenSearch-Dashboards/src/plugins/expressions/public/react_expression_renderer.tsx
Lines 187 to 212 in 61ea841
For the most part, these can be replaced with
EuiPanel
,EuiFlexGroup
, andEuiFlexItem
. However, there are a few misses from OUI:display: none
. It is important we apply this value because we need to get a ref to the element this is applied to while data is loading.overflow: auto
. Not sure how necessary this is, but it might be nice to have parity with the older version. I think this might be useful when the parent is size constricting, so it adds a scrollbar.flex-shrink
orflex-basis
onEuiFlexItem
. Again, not sure how important this is, but it would be nice to have parity.Conclusion
We should follow these action items:
oui-displayNone
to applydisplay: none
oui-overflowAuto
to applyoverflow: auto
EuiFlexItem
to modifyflex-shrink
andflex-basis
Once those changes are made to OUI, the React code can be modified to use OUI:
The text was updated successfully, but these errors were encountered: