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

Opendistro-1.3 compatible with ES and Kibana 7.3 #8

Merged
merged 2 commits into from
Nov 13, 2019
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"homepage": "https://github.com/opendistro-for-elasticsearch/sql-kibana-plugin",
"kibana": {
"version": "6.5.4",
"version": "7.3.3",
"templateVersion": "1.0.0"
},
"repository": {
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
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;
})(),
}));