Skip to content

Commit 255e555

Browse files
opensearch-trigger-bot[bot]github-actions[bot]Kishore Kumaar Natarajan
authored
Remove “Open in search comparison” button from Query Details & Query Group Details (#396) (#415)
(cherry picked from commit 67377d2) Signed-off-by: Kishore Kumaar Natarajan <kkumaarn@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kishore Kumaar Natarajan <kkumaarn@amazon.com>
1 parent bc01395 commit 255e555

File tree

6 files changed

+0
-119
lines changed

6 files changed

+0
-119
lines changed

public/pages/QueryDetails/QueryDetails.test.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,6 @@ describe('QueryDetails component', () => {
122122
});
123123
});
124124

125-
it('renders the search comparison button', async () => {
126-
renderQueryDetails();
127-
128-
await waitFor(() => {
129-
const button = screen.getByText('Open in search comparison');
130-
expect(button).toBeInTheDocument();
131-
expect(button.closest('a')).toHaveAttribute(
132-
'href',
133-
'https://playground.opensearch.org/app/searchRelevance#/'
134-
);
135-
});
136-
});
137-
138125
it('matches snapshot', async () => {
139126
const { container } = renderQueryDetails();
140127

public/pages/QueryDetails/QueryDetails.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import React, { useCallback, useContext, useEffect, useState } from 'react';
77
// @ts-ignore
88
import Plotly from 'plotly.js-dist';
99
import {
10-
EuiButton,
1110
EuiCodeBlock,
1211
EuiFlexGrid,
1312
EuiFlexGroup,
@@ -173,17 +172,6 @@ const QueryDetails = ({
173172
<h2>Query</h2>
174173
</EuiTitle>
175174
</EuiFlexItem>
176-
<EuiFlexItem grow={false}>
177-
<EuiButton
178-
size="s"
179-
iconSide="right"
180-
iconType="popout"
181-
target="_blank"
182-
href="https://playground.opensearch.org/app/searchRelevance#/"
183-
>
184-
Open in search comparison
185-
</EuiButton>
186-
</EuiFlexItem>
187175
</EuiFlexGroup>
188176
<EuiHorizontalRule margin="xs" />
189177
<EuiSpacer size="xs" />

public/pages/QueryDetails/__snapshots__/QueryDetails.test.tsx.snap

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -216,40 +216,6 @@ exports[`QueryDetails component matches snapshot 1`] = `
216216
Query
217217
</h2>
218218
</div>
219-
<div
220-
class="euiFlexItem euiFlexItem--flexGrowZero"
221-
>
222-
<a
223-
class="euiButton euiButton--primary euiButton--small"
224-
href="https://playground.opensearch.org/app/searchRelevance#/"
225-
rel="noopener noreferrer"
226-
target="_blank"
227-
>
228-
<span
229-
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
230-
>
231-
<svg
232-
aria-hidden="true"
233-
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
234-
focusable="false"
235-
height="16"
236-
role="img"
237-
viewBox="0 0 16 16"
238-
width="16"
239-
xmlns="http://www.w3.org/2000/svg"
240-
>
241-
<path
242-
d="M13 8.5a.5.5 0 1 1 1 0V12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h3.5a.5.5 0 0 1 0 1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8.5Zm-5.12.339a.5.5 0 1 1-.706-.707L13.305 2H10.5a.5.5 0 1 1 0-1H14a1 1 0 0 1 1 1v3.5a.5.5 0 1 1-1 0V2.72L7.88 8.838Z"
243-
/>
244-
</svg>
245-
<span
246-
class="euiButton__text"
247-
>
248-
Open in search comparison
249-
</span>
250-
</span>
251-
</a>
252-
</div>
253219
</div>
254220
<hr
255221
class="euiHorizontalRule euiHorizontalRule--full euiHorizontalRule--marginXSmall"

public/pages/QueryGroupDetails/QueryGroupDetails.test.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,6 @@ describe('QueryGroupDetails', () => {
122122
expect(document.getElementById('latency')).toBeInTheDocument();
123123
});
124124

125-
it('displays query details', async () => {
126-
const { container } = renderComponent();
127-
128-
await waitFor(() => {
129-
expect(screen.getByText('Open in search comparision')).toBeInTheDocument();
130-
});
131-
132-
const codeBlock = container.querySelector('.euiCodeBlock__pre');
133-
expect(codeBlock).toBeInTheDocument();
134-
135-
expect(codeBlock?.textContent).toContain('"query"');
136-
expect(codeBlock?.textContent).toMatch(/{\s*"query":/);
137-
});
138-
139125
it('renders tooltips', () => {
140126
renderComponent();
141127

public/pages/QueryGroupDetails/QueryGroupDetails.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Plotly from 'plotly.js-dist';
1010
import { useHistory, useLocation } from 'react-router-dom';
1111
import React, { useContext, useEffect, useState } from 'react';
1212
import {
13-
EuiButton,
1413
EuiCodeBlock,
1514
EuiFlexGrid,
1615
EuiFlexGroup,
@@ -204,17 +203,6 @@ export const QueryGroupDetails = ({
204203
<h2>Query</h2>
205204
</EuiTitle>
206205
</EuiFlexItem>
207-
<EuiFlexItem grow={false}>
208-
<EuiButton
209-
size="s"
210-
iconSide="right"
211-
iconType="popout"
212-
target="_blank"
213-
href="https://playground.opensearch.org/app/searchRelevance#/"
214-
>
215-
Open in search comparision
216-
</EuiButton>
217-
</EuiFlexItem>
218206
</EuiFlexGroup>
219207
<EuiHorizontalRule margin="xs" />
220208
<EuiSpacer size="xs" />

public/pages/QueryGroupDetails/__snapshots__/QueryGroupDetails.test.tsx.snap

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -339,40 +339,6 @@ exports[`QueryGroupDetails matches snapshot 1`] = `
339339
Query
340340
</h2>
341341
</div>
342-
<div
343-
class="euiFlexItem euiFlexItem--flexGrowZero"
344-
>
345-
<a
346-
class="euiButton euiButton--primary euiButton--small"
347-
href="https://playground.opensearch.org/app/searchRelevance#/"
348-
rel="noopener noreferrer"
349-
target="_blank"
350-
>
351-
<span
352-
class="euiButtonContent euiButtonContent--iconRight euiButton__content"
353-
>
354-
<svg
355-
aria-hidden="true"
356-
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonContent__icon"
357-
focusable="false"
358-
height="16"
359-
role="img"
360-
viewBox="0 0 16 16"
361-
width="16"
362-
xmlns="http://www.w3.org/2000/svg"
363-
>
364-
<path
365-
d="M13 8.5a.5.5 0 1 1 1 0V12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h3.5a.5.5 0 0 1 0 1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8.5Zm-5.12.339a.5.5 0 1 1-.706-.707L13.305 2H10.5a.5.5 0 1 1 0-1H14a1 1 0 0 1 1 1v3.5a.5.5 0 1 1-1 0V2.72L7.88 8.838Z"
366-
/>
367-
</svg>
368-
<span
369-
class="euiButton__text"
370-
>
371-
Open in search comparision
372-
</span>
373-
</span>
374-
</a>
375-
</div>
376342
</div>
377343
<hr
378344
class="euiHorizontalRule euiHorizontalRule--full euiHorizontalRule--marginXSmall"

0 commit comments

Comments
 (0)