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

Consume the className prop in OuiSearchBar #1381

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Deprecations

- Deprecate `aria-label` and `data-test-subj` of OuiSearchBar which have never been consumed despite being defined ([#1381](https://github.com/opensearch-project/oui/pull/1381))

### 🛡 Security

### 📈 Features/Enhancements
Expand All @@ -13,6 +15,7 @@
### 🐛 Bug Fixes

- Fix `compressed` styling of OuiDatePickerRange ([#1380](https://github.com/opensearch-project/oui/pull/1380))
- Make OuiSearchBar consume a provided `className` ([#1381](https://github.com/opensearch-project/oui/pull/1381))

### 🚞 Infrastructure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ exports[`SearchBar render - box 1`] = `
exports[`SearchBar render - no config, no query 1`] = `
<OuiFlexGroup
alignItems="center"
className="testClass1 testClass2"
gutterSize="m"
wrap={true}
>
Expand All @@ -48,6 +49,7 @@ exports[`SearchBar render - no config, no query 1`] = `
exports[`SearchBar render - provided query, filters 1`] = `
<OuiFlexGroup
alignItems="center"
className="testClass1 testClass2"
gutterSize="m"
wrap={true}
>
Expand Down Expand Up @@ -153,6 +155,7 @@ exports[`SearchBar render - provided query, filters 1`] = `
exports[`SearchBar render - tools 1`] = `
<OuiFlexGroup
alignItems="center"
className="testClass1 testClass2"
gutterSize="m"
wrap={true}
>
Expand Down
13 changes: 12 additions & 1 deletion src/components/search_bar/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ export interface OuiSearchBarProps extends CommonProps {
dateFormat?: object;

compressed?: boolean;

// @deprecated This property has never been consumed despite being defined
'aria-label'?: string;

// @deprecated This property has never been consumed despite being defined
'data-test-subj'?: string;
Comment on lines +103 to +107
Copy link
Member

Choose a reason for hiding this comment

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

do we still have a data-test-subj that we can use? for our tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the actual component inside does and that one has its own test id. These two have never been attached to anything.

}

const parseQuery = (
Expand Down Expand Up @@ -234,6 +240,7 @@ export class OuiSearchBar extends Component<OuiSearchBarProps, State> {
toolsLeft,
toolsRight,
compressed,
className,
} = this.props;

const toolsLeftEl = this.renderTools(toolsLeft);
Expand All @@ -252,7 +259,11 @@ export class OuiSearchBar extends Component<OuiSearchBarProps, State> {
const toolsRightEl = this.renderTools(toolsRight);

return (
<OuiFlexGroup gutterSize="m" alignItems="center" wrap>
<OuiFlexGroup
gutterSize="m"
alignItems="center"
className={className}
wrap>
{toolsLeftEl}
<OuiFlexItem className="ouiSearchBar__searchHolder" grow={true}>
<OuiSearchBox
Expand Down
Loading