-
Notifications
You must be signed in to change notification settings - Fork 71
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) O3-3947: Add support for different question types #354
base: main
Are you sure you want to change the base?
Conversation
…well as options for the toggle
This change introduces the ability for form questions to utilize Markdown formatting. A new Markdown input field is added to the question editor, allowing users to specify Markdown content. This content is then rendered appropriately when the form is displayed.
Added a new configuration option to enable a Markdown editor for text input.
Introduces the ability for form creators to utilize Markdown formatting in question text, providing greater flexibility and control over question presentation.
When editing a "content-switcher" question type, the available answers are now dynamically populated based on the selected concept. This ensures that users can only choose from relevant answers associated with the chosen concept, streamlining the question editing process.
Introduces the capability to configure and launch workspaces directly from the question builder interface. This enhancement provides users with a streamlined method to initiate workspaces, enhancing the platform's interactive capabilities.
This introduces UI elements specifically for the "workspace-launcher" question type. Users can now input a button label and a workspace name when editing a question of this type.
@Kinotijoan can you resolve the merge conflicts and update your fork? |
For questions of type |
sure |
Removes the option to customize labels for the "true" and "false" states of toggle fields.
Standardizes the casing of "On" and "Off" labels used within the toggle component in the English translation file to ensure consistency throughout the application. This addresses a minor visual discrepancy and enhances the overall user experience.
id="lableTrue" | ||
labelText={t('Label true', 'Label true')} |
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.
id="lableTrue" | |
labelText={t('Label true', 'Label true')} | |
id="labelTrue" | |
labelText={t('labelTrue', 'Label true')} |
value={t(toggleLabelTrue || '')} | ||
onChange={(event: React.ChangeEvent<HTMLInputElement>) => | ||
setToggleLabelTrue(event.target.value) | ||
} | ||
placeholder={t('on', 'On')} | ||
placeholder={t('On')} |
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.
placeholder={t('On')} | |
placeholder={t('on', 'On')} |
id="lableFalse" | ||
labelText={t('Label false', 'Label 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.
id="lableFalse" | |
labelText={t('Label false', 'Label false')} | |
id="labelFalse" | |
labelText={t('labelFalse', 'Label false')} |
value={t(toggleLabelFalse || '')} | ||
onChange={(event: React.ChangeEvent<HTMLInputElement>) => | ||
setToggleLabelFalse(event.target.value) | ||
} | ||
placeholder={t('off', 'Off')} | ||
placeholder={t('Off')} |
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.
placeholder={t('Off')} | |
placeholder={t('off', 'Off')} |
{renderingType == 'markdown' ? ( | ||
<TextInput | ||
id="questionMarkdown" | ||
labelText={t('questionMarkdown', 'Markdown')} | ||
placeholder={t('questionMarkdownPlaceholder', 'Enter the Markdown for your form...')} | ||
value={formMarkdown} | ||
onChange={(event: React.ChangeEvent<HTMLInputElement>) => | ||
setFormMarkdown(event.target.value.split(',').map((item) => item.trim())) | ||
} | ||
/> | ||
) : null} |
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 don't think we need this since PR #355 will implement this
{fieldType == 'markdown' ? ( | ||
<TextInput | ||
id="questionMarkdown" | ||
labelText={t('questionMarkdown', 'Markdown')} | ||
placeholder={t('questionMarkdownPlaceholder', 'Enter the Markdown for your form...')} | ||
value={formMarkdown} | ||
onChange={(event: React.ChangeEvent<HTMLInputElement>) => | ||
setFormMarkdown(event.target.value.split(',').map((item) => item.trim())) | ||
} | ||
/> | ||
) : null} |
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.
Same as above, won't be needed
const [toggleLabelTrue, setToggleLabelTrue] = useState(''); | ||
const [toggleLabelFalse, setToggleLabelFalse] = useState(''); |
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 be reverted
const [buttonLabel, setButtonLabel] = useState(''); | ||
const [workspaceName, setWorkspaceName] = useState(''); |
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.
These variables should be initiated not with an empty string but with the relevant values from the questionToEdit
object
Requirements
Summary
I have added support for some question types that were in the json-schema but not in the interactive builder hence I have finalised on this ticket
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-3947
Other