opensearch-project / OpenSearch-Dashboards

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

[Research] [CCI] OUI Usage Audit in `saved_objects_management` plugin #3967

Open SergeyMyssak opened 1 year ago

SergeyMyssak commented 1 year ago

Audit

I performed the OUI Usage audit to the saved_objects_management plugin and got the following results. This plugin consists of two parts: objects_table and object_view.

objects_table part

This part has 7 custom components: table, relationships, overwrite_modal, import_summary, import_mode_control, header, flyout. The images below show all the components listed, where the text in red is the name of the component:

This part also has one scss file - import_summary.scss which is used in import_summary component. The image below shows the use of the classnames written in the file (except .savedObjectsManagementImportSummary__icon), where the text in red is the classname.

objects_table part conclusion


object_view part

This part has 5 custom components: field, form, header, intro, not_found_errors. The images below show all the components listed, where the text in red is the name of the component:

This part does not use scss files.

object_view part conclusion

BSFishy commented 1 year ago

scss styles are used for additional placement or to add external effects that do not change the appearance of the components in the OUI

Does this mark a gap in OUI's layouts? Or can these layouts be achieved with OUI components?

The Field component from advanced_settings plugin (plugins/advanced_settings/public/management_app/components/field -> renderField function), can somehow be combined with the Field component from saved_object_management plugin (plugins/saved_objects_management/public/management_section/object_view/components/field.tsx) and used as common

I think we briefly discussed in @joshuarrrr's office hours that we want to consolidate where custom components are defined? Is there a proposal out do to that? If not, should we make one?

SergeyMyssak commented 1 year ago

The Field component from advanced_settings plugin (plugins/advanced_settings/public/management_app/components/field -> renderField function), can somehow be combined with the Field component from saved_object_management plugin (plugins/saved_objects_management/public/management_section/object_view/components/field.tsx) and used as common

I think we briefly discussed in @joshuarrrr's office hours that we want to consolidate where custom components are defined? Is there a proposal out do to that? If not, should we make one?

Sure, I have described it in https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3963#issuecomment-1568573835, I will create a proposal for it

SergeyMyssak commented 1 year ago

scss styles are used for additional placement or to add external effects that do not change the appearance of the components in the OUI

Does this mark a gap in OUI's layouts? Or can these layouts be achieved with OUI components?

Analysis of css styles:

https://github.com/opensearch-project/OpenSearch-Dashboards/blob/f017eaacd97a7a575bc9b0d34d9e919caf152b32/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.tsx#L228-L250

I don't think the use of these classnames can be achieved with OUI components