-
Notifications
You must be signed in to change notification settings - Fork 59
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
(feat) Implement the inline date picker with showDate and shownDateOptions #285
Conversation
Size Change: -242 kB (-18.6%) 👏 Total Size: 1.06 MB
ℹ️ View Unchanged
|
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 for the work @hadijahkyampeire!
I'm concerned about how we currently manage expressions vs booleans in general within the schema. Eg.
- Hide
interface FormField {
hide?: HideProps;
isHidden?: boolean;
}
export interface HideProps {
hideWhenExpression: string;
}
- Required
interface FormField {
isRequired?: boolean;
required?: string | boolean | RequiredFieldProps;
}
interface RequiredFieldProps {
type: string;
message?: string;
referenceQuestionId: string;
referenceQuestionAnswers: Array<string>;
}
- Readonly
For the readonly, the engine assumes this to either be an expression (string) or a boolean, so it will attempt to evaluate it directly, see.
I need your thoughts on:
- The ideal approach for the disable prop. (What is the best place to store the expression)
- How can we harmonise the above to have a more consistent pattern on how to manage expressions in general?
e105fa1
to
64710ff
Compare
@samuelmale I think the PR is ready to go in, please take another look. |
64710ff
to
84a9ff5
Compare
@samuelmale moving the evalutions to the formHelpers puts them in a circular import and that's why I have moved them to the expression-runner, check the failing tests. |
Yes @hadijahkyampeire I'm looking into it. |
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 @hadijahkyampeire
Thanks @samuelmale |
…tions (#285) * implement the inline date picker * Handle disabled when value is undefined * fix failing test * PR reviews * tweak evals functions * Fixup * Fix cyclic dependency --------- Co-authored-by: samuelmale <samuelsmalek@gmail.com>
Requirements
Summary
showDate: true
is defined in the parent question. The value of this date field is then submitted as theobsDatetime
for that question.showDateOptions
object.Screenshots
inline-date.mov
Related Issue