Skip to content

Commit

Permalink
fix bug with download popover on pivot tabes (metabase#14761)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrosenzweig authored Feb 10, 2021
1 parent 9193319 commit 5b03ff8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const QueryDownloadWidget = ({
</PopoverWithTrigger>
);

const UnsavedQueryButton = ({ type, result: { json_query }, card }) => (
const UnsavedQueryButton = ({ type, result: { json_query = {} }, card }) => (
<DownloadButton
url={`api/dataset/${type}`}
params={{ query: JSON.stringify(_.omit(json_query, "constraints")) }}
Expand All @@ -104,7 +104,7 @@ const UnsavedQueryButton = ({ type, result: { json_query }, card }) => (
</DownloadButton>
);

const SavedQueryButton = ({ type, result: { json_query }, card }) => (
const SavedQueryButton = ({ type, result: { json_query = {} }, card }) => (
<DownloadButton
url={`api/card/${card.id}/query/${type}`}
params={{ parameters: JSON.stringify(json_query.parameters) }}
Expand All @@ -114,7 +114,7 @@ const SavedQueryButton = ({ type, result: { json_query }, card }) => (
</DownloadButton>
);

const PublicQueryButton = ({ type, uuid, result: { json_query } }) => (
const PublicQueryButton = ({ type, uuid, result: { json_query = {} } }) => (
<DownloadButton
method="GET"
url={Urls.publicQuestion(uuid, type)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,12 @@ describe("scenarios > visualizations > pivot tables", () => {
});
});
});

it("should open the download popover (metabase#14750)", () => {
createAndVisitTestQuestion();
cy.get(".Icon-download").click();
popover().within(() => cy.findByText("Download full results"));
});
});

const testQuery = {
Expand Down

0 comments on commit 5b03ff8

Please sign in to comment.