document link disable
This commit is contained in:
@@ -178,25 +178,51 @@ const DocumentDetails = (props) => {
|
||||
key={key}
|
||||
>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<a
|
||||
{showDownloadingState ===
|
||||
key && (
|
||||
<div className="coverLoadingLink downloading">
|
||||
{/* <img
|
||||
className="data-loading-icon"
|
||||
src="/assets/images/loading.gif"
|
||||
alt={
|
||||
router.locale ==
|
||||
"cy"
|
||||
? "Nôl data"
|
||||
: "Fetching data"
|
||||
}
|
||||
/> */}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Link
|
||||
scroll={false}
|
||||
href={
|
||||
detailsObj.pinswg_hashlink
|
||||
}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"case:documents-name-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.has(historyObj, [
|
||||
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? historyObj[
|
||||
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: ""}
|
||||
</a>
|
||||
<a
|
||||
key={key}
|
||||
onClick={() => {
|
||||
toggleDownLoadLink(
|
||||
key
|
||||
);
|
||||
}}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
"case:documents-name-label"
|
||||
)}
|
||||
:
|
||||
</span>
|
||||
{_.has(historyObj, [
|
||||
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? historyObj[
|
||||
"_pinswg_documentid_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
: ""}
|
||||
</a>
|
||||
</Link>
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
@@ -416,6 +442,19 @@ const DocumentDetails = (props) => {
|
||||
|
||||
const [showSpinnerState, setShowSpinnerState] = useState(false);
|
||||
|
||||
const [showDownloadingState, setShowDownloadingState] = useState(null);
|
||||
|
||||
const toggleDownLoadLink = (i) => {
|
||||
setShowDownloadingState(i);
|
||||
|
||||
const downloadTime = setTimeout(hideDownloadCover, 5000);
|
||||
downloadTime;
|
||||
};
|
||||
|
||||
function hideDownloadCover() {
|
||||
setShowDownloadingState(null);
|
||||
}
|
||||
|
||||
let spinnerState = () => {
|
||||
showSpinnerState == true
|
||||
? setShowSpinnerState(false)
|
||||
@@ -442,6 +481,7 @@ const DocumentDetails = (props) => {
|
||||
? setfieldSortState("asc")
|
||||
: setfieldSortState("desc")
|
||||
: setfieldSortState("asc");
|
||||
setCurrentPage(1);
|
||||
setShowSpinnerState(true);
|
||||
};
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ const TopThree = (props) => {
|
||||
<div className="cardModuleItem" key={index}>
|
||||
<div className="cardModuleDetails">
|
||||
<div className="cardModuleReference">
|
||||
<b>{t("myportal:case-reference")}:</b>{" "}
|
||||
<b>{t("myportal:case-reference")}:</b>
|
||||
<Link
|
||||
href={
|
||||
topThreeType == "awaitingSubmission"
|
||||
@@ -212,6 +212,10 @@ const TopThree = (props) => {
|
||||
]}
|
||||
</a>
|
||||
</Link>
|
||||
{topThreeType == "awaitingSubmission" &&
|
||||
showTopThreeArr[key][
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
]}
|
||||
</div>
|
||||
{topThreeType != "awaitingSubmission" ? (
|
||||
<div className="carModuleAddress">
|
||||
|
||||
@@ -5,6 +5,7 @@ import { setCurrentReference } from "../../store/currentView/action";
|
||||
import { connect } from "react-redux";
|
||||
import jsonpath from "jsonpath";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import { getFormCollectionByID } from "../../components/utils";
|
||||
|
||||
const ViewAllResults = (props) => {
|
||||
const {
|
||||
@@ -23,6 +24,22 @@ const ViewAllResults = (props) => {
|
||||
var resultsArr = props[currentView.viewKey][currentView.viewKey].value || [
|
||||
{},
|
||||
];
|
||||
|
||||
function formatDates(dateObj) {
|
||||
var dateObj = new Date(dateObj);
|
||||
var dd = String(dateObj.getDate()).padStart(2, "0");
|
||||
var mm = String(dateObj.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||
var yyyy = dateObj.getFullYear();
|
||||
|
||||
return dd + "/" + mm + "/" + yyyy;
|
||||
}
|
||||
|
||||
console.log(
|
||||
currentView.viewKey,
|
||||
props[currentView.viewKey],
|
||||
props[currentView.viewKey][currentView.viewKey].value
|
||||
);
|
||||
|
||||
var searchDetailsObj =
|
||||
props[currentView.viewKey][currentView.viewKey + "Details"] || {};
|
||||
let resultsRowArr = [];
|
||||
@@ -38,7 +55,25 @@ const ViewAllResults = (props) => {
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||
<Link
|
||||
href={
|
||||
router.locale == "cy"
|
||||
currentView.viewKey == "awaitingSubmission"
|
||||
? router.locale == "cy"
|
||||
? "/fymhorth/parhauigyflwyno"
|
||||
: "/myportal" +
|
||||
"/" +
|
||||
getFormCollectionByID(
|
||||
resultsArr[key].pinswg_appealcasetype
|
||||
).UrlName +
|
||||
"?lpa=" +
|
||||
resultsArr[key][
|
||||
"_pinswg_associatedlpa_value"
|
||||
] +
|
||||
"&apt=" +
|
||||
resultsArr[key].pinswg_appealcasetype +
|
||||
"&casereference=" +
|
||||
resultsArr[key].pinswg_title +
|
||||
"&inid=" +
|
||||
resultsArr[key].incidentid
|
||||
: router.locale == "cy"
|
||||
? myportal == true
|
||||
? "/fymhorth/achos"
|
||||
: "/achos"
|
||||
@@ -119,12 +154,16 @@ const ViewAllResults = (props) => {
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{t("search:searchresults-applicant-label")}:
|
||||
{currentView.viewKey == "awaitingSubmission"
|
||||
? "Created on"
|
||||
: t("search:searchresults-applicant-label")}
|
||||
</span>
|
||||
|
||||
{_.has(detailsObj, [
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
{currentView.viewKey == "awaitingSubmission"
|
||||
? formatDates(item.createdon)
|
||||
: _.has(detailsObj, [
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? detailsObj[
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
@@ -207,9 +246,15 @@ const ViewAllResults = (props) => {
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("search:searchresults-site-address-label")}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("search:searchresults-applicant-label")}
|
||||
</dd>
|
||||
{currentView.viewKey == "awaitingSubmission" ? (
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
Created on
|
||||
</dd>
|
||||
) : (
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("search:searchresults-applicant-label")}
|
||||
</dd>
|
||||
)}
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("search:searchresults-authority-label")}
|
||||
</dd>
|
||||
|
||||
@@ -56,7 +56,7 @@ let BuildCheckSection = (props) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-row" key={1222}>
|
||||
<div className="govuk-grid-column-full">
|
||||
<div>
|
||||
<h1 className="govuk-heading-m">
|
||||
@@ -64,7 +64,7 @@ let BuildCheckSection = (props) => {
|
||||
</h1>
|
||||
<dl className="govuk-summary-list ">
|
||||
{Object.keys(titles).map((key) => (
|
||||
<>
|
||||
<div key={key}>
|
||||
{/* <h2 className="govuk-heading-m">
|
||||
{titles[key].value}
|
||||
</h2> */}
|
||||
@@ -77,7 +77,7 @@ let BuildCheckSection = (props) => {
|
||||
key={key}
|
||||
mandatoryFieldsData={mandatoryFieldsData}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9 at-summary-list"></dl>
|
||||
|
||||
@@ -20,7 +20,9 @@ let CompleteAppeal = (props) => {
|
||||
props.appealType.appealTypeID
|
||||
);
|
||||
let updateBindAppealTypeToIncident =
|
||||
appTypeCollection.LogicalName + "Ids";
|
||||
appTypeCollection.NavigationProperty;
|
||||
|
||||
console.log(props.appealType.appealTypeID, appTypeCollection);
|
||||
|
||||
Object.assign(updateBody, {
|
||||
"pinswg_Appellant@odata.bind":
|
||||
@@ -58,23 +60,6 @@ let CompleteAppeal = (props) => {
|
||||
props.appealType.appealTypeID,
|
||||
]);
|
||||
|
||||
const getFormCollection = (formtype) => {
|
||||
const collectionName = jsonpath.query(
|
||||
data,
|
||||
"$..[?(@.LogicalName=='" + formtype + "')]"
|
||||
);
|
||||
//console.log(collectionName[0]);
|
||||
return collectionName[0];
|
||||
};
|
||||
|
||||
const getPrimaryAttr = (formtype) => {
|
||||
const attrName = jsonpath.query(
|
||||
data,
|
||||
"$..[?(@.LogicalName=='" + formtype + "')].PrimaryIdAttribute"
|
||||
);
|
||||
return attrName[0];
|
||||
};
|
||||
|
||||
let { t } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -90,23 +75,6 @@ let CompleteAppeal = (props) => {
|
||||
} = props;
|
||||
|
||||
const currentSection = props.appealType.currentSection;
|
||||
const parser = new DOMParser();
|
||||
var doc = parser.parseFromString(props.formXML, "text/xml");
|
||||
var titles = xpath.select(
|
||||
"//form/tabs/tab[" + currentSection + " ]/labels/label/@description",
|
||||
doc
|
||||
);
|
||||
var rowXML = xpath.select(
|
||||
"/form/tabs/tab[" +
|
||||
currentSection +
|
||||
"]/columns//sections/section/rows/row",
|
||||
doc
|
||||
);
|
||||
|
||||
var titleList = xpath.select(
|
||||
"//form/tabs/tab[*]/labels/label/@description",
|
||||
doc
|
||||
);
|
||||
|
||||
const handleParam = (setValue) => (e) => setValue(e.target.value);
|
||||
|
||||
|
||||
@@ -340,6 +340,7 @@ const DNSSearchResults = (props) => {
|
||||
? setfieldSortState("asc")
|
||||
: setfieldSortState("desc")
|
||||
: setfieldSortState("asc");
|
||||
setCurrentPage(1);
|
||||
setShowSpinnerState(true);
|
||||
};
|
||||
|
||||
|
||||
@@ -584,6 +584,7 @@ const SearchResults = (props) => {
|
||||
? setfieldSortState("asc")
|
||||
: setfieldSortState("desc")
|
||||
: setfieldSortState("asc");
|
||||
setCurrentPage(1);
|
||||
setShowSpinnerState(true);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user