From 151f34a7b627607f59dc434378b0997887527ab6 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Mon, 25 Mar 2024 09:13:43 +0300 Subject: [PATCH] Fix: [autocomplete] show dollar sign paths (#3052) --- .../query-input/auto-complete/AutoComplete.tsx | 4 ++-- src/modules/suggestions/suggestions.ts | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/app/views/query-runner/query-input/auto-complete/AutoComplete.tsx b/src/app/views/query-runner/query-input/auto-complete/AutoComplete.tsx index 7dec3b35d4..23db381a5a 100644 --- a/src/app/views/query-runner/query-input/auto-complete/AutoComplete.tsx +++ b/src/app/views/query-runner/query-input/auto-complete/AutoComplete.tsx @@ -241,9 +241,9 @@ const AutoComplete = (props: IAutoCompleteProps) => { const appendSuggestionToUrl = (selected: string) => { if (!selected) { return; } - + const { context } = getLastDelimiterInUrl(queryUrl); let query = selected; - if (selected.startsWith(delimiters.DOLLAR.symbol)) { + if (selected.startsWith(delimiters.DOLLAR.symbol) && context === 'parameters') { selected += delimiters.EQUALS.symbol; query = ''; } diff --git a/src/modules/suggestions/suggestions.ts b/src/modules/suggestions/suggestions.ts index a31d8aef9b..33abb2132b 100644 --- a/src/modules/suggestions/suggestions.ts +++ b/src/modules/suggestions/suggestions.ts @@ -52,20 +52,12 @@ class Suggestions implements ISuggestions { } private createOpenApiResponse(versionedResources: IResource[], url: string): IParsedOpenApiResponse { - const paths: string[] = []; - - versionedResources.forEach((resource: IResource) => { - if (!resource.segment.contains('$')) { - paths.push(resource.segment); - } - }); - const response: IParsedOpenApiResponse = { createdAt: '', parameters: [{ verb: 'get', values: [], - links: paths + links: versionedResources.map((resource: IResource) => resource.segment) }], url };