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

Fix checkbox open label string input #1039

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ This log documents significant changes for the [@aehrc/smart-forms-renderer](htt

Changelog only includes changes from version 0.36.0 onwards.

## [0.44.2] - 2024-10-18
### Fixed
- Fixed an issue where inputs in checkbox open-choice's open label field does not update the QuestionnaireResponse.

## [0.44.1] - 2024-10-14
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion apps/smart-forms-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@aehrc/sdc-assemble": "^1.3.1",
"@aehrc/sdc-populate": "^2.3.1",
"@aehrc/smart-forms-renderer": "^0.44.1",
"@aehrc/smart-forms-renderer": "^0.44.2",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@fontsource/material-icons": "^5.0.18",
Expand Down
2 changes: 1 addition & 1 deletion documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"typecheck": "tsc"
},
"dependencies": {
"@aehrc/smart-forms-renderer": "^0.44.1",
"@aehrc/smart-forms-renderer": "^0.44.2",
"@docusaurus/core": "^3.4.0",
"@docusaurus/preset-classic": "^3.4.0",
"@docusaurus/theme-live-codeblock": "^3.4.0",
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/smart-forms-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aehrc/smart-forms-renderer",
"version": "0.44.1",
"version": "0.44.2",
"description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
"main": "lib/index.js",
"scripts": {
Expand Down
15 changes: 13 additions & 2 deletions packages/smart-forms-renderer/src/utils/openChoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,21 @@ export function updateOpenLabelAnswer(
}

// New open label answer is different from old open label answer, update it
oldOpenLabelAnswer.valueString = changedOpenLabelValue;
const updatedAnswers = oldQrItem.answer?.map((answer) => {
const { valueString } = answer;
if (valueString === oldOpenLabelAnswer.valueString) {
return {
...answer,
valueString: changedOpenLabelValue // Update the valueString
};
}

return answer; // Keep the other answers unchanged
});

return {
...oldQrItem,
answer: oldQrItem.answer
answer: updatedAnswers
};
}

Expand Down
Loading