Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency jsonpath-plus to v5 #3398

Merged
merged 4 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions anet-dictionary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ fields:
- recurrence: quarterly
questions:
test1:
test: $.subject.position.organization.[?(@property === "identificationCode" && @.match(/^Z/i))]
test: $.subject.position.organization[?(@property === "identificationCode" && @.match(/^Z/i))]
type: enum
label: Test question 1
choices:
Expand All @@ -768,7 +768,7 @@ fields:
label: three
color: '#ff8279'
test2:
test: $.subject.position.organization.[?(@property === "identificationCode" && @.match(/^Z/i))]
test: $.subject.position.organization[?(@property === "identificationCode" && @.match(/^Z/i))]
type: enum
label: Test question 2
choices:
Expand All @@ -782,7 +782,7 @@ fields:
label: five
color: '#c2ffb3'
test3:
test: $.subject.position.organization.[?(@property === "identificationCode" && @.match(/^Z/i))]
test: $.subject.position.organization[?(@property === "identificationCode" && @.match(/^Z/i))]
type: enum
label: Test question 3
choices:
Expand Down Expand Up @@ -818,23 +818,23 @@ fields:
label: high
color: '#ff8279'
question2:
test: $.subject.position.organization.[?(@property === "identificationCode" && @.match(/^P/i))]
test: $.subject.position.organization[?(@property === "identificationCode" && @.match(/^P/i))]
type: enumset
label: Attendee from P org
choices:
yes:
label: P
color: '#ff0000'
question3:
test: $.subject.position.organization.[?(@property === "identificationCode" && @.match(/^Z/i))]
test: $.subject.position.organization[?(@property === "identificationCode" && @.match(/^Z/i))]
type: enumset
label: Attendee from Z org
choices:
yes:
label: Z
color: '#00ff00'
question4:
test: $.relatedObject.[?(@property === "atmosphere" && @ === "POSITIVE")]
test: $.relatedObject[?(@property === "atmosphere" && @ === "POSITIVE")]
type: enumset
label: Report had POSITIVE atmosphere
choices:
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"graphql": "15.5.0",
"hopscotch": "0.3.1",
"html-react-parser": "1.2.3",
"jsonpath-plus": "4.0.0",
"jsonpath-plus": "5.0.3",
"leaflet": "1.6.0",
"leaflet-defaulticon-compatibility": "0.1.1",
"leaflet-geosearch": "3.2.1",
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/CustomFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@ export function getInvisibleFields(
Object.entries(fieldsConfig).forEach(([key, fieldConfig]) => {
const visibleWhenPath = fieldConfig.visibleWhen
const isVisible =
!visibleWhenPath || !_isEmpty(JSONPath(visibleWhenPath, formikValues))
!visibleWhenPath ||
!_isEmpty(JSONPath({ path: visibleWhenPath, json: formikValues }))

const fieldName = `${parentFieldName}.${key}`

Expand Down
3 changes: 2 additions & 1 deletion client/src/components/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ export default class Model {
Object.entries(assessmentConfig)
.filter(
([key, question]) =>
!question.test || !_isEmpty(JSONPath(question.test, testValue))
!question.test ||
!_isEmpty(JSONPath({ path: question.test, json: testValue }))
)
.forEach(([key, question]) => {
filteredAssessmentConfig[key] = question
Expand Down
9 changes: 4 additions & 5 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7990,7 +7990,6 @@ extsprintf@^1.2.0:

"faker@https://github.com/Marak/faker.js.git":
version "5.2.0"
uid "72fb83d66f275b8337406cc5cbaa29f4ac32b91a"
resolved "https://github.com/Marak/faker.js.git#72fb83d66f275b8337406cc5cbaa29f4ac32b91a"

fast-deep-equal@^2.0.1:
Expand Down Expand Up @@ -10847,10 +10846,10 @@ jsonfile@^6.0.1:
optionalDependencies:
graceful-fs "^4.1.6"

jsonpath-plus@4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-4.0.0.tgz#954b69faa3d8b07f30ae2f9e601176a4b0d2806e"
integrity sha512-e0Jtg4KAzDJKKwzbLaUtinCn0RZseWBVRTRGihSpvFlM3wTR7ExSp+PTdeTsDrLNJUe7L7JYJe8mblHX5SCT6A==
jsonpath-plus@5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-5.0.3.tgz#502f0fc953d0f92428b2c2357c0c6809a803ec36"
integrity sha512-RDvpzY21CmKTvEfxuGqQmPqRTuzNOim7L+/TcsdBM8jguI5ok38t0p2eKr9GAsVkazrTyylpMZV/hKSQCWqx9g==

jsprim@^1.2.2:
version "1.4.1"
Expand Down