Skip to content
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 toggle type questions to interactive builder #350

Merged
merged 14 commits into from
Sep 26, 2024

Conversation

Kinotijoan
Copy link
Contributor

@Kinotijoan Kinotijoan commented Sep 10, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Enables users to create toggle type questions using the interactive builder

Screenshots

image
image

Related Issue

https://openmrs.atlassian.net/browse/O3-3947

Other

None.

Comment on lines 152 to 153
const [toggleLabelTrue, setToggleLabelTrue] = useState('');
const [toggleLabelFalse, setToggleLabelFalse] = useState('');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should initialize these values to show the existing labels since this is in the edit modal.
We would have to update the interfaces in types.ts to add toggleOptions to questionOptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated this together with the issues you had requested in the closed PR.You can look at it

@NethmiRodrigo
Copy link
Contributor

Hey @Kinotijoan, I see that the PR #349 has the same changes. Can we have the changes in one of the two PRs since its the same ticket and close the other one?

@Kinotijoan
Copy link
Contributor Author

Hey@NethmiRodrigo ,sure I'll work on it

@NethmiRodrigo
Copy link
Contributor

Thanks @Kinotijoan! Could you please make the changes that were requested in the closed PR in this one?

@Kinotijoan
Copy link
Contributor Author

Thanks @Kinotijoan! Could you please make the changes that were requested in the closed PR in this one?

No problem

…ptions

- Updated the toggle label placeholders in the edit-question.modal
- Added toggle rendering options to the interactive builder
- Modified the translations in en.json to include labelFalse, labelPlaceholder, and labelTrue
- Added "Off" and "On" translations in en.json
@Kinotijoan Kinotijoan changed the title Toggle render type to edit question Modal Update toggle label placeholders to show the existing labels Sep 12, 2024
@NethmiRodrigo NethmiRodrigo changed the title Update toggle label placeholders to show the existing labels (feat) O3-3947: Add toggle type questions to interactive builder Sep 18, 2024
Copy link
Contributor

@NethmiRodrigo NethmiRodrigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Kinotijoan! A minor fix with the translation strings and we should be good to go!

src/components/interactive-builder/add-question.modal.tsx Outdated Show resolved Hide resolved
src/components/interactive-builder/add-question.modal.tsx Outdated Show resolved Hide resolved
src/components/interactive-builder/add-question.modal.tsx Outdated Show resolved Hide resolved
src/components/interactive-builder/add-question.modal.tsx Outdated Show resolved Hide resolved
src/types.ts Show resolved Hide resolved
translations/en.json Outdated Show resolved Hide resolved
translations/en.json Outdated Show resolved Hide resolved
translations/en.json Outdated Show resolved Hide resolved
Copy link
Contributor

@NethmiRodrigo NethmiRodrigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @Kinotijoan!

@NethmiRodrigo NethmiRodrigo merged commit 1b91c37 into openmrs:main Sep 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants