Open sayuree opened 1 year ago
Thanks @sayuree, this is a helpful start. I think the primary issue to address here is the fact that this plugin doesn't use https://oui.opensearch.org/1.0/#/layout/page for handling the page layout (the use of <main>
is a really important hint/finding here). Note that, if we were using OuiPage* components for layout, the tab structure could easily be handled by https://oui.opensearch.org/1.0/#/layout/page-header#tabs-in-the-page-header (rather than the more generic EuiTabs
), which would also mean there's no need for the spacing hacks of devAppDataSourcePicker
.
Audit of #4078
The
dev_tools
plugin has 1 Sass file:index.scss
: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/index.scss#L8-L34The plugin does not contain
img
,span
HTML tags, but usesmain
,div
tags. https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/application.tsx#L156-L209The plugin has a component
DevToolsWrapper
, which mostly usesOUI
library components and occasionally uses HTML tags for wrapping: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/application.tsx#L81-L88devApp__container
,devApp
classes are identical: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/index.scss#L8-L17 These could be replaced by adding some properties toEuiFlexGroup
andEuiFlexItem
, however, OUI doesn't allow editingflex-shrink
orflex-basis
onEuiFlexItem
.devAppWrapper
can be easily replaced byEuiFlexGroup
andEuiFlexItem
s using their corresponding properties likedisplay
,direction
,grow
: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/index.scss#L19-L23devAppTabs
can also be replaced byEuiFlexGroup
andEuiFlexItem
. AlthoughEuiFlexGroup
does not haveflex-flow
property it can be replaced by using bothdirection
andwrap
properties, sincehttps://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/index.scss#L30-L34
devAppDataSourcePicker
is used to add margin and min-width: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/index.scss#L25-L28 I foundEuiPanel
withpadding
-related property, but could not findmargin
-related property in components. We could uselogicalShorthandCSS
, but suppose it might still require HTML tag: https://elastic.github.io/eui/#/theming/sizing/utilities#logicalConclusion
EuiFlexItem
to modifyflex-shrink
andflex-basis
;devAppWrapper
,devAppTabs
with OUI library items;