Comments (3)
@Miguel-314 FYI! I'll plan to add some more of the technical details I found when looking into this as well
from civiform.
This is where we decide whether to show / hide a block:
This is where we make sure there is something selected in the predicate UI:
civiform/server/app/assets/javascripts/admin_predicate_configuration.ts
Lines 128 to 139 in 7b3cd57
When nothing is selected, the predicate doesn't match either of these key patterns because the predicate value is empty:
from civiform.
The reason this is complicated is because if a question hasn't been seen / answered, the response won't be added to the applicant data (
) and the applicant data is what is compared with the predicate.So my applicant data may look like this because I've only seen one question {"applicant":{"treeqdk":{"updated_at":1714146723403,"program_updated_in":7,"selections":["1"]}}}
But the predicate will look like this: $.applicant.sample_checkbox_question[?(@.selections noneof ["3", "2", "1"])]
So if the sample_checkbox_question is not in the applicant data, it won't be compared no matter what.
If an optional question is skipped, it is entered as so: {"applicant":{"treeqdk":{"updated_at":1714148097313,"program_updated_in":7}}}
We can consider either allowing for empty predicates to be set and if its empty we'd check that its absent or empty (like the optional situation above)
Maybe this would look something like !$.applicant.sample_checkbox_question || !$.applicant.sample_checkbox_question[?(@.selections)]
I think this would involve adding a new operator type of EMPTY or something like that
from civiform.
Related Issues (20)
- "[North Star Applicant UI] Translate all aria-labels" HOT 1
- [North Star Applicant UI] Add support for CEs to enter translations for screen titles and descriptions
- [North Star Applicant UI] Only show login modal once per session
- Create Program Filtering feature flag
- [North Star Applicant UI] Application submitted page for common intake HOT 1
- Add syntax highlighting to json preview on program export
- [Disabled Programs] Build error info page for disabled program
- Translations Batch: 2024-06-03
- [Placeholder] Austin Google Internal Work
- Design support for uploading multiple files per view
- [PRD] Referral + Warm Handoff Strategy
- TDD - Performance regression testing
- Documentation: performance testing
- Azure Work Plan Document
- Fix and re-enable azure staging site
- Charlotte AWS deployment
- Create a separate section in the Admin Settings UI for flags that are for "under development" features
- [PRD] Application Details / Program Preview
- Change options for feature flags on the Settings page to "True" or "False"
- [Disabled Program] Localize error info page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from civiform.