From 887cfbd3c202049ea2e5d88e9825d2f877819ccc Mon Sep 17 00:00:00 2001 From: Mengwei Ding Date: Mon, 8 Apr 2019 10:39:46 +0800 Subject: [PATCH] [Code] add description for file and repo typeahead items --- x-pack/plugins/code/public/components/main/main.scss | 2 +- .../query_bar/suggestions/file_suggestions_provider.ts | 3 ++- .../query_bar/suggestions/repository_suggestions_provider.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/code/public/components/main/main.scss b/x-pack/plugins/code/public/components/main/main.scss index 1e899cc58cebb..bb9f844b581d6 100644 --- a/x-pack/plugins/code/public/components/main/main.scss +++ b/x-pack/plugins/code/public/components/main/main.scss @@ -229,7 +229,7 @@ overflow: hidden; text-overflow: ellipsis; font-size: $euiFontSizeXS; - padding: $euiSizeXS $euiSize; + padding: $euiSizeXS $euiSizeS; } .codeSearch-suggestion__token { diff --git a/x-pack/plugins/code/public/components/query_bar/suggestions/file_suggestions_provider.ts b/x-pack/plugins/code/public/components/query_bar/suggestions/file_suggestions_provider.ts index 38226f03ddb27..2e49e769f9632 100644 --- a/x-pack/plugins/code/public/components/query_bar/suggestions/file_suggestions_provider.ts +++ b/x-pack/plugins/code/public/components/query_bar/suggestions/file_suggestions_provider.ts @@ -11,6 +11,7 @@ import { AutocompleteSuggestionGroup, AutocompleteSuggestionType, } from '.'; +import { toRepoNameWithOrg } from '../../../../common/uri_util'; import { SearchResultItem, SearchScope } from '../../../../model'; export class FileSuggestionsProvider extends AbstractSuggestionsProvider { @@ -36,7 +37,7 @@ export class FileSuggestionsProvider extends AbstractSuggestionsProvider { .slice(0, this.MAX_SUGGESTIONS_PER_GROUP) .map((doc: SearchResultItem) => { return { - description: '', + description: toRepoNameWithOrg(doc.uri), end: 10, start: 1, text: doc.filePath, diff --git a/x-pack/plugins/code/public/components/query_bar/suggestions/repository_suggestions_provider.ts b/x-pack/plugins/code/public/components/query_bar/suggestions/repository_suggestions_provider.ts index 3079a2c7f0429..5c5a4129c1b49 100644 --- a/x-pack/plugins/code/public/components/query_bar/suggestions/repository_suggestions_provider.ts +++ b/x-pack/plugins/code/public/components/query_bar/suggestions/repository_suggestions_provider.ts @@ -37,7 +37,7 @@ export class RepositorySuggestionsProvider extends AbstractSuggestionsProvider { .slice(0, this.MAX_SUGGESTIONS_PER_GROUP) .map((repo: Repository) => { return { - description: '', + description: repo.url, end: 10, start: 1, text: toRepoNameWithOrg(repo.uri),