-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add stepper-layout
prop to OdkWebForm component for Collect-like experience
#329
base: main
Are you sure you want to change the base?
Conversation
|
3579ece
to
0d0363c
Compare
@@ -48,7 +48,7 @@ const isControlNode = (node: NonStructuralNode): node is ControlNode => { | |||
<template v-for="node in nodes" :key="node.nodeId"> | |||
<template v-if="node.currentState.relevant"> | |||
<!-- Render group nodes --> | |||
<FormGroup v-if="isGroupNode(node)" :node="node" /> | |||
<FormGroup v-if="isGroupNode(node)" :node="node" toggleable /> |
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.
I set the default for the prop toggleable
to false
, meaning the prop needs to be passed here to allow for the collapsable panels in the list view
@@ -140,6 +151,11 @@ h2 { | |||
} | |||
} | |||
|
|||
.toggleable-enabled :deep(.p-panel-content) { |
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.
<template> | ||
<Panel v-if="!noUi" :class="panelClass" :toggleable="true" :collapsed="panelState"> | ||
<Panel v-if="!noUi" :class="[panelClass, { 'toggleable-enabled': toggleable }]" :toggleable="toggleable" :collapsed="toggleable ? panelState : false"> |
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.
Adding the toggleable-enabled
class dynamically
Thanks so much for exploring this and sharing what you've come up with! The video looks so good and it's great to see that the implementation is largely contained. I'm going to change this to a draft for now to help with our review processes. We'd want to make sure there are tests and a design pass before considering for merge. I think it makes sense for us to prioritize image capture and selects with images over reviewing and finalizing this, does that sound right? |
Yep sounds good to me! We can finalise and discuss this further in the long term - I'll add tests too 😁 We can use this layout on our fork for the time being 👍 |
@spwoodcock this is awesome! I'm working on designing the flows for image capture and selects with images. I'll share it with you once I have something ready to get your feedback. |
I have verified this PR works in these browsers (latest versions):
What else has been done to verify that this works as intended?
Why is this the best possible solution? Were any other approaches considered?
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Do we need any specific form for testing your changes? If so, please attach one.
I was testing with this one:
mdp_fmtm_xlsform.xlsx
What's changed
Included
QuestionStepper
that mirrors theQuestionList
component.stepper-layout
prop toOdkWebForm
.submitPressed
dependency to trigger the existing validation logic, without needing to add extra code - it seems to work nicely.Recording.2025-03-10.134548.mp4
Things I didn't do
FormPanel
to have an optionaltoggleable
prop. This allows us to disable the panel collapsing behaviour for the stepper. I didn't update RepeatInstance and RepeatRange to have a toggleable prop passed through to FormPanel too, but assume this may be needed?relevant
fields, additional nodes can be added causing the percentage complete to drop. I need to look into this in more detail - it's probably doable - if this is a desired feature.Note on the FormPanel border
Stepper view:
List view:
box-shadow
CSS.Extra notes