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: Configure Report To Select Scores or Raw Scores (CAMHI) (M2-7738) #1935

Merged
merged 34 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9f29971
Add support for a tooltip icon with a tooltip in the RadioGroupContro…
sultanofcardio Oct 3, 2024
b7c9386
Add radio buttons with hardcoded text
sultanofcardio Oct 3, 2024
e983875
Update ScoreReport type to include scoreType and linkedSubscaleName
sultanofcardio Oct 3, 2024
1c1f56d
WIP update to score type selection logic
sultanofcardio Oct 3, 2024
476d442
Set selected items based on subscale
sultanofcardio Oct 4, 2024
4203420
Update score range calculation to account for linked subscale
sultanofcardio Oct 4, 2024
aec2a10
Exclude subscales with no activity items
sultanofcardio Oct 4, 2024
26af850
Pass the `onChange` to the `onCustomChange` in the InputController
sultanofcardio Oct 4, 2024
7c4a4e0
Update report score linked subscale name when it is edited on the sub…
sultanofcardio Oct 4, 2024
1789422
Fix type name
sultanofcardio Oct 4, 2024
d8b6114
Require linked subscale when report score type is score
sultanofcardio Oct 4, 2024
184c29e
Update the logic that accounts for updates on the subscales configura…
sultanofcardio Oct 4, 2024
f177af4
Remove the link to a report score if a subscale or its lookup table i…
sultanofcardio Oct 4, 2024
1b548d6
Translate strings
sultanofcardio Oct 4, 2024
a601f8e
Fix broken tests
sultanofcardio Oct 4, 2024
2a7cabc
Move key prop to parent
sultanofcardio Oct 4, 2024
57b9d61
Fix MUI select warning
sultanofcardio Oct 4, 2024
345453e
Set score type back to raw score if there are no eligible subscales
sultanofcardio Oct 4, 2024
254888d
Hide the radio group if there are no eligible subscales
sultanofcardio Oct 4, 2024
787e7ab
Fix broken test
sultanofcardio Oct 4, 2024
81c0b0d
Abstract field names
sultanofcardio Oct 4, 2024
a6e2986
Rename scoreType to scoringType
sultanofcardio Oct 4, 2024
65e2a4a
Rename linkedSubscaleName to subscaleName
sultanofcardio Oct 4, 2024
33073ea
Change `rawScore` to `raw_score`
sultanofcardio Oct 7, 2024
001ea23
Make the `scoringType` field nullable
sultanofcardio Oct 7, 2024
971e13e
Remove the noisy MUI controlled field warning
sultanofcardio Oct 7, 2024
7002d93
Handle the case where the score is undefined
sultanofcardio Oct 7, 2024
c30a70c
Filter out ineligible subscale items
sultanofcardio Oct 7, 2024
781ac4f
Account for existing applets with reports but no subscales
sultanofcardio Oct 8, 2024
8fd259b
Account for reports that were saved without an explicit scoring type
sultanofcardio Oct 8, 2024
b382cc5
Reset report scores to raw_score if there are no more eligible subscales
sultanofcardio Oct 9, 2024
1c2f67d
Remove linked subscales from reports when they no longer contain non-…
sultanofcardio Oct 9, 2024
eb9da49
Fix score range calculation
sultanofcardio Oct 23, 2024
18de88e
Ignore score ranges
sultanofcardio Oct 23, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const SelectionOption = ({
}
};

const handleScoreChange = (event: ChangeEvent<HTMLInputElement>) => {
const handleScoreChange = (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
if (event.target.value === '') return setValue(scoreName, 0);

setValue(scoreName, +event.target.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const Items = ({ name, isSingle }: ItemsProps) => {
const isRemoveButtonVisible =
hasRemoveButton && key === options?.length - 1 && index !== 0;

const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
const handleChange = (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
if (event.target.value === '') return setValue(scoreName, 0);

setValue(scoreName, +event.target.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export const SliderPanel = ({
hasAlerts && setValue(`${alertsName}.${index}.value`, '');
};

const handleMinValueChange = async (event: ChangeEvent<HTMLInputElement>) => {
const handleMinValueChange = async (
event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
) => {
const value = event.target.value === '' ? '' : +event.target.value;
await setValue(minValueName, value);
clearErrors([minValueName, maxValueName]);
Expand Down Expand Up @@ -165,7 +167,7 @@ export const SliderPanel = ({
setDefaultScoresAndAlerts();
};

const handleMaxValueChange = (event: ChangeEvent<HTMLInputElement>) => {
const handleMaxValueChange = (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const value = event.target.value === '' ? '' : +event.target.value;
clearErrors([minValueName, maxValueName]);
setValue(maxValueName, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export const TextResponse = ({ name, uiType }: TextResponseProps) => {
}
};

const handleResponseLengthOnChange = (event: ChangeEvent<HTMLInputElement>) => {
const handleResponseLengthOnChange = (
event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
) => {
const newValue = +event.target.value;
handleResponseLengthChange(newValue);
};
Expand Down
Loading
Loading