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

Log update vital feature modified #7301

Closed
wants to merge 5 commits into from
Closed
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ let make = (
}
})

let getStatus = (min, minText, max, maxText, val) => {
switch (val >= min, val <= max) {
| (true, true) => ("Normal", "#059669")
| (true, false) => (maxText, "#DC2626")
| _ => (minText, "#DC2626")
}
let getLabel = (param: float) => {
let minText = "Low"
let maxText = "High"
switch param {
| 0.0 => (minText, "#059669")
| 5.0 => (maxText, "#DC2626")
| _ => ("", "")
Comment on lines +58 to +64
Copy link
Member

Choose a reason for hiding this comment

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

why not have a human-readable values for all the 5 cases like,
0 -> No pain (gray)
1 -> Noticeable (yellow)
2 -> Mild (orange)
3 -> High (light red)
4 -> Extremely high (red)
5 -> Unbearable (darker red)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@khavinshankar should I change it then ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please do

cc: @nihal467

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 opened a new pr and done the changes as you described.please review it @khavinshankar

}
}

<div
hidden={!show}
Expand Down Expand Up @@ -104,7 +106,7 @@ let make = (
| None => setState(prev => {...prev, scale: 0})
}
}}
getLabel={getStatus(2.0, "Low", 4.0, "High")}
getLabel={getLabel}
hasError={ValidationUtils.isInputInRangeInt(
0,
5,
Expand Down
Loading