update jsonpath library
This commit is contained in:
@@ -2,7 +2,7 @@ import Link from "next/link";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath, { value } from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import _, { property } from "lodash";
|
||||
import {
|
||||
Field,
|
||||
@@ -85,13 +85,13 @@ let MakeRepresentation = (props) => {
|
||||
: false;
|
||||
|
||||
currentType == "searchResultsObj"
|
||||
? (casesObj = jsonpath.query(
|
||||
setCaseQueryObj,
|
||||
'$..[?(@.title=="' + caseReference + '")]'
|
||||
? (casesObj = jsonpath(
|
||||
'$..[?(@.title=="' + caseReference + '")]',
|
||||
setCaseQueryObj
|
||||
))
|
||||
: (casesObj = jsonpath.query(
|
||||
setCaseQueryObj,
|
||||
'$..[?(@.reference=="' + caseReference + '")]'
|
||||
: (casesObj = jsonpath(
|
||||
'$..[?(@.reference=="' + caseReference + '")]',
|
||||
setCaseQueryObj
|
||||
));
|
||||
|
||||
casesObj = Object.assign({}, ...casesObj);
|
||||
@@ -114,7 +114,7 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath.query(
|
||||
detailsObj = jsonpath(
|
||||
setCaseDetailsObj,
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
@@ -497,9 +497,9 @@ let MakeRepresentation = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath.query(
|
||||
setCaseDetailsObj,
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]'
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
|
||||
detailsObj = detailsObj[0];
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { Field, reduxForm } from "redux-form";
|
||||
import { RenderPickList, RenderTextfield } from "./representationElements";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
const RepDetails = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -31,9 +31,9 @@ const RepDetails = (props) => {
|
||||
: caseReference
|
||||
: caseReference;
|
||||
|
||||
detailsObj = jsonpath.query(
|
||||
setCaseDetailsObj,
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]'
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
|
||||
detailsObj = detailsObj[0];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Field, Fields, reduxForm } from "redux-form";
|
||||
import router from "next/router";
|
||||
import React, { useState, useMemo } from "react";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import Dropzone, { useDropzone } from "react-dropzone";
|
||||
import Link from "next/link";
|
||||
import dynamic from "next/dynamic";
|
||||
@@ -963,9 +963,9 @@ export const RenderFileUpload = (field) => {
|
||||
|
||||
const filelistObj = field.fileList || {};
|
||||
|
||||
const blobList = jsonpath.query(
|
||||
filelistObj,
|
||||
"$..[?(@.documentType=='" + field.documentTypeCode + "')]"
|
||||
const blobList = jsonpath(
|
||||
"$..[?(@.documentType=='" + field.documentTypeCode + "')]",
|
||||
filelistObj
|
||||
);
|
||||
|
||||
const deleteThisBlob = async (
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
} from "../../../store/currentView/action";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { select } from "xpath";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { useState } from "react";
|
||||
import Enforcement_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_enforcement";
|
||||
import S78_Questionnaire from "./representationQuestionnaires/representationLPAQuestionnaire_s78";
|
||||
@@ -199,11 +199,11 @@ let RepLPA = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath.query(
|
||||
setCaseDetailsObj,
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]'
|
||||
'")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
|
||||
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||
@@ -216,11 +216,11 @@ let RepLPA = (props) => {
|
||||
|
||||
var resultsObj = {};
|
||||
|
||||
resultsObj = jsonpath.query(
|
||||
setCaseResultssObj,
|
||||
resultsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]'
|
||||
'")]',
|
||||
setCaseResultssObj
|
||||
);
|
||||
resultsObj = resultsObj[0];
|
||||
|
||||
@@ -239,11 +239,11 @@ let RepLPA = (props) => {
|
||||
: "Representation"}{" "}
|
||||
{locale == "cy" ? "o ACLI am a" : "from an LPA for a"}{" "}
|
||||
{locale == "cy"
|
||||
? jsonpath.query(
|
||||
transLookup,
|
||||
? jsonpath(
|
||||
'$..[?(@.attributevalue=="' +
|
||||
currentView.caseReference.appealType +
|
||||
'")].value_cy'
|
||||
'")].value_cy',
|
||||
transLookup
|
||||
)
|
||||
: getFormCollectionByID(
|
||||
currentView.caseReference.appealType
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { Field, reduxForm } from "redux-form";
|
||||
import { RenderPickList, RenderTextfield } from "./representationElements";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
const RepLPADetails = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -23,9 +23,9 @@ const RepLPADetails = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath.query(
|
||||
setCaseDetailsObj,
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]'
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' + caseReference + '")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
|
||||
detailsObj = detailsObj[0];
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import {
|
||||
} from "../../../../store/currentView/action";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { select } from "xpath";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
const RepresentationProgress_enforcement = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
} from "../../../../store/currentView/action";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { select } from "xpath";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
const RepresentationProgress_s78 = (props) => {
|
||||
let { t } = useTranslation();
|
||||
|
||||
+7
-7
@@ -20,7 +20,7 @@ import {
|
||||
} from "../../../../store/currentView/action";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { select } from "xpath";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
|
||||
let Enforcement_Questionnaire = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -53,11 +53,11 @@ let Enforcement_Questionnaire = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath.query(
|
||||
setCaseDetailsObj,
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]'
|
||||
'")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
|
||||
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||
@@ -70,11 +70,11 @@ let Enforcement_Questionnaire = (props) => {
|
||||
|
||||
var resultsObj = {};
|
||||
|
||||
resultsObj = jsonpath.query(
|
||||
setCaseResultssObj,
|
||||
resultsObj = jsonpath(
|
||||
'$..[?(@.ticketnumber=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]'
|
||||
'")]',
|
||||
setCaseResultssObj
|
||||
);
|
||||
resultsObj = resultsObj[0];
|
||||
|
||||
|
||||
+7
-7
@@ -20,7 +20,7 @@ import {
|
||||
} from "../../../../store/currentView/action";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { select } from "xpath";
|
||||
import jsonpath from "jsonpath";
|
||||
import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { getFormCollectionByID } from "../../../../components/utils";
|
||||
|
||||
let S78_Questionnaire = (props) => {
|
||||
@@ -56,11 +56,11 @@ let S78_Questionnaire = (props) => {
|
||||
|
||||
var detailsObj = {};
|
||||
|
||||
detailsObj = jsonpath.query(
|
||||
setCaseDetailsObj,
|
||||
detailsObj = jsonpath(
|
||||
'$..[?(@.pinswg_name=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]'
|
||||
'")]',
|
||||
setCaseDetailsObj
|
||||
);
|
||||
|
||||
let setCaseResultssObj = router.query.hasOwnProperty("state")
|
||||
@@ -73,8 +73,7 @@ let S78_Questionnaire = (props) => {
|
||||
|
||||
var resultsObj = {};
|
||||
|
||||
resultsObj = jsonpath.query(
|
||||
setCaseResultssObj,
|
||||
resultsObj = jsonpath(
|
||||
"$..[?(@." +
|
||||
(router.query.hasOwnProperty("state")
|
||||
? router.query.state == "edit"
|
||||
@@ -83,7 +82,8 @@ let S78_Questionnaire = (props) => {
|
||||
: "ticketnumber") +
|
||||
'=="' +
|
||||
currentView.caseReference.currentReference +
|
||||
'")]'
|
||||
'")]',
|
||||
setCaseResultssObj
|
||||
);
|
||||
resultsObj = resultsObj[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user