-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Add Link to Logic View in Options Modal #4046
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
Conversation
🧪 Review environmenthttps://qjcgggreiveqcefmbcdm5rlrua0uhjpp.lambda-url.ca-central-1.on.aws/ |
...gcforms)/[locale]/(form administration)/form-builder/[id]/edit/components/ModalFormRules.tsx
Show resolved
Hide resolved
@@ -147,7 +147,9 @@ export const Edit = ({ formId }: { formId: string }) => { | |||
if (element) { | |||
const questionNumber = getQuestionNumber(element, elementTypes); | |||
const item = { ...element, index, questionNumber }; | |||
return <ElementPanel elements={sortedElements} item={item} key={item.id} />; | |||
return ( | |||
<ElementPanel elements={sortedElements} item={item} key={item.id} formId={formId} /> |
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.
Hopefully in the future we can use a react context for situations like this (lots in the app). Just a future refactoring note when/if we get around to refactoring the app state management and definitely something for outside of this PR.
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.
Nice work! LGTM :)
Closes #3976
Passes the formId across the application to be able to route to the logic view - so just a quick test to make sure options don't return "undefined" in the URL at the top.
To test:
-> Open or Create a form.
-> Add a question that can have options.
-> Click an option to show "add rules"
-> Click the "add rules", and then click the "Have a complex form? Try branching instead +"
Double check the form has all the stuff you had, and the URL matches. eg: "en/form-builder/0000/edit" vs "en/form-builder/undefined/edit"