opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.69k stars 885 forks source link

[Research] OUI Compliance Audit of `dev_tools` plugin #4160

Open sayuree opened 1 year ago

sayuree commented 1 year ago

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-L34

  1. The plugin does not contain img, span HTML tags, but uses main, div tags. https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/application.tsx#L156-L209

  2. The plugin has a component DevToolsWrapper, which mostly uses OUI 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-L88

https://github.com/opensearch-project/OpenSearch-Dashboards/blob/bd7d70731eb56372aa2a360e85207a1e6396091f/src/plugins/dev_tools/public/index.scss#L30-L34

joshuarrrr commented 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.