Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Fix CSV Test Cases #62

Merged
merged 3 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"@babel/core": "^7.10.2",
"@babel/parser": "^7.11.4",
"@elastic/elasticsearch": "^7.8.0",
"@elastic/eui": "^26.0.0",
"@testing-library/jest-dom": "^5.10.1",
Expand All @@ -32,6 +33,7 @@
"@types/react": "^16.9.36",
"@types/react-dom": "^16.9.8",
"@types/react-test-renderer": "^16.9.2",
"axios": "^0.20.0",
"babel-polyfill": "^6.26.0",
"jest-cli": "^26.0.1",
"jest-dom": "^4.0.0",
Expand Down Expand Up @@ -64,6 +66,7 @@
"@kbn/plugin-helpers": "link:../../packages/kbn-plugin-helpers",
"babel-eslint": "^10.0.1",
"babel-jest": "^26.0.1",
"elastic-builder": "^2.7.1",
"eslint": "^5.16.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.16.0",
Expand All @@ -74,9 +77,8 @@
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-react": "^7.12.4",
"jest": "^26.0.1",
"json-2-csv": "^3.7.6",
"prettier": "2.0.5",
"react-test-renderer": "^16.13.1",
"elastic-builder": "^2.7.1",
"json-2-csv": "^3.7.6"
"react-test-renderer": "^16.13.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export function ReportSettings(props) {
target: { value: React.SetStateAction<string> };
}) => {
setDashboardSourceSelect(e.target.value);
createReportDefinitionRequest['report_params']['url'] =
createReportDefinitionRequest['report_params']['url'] =
getDashboardBaseUrl() + e.target.value;
};

Expand Down Expand Up @@ -398,7 +398,7 @@ export function ReportSettings(props) {
let baseUrl = window.location.href;
return baseUrl.replace(
'opendistro_kibana_reports#/create',
'dashboards#/view/'
'kibana#/dashboard/'
davidcui1225 marked this conversation as resolved.
Show resolved Hide resolved
);
};

Expand All @@ -412,7 +412,8 @@ export function ReportSettings(props) {
await handleDashboards(dashboardOptions);
await setDashboardSourceSelect(dashboardOptions[0].value);
createReportDefinitionRequest['report_params']['url'] =
getDashboardBaseUrl() + response['hits']['hits'][0]['_id'].substring(10);
getDashboardBaseUrl() +
response['hits']['hits'][0]['_id'].substring(10);
})
.catch((error) => {
console.log('error when fetching dashboards:', error);
Expand Down
10 changes: 0 additions & 10 deletions server/routes/dataReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ export default function (router: IRouter) {
includeDefaults: true,
}
);

const default_max_size: number =
settings[indexPattern].defaults.index.max_result_window;

//build the ES Count query
const countReq = buildQuery(report, 1);

//Count the Data in ES
const esCount = await context.core.elasticsearch.adminClient.callAsInternalUser(
'count',
Expand Down Expand Up @@ -129,14 +127,6 @@ export default function (router: IRouter) {
rows = nbRows;
nbScroll = Math.floor(nbRows / default_max_size);
}
// let data = {
// esData,
// rows,
// nbScroll,
// fetch_size,
// report,
// reqBody,
// };

for (let i = 0; i < nbScroll - 1; i++) {
let resScroll = await context.core.elasticsearch.adminClient.callAsInternalUser(
Expand Down
10 changes: 5 additions & 5 deletions server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
* permissions and limitations under the License.
*/

import registerReportRoute from './report';
import registervisualReportRoute from './visualReport';
import registerReportDefinitionRoute from './reportDefinition';
import registerDataReport from './dataReport';
import registerDataReportMetadata from './dataReportMetadata';
import dashboardRoute from './getDashboards';
import { IRouter } from '../../../../src/core/server';

export default function (router: IRouter) {
registerReportRoute(router);
registerReportDefinitionRoute(router);
registerDataReportMetadata(router);
registerDataReport(router);
registervisualReportRoute(router);
davidcui1225 marked this conversation as resolved.
Show resolved Hide resolved
registerReportDefinitionRoute(router);
registerDataReportMetadata(router);
registerDataReport(router);
davidcui1225 marked this conversation as resolved.
Show resolved Hide resolved
dashboardRoute(router);
davidcui1225 marked this conversation as resolved.
Show resolved Hide resolved
}
Loading