Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(reports): fix report export download in production mode #501

Merged
merged 1 commit into from
Oct 18, 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
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