Skip to content

Commit

Permalink
Revert "Fix running recent query button (opensearch-project#8252) (op…
Browse files Browse the repository at this point in the history
…ensearch-project#8281)"

This reverts commit baee58c.
  • Loading branch information
abbyhu2000 committed Sep 24, 2024
1 parent f775acf commit dde9f81
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
2 changes: 0 additions & 2 deletions changelogs/fragments/8252.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ export function RecentQueriesTable({
icon: 'play',
type: 'icon',
onClick: (item: RecentQueryTableItem) => {
onClickRecentQuery(
recentQueries.find((recentQuery) => recentQuery.id === item.id)?.query!,
recentQueries.find((recentQuery) => recentQuery.id === item.id)?.timeRange
);
onClickRecentQuery(recentQueries[item.id].query, recentQueries[item.id].timeRange);
},
'data-test-subj': 'action-run',
},
Expand All @@ -79,8 +76,8 @@ export function RecentQueriesTable({
const recentQueryItems: RecentQueryTableItem[] = recentQueries
.filter((item, idx) => idx < MAX_RECENT_QUERY_SIZE)
.filter((item) => item.query.language === currentLanguage)
.map((query) => ({
id: query.id,
.map((query, idx) => ({
id: idx,
query: query.query.query,
timeRange: query.timeRange,
time: moment(query.time).format('MMM D, YYYY HH:mm:ss'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
import { EditorInstance } from '../../../ui/query_editor/editors';

export interface RecentQueryItem {
id: number;
query: Query;
time: number;
timeRange?: TimeRange;
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/data/public/query/query_string/query_history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import uuid from 'uuid';
import { BehaviorSubject } from 'rxjs';
import { DataStorage } from '../../../common';
import { Query, TimeRange } from '../..';
Expand Down Expand Up @@ -62,7 +61,6 @@ export class QueryHistory {
time: timestamp,
query,
dateRange,
id: uuid.v4(),
};
this.storage.set(newKey, newItem);

Expand Down

0 comments on commit dde9f81

Please sign in to comment.