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 62f2cf332389b..cc7ee6b4ecf27 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]} @@ -608,11 +589,11 @@ exports[`render correctly with empty query string 1`] = ` className="euiButtonEmpty__text" > 0 @@ -624,7 +605,7 @@ exports[`render correctly with empty query string 1`] = ` className="euiTextColor euiTextColor--secondary" > - Search Filters + Advanced Filters @@ -752,10 +733,11 @@ exports[`render correctly with input query string changed 1`] = ` className="euiFlexGroup euiFlexGroup--directionRow" >
} @@ -988,11 +960,6 @@ exports[`render correctly with input query string changed 1`] = ` }, ] } - style={ - Object { - "width": "14.285714285714286rem", - } - } value="default" >
@@ -1238,7 +1200,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} @@ -1273,7 +1235,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]} @@ -1329,11 +1291,11 @@ exports[`render correctly with input query string changed 1`] = ` className="euiButtonEmpty__text" > 0 @@ -1345,7 +1307,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 1320a9f199639..d44eeba39db3d 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 ( - + @@ -453,7 +453,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 effb4da4c7f92..c4cc41d4d5fed 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 @@ -214,6 +214,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; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index b904e91bcc7b5..6820577ea59ba 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -4776,7 +4776,7 @@ "xpack.code.searchBar.fileGroupTitle": "ファイル", "xpack.code.searchBar.repositorylGroupTitle": "レポジトリ", "xpack.code.searchBar.resultCountText": "{total} 件の{total, plural, one {結果} other {結果}}", - "xpack.code.searchBar.searchFilterTitle": " {filterCount, plural, one {検索フィルター} other {検索フィルター}} ", + "xpack.code.searchBar.searchFilterTitle": "{filterCount, plural, one {検索フィルター} other {検索フィルター}}", "xpack.code.searchBar.searchScopeTitle": "検索対象", "xpack.code.searchBar.symbolGroupTitle": "シンボル", "xpack.code.searchBar.viewFullSearchLinkText": "完全テキスト全文検索は ⮐ エンターキーを押してください", @@ -4785,8 +4785,6 @@ "xpack.code.searchPage.emptyTitle": "ふむむ、検索しましたが何も見つかりませんでした。", "xpack.code.searchPage.hitsCountText": " 次の場所からのヒット ", "xpack.code.searchPage.modifySearchSettingButtonLabel": "検索設定を変更", - "xpack.code.searchPage.scopeTabs.codeTabLabel": "コード", - "xpack.code.searchPage.scopeTabs.repositoryTabLabel": "レポジトリ", "xpack.code.searchPage.showingResultsTitle": "{total} 件中 {from} ~ {to} 件目を表示中", "xpack.code.searchPage.sideBar.languagesTitle": "言語", "xpack.code.searchPage.sideBar.repositoriesTitle": "レポジトリ", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 297b93b49fe18..d03e02067e9d6 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -4778,7 +4778,7 @@ "xpack.code.searchBar.fileGroupTitle": "文件", "xpack.code.searchBar.repositorylGroupTitle": "存储库", "xpack.code.searchBar.resultCountText": "{total} 个 {total, plural, one {结果} other {结果}}", - "xpack.code.searchBar.searchFilterTitle": " {filterCount, plural, one {搜索筛选} other {搜索筛选}} ", + "xpack.code.searchBar.searchFilterTitle": "{filterCount, plural, one {高级选项} other {高级选项}}", "xpack.code.searchBar.searchScopeTitle": "搜索范围", "xpack.code.searchBar.symbolGroupTitle": "符号", "xpack.code.searchBar.viewFullSearchLinkText": "按 ⮐ Return 键以进行全文本搜索", @@ -4787,8 +4787,6 @@ "xpack.code.searchPage.emptyTitle": "嗯...... 我们已找过该内容,但未有任何发现。", "xpack.code.searchPage.hitsCountText": " 次命中,来自 ", "xpack.code.searchPage.modifySearchSettingButtonLabel": "修改搜索设置", - "xpack.code.searchPage.scopeTabs.codeTabLabel": "Code", - "xpack.code.searchPage.scopeTabs.repositoryTabLabel": "存储库", "xpack.code.searchPage.showingResultsTitle": "显示第 {from} - {to} 个结果,共 {total} 个。", "xpack.code.searchPage.sideBar.languagesTitle": "语言", "xpack.code.searchPage.sideBar.repositoriesTitle": "存储库",