Saving progress spinner and language updates
This commit is contained in:
@@ -112,6 +112,17 @@ let PersonalDetails = (props) => {
|
||||
About you
|
||||
</h2>
|
||||
</legend>
|
||||
<div className="govuk-form-group ">
|
||||
<span className="govuk-label ">
|
||||
Role:{" "}
|
||||
{
|
||||
props.props.accountDetails
|
||||
.accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<Field
|
||||
name="firstname"
|
||||
id="firstname"
|
||||
|
||||
@@ -344,7 +344,9 @@ const Breadcrumbs = (props) => {
|
||||
<Link
|
||||
href={
|
||||
router.locale != "en"
|
||||
? router.locale + "/myportal"
|
||||
? "/" +
|
||||
router.locale +
|
||||
"/myportal"
|
||||
: "/myportal"
|
||||
}
|
||||
>
|
||||
@@ -354,7 +356,20 @@ const Breadcrumbs = (props) => {
|
||||
</Link>
|
||||
</li>
|
||||
<li className="govuk-breadcrumbs__list-item">
|
||||
{currentView.viewName}
|
||||
{currentView.viewKey ==
|
||||
"awaitingSubmissionDetails" &&
|
||||
t(
|
||||
"myportal:awatitingsubmission-card-title"
|
||||
)}
|
||||
{currentView.viewKey == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{currentView.viewKey == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{currentView.viewKey ==
|
||||
"myRepresentations" &&
|
||||
t(
|
||||
"myportal:myrepresentations-card-title"
|
||||
)}
|
||||
</li>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -707,7 +707,7 @@ const CaseSummary = (props) => {
|
||||
}
|
||||
|
||||
const { data: session, status } = useSession();
|
||||
console.log("session status:", status, session);
|
||||
//console.log("session status:", status, session);
|
||||
return (
|
||||
<>
|
||||
{showDetailsBlock}
|
||||
|
||||
@@ -66,6 +66,12 @@ const MyPortal = (props) => {
|
||||
props.accountDetails.accountDetails
|
||||
.lastname
|
||||
}
|
||||
{" - "}
|
||||
{
|
||||
props.accountDetails.accountDetails[
|
||||
"pinswg_typeofinvolvement@OData.Community.Display.V1.FormattedValue"
|
||||
]
|
||||
}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -43,12 +43,11 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
});
|
||||
};
|
||||
|
||||
let topThreeOnlyArr = showTopThreeArr;
|
||||
console.log(showTopThreeArr);
|
||||
let topThreeOnlyArr = showTopThreeArr.slice(0, 3);
|
||||
//console.log(showTopThreeArr);
|
||||
Object.keys(topThreeOnlyArr).map((key, index) => {
|
||||
console.log(key, showTopThreeArr[key].pinswg_appealcasetype);
|
||||
|
||||
console.log("subsssss:", showTopThreeArr[key]);
|
||||
//console.log(key, showTopThreeArr[key].pinswg_appealcasetype);
|
||||
//console.log("subsssss:", showTopThreeArr[key]);
|
||||
let urlname = getFormCollectionByID(
|
||||
showTopThreeArr[key].pinswg_appealcasetype
|
||||
).UrlName;
|
||||
@@ -103,7 +102,7 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
</Link>
|
||||
</div>
|
||||
<div>
|
||||
<b>Appeal type:</b>{" "}
|
||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||
{
|
||||
getFormCollectionByID(
|
||||
showTopThreeArr[key].pinswg_appealcasetype
|
||||
@@ -141,7 +140,9 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
{showTopThreeArrDets[key].pinswg_appellantagent != null && (
|
||||
<div>
|
||||
{showTopThreeArrDets[key].pinswg_appellantagent !=
|
||||
846040000 && <b>Raised by: </b>}
|
||||
846040000 && (
|
||||
<b>{t("myportal:raised-by-label")}: </b>
|
||||
)}
|
||||
{showTopThreeArrDets[key].pinswg_appellantagent !=
|
||||
846040000 &&
|
||||
(showTopThreeArrDets[key]
|
||||
@@ -158,7 +159,7 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
{showTopThreeArrDets[key].pinswg_appellantfirstname !=
|
||||
null && (
|
||||
<div>
|
||||
<b>On behalf of: </b>
|
||||
<b>{t("myportal:on-behalf-of-label")}: </b>
|
||||
{showTopThreeArrDets[key]
|
||||
.pinswg_appellantfirstname +
|
||||
" " +
|
||||
@@ -220,7 +221,7 @@ const AwaitingSubmissionFromBlob = (props) => {
|
||||
onClick={() => {
|
||||
setCurrentView({
|
||||
"viewName": "Awaiting Submission",
|
||||
"viewKey": "awaitingSubmission",
|
||||
"viewKey": "awaitingSubmissionDetails",
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -213,7 +213,7 @@ const TopThree = (props) => {
|
||||
{/* {(topThreeType == "awaitingSubmission" ||
|
||||
topThreeType == "watchedCases") && ( */}
|
||||
<div>
|
||||
<b>Appeal type:</b>{" "}
|
||||
<b>{t("myportal:appeal-type-label")}:</b>{" "}
|
||||
{
|
||||
showTopThreeArr[key][
|
||||
"pinswg_appealcasetype@OData.Community.Display.V1.FormattedValue"
|
||||
@@ -258,7 +258,9 @@ const TopThree = (props) => {
|
||||
{showTopThreeArr[key].pinswg_appellantagent != null && (
|
||||
<div>
|
||||
{showTopThreeArr[key].pinswg_appellantagent !=
|
||||
846040000 && <b>Raised by: </b>}
|
||||
846040000 && (
|
||||
<b>{t("myportal:raised-by-label")}</b>
|
||||
)}
|
||||
{showTopThreeArr[key].pinswg_appellantagent !=
|
||||
846040000 &&
|
||||
(showTopThreeArr[key].pinswg_agentcompanyname !=
|
||||
@@ -272,7 +274,7 @@ const TopThree = (props) => {
|
||||
)}
|
||||
{showTopThreeArr[key].pinswg_appellantfirstname != null && (
|
||||
<div>
|
||||
<b>On behalf of: </b>
|
||||
<b>{t("myportal:on-behalf-of-label")}: </b>
|
||||
{showTopThreeArr[key].pinswg_appellantfirstname +
|
||||
" " +
|
||||
showTopThreeArr[key].pinswg_appellantlastname}
|
||||
|
||||
+135
-24
@@ -21,9 +21,10 @@ const ViewAllResults = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
var resultsArr = props[currentView.viewKey][currentView.viewKey].value || [
|
||||
{},
|
||||
];
|
||||
var resultsArr =
|
||||
currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.case
|
||||
: props[currentView.viewKey][currentView.viewKey].value || [];
|
||||
|
||||
function formatDates(dateObj) {
|
||||
var dateObj = new Date(dateObj);
|
||||
@@ -34,14 +35,17 @@ const ViewAllResults = (props) => {
|
||||
return dd + "/" + mm + "/" + yyyy;
|
||||
}
|
||||
|
||||
console.log(
|
||||
currentView.viewKey,
|
||||
props[currentView.viewKey],
|
||||
props[currentView.viewKey][currentView.viewKey].value
|
||||
);
|
||||
// console.log(
|
||||
// currentView.viewKey,
|
||||
// props[currentView.viewKey],
|
||||
// props[currentView.viewKey][currentView.viewKey].value
|
||||
// );
|
||||
|
||||
var searchDetailsObj =
|
||||
props[currentView.viewKey][currentView.viewKey + "Details"] || {};
|
||||
currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? props["awaitingSubmission"].awaitingSubmissionDetails.value
|
||||
: props[currentView.viewKey][currentView.viewKey + "Details"] || [];
|
||||
|
||||
let resultsRowArr = [];
|
||||
resultsArr.map((item, key) => {
|
||||
let detailsObj = jsonpath.query(
|
||||
@@ -55,7 +59,7 @@ const ViewAllResults = (props) => {
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 govuk-!-padding-left-2">
|
||||
<Link
|
||||
href={
|
||||
currentView.viewKey == "awaitingSubmission"
|
||||
currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? "/fymhorth/parhauigyflwyno"
|
||||
: "/myportal" +
|
||||
@@ -70,7 +74,7 @@ const ViewAllResults = (props) => {
|
||||
"&apt=" +
|
||||
resultsArr[key].pinswg_appealcasetype +
|
||||
"&casereference=" +
|
||||
resultsArr[key].pinswg_title +
|
||||
resultsArr[key].title +
|
||||
"&inid=" +
|
||||
resultsArr[key].incidentid
|
||||
: router.locale == "cy"
|
||||
@@ -135,45 +139,103 @@ const ViewAllResults = (props) => {
|
||||
)[0]
|
||||
: ""
|
||||
: ""} */}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline1
|
||||
: ""}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline1
|
||||
: ""}
|
||||
|
||||
{/* {detailsObj.pinswg_siteaddressline1 !=
|
||||
null && <br />} */}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddressline1"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddressline1 !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1") &&
|
||||
detailsObj.pinswg_siteaddressline1 != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddressline1")
|
||||
? searchDetailsObj[key].pinswg_siteaddressline2
|
||||
: ""}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddressline1")
|
||||
? detailsObj.pinswg_siteaddressline2
|
||||
: ""}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddressline2"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddressline2 !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddressline2") &&
|
||||
detailsObj.pinswg_siteaddressline2 != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresstown")
|
||||
? searchDetailsObj[key].pinswg_siteaddresstown
|
||||
: ""}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown")
|
||||
? detailsObj.pinswg_siteaddresstown
|
||||
: ""}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresstown"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddresstown !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresstown") &&
|
||||
detailsObj.pinswg_siteaddresstown != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresscounty")
|
||||
? searchDetailsObj[key].pinswg_siteaddresscounty
|
||||
: ""}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresscounty")
|
||||
? detailsObj.pinswg_siteaddresscounty
|
||||
: ""}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(
|
||||
searchDetailsObj[key],
|
||||
"pinswg_siteaddresscounty"
|
||||
) &&
|
||||
searchDetailsObj[key].pinswg_siteaddresscounty !=
|
||||
null && <br />}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresscounty") &&
|
||||
detailsObj.pinswg_siteaddresscounty != null && <br />}
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(searchDetailsObj[key], "pinswg_siteaddresspostcode")
|
||||
? searchDetailsObj[key].pinswg_siteaddresspostcode
|
||||
: ""}
|
||||
|
||||
{_.has(detailsObj, "pinswg_siteaddresspostcode")
|
||||
? detailsObj.pinswg_siteaddresspostcode
|
||||
: ""}
|
||||
</dd>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16">
|
||||
<span className="results-visually-hidden">
|
||||
{currentView.viewKey == "awaitingSubmission"
|
||||
? "Created on"
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? t("search:searchresults-created-on-label")
|
||||
: t("search:searchresults-applicant-label")}
|
||||
</span>
|
||||
|
||||
{currentView.viewKey == "awaitingSubmission"
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? formatDates(item.createdon)
|
||||
: _.has(detailsObj, [
|
||||
"_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue",
|
||||
@@ -189,19 +251,32 @@ const ViewAllResults = (props) => {
|
||||
<span className="results-visually-hidden">
|
||||
{t("search:searchresults-authority-label")}:
|
||||
</span>
|
||||
{_.has(detailsObj, [
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
_.has(resultsArr[key], "pinswg_lpaname")
|
||||
? router.locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.value=="' +
|
||||
resultsArr[key].pinswg_lpaname +
|
||||
'")].value_cy'
|
||||
)
|
||||
: resultsArr[key].pinswg_lpaname || "N/A"
|
||||
: ""}
|
||||
|
||||
{_.has(resultsArr[key], [
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue",
|
||||
])
|
||||
? router.locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.value=="' +
|
||||
item[
|
||||
resultsArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] +
|
||||
'")].value_cy'
|
||||
)
|
||||
: detailsObj[
|
||||
: resultsArr[key][
|
||||
"_pinswg_associatedlpa_value@OData.Community.Display.V1.FormattedValue"
|
||||
] || "N/A"
|
||||
: ""}
|
||||
@@ -210,7 +285,20 @@ const ViewAllResults = (props) => {
|
||||
<span className="results-visually-hidden">
|
||||
{t("search:searchresults-case-type-label")}:
|
||||
</span>
|
||||
{router.locale == "cy"
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.value=="' +
|
||||
getFormCollectionByID(
|
||||
item.pinswg_appealcasetype
|
||||
).value +
|
||||
'")].value_cy'
|
||||
)
|
||||
: getFormCollectionByID(item.pinswg_appealcasetype)
|
||||
.value || "N/A"
|
||||
: router.locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.value=="' +
|
||||
@@ -227,7 +315,22 @@ const ViewAllResults = (props) => {
|
||||
<span className="results-visually-hidden">
|
||||
{t("search:searchresults-status-label")}:
|
||||
</span>
|
||||
{router.locale == "cy"
|
||||
|
||||
{currentView.viewKey == "awaitingSubmissionDetails"
|
||||
? router.locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.statuscode=="' +
|
||||
item.statuscode +
|
||||
'")].value_cy'
|
||||
)
|
||||
: jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.statuscode=="' +
|
||||
item.statuscode +
|
||||
'")].value'
|
||||
) || "N/A"
|
||||
: router.locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
'$..[?(@.value=="' +
|
||||
@@ -249,7 +352,14 @@ const ViewAllResults = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
{currentView.viewName}
|
||||
{currentView.viewKey == "awaitingSubmissionDetails" &&
|
||||
t("myportal:awatitingsubmission-card-title")}
|
||||
{currentView.viewKey == "watchedCases" &&
|
||||
t("myportal:watchedcases-card-title")}
|
||||
{currentView.viewKey == "myCases" &&
|
||||
t("myportal:mycases-card-title")}
|
||||
{currentView.viewKey == "myRepresentations" &&
|
||||
t("myportal:myrepresentations-card-title")}
|
||||
</h1>
|
||||
|
||||
<dl className="govuk-summary-list govuk-!-margin-bottom-9 results">
|
||||
@@ -260,9 +370,10 @@ const ViewAllResults = (props) => {
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
{t("search:searchresults-site-address-label")}
|
||||
</dd>
|
||||
{currentView.viewKey == "awaitingSubmission" ? (
|
||||
{currentView.viewKey ==
|
||||
"awaitingSubmissionDetails" ? (
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
Created on
|
||||
{t("search:searchresults-created-on-label")}{" "}
|
||||
</dd>
|
||||
) : (
|
||||
<dd className="govuk-summary-list__key govuk-!-font-size-16">
|
||||
|
||||
@@ -25,6 +25,8 @@ let BuildSection = (props) => {
|
||||
const [currentSectionSelected, setCurrentSectionSelected] = useState(1);
|
||||
const [pickupWhereLeftOff, setPickupWhereLeftOff] = useState(true);
|
||||
|
||||
const [savingStatus, setSavingStatus] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
progObj = getProgressObj(
|
||||
formXML,
|
||||
@@ -69,6 +71,7 @@ let BuildSection = (props) => {
|
||||
|
||||
const documentListObj = props.appealType.documentList;
|
||||
const currentSection = props.appealType.currentSection;
|
||||
|
||||
const parser = new DOMParser();
|
||||
var doc = parser.parseFromString(props.formXML, "text/xml");
|
||||
var titles = xpath.select(
|
||||
@@ -97,6 +100,16 @@ let BuildSection = (props) => {
|
||||
props
|
||||
);
|
||||
|
||||
const isProgressComplete = (progObj) => {
|
||||
const progressCount = 0;
|
||||
|
||||
for (let key in progObj) {
|
||||
progObj[key].allFieldsComplete === true && progressCount++;
|
||||
}
|
||||
|
||||
return progObj.length == progressCount;
|
||||
};
|
||||
|
||||
const lastIndex = progObj
|
||||
.map((whichIsLast) => whichIsLast.allFieldsComplete == true)
|
||||
.lastIndexOf(true);
|
||||
@@ -134,10 +147,11 @@ let BuildSection = (props) => {
|
||||
});
|
||||
};
|
||||
|
||||
const updateCaseProgress = (values, sendSavedEmail) => {
|
||||
const updateCaseProgress = (values, sendSavedEmail, useSaveStatus) => {
|
||||
let incidentId = props.appealType.caseReference.incidentid;
|
||||
let updateBody = values || {};
|
||||
|
||||
setSavingStatus(useSaveStatus);
|
||||
uploadAppealFiles(values);
|
||||
props.setNewAppealProgress(
|
||||
getProgressObj(formXML, titleList, mandatoryFieldsData, props)
|
||||
@@ -206,6 +220,13 @@ let BuildSection = (props) => {
|
||||
props.appealType.caseReference.incidentid +
|
||||
"'> from here </a>"
|
||||
);
|
||||
|
||||
useSaveStatus &&
|
||||
router.replace(
|
||||
router.locale != "en"
|
||||
? router.locale + "/myportal"
|
||||
: "/myportal"
|
||||
);
|
||||
};
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
@@ -214,7 +235,7 @@ let BuildSection = (props) => {
|
||||
|
||||
delete valuesObj["_pinswg_appellant_value"];
|
||||
console.log("has errors:", props.invalid);
|
||||
props.invalid == false && updateCaseProgress(valuesObj, false);
|
||||
props.invalid == false && updateCaseProgress(valuesObj, false, false);
|
||||
|
||||
setCurrentSection(currentSection + 1);
|
||||
};
|
||||
@@ -330,7 +351,7 @@ let BuildSection = (props) => {
|
||||
delete valuesObj["_pinswg_appellant_value"];
|
||||
|
||||
//console.log("on save:", valuesObj);
|
||||
updateCaseProgress(valuesObj, false);
|
||||
updateCaseProgress(valuesObj, false, false);
|
||||
}}
|
||||
>
|
||||
{t("common:continue-button")}
|
||||
@@ -340,6 +361,7 @@ let BuildSection = (props) => {
|
||||
)}
|
||||
{props.sectionCount == currentSection ? (
|
||||
<button
|
||||
disabled={!isProgressComplete(progObj)}
|
||||
type="submit"
|
||||
className="govuk-button"
|
||||
data-module="govuk-button"
|
||||
@@ -383,27 +405,38 @@ let BuildSection = (props) => {
|
||||
/>
|
||||
|
||||
<hr className="govuk-section-break govuk-section-break--m govuk-section-break--visible" />
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props.form[props.form].values || {};
|
||||
|
||||
console.log("valuesobj:", valuesObj);
|
||||
{savingStatus ? (
|
||||
<span className=" progress-save-active">
|
||||
Saving data
|
||||
<img
|
||||
className="data-loading-icon"
|
||||
src="/assets/images/loading.gif"
|
||||
alt={
|
||||
router.locale == "cy"
|
||||
? "Nôl data"
|
||||
: "Saving data"
|
||||
}
|
||||
/>
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
className="govuk-button govuk-button--secondary progress-save "
|
||||
onClick={() => {
|
||||
let valuesObj =
|
||||
props.props.form[props.form].values || {};
|
||||
|
||||
delete valuesObj["_pinswg_appellant_value"];
|
||||
console.log("valuesobj:", valuesObj);
|
||||
|
||||
console.log("on save:", valuesObj);
|
||||
updateCaseProgress(valuesObj, true);
|
||||
router.replace(
|
||||
router.locale != "en"
|
||||
? router.locale + "/myportal"
|
||||
: "/myportal"
|
||||
);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
delete valuesObj["_pinswg_appellant_value"];
|
||||
|
||||
console.log("on save:", valuesObj);
|
||||
updateCaseProgress(valuesObj, true, true);
|
||||
}}
|
||||
>
|
||||
{t("common:save-exit-button")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -510,11 +510,11 @@ const SearchResults = (props) => {
|
||||
}}
|
||||
title="Stop watching this case"
|
||||
>
|
||||
−
|
||||
<span className="eye"></span>
|
||||
</span>
|
||||
) : (
|
||||
<span
|
||||
className="govuk-summary-list__actionLink"
|
||||
className="govuk-summary-list__actionLink watchLink"
|
||||
onClick={() => {
|
||||
selectWatchedCase(
|
||||
cookies.pinsUser,
|
||||
@@ -528,7 +528,7 @@ const SearchResults = (props) => {
|
||||
}}
|
||||
title="Watch this case"
|
||||
>
|
||||
+
|
||||
<span className="eye"></span>
|
||||
</span>
|
||||
)}
|
||||
</dd>
|
||||
@@ -536,7 +536,7 @@ const SearchResults = (props) => {
|
||||
{!session && (
|
||||
<dd>
|
||||
<span
|
||||
className="govuk-summary-list__actionLink"
|
||||
className="govuk-summary-list__actionLink watchLink"
|
||||
onClick={() => {
|
||||
signIn("email");
|
||||
// selectWatchedCase(
|
||||
@@ -551,7 +551,7 @@ const SearchResults = (props) => {
|
||||
}}
|
||||
title="Watch this case"
|
||||
>
|
||||
+
|
||||
<span className="eye"></span>
|
||||
</span>
|
||||
</dd>
|
||||
)}
|
||||
|
||||
@@ -218,7 +218,11 @@ export const getProgressObj = (
|
||||
"title": titleList[key].value,
|
||||
rowCount,
|
||||
"totalFields": formObj[key].fieldsTotal,
|
||||
"allFieldsComplete": rowCount == formObj[key].fieldsTotal,
|
||||
"allFieldsComplete":
|
||||
titleList[key].value == "Upload documents"
|
||||
? _.has(props.props.appealType.fileList, "files") &&
|
||||
props.props.appealType.fileList.files.length > 0
|
||||
: rowCount == formObj[key].fieldsTotal,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user