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

[JN-1083] Temp fix for empty search expression #892

Merged
merged 2 commits into from
May 21, 2024

Conversation

connorlbark
Copy link
Collaborator

@connorlbark connorlbark commented May 16, 2024

DESCRIPTION (include screenshots, and mobile screenshots for participant UX)

If you go to edit a survey with an eligibility rule, it shows as empty. If you then save, it strips the eligibility rule (yikes). This is only if you have the fancy query builder. This is because on the first render, the query builder has nothing, so it does an onChange call to make it empty.

Without doing fancy ref stuff, I figured just making it skip changing the eligibility rule if the string is empty is fine in the meantime, since once we have antlr it will work properly & this is only shown to prototype users/superusers anyway, so a wonky UX is fine in the meantime.

TO TEST: (simple manual steps for confirming core behavior -- used for pre-release checks)

  • Create a survey with an eligibility rule
  • Observe that the eligibility rule still shows up when you try to edit it

@connorlbark connorlbark marked this pull request as ready for review May 16, 2024 17:00
Copy link
Collaborator

@devonbush devonbush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good quick fix -- just remember to strip out the logs

@@ -56,6 +56,13 @@ const SurveyEditorView = (props: SurveyEditorViewProps) => {
const [draft, setDraft] = useState<FormDraft | undefined>(
!readOnly ? getDraft({ formDraftKey: FORM_DRAFT_KEY }) : undefined)

useEffect(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove logs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 I keep doing this lol. I blame the coffee making me jittery.

Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@MatthewBemis MatthewBemis self-requested a review May 21, 2024 14:07
@MatthewBemis MatthewBemis added this pull request to the merge queue May 21, 2024
Merged via the queue into development with commit 8207cb0 May 21, 2024
12 checks passed
@MatthewBemis MatthewBemis deleted the cb-fix-empty-search-expression branch May 21, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants