refactor(actions): complete priority-1 consumer import migration pass
This commit is contained in:
@@ -10,22 +10,22 @@ import {
|
||||
deleteWatchedCases,
|
||||
getAwaitingSubmissionProxy,
|
||||
getPortalModuleDetailsProxy,
|
||||
getWatchedCasesProxy,
|
||||
} from "../../actions";
|
||||
getWatchedCasesProxy
|
||||
} from "../../actions/services/portalService";
|
||||
import { getFormCollectionByID, getDetailsProxy } from "../../components/utils";
|
||||
import transLookup from "../../data/lookuptranslations.json";
|
||||
import {
|
||||
setAwaitingSubmission,
|
||||
setAwaitingSubmissionDetails,
|
||||
setAwaitingSubmissionDetails
|
||||
} from "../../store/awaitingSubmission/action";
|
||||
import { setCurrentReference } from "../../store/currentView/action";
|
||||
import {
|
||||
setSearchDetails,
|
||||
setSearchResults,
|
||||
setSearchResults
|
||||
} from "../../store/searchOutput/action";
|
||||
import {
|
||||
setWatchedCases,
|
||||
setWatchedCasesDetails,
|
||||
setWatchedCasesDetails
|
||||
} from "../../store/watchedCases/action";
|
||||
|
||||
import { planningappeals78_pdf } from "../../components/pdftemplates/planningappeals78_pdf";
|
||||
@@ -47,7 +47,7 @@ const TopThree = (props) => {
|
||||
setAwaitingSubmissionDetails,
|
||||
setSearchResults,
|
||||
setSearchDetails,
|
||||
showLoginCheck,
|
||||
showLoginCheck
|
||||
} = props;
|
||||
|
||||
const router = useRouter();
|
||||
@@ -132,19 +132,19 @@ const TopThree = (props) => {
|
||||
let newObj = {};
|
||||
return Object.assign(newObj, {
|
||||
"@odata.count": required.length,
|
||||
"value": required,
|
||||
"value": required
|
||||
});
|
||||
};
|
||||
|
||||
let filteredWatchedCases = showWatchedCases(data);
|
||||
|
||||
setWatchedCases(filteredWatchedCases),
|
||||
(setWatchedCases(filteredWatchedCases),
|
||||
getDetailsProxy(
|
||||
filteredWatchedCases,
|
||||
"myWatchedCases"
|
||||
).then((data) => {
|
||||
setWatchedCasesDetails(data);
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -156,7 +156,7 @@ const TopThree = (props) => {
|
||||
.then(() => {
|
||||
getAwaitingSubmissionProxy(cookies.pinsUser).then(
|
||||
(data) => {
|
||||
setAwaitingSubmission(data),
|
||||
(setAwaitingSubmission(data),
|
||||
getDetailsProxy(
|
||||
data,
|
||||
"awaitingSubmission"
|
||||
@@ -166,7 +166,7 @@ const TopThree = (props) => {
|
||||
// data
|
||||
// );
|
||||
setAwaitingSubmissionDetails(data);
|
||||
});
|
||||
}));
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -196,7 +196,7 @@ const TopThree = (props) => {
|
||||
const res = await fetch("/api/file/generateappealpdfcopy", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ docProps }),
|
||||
body: JSON.stringify({ docProps })
|
||||
});
|
||||
|
||||
if (!res.ok) throw new Error("PDF generation failed");
|
||||
@@ -287,25 +287,25 @@ const TopThree = (props) => {
|
||||
"&inid=" +
|
||||
showTopThreeArr[key].incidentid
|
||||
: router.locale == "cy"
|
||||
? "/fymhorth/achos/" +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType +
|
||||
"&appealType=" +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
: "/myportal/case/" +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType +
|
||||
"&appealType=" +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
? "/fymhorth/achos/" +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType +
|
||||
"&appealType=" +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
: "/myportal/case/" +
|
||||
showTopThreeArr[key].ticketnumber +
|
||||
"?key=" +
|
||||
topThreeType +
|
||||
"&appealType=" +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype
|
||||
}
|
||||
className="govuk-link--no-underline"
|
||||
data-id={index}
|
||||
onClick={() => {
|
||||
setSearchResults(
|
||||
(setSearchResults(
|
||||
props.props[topThreeType][topThreeType]
|
||||
),
|
||||
setSearchDetails(
|
||||
@@ -337,8 +337,8 @@ const TopThree = (props) => {
|
||||
|
||||
"appealType":
|
||||
showTopThreeArr[key]
|
||||
.pinswg_appealcasetype,
|
||||
});
|
||||
.pinswg_appealcasetype
|
||||
}));
|
||||
}}
|
||||
>
|
||||
{showTopThreeArr[key].pinswg_title}
|
||||
@@ -423,7 +423,7 @@ const TopThree = (props) => {
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
eval: true
|
||||
})
|
||||
: showTopThreeArr[key][
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -436,26 +436,32 @@ const TopThree = (props) => {
|
||||
{_.isEmpty(showTopThreeArr[key])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(showTopThreeArr[key])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(showTopThreeArr[key])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(
|
||||
showTopThreeArr[key].pinswg_siteaddressline1
|
||||
)
|
||||
? t("myportal:case-address-not-entered")
|
||||
: showTopThreeArr[key].pinswg_siteaddressline1 +
|
||||
(!_.isEmpty(
|
||||
showTopThreeArr[key].pinswg_siteaddressline2
|
||||
)
|
||||
? ", " +
|
||||
showTopThreeArr[key].pinswg_siteaddressline2
|
||||
: "") +
|
||||
(!_.isEmpty(
|
||||
showTopThreeArr[key].pinswg_siteaddresstown
|
||||
)
|
||||
? ", " +
|
||||
showTopThreeArr[key].pinswg_siteaddresstown
|
||||
: "")}
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(showTopThreeArr[key])
|
||||
? t("myportal:case-address-not-entered")
|
||||
: _.isEmpty(
|
||||
showTopThreeArr[key]
|
||||
.pinswg_siteaddressline1
|
||||
)
|
||||
? t("myportal:case-address-not-entered")
|
||||
: showTopThreeArr[key]
|
||||
.pinswg_siteaddressline1 +
|
||||
(!_.isEmpty(
|
||||
showTopThreeArr[key]
|
||||
.pinswg_siteaddressline2
|
||||
)
|
||||
? ", " +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_siteaddressline2
|
||||
: "") +
|
||||
(!_.isEmpty(
|
||||
showTopThreeArr[key]
|
||||
.pinswg_siteaddresstown
|
||||
)
|
||||
? ", " +
|
||||
showTopThreeArr[key]
|
||||
.pinswg_siteaddresstown
|
||||
: "")}
|
||||
</div>
|
||||
{showTopThreeArr[key].pinswg_appellantagent != null && (
|
||||
<div className="cardModuleReference">
|
||||
@@ -495,7 +501,7 @@ const TopThree = (props) => {
|
||||
] +
|
||||
'")].value_cy',
|
||||
json: transLookup,
|
||||
eval: true,
|
||||
eval: true
|
||||
})
|
||||
: showTopThreeArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -591,7 +597,7 @@ const mapDispatchToProps = (dispatch) => {
|
||||
},
|
||||
setSearchDetails: (searchDetails) => {
|
||||
dispatch(setSearchDetails(searchDetails));
|
||||
},
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user