[Research] OUI Compliance audit of the saved_objects
plugin
#4161
Labels
enhancement
New feature or request
OUI compliance
Issues and PRs to maximize OUI usage and remove style and component hacks
OUI
Issues that require migration to OUI
Audit
The
saved_objects
plugin contains 3 Sass files:index.scss
,saved_object_save_modal.scss
and_index.scss
.index.scss
and_index.scss
are importing a style fromsaved_object_save_modal.scss
, which has a single class:OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.scss
Lines 1 to 3 in bd7d707
OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/_index.scss
Line 1 in bd7d707
OpenSearch-Dashboards/src/plugins/saved_objects/public/index.scss
Line 1 in bd7d707
Related React code:
OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
Lines 102 to 106 in bd7d707
There are no
img
,span
, butdiv
,p
HTML tags are present, outnumbered by OUI library components.When a specific value was needed, OUI variable was used:
euiSizeXXL
The custom components are predominantly made of OUI library components and are used correctly:
OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.test.tsx
Lines 40 to 47 in bd7d707
OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.test.tsx
Lines 54 to 62 in bd7d707
OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
Lines 102 to 166 in bd7d707
OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
Lines 265 to 274 in bd7d707
However, HTML tags are also present in the following places:
OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
Lines 284 to 310 in bd7d707
For the focus management, we have
ref
andtabindex
defined indiv
tag. I assume we could useEuiPanel
with the propertypanelRef
of typeRef<HTMLDivElement>
and extendsHTMLElement
, allowing us to definetabindex
property as well.OpenSearch-Dashboards/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx
Lines 320 to 334 in bd7d707
FormattedMessage
is wrapped intop
tag for customized rendering (recommended practice):Conclusion
saved_objects
plugin, there are no issues with the usage;EuiPanel
, including cases related to focus management;p
tag, envelopingFormattedMessage
;The text was updated successfully, but these errors were encountered: