document link disable
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user