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

[Backport 1.x] Consume the className prop in OuiSearchBar #1386

Merged
merged 1 commit into from
Sep 5, 2024
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
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;
}

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