Skip to content
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

[Multiple Datasource] Fix style of data source option inside popover for data source selector, selectable, multi select components #6438

Merged
merged 7 commits into from
Apr 16, 2024

Conversation

BionIT
Copy link
Collaborator

@BionIT BionIT commented Apr 13, 2024

Description

This change fixes the style of data source selector/selectable/multi selectable components to hide the test overflow to address the long data source name problem

Issues Resolved

Fixes #6430

Screenshot

Testing the changes

UI should show default icon and truncate the long data source name

  1. data source selector
    Screenshot from 2024-04-12 21-15-00
  2. data source selectable
    Screenshot from 2024-04-12 21-13-57
  3. multi selectable
    Screenshot from 2024-04-12 21-53-34

Function

  1. active option provided with empty id string, while hide local cluster
    data source selector
    defaultOption={[{id: ''}]}
    Screenshot from 2024-04-12 21-55-35

data source selectable
activeOption: [{id: ''}],
Screenshot from 2024-04-12 21-56-57

  1. has default data source
    data source selector
    Screenshot from 2024-04-12 21-15-00

data source selectable
Screenshot from 2024-04-12 21-14-48

  1. empty array passed to data source selector should show placeholder text
    Screenshot from 2024-04-12 21-59-41

  2. invalid data source id passed in
    data source selector
    defaultOption={[{id: 'badid'}]}
    Screenshot from 2024-04-12 22-00-53

data source selectable
activeOption: [{id: 'invalid'}],
Screenshot from 2024-04-12 22-01-47

  1. empty string as id and hide local cluster is set to false, should show local cluster
    data source selector
    defaultOption={[{id: ''}]}
    Screenshot from 2024-04-12 22-03-52

data source selectable
activeOption: [{id: ''}],
Screenshot from 2024-04-12 22-04-39

  1. filter out default data source, hide local cluster is false, should show local cluster
    data source selector
    Screenshot from 2024-04-12 22-07-09

data source selectable
Screenshot from 2024-04-12 22-07-52

  1. pass in valid data source id
    data source selector
    Screenshot from 2024-04-12 22-09-14

data source selectable
Screenshot from 2024-04-12 22-09-50

  1. no available data sources
    data source selector
    Screenshot from 2024-04-12 22-11-46

data source selectable
Screenshot from 2024-04-12 22-11-59

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

display: inline-block;
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the name to _data_source_selectable.cscc as a underscore _ shows this is a internal style file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should follow the dev guide Do not use the underscore _ SASS file naming pattern when importing directly into a javascript file. in https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md#sass-files

@@ -138,7 +139,7 @@ export const DataSourceFilterGroup: React.FC<DataSourceFilterGroupProps> = ({
data-test-subj="dataSourceMultiSelectFieldSearch"
/>
</EuiPopoverTitle>
<div className="ouiFilterSelect__items" style={{ maxHeight: 400, overflow: 'scroll' }}>
<div className="dataSourceFilterGroupItems" style={{}}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove style={{}}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

BionIT added 2 commits April 15, 2024 22:24
Signed-off-by: Lu Yu <[email protected]>
@BionIT BionIT merged commit eef417c into opensearch-project:main Apr 16, 2024
67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 16, 2024
…for data source selector, selectable, multi select components (#6438)

* adjust style

Signed-off-by: Lu Yu <[email protected]>

* fix style for data source components

Signed-off-by: Lu Yu <[email protected]>

* clean up

Signed-off-by: Lu Yu <[email protected]>

* add change log

Signed-off-by: Lu Yu <[email protected]>

* remove unused style prop

Signed-off-by: Lu Yu <[email protected]>

* fix snapshot

Signed-off-by: Lu Yu <[email protected]>

---------

Signed-off-by: Lu Yu <[email protected]>
(cherry picked from commit eef417c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
BionIT pushed a commit that referenced this pull request Apr 16, 2024
…for data source selector, selectable, multi select components (#6438) (#6467)

* adjust style

Signed-off-by: Lu Yu <[email protected]>

* fix style for data source components

Signed-off-by: Lu Yu <[email protected]>

* clean up

Signed-off-by: Lu Yu <[email protected]>

* add change log

Signed-off-by: Lu Yu <[email protected]>

* remove unused style prop

Signed-off-by: Lu Yu <[email protected]>

* fix snapshot

Signed-off-by: Lu Yu <[email protected]>

---------

Signed-off-by: Lu Yu <[email protected]>
(cherry picked from commit eef417c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants