-
Notifications
You must be signed in to change notification settings - Fork 16
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
5162 response requisition indicator UI #5523
Conversation
Cannot see it and causing errors in browser console
I couldn't replicate any so idk!
|
||
const InputWithLabel = ({ data }: { data: IndicatorColumnNode }) => { | ||
if (!data?.value) { | ||
return; |
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.
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.
Probably should just pass through a default empty string if not defined...
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.
If the values don't exist for the indicator then the buttons or (tab if both indicators) shouldn't show!
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.
Alas we have determined this was actually because I had indicator lines with no values on an existing program requisition - works fine on newly created ones! Need to find a way to handle existing requisitions π
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.
Looking good - just 2 things:
- HIV indicators available on non-hiv program requisitions
- Old requisitions show regimen data columns but no fields - should not show at all
Thanks for all the mahi Chris π
} | ||
/> | ||
)} | ||
{hivIndicators.length > 0 && ( |
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.
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.
Hmm I think if you look at an old program requisition, the button would still be there but if you click it everything gets filtered out? It's getting a bit gross cause I already do the same filter in IndicatorEditPage
and IndicatorLineEdit
, and I'd have to do it again in IndicatorTab
. In hindsight I really should have persisted with doing it in the backend, as this will pop up as a problem request requisitions too.
As discussed I've also been ignoring that you can turn HIV off on program and the indicators will still be there π. I'm not 100% sure if OG does it, but ideally OG would set the HIV program_indicator to be inactive:
pub is_active: bool, |
I don't believe we're doing any filtering on that yet but.
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.
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.
OK i have CONFIRMED that the HIV button is NOT THERE when I create new master list that is not HIV program, maybe something lingering with program that was HIV, then turned off? Happy to merge this now, as long as this edge case is investigated/captured!! π
Yeah, would like to see this as a clean up PR if poss - would be good to get the feature out to QA though? |
whoops just saw that hiv indicators could have the same issue, pushed quick fix for that too! |
indicator => | ||
indicator.code === 'REGIMEN' && | ||
// Should only include regimen indicators if they have at least one column with a value | ||
indicator.lineAndColumns.some(line => line.columns.some(c => c.value)) |
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.
coming from rust more recently I was like ugh I though js had an Array.any
π. Been using filter
and find
hahahaaaaaaaa
Actually just tried setting a new HIV program back to non-HIV, and the indicators are gone so... must just be my munted dev data, sorry! |
Fixes #5162
π©π»βπ» What does this PR do?
Add indicator UI to manual customer program requisitions.
π Any notes for the reviewer?
For now we just have buttons to access each program indicator's lines. In the future it'll be tables for each as per designs.
Problems I've noticed that need fixing:
HIV indicators never seems to select first indicator line:
Probably a number input problem, but default value is typically
0
. It is hard to actually remove this leading 0 without highlighting the digit and replacing it. This would feel even more awful on tablets:π§ͺ Testing
π Documentation
1.
2.