From bba7610902ea9f6a713fcd3ab114154104dab774 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Fri, 13 Jan 2023 14:29:42 -0600 Subject: [PATCH] Update export to do a form with post to send Authoriztion header; also commented-out POC of exports to iframe --- package.json | 2 +- src/qqq/pages/records/query/RecordQuery.tsx | 29 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4630f0d..25c13de 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "@auth0/auth0-react": "1.10.2", "@emotion/react": "11.7.1", "@emotion/styled": "11.6.0", - "@kingsrook/qqq-frontend-core": "1.0.42", + "@kingsrook/qqq-frontend-core": "1.0.43", "@mui/icons-material": "5.4.1", "@mui/material": "5.11.1", "@mui/styles": "5.11.1", diff --git a/src/qqq/pages/records/query/RecordQuery.tsx b/src/qqq/pages/records/query/RecordQuery.tsx index 2538be2..12588fd 100644 --- a/src/qqq/pages/records/query/RecordQuery.tsx +++ b/src/qqq/pages/records/query/RecordQuery.tsx @@ -729,13 +729,30 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element - Generating file ${filename}${totalRecords ? " with " + totalRecords.toLocaleString() + " record" + (totalRecords == 1 ? "" : "s") : ""}... + + Generating file ${filename}${totalRecords ? " with " + totalRecords.toLocaleString() + " record" + (totalRecords == 1 ? "" : "s") : ""}... +
+ +
+ `); + /* + // todo - probably better - generate the report in an iframe... + // only open question is, giving user immediate feedback, and knowing when the stream has started and/or stopped + // maybe a busy-loop that would check iframe's url (e.g., after posting should change, maybe?) + const iframe = document.getElementById("exportIFrame"); + const form = iframe.querySelector("form"); + form.action = url; + form.target = "exportIFrame"; + (iframe.querySelector("#authorizationInput") as HTMLInputElement).value = qController.getAuthorizationHeaderValue(); + form.submit(); + */ + /////////////////////////////////////////// // Hide the export menu after the export // /////////////////////////////////////////// @@ -1126,6 +1143,14 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element return ( + {/* + // see above code that would use this + + */} {alertContent ? (