Merge branch 'Development' into get-progress-from-blob
This commit is contained in:
@@ -68,6 +68,91 @@ const RenderTextfield = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const RenderCaseStatusList = ({
|
||||||
|
name,
|
||||||
|
id,
|
||||||
|
input,
|
||||||
|
optionsObj,
|
||||||
|
meta: { touched, error },
|
||||||
|
label,
|
||||||
|
errormsg,
|
||||||
|
}) => {
|
||||||
|
let { t } = useTranslation();
|
||||||
|
const router = useRouter();
|
||||||
|
const { locale } = router;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
touched && error
|
||||||
|
? "govuk-form-group govuk-form-group--error"
|
||||||
|
: "govuk-form-group "
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<label className="govuk-label" htmlFor={id}>
|
||||||
|
{label}
|
||||||
|
{name}
|
||||||
|
</label>
|
||||||
|
{touched && error && (
|
||||||
|
<span
|
||||||
|
id="passport-issued-error"
|
||||||
|
className="govuk-error-message"
|
||||||
|
>
|
||||||
|
<span className="govuk-visually-hidden">Error:</span>{" "}
|
||||||
|
{errormsg}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<div>
|
||||||
|
<select
|
||||||
|
{...input}
|
||||||
|
className="govuk-select"
|
||||||
|
id={id}
|
||||||
|
name={name}
|
||||||
|
//onChange={(e) => props.onChangeSelectAppealType(e)}
|
||||||
|
>
|
||||||
|
<option value="" disabled defaultValue>
|
||||||
|
{t("common:drop-down-select")}
|
||||||
|
</option>
|
||||||
|
{_.isEmpty(optionsObj)
|
||||||
|
? ""
|
||||||
|
: Object.keys(optionsObj).map((key, index) => {
|
||||||
|
return (
|
||||||
|
<option
|
||||||
|
key={key}
|
||||||
|
value={
|
||||||
|
_.isEmpty(optionsObj[key])
|
||||||
|
? ""
|
||||||
|
: optionsObj[key].statuscode
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{_.isEmpty(optionsObj[key])
|
||||||
|
? ""
|
||||||
|
: _.isEmpty(optionsObj[key])
|
||||||
|
? ""
|
||||||
|
: _.isEmpty(optionsObj[key].value)
|
||||||
|
? ""
|
||||||
|
: router.locale == "cy"
|
||||||
|
? jsonpath.query(
|
||||||
|
optionsObj,
|
||||||
|
'$..[?(@.statuscode=="' +
|
||||||
|
optionsObj[key]
|
||||||
|
.statuscode +
|
||||||
|
'")].value_cy'
|
||||||
|
)
|
||||||
|
: optionsObj[key].value ||
|
||||||
|
t(
|
||||||
|
"case:summary-no-date-entered-label"
|
||||||
|
)}
|
||||||
|
</option>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
let AdvancedSearch = (props) => {
|
let AdvancedSearch = (props) => {
|
||||||
let { t } = useTranslation();
|
let { t } = useTranslation();
|
||||||
|
|
||||||
@@ -299,23 +384,25 @@ let AdvancedSearch = (props) => {
|
|||||||
var searchString = "";
|
var searchString = "";
|
||||||
|
|
||||||
searchString +=
|
searchString +=
|
||||||
values.caseRef != null ? "?q=" + values.caseRef.trim() : "";
|
values.caseRef != null ? "q=" + values.caseRef.trim() + "&" : "";
|
||||||
|
|
||||||
searchString +=
|
searchString +=
|
||||||
values.lpaTypes != null
|
values.lpaTypes != null ? "lpa=" + values.lpaTypes + "&" : "";
|
||||||
? (typeof values.caseRef == "undefined" ? "?" : "&") +
|
|
||||||
"lpa=" +
|
|
||||||
values.lpaTypes
|
|
||||||
: "";
|
|
||||||
|
|
||||||
searchString +=
|
searchString +=
|
||||||
values.appealTypes != null
|
values.appealTypes != null
|
||||||
? (typeof values.caseRef == "undefined" &&
|
? "apt=" + values.appealTypes.split(",")[0] + "&"
|
||||||
typeof values.lpaTypes == "undefined"
|
|
||||||
? "?"
|
|
||||||
: "&") +
|
|
||||||
("apt=" + values.appealTypes.split(",")[0])
|
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
|
searchString +=
|
||||||
|
values.statusCode != null
|
||||||
|
? "statuscode=" + values.statusCode + "&"
|
||||||
|
: "";
|
||||||
|
|
||||||
|
searchString = "?" + searchString.slice(0, -1);
|
||||||
|
|
||||||
|
console.log(searchString);
|
||||||
|
|
||||||
router.replace(
|
router.replace(
|
||||||
router.locale == "cy"
|
router.locale == "cy"
|
||||||
? (myportal == true ? "/fymhorth" : "") +
|
? (myportal == true ? "/fymhorth" : "") +
|
||||||
@@ -385,6 +472,49 @@ let AdvancedSearch = (props) => {
|
|||||||
label={t("search:lpa-label")}
|
label={t("search:lpa-label")}
|
||||||
errormsg="Local authority is required"
|
errormsg="Local authority is required"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Field
|
||||||
|
name="statusCode"
|
||||||
|
id="statusCode"
|
||||||
|
component={RenderCaseStatusList}
|
||||||
|
optionsObj={[
|
||||||
|
{
|
||||||
|
"value": "In Progress",
|
||||||
|
"value_cy": "Ar y gweill",
|
||||||
|
"statuscode": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "On Hold",
|
||||||
|
"value_cy": "Ar Dal",
|
||||||
|
"statuscode": 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value":
|
||||||
|
"Waiting for details",
|
||||||
|
"value_cy":
|
||||||
|
"Aros am fanylion",
|
||||||
|
"statuscode": 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Researching",
|
||||||
|
"value_cy": "Ymchwilio",
|
||||||
|
"statuscode": 4,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Case Closed",
|
||||||
|
"value_cy": "Achos ar Gau",
|
||||||
|
"statuscode": 5,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "Canceled",
|
||||||
|
"value_cy": "Wedi'i ganslo",
|
||||||
|
"statuscode": 6,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
//validate={[required]}
|
||||||
|
label={"Case Status"}
|
||||||
|
errormsg="Local authority is required"
|
||||||
|
/>
|
||||||
{/* <fieldset className="govuk-fieldset">
|
{/* <fieldset className="govuk-fieldset">
|
||||||
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
<legend className="govuk-fieldset__legend govuk-fieldset__legend--l">
|
||||||
<h3 className="govuk-heading-m">
|
<h3 className="govuk-heading-m">
|
||||||
|
|||||||
@@ -37,29 +37,32 @@ export default async function ApiProxy(req, res) {
|
|||||||
searchString.q +
|
searchString.q +
|
||||||
"') or contains(ticketnumber,'" +
|
"') or contains(ticketnumber,'" +
|
||||||
searchString.q +
|
searchString.q +
|
||||||
"'))"
|
"')) and"
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
queryString +=
|
queryString +=
|
||||||
_.has(searchString, "lpa") && searchString.lpa != null
|
_.has(searchString, "lpa") && searchString.lpa != null
|
||||||
? (typeof searchString.q == "undefined" ? "" : " and ") +
|
? " _pinswg_associatedlpa_value eq " + searchString.lpa + " and"
|
||||||
"_pinswg_associatedlpa_value eq " +
|
|
||||||
searchString.lpa
|
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
queryString +=
|
queryString +=
|
||||||
_.has(searchString, "apt") && searchString.apt != null
|
_.has(searchString, "apt") && searchString.apt != null
|
||||||
? (typeof searchString.q == "undefined" &&
|
? " pinswg_appealcasetype eq " + searchString.apt + " and"
|
||||||
typeof searchString.lpa == "undefined"
|
|
||||||
? ""
|
|
||||||
: " and ") +
|
|
||||||
"pinswg_appealcasetype eq " +
|
|
||||||
searchString.apt
|
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
|
queryString +=
|
||||||
|
_.has(searchString, "statuscode") && searchString.statuscode != null
|
||||||
|
? " statuscode eq " + searchString.statuscode + " and"
|
||||||
|
: "";
|
||||||
|
|
||||||
|
console.log(queryString);
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"incidents?$select=description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
"incidents?$select=description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
||||||
queryString +
|
queryString +
|
||||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
" pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||||
|
|
||||||
|
console.log(queryUrl);
|
||||||
|
|
||||||
var apiResponse = _.isEmpty(searchString)
|
var apiResponse = _.isEmpty(searchString)
|
||||||
? res.status(400).json()
|
? res.status(400).json()
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ import axios from "axios";
|
|||||||
import CryptoJS from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
import { query } from "jsonpath";
|
import { query } from "jsonpath";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { getToken, azureHeadersPagedCustom } from "../../../actions";
|
import {
|
||||||
|
getToken,
|
||||||
|
azureHeadersPagedCustom,
|
||||||
|
consoleLogger,
|
||||||
|
} from "../../../actions";
|
||||||
|
|
||||||
const WORDKEY = process.env.HASHKEY;
|
const WORDKEY = process.env.HASHKEY;
|
||||||
|
|
||||||
@@ -43,29 +47,28 @@ export default async function ApiProxy(req, res) {
|
|||||||
searchString.q +
|
searchString.q +
|
||||||
"') or contains(ticketnumber,'" +
|
"') or contains(ticketnumber,'" +
|
||||||
searchString.q +
|
searchString.q +
|
||||||
"'))"
|
"')) and"
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
queryString +=
|
queryString +=
|
||||||
_.has(searchString, "lpa") && searchString.lpa != null
|
_.has(searchString, "lpa") && searchString.lpa != null
|
||||||
? (typeof searchString.q == "undefined" ? "" : " and ") +
|
? " _pinswg_associatedlpa_value eq " + searchString.lpa + " and"
|
||||||
"_pinswg_associatedlpa_value eq " +
|
|
||||||
searchString.lpa
|
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
queryString +=
|
queryString +=
|
||||||
_.has(searchString, "apt") && searchString.apt != null
|
_.has(searchString, "apt") && searchString.apt != null
|
||||||
? (typeof searchString.q == "undefined" &&
|
? " pinswg_appealcasetype eq " + searchString.apt + " and"
|
||||||
typeof searchString.lpa == "undefined"
|
: "";
|
||||||
? ""
|
|
||||||
: " and ") +
|
queryString +=
|
||||||
"pinswg_appealcasetype eq " +
|
_.has(searchString, "statuscode") && searchString.statuscode != null
|
||||||
searchString.apt
|
? " statuscode eq " + searchString.statuscode + " and"
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
var queryUrl =
|
var queryUrl =
|
||||||
"incidents?$select=description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
"incidents?$select=description,numberofchildincidents,_accountid_value,_customerid_value,_pinswg_associatedlpa_value,_ownerid_value,pinswg_appealcasetype,statuscode,ticketnumber,title, _primarycontactid_value&$expand=primarycontactid($select=fullname)&$filter=" +
|
||||||
queryString +
|
queryString +
|
||||||
" and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=" +
|
" pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=" +
|
||||||
orderby +
|
orderby +
|
||||||
" " +
|
" " +
|
||||||
fieldSort +
|
fieldSort +
|
||||||
|
|||||||
Reference in New Issue
Block a user