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

5162 response requisition indicator UI #5523

Merged
merged 49 commits into from
Nov 27, 2024

Conversation

Chris-Petty
Copy link
Contributor

Fixes #5162

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Add indicator UI to manual customer program requisitions.

image
image

πŸ’Œ 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:

image

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:

image

πŸ§ͺ Testing

  • Central OG and Central OMS
  • Stores configured to use programs with program indicators, periods etc. Check the "Is HIV" checkbox in program config
  • Another program without "Is HIV"
  • In OMS make a manual program customer requisition to another store and use the program that "Is HIV"
  • Indicator tab shows
  • It has Regimen and HIV buttons
  • Pressing them takes you to corresponding set of questions
  • Make another requisition using a program that is NOT "HIV"
  • It only has the Regimen button

πŸ“ƒ Documentation

  • Part of an epic: documentation will be completed for the feature as a whole
  • No documentation required: no user facing changes or a bug fix which isn't a change in behaviour
  • These areas should be updated or checked:
    1.
    2.

@github-actions github-actions bot added enhancement New feature or request front-end Front-end related Team Ruru πŸ¦‰ Roxy, Ferg, Noel feature: manual requisition labels Nov 22, 2024

const InputWithLabel = ({ data }: { data: IndicatorColumnNode }) => {
if (!data?.value) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2024-11-27 at 12 56 38β€―PM

Not sure if you were just returning here so the type is definitely available but... if no value on indicator yet then I get nothing!

Copy link
Contributor

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...

Copy link
Contributor

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!

Copy link
Contributor

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 πŸ™

Copy link
Contributor

@lache-melvin lache-melvin left a 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 && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2024-11-27 at 1 16 32β€―PM

Still seeing HIV indicators on my non-HIV program?

Copy link
Contributor Author

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:

I don't believe we're doing any filtering on that yet but.

@roxy-dao roxy-dao linked an issue Nov 27, 2024 that may be closed by this pull request
16 tasks
Copy link
Contributor

@lache-melvin lache-melvin left a comment

Choose a reason for hiding this comment

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

Well they're not there... but it would appear the buttons are still showing, so I get a blank page now 😭
Screenshot 2024-11-27 at 3 35 13β€―PM
Screenshot 2024-11-27 at 1 16 32β€―PM

@Chris-Petty
Copy link
Contributor Author

Chris-Petty commented Nov 27, 2024

Well they're not there... but it would appear the buttons are still showing, so I get a blank page now 😭 Screenshot 2024-11-27 at 3 35 13β€―PM Screenshot 2024-11-27 at 1 16 32β€―PM

Dang yea, 'cause I did the filtering in the child routes/components but not IndicatorTab 🫠 . Really should do it in the backend so it's not so easily missed!

Copy link
Contributor

@lache-melvin lache-melvin left a 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!! πŸ™

@lache-melvin
Copy link
Contributor

Dang yea, 'cause I did the filtering in the child routes/components but not IndicatorTab 🫠 . Really should do it in the backend so it's not so easily missed!

Yeah, would like to see this as a clean up PR if poss - would be good to get the feature out to QA though?

@lache-melvin
Copy link
Contributor

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))
Copy link
Contributor Author

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

@lache-melvin
Copy link
Contributor

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!

@Chris-Petty Chris-Petty merged commit be9607e into v2.4.0 Nov 27, 2024
4 checks passed
@Chris-Petty Chris-Petty deleted the 5162-response-requisition-indicator-ui branch November 27, 2024 03:10
@roxy-dao roxy-dao mentioned this pull request Nov 27, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: manual requisition front-end Front-end related Team Ruru πŸ¦‰ Roxy, Ferg, Noel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indicators UI
3 participants