Skip to content

Commit

Permalink
Update the way JSONPath is called
Browse files Browse the repository at this point in the history
  • Loading branch information
gjvoosten authored and cemalettin-work committed Feb 3, 2021
1 parent 5ff7244 commit a54032b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit a54032b

Please sign in to comment.