-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor create test form #80
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #80 +/- ##
==========================================
+ Coverage 88.40% 88.44% +0.04%
==========================================
Files 15 15
Lines 750 753 +3
Branches 140 140
==========================================
+ Hits 663 666 +3
Misses 51 51
Partials 36 36 ☔ View full report in Codecov by Sentry. |
</div> | ||
); | ||
}; | ||
|
||
export function initGoalSelector() { | ||
const goalSelectorProps = JSON.parse(document.getElementById('data-goal-selector-props')?.textContent || ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should fall back to an empty object instead of an empty string, otherwise JSON.parse
will crash with SyntaxError: Unexpected end of JSON input
.
const goalSelectorProps = JSON.parse(document.getElementById('data-goal-selector-props')?.textContent || ''); | |
const goalSelectorProps = JSON.parse(document.getElementById('data-goal-selector-props')?.textContent || '{}'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
3a60cfb
to
1a6a056
Compare
1a6a056
to
7e5bb95
Compare
Fixes #79.
Modifies
CreateAbTestForm
and the respectiveadd_form
view so that the template is rendered via Wagtail's panels. This ensures visual consistency with current Wagtail UX/UI and also simplifies the template.The React component responsible for choosing a page and a goal has also been updated with the 5.X styling.