Skip to content

Commit

Permalink
fix(reports): fix report export download in production mode (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrajashkr authored Oct 18, 2020
1 parent ff1d92e commit f175d51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ui/src/features/components/Report/compareReports.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {connect} from "react-redux";
import Snackbar from "material-ui/Snackbar";
import Checkbox from "../../../components/Checkbox/Checkbox";
import Button from "../../../components/Button";
import env from "../../../App/common/env";

class CompareReports extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -100,7 +101,7 @@ class CompareReports extends React.Component {
}
}
request_string = "report_ids="+reportIdsAsCSV+"&test_ids="+testIdsAsCSV;
window.open(`${process.env.PREDATOR_URL}/tests/reports/compare/export/csv?`+request_string,"_blank");
window.open(`${env.PREDATOR_URL}/tests/reports/compare/export/csv?`+request_string,"_blank");
};

render() {
Expand Down
3 changes: 2 additions & 1 deletion ui/src/features/components/Report/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Card from "../../../components/Card";
import {faStar as emptyStar} from "@fortawesome/free-regular-svg-icons";
import {faStar as fullStar} from "@fortawesome/free-solid-svg-icons";
import InfoToolTip from "../InfoToolTip";
import env from "../../../App/common/env";

const REFRESH_DATA_INTERVAL = 30000;

Expand Down Expand Up @@ -47,7 +48,7 @@ class Report extends React.Component {

exportCSV = () => {
const {report} = this.props;
window.open(`${process.env.PREDATOR_URL}/tests/${report.test_id}/reports/${report.report_id}/export/csv`,'_blank');
window.open(`${env.PREDATOR_URL}/tests/${report.test_id}/reports/${report.report_id}/export/csv`,'_blank');
};

onStar = () => {
Expand Down

0 comments on commit f175d51

Please sign in to comment.