Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Bump pr-branch to v1.3 #21

Merged
merged 4 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class Main extends React.Component<MainProps, MainState> {
}
return {
fulfilled: true,
data: JSON.parse(response.data.resp),
data: response.data.resp,
};
}

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "opendistro-sql-kibana",
"version": "1.0.0.0",
"version": "1.3.0.0",
"description": "SQL Console",
"main": "index.js",
"license": "Apache-2.0",
"homepage": "https://github.com/opendistro-for-elasticsearch/sql-kibana-plugin",
"kibana": {
"version": "6.5.4",
"templateVersion": "1.0.0"
"version": "7.3.2",
"templateVersion": "6.3.3"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -77,7 +77,7 @@
"typescript": "3.0.3"
},
"engines": {
"node": "8.14.0",
"node": "10.15.2",
"yarn": "^1.10.1"
},
"resolutions": {
Expand Down
4 changes: 2 additions & 2 deletions public/components/Main/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
Expand Down Expand Up @@ -166,7 +166,7 @@ export class Main extends React.Component<MainProps, MainState> {
}
return {
fulfilled: true,
data: JSON.parse(response.data.resp)
data: response.data.resp
};
}

Expand Down
7 changes: 3 additions & 4 deletions public/components/QueryEditor/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class QueryEditor extends React.Component<QueryEditorProps, QueryEditorState> {
mode="mysql"
theme="sql_console"
width="100%"
height="20em"
height="18.5rem"
value={this.state.sqlQueriesString}
onChange={this.updateSQLQueries}
showPrintMargin={false}
Expand All @@ -89,7 +89,7 @@ class QueryEditor extends React.Component<QueryEditorProps, QueryEditorState> {
mode="json"
theme="sql_console"
width="100%"
height="20em"
height="18.5rem"
value={this.props.queryTranslations
.map((queryTranslation: any) =>
JSON.stringify(queryTranslation.data, null, 2)
Expand All @@ -107,8 +107,7 @@ class QueryEditor extends React.Component<QueryEditorProps, QueryEditorState> {
/>
</EuiFlexItem>
</EuiFlexGroup>

<div className="action-container">
<div>
<EuiFlexGroup className="action-container" gutterSize="m">
<EuiFlexItem
grow={false}
Expand Down
8 changes: 1 addition & 7 deletions public/components/QueryResults/QueryResultsBody.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,7 @@ describe("<QueryResultsBody /> spec", () => {
""
);

const emptyQueryResult = {
fields: [''],
records: [{}],
message: ''
};

const { queryByTestId } = renderQueryResultsBody(emptyQueryResult, '', mockSortableProperties, mockErrorMessage, onSort, onQueryChange, updateExpandedMap, onChangeItemsPerPage);
const { queryByTestId } = renderQueryResultsBody(undefined, undefined, mockSortableProperties, mockErrorMessage, onSort, onQueryChange, updateExpandedMap, onChangeItemsPerPage);

// Download buttons, pagination, search area, table should not be visible when there is no data
expect(queryByTestId('Download')).toBeNull();
Expand Down
6 changes: 3 additions & 3 deletions public/icons/sql.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion public/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function getDefaultTabId ( queryResults: ResponseDetail<string>[]) : stri
}

export function getDefaultTabLabel ( queryResults: ResponseDetail<string>[], queryString: string ) : string {

return queryResults && queryResults.length > 0 && queryResults[0].fulfilled ? getQueryIndex(queryString) : MESSAGE_TAB_LABEL
}

Expand All @@ -71,7 +72,7 @@ export function capitalizeFirstLetter(name: string): string {
}

export function getMessageString(messages: QueryMessage[], tabNames: string[]): string {
return messages && messages.length > 0 && tabNames ? messages.reduce( (finalMessage, message, currentIndex) => finalMessage.concat(capitalizeFirstLetter(tabNames[currentIndex]), ': ', messages[currentIndex].text, '\n\n'), '' ) : '';
return messages && messages.length > 0 && tabNames && tabNames.length > 0 ? messages.reduce( (finalMessage, message, currentIndex) => finalMessage.concat(capitalizeFirstLetter(tabNames[currentIndex]), ': ', messages[currentIndex].text, '\n\n'), '' ) : '';
}

export function scrollToNode(nodeId: string): void {
Expand Down
18 changes: 0 additions & 18 deletions test/setup.jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,3 @@ window.URL = {
return "";
},
};

jest.mock("ui/notify", () => ({
toastNotifications: {
addDanger: jest.fn().mockName("addDanger"),
addSuccess: jest.fn().mockName("addSuccess"),
},
}));

jest.mock("ui/chrome", () => ({
breadcrumbs: (() => {
const breadcrumbs = () => {};
// @ts-ignore
breadcrumbs.set = jest.fn();
// @ts-ignore
breadcrumbs.push = jest.fn();
return breadcrumbs;
})(),
}));
Loading