updated translations and oauth

This commit is contained in:
2021-11-19 09:30:04 +00:00
parent 3c38da1400
commit f9f7b777e7
91 changed files with 2519 additions and 1275 deletions
+28 -14
View File
@@ -7,6 +7,7 @@ import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import transLookup from "../../data/lookuptranslations.json";
import PaginationControl from "./pagination";
import LoadingOverlay from "react-loading-overlay";
import CryptoJS from "crypto-js";
import {
getBasicSearch,
@@ -15,7 +16,7 @@ import {
getSearchDocumentHistory1,
getSearchDocumentHistory1Paged,
getSearchDocumentDetails1Paged,
getSASToken,
getToken,
} from "../../actions";
import {
@@ -104,10 +105,9 @@ const DocumentDetails = (props) => {
>
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
<a
href={
"/api/proxy/documents/download/" +
href={encryptDocReference(
detailsObj.pinswg_isharedocumentreference
}
)}
>
<span className="results-visually-hidden">
{t(
@@ -184,13 +184,27 @@ const DocumentDetails = (props) => {
<PaginationControl
currentPage={currentPage}
searchResultsObj={documentDetailsObj}
spinnerState={spinnerState}
// spinnerState={spinnerState}
getDocumentResults={getDocumentResults}
/>
</>
);
};
const WORDKEY = process.env.NEXT_PUBLIC_HASHKEY;
const encryptDocReference = (documentRef) => {
var hashlink = CryptoJS.HmacSHA256(
"documents/download/" + documentRef,
CryptoJS.enc.Hex.parse(WORDKEY)
);
hashlink = hashlink.toString(CryptoJS.enc.Hex);
return (
"/api/proxy/documents/download/" + documentRef + "?hash=" + hashlink
);
};
useEffect(() => {
const docDetailsObj = async () => {
let docObj = await getSearchDocumentDetails1(incidentid)
@@ -249,7 +263,7 @@ const DocumentDetails = (props) => {
//console.log("getting details", data);
return getDocumentHistory(data.value).then((data) => {
setDocumentHistory(data);
setShowSpinnerState(false);
//setShowSpinnerState(false);
});
});
};
@@ -330,13 +344,13 @@ const DocumentDetails = (props) => {
)
: pagesCount;
const [showSpinnerState, setShowSpinnerState] = useState(false);
//const [showSpinnerState, setShowSpinnerState] = useState(false);
let spinnerState = () => {
showSpinnerState == true
? setShowSpinnerState(false)
: setShowSpinnerState(true);
};
// let spinnerState = () => {
// showSpinnerState == true
// ? setShowSpinnerState(false)
// : setShowSpinnerState(true);
// };
const [showDocumentSearchState, setDocumentSearchState] = useState(false);
@@ -370,11 +384,11 @@ const DocumentDetails = (props) => {
</div>
</div>
</div>
<LoadingOverlay
{/* <LoadingOverlay
active={showSpinnerState}
spinner
text={t("common:spinner-searching")}
/>
/> */}
</>
);
};