diff --git a/x-pack/legacy/plugins/code/public/components/main/main.scss b/x-pack/legacy/plugins/code/public/components/main/main.scss index 23eb111981a8a..58776fe1cec6f 100644 --- a/x-pack/legacy/plugins/code/public/components/main/main.scss +++ b/x-pack/legacy/plugins/code/public/components/main/main.scss @@ -152,7 +152,6 @@ margin: 0 $euiSize; border-radius: $euiSizeXS; cursor: pointer; - width: calc(100% - $euiSizeXL); &:hover { background: $euiFocusBackgroundColor; diff --git a/x-pack/legacy/plugins/code/public/components/query_bar/components/__snapshots__/query_bar.test.tsx.snap b/x-pack/legacy/plugins/code/public/components/query_bar/components/__snapshots__/query_bar.test.tsx.snap index ccc69a36a01ec..2b049ba6273e3 100644 --- a/x-pack/legacy/plugins/code/public/components/query_bar/components/__snapshots__/query_bar.test.tsx.snap +++ b/x-pack/legacy/plugins/code/public/components/query_bar/components/__snapshots__/query_bar.test.tsx.snap @@ -31,10 +31,11 @@ exports[`render correctly with empty query string 1`] = ` className="euiFlexGroup euiFlexGroup--directionRow" >
} @@ -267,11 +258,6 @@ exports[`render correctly with empty query string 1`] = ` }, ] } - style={ - Object { - "width": "14.285714285714286rem", - } - } value="default" >
@@ -517,7 +498,7 @@ exports[`render correctly with empty query string 1`] = ` aria-label="Search input" autoComplete="off" autoFocus={true} - className="kuiLocalSearchAssistedInput__input codeSearchBar__input" + className="kuiLocalSearchAssistedInput__input codeQueryBar__input" compressed={false} data-test-subj="queryInput" fullWidth={true} @@ -552,7 +533,7 @@ exports[`render correctly with empty query string 1`] = ` aria-label="Search input" autoComplete="off" autoFocus={true} - className="euiFieldText kuiLocalSearchAssistedInput__input codeSearchBar__input euiFieldText--fullWidth" + className="euiFieldText kuiLocalSearchAssistedInput__input codeQueryBar__input euiFieldText--fullWidth" data-test-subj="queryInput" onChange={[Function]} onClick={[Function]} @@ -605,11 +586,11 @@ exports[`render correctly with empty query string 1`] = ` className="euiButtonEmpty__text" > 0 @@ -621,7 +602,7 @@ exports[`render correctly with empty query string 1`] = ` className="euiTextColor euiTextColor--secondary" > - Search Filters + Advanced Filters @@ -749,10 +730,11 @@ exports[`render correctly with input query string changed 1`] = ` className="euiFlexGroup euiFlexGroup--directionRow" >
} @@ -985,11 +957,6 @@ exports[`render correctly with input query string changed 1`] = ` }, ] } - style={ - Object { - "width": "14.285714285714286rem", - } - } value="default" >
@@ -1235,7 +1197,7 @@ exports[`render correctly with input query string changed 1`] = ` aria-label="Search input" autoComplete="off" autoFocus={true} - className="kuiLocalSearchAssistedInput__input codeSearchBar__input" + className="kuiLocalSearchAssistedInput__input codeQueryBar__input" compressed={false} data-test-subj="queryInput" fullWidth={true} @@ -1270,7 +1232,7 @@ exports[`render correctly with input query string changed 1`] = ` aria-label="Search input" autoComplete="off" autoFocus={true} - className="euiFieldText kuiLocalSearchAssistedInput__input codeSearchBar__input euiFieldText--fullWidth" + className="euiFieldText kuiLocalSearchAssistedInput__input codeQueryBar__input euiFieldText--fullWidth" data-test-subj="queryInput" onChange={[Function]} onClick={[Function]} @@ -1323,11 +1285,11 @@ exports[`render correctly with input query string changed 1`] = ` className="euiButtonEmpty__text" > 0 @@ -1339,7 +1301,7 @@ exports[`render correctly with input query string changed 1`] = ` className="euiTextColor euiTextColor--secondary" > - Search Filters + Advanced Filters diff --git a/x-pack/legacy/plugins/code/public/components/query_bar/components/options.tsx b/x-pack/legacy/plugins/code/public/components/query_bar/components/options.tsx index 86f74a498ad5f..aa0fa04b726b2 100644 --- a/x-pack/legacy/plugins/code/public/components/query_bar/components/options.tsx +++ b/x-pack/legacy/plugins/code/public/components/query_bar/components/options.tsx @@ -133,18 +133,18 @@ export class SearchOptions extends Component { > -

- + + {repoScope.length} - + -

+
@@ -196,13 +196,13 @@ export class SearchOptions extends Component {
- + {repoScope.length} diff --git a/x-pack/legacy/plugins/code/public/components/query_bar/components/query_bar.tsx b/x-pack/legacy/plugins/code/public/components/query_bar/components/query_bar.tsx index 03a49774e7a15..5bb08f56af42b 100644 --- a/x-pack/legacy/plugins/code/public/components/query_bar/components/query_bar.tsx +++ b/x-pack/legacy/plugins/code/public/components/query_bar/components/query_bar.tsx @@ -435,7 +435,7 @@ export class CodeQueryBar extends Component { : ''; return ( - + @@ -455,7 +455,7 @@ export class CodeQueryBar extends Component {
{ public render() { return ( { - public onTabClicked = (scope: SearchScope) => { - return () => { - const { query } = this.props; - const queries = querystring.parse(history.location.search.replace('?', '')); - history.push( - url.format({ - pathname: '/search', - query: { - ...queries, - q: query, - scope, - }, - }) - ); - }; - }; - - public render() { - return ( -
- - - - - - - - -
- ); - } -} diff --git a/x-pack/legacy/plugins/code/public/components/search_page/search.tsx b/x-pack/legacy/plugins/code/public/components/search_page/search.tsx index bf4792338616a..457a28ac0adba 100644 --- a/x-pack/legacy/plugins/code/public/components/search_page/search.tsx +++ b/x-pack/legacy/plugins/code/public/components/search_page/search.tsx @@ -220,6 +220,13 @@ class SearchPage extends React.PureComponent { return (
+ (this.searchBar = element)} + />
{ onLanguageFilterToggled={this.onLanguageFilterToggled} onRepositoryFilterToggled={this.onRepositoryFilterToggled} /> -
- (this.searchBar = element)} - /> - {mainComp} -
+
{mainComp}
); diff --git a/x-pack/legacy/plugins/code/public/components/search_page/side_bar.tsx b/x-pack/legacy/plugins/code/public/components/search_page/side_bar.tsx index 92b912964442c..3bcc6f9dce3b2 100644 --- a/x-pack/legacy/plugins/code/public/components/search_page/side_bar.tsx +++ b/x-pack/legacy/plugins/code/public/components/search_page/side_bar.tsx @@ -9,7 +9,6 @@ import { EuiFacetGroup, EuiFlexGroup, EuiFlexItem, - EuiSpacer, EuiTitle, EuiToken, } from '@elastic/eui'; @@ -18,7 +17,6 @@ import React from 'react'; import { RepositoryUtils } from '../../../common/repository_utils'; import { SearchScope } from '../../../model'; -import { ScopeTabs } from './scope_tabs'; interface Props { query: string; @@ -74,15 +72,9 @@ export class SideBar extends React.PureComponent { public render() { return (
- -
- - +
+ + @@ -96,15 +88,9 @@ export class SideBar extends React.PureComponent { - {this.renderRepoFacets()} - - - + {this.renderRepoFacets()} + + { - + {this.renderLangFacets()}
diff --git a/x-pack/legacy/plugins/code/public/index.scss b/x-pack/legacy/plugins/code/public/index.scss index 090366342939d..0ea2cdf5b7300 100644 --- a/x-pack/legacy/plugins/code/public/index.scss +++ b/x-pack/legacy/plugins/code/public/index.scss @@ -7,6 +7,7 @@ // TODO: Cleanup everything above this line +@import "./style/variables"; @import "./style/utilities"; @import "./style/buttons"; @import "./style/layout"; diff --git a/x-pack/legacy/plugins/code/public/style/_filters.scss b/x-pack/legacy/plugins/code/public/style/_filters.scss index e360ec75c86ed..5519efa6a722e 100644 --- a/x-pack/legacy/plugins/code/public/style/_filters.scss +++ b/x-pack/legacy/plugins/code/public/style/_filters.scss @@ -1,8 +1,15 @@ +.codeFilter__groups { + padding: $euiSize; +} + .codeFilter__group { - padding: 0 1rem; - margin-top: $euiSizeS; + margin-bottom: $euiSizeS; +} + +.codeFilter__group-icon { + width: $codeSideBarIndent; } -.codeFilter__title { - height: 2.25rem; +.codeFilter__item { + margin-left: $codeSideBarIndent; } diff --git a/x-pack/legacy/plugins/code/public/style/_layout.scss b/x-pack/legacy/plugins/code/public/style/_layout.scss index 632018cdd03ce..f46432a2b9494 100644 --- a/x-pack/legacy/plugins/code/public/style/_layout.scss +++ b/x-pack/legacy/plugins/code/public/style/_layout.scss @@ -67,10 +67,6 @@ overflow: auto; } -.codeContainer__searchBar { - width: 100%; -} - .codeContainer__select { margin-right: $euiSizeS; width: 12rem; @@ -78,10 +74,6 @@ flex-shrink: 0; } -.codeContainer__tabs { - height: 3.5rem; -} - .codeContainer__search--inner { overflow-y: scroll; padding: 1rem; @@ -120,13 +112,13 @@ flex-grow: 1; flex-shrink: 1; overflow: auto; - max-width: 256px; - min-width: 256px; + max-width: $codeSideBarWidth; + min-width: $codeSideBarWidth; } .codeSearchbar__container { height: 3.5rem; - padding: $euiSizeS; + padding: $codeSearchBarPadding; border-bottom: $euiBorderWidthThin solid $euiBorderColor; } diff --git a/x-pack/legacy/plugins/code/public/style/_query_bar.scss b/x-pack/legacy/plugins/code/public/style/_query_bar.scss index ece554e1d9159..7459a8cd41e3a 100644 --- a/x-pack/legacy/plugins/code/public/style/_query_bar.scss +++ b/x-pack/legacy/plugins/code/public/style/_query_bar.scss @@ -5,6 +5,14 @@ text-overflow: ellipsis; } -.codeSearchBar__input { +.codeQueryBar__input { padding-right: 10rem; } + +.codeQueryBar__scope { + width: calc(#{$codeSideBarWidth} - #{$codeSearchBarPadding}); +} + +.codeQueryBar__filter-badge { + margin-right: $euiSizeS; +} diff --git a/x-pack/legacy/plugins/code/public/style/_utilities.scss b/x-pack/legacy/plugins/code/public/style/_utilities.scss index 82c5e17bfdf18..6d0f814670e25 100644 --- a/x-pack/legacy/plugins/code/public/style/_utilities.scss +++ b/x-pack/legacy/plugins/code/public/style/_utilities.scss @@ -2,10 +2,6 @@ cursor: pointer; } -.codeUtility__width--half { - width: 50%; -} - .codeMargin__title { margin: $euiSizeXS 0 $euiSize $euiSizeM; } diff --git a/x-pack/legacy/plugins/code/public/style/_variables.scss b/x-pack/legacy/plugins/code/public/style/_variables.scss new file mode 100644 index 0000000000000..c838f8d8e3309 --- /dev/null +++ b/x-pack/legacy/plugins/code/public/style/_variables.scss @@ -0,0 +1,3 @@ +$codeSideBarWidth: calc(#{$euiSize} * 16); +$codeSideBarIndent: $euiSizeXL; +$codeSearchBarPadding: $euiSizeS;