bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 57 forks source link

UI - PPR & MHR Search - Large Search i icon and message #13980

Closed chdivyareddy closed 1 year ago

chdivyareddy commented 1 year ago

AC

GIVEN I am a PPR & MHR user WHEN I perform a search (all categories) and the search is large (more than 70 selections) THEN the i icon should appear in the PDF space AND if a user clicks that icon the spinner displays for 5 seconds AND the updated tooltip displays

Wireframe: https://preview.uxpin.com/9241682900635350d86dfd4670e408225a7751f6#/pages/159351397

forgeuxGH5 commented 1 year ago

@RFK250 @chdivyareddy we might need to have a quick chat about how reports are being generated. The above interaction look old and I don't know if this interaction makes sense for the new report API. I need a better understanding of how the new report API works.

Below is a preliminary wireframe for the report download interaction based on my understanding of how the new report API works.

Preliminary Wireframe - not for development https://preview.uxpin.com/9241682900635350d86dfd4670e408225a7751f6#/pages/159351397

mstanton1 commented 1 year ago

@chdivyareddy can you please verify?

chdivyareddy commented 1 year ago

@mstanton1 @forgeuxGH5 For the searches, I believe the tooltip info should be modified. PDF is generated by clicking on the 'i' icon, but the tooltip says 'Reload this page to see if your PDF is ready to download' instead of 'Click the i icon to see if your PDF is ready to download.' Please take a look, thanks!

Current Behavior: Screenshot (90).png

Design: image.png

forgeuxGH5 commented 1 year ago

yes - we should update the text in the tooltip - but we should also make sure the icon state matches the interaction in the wireframe link - @chdivyareddy I'm not sure if you are able to test this. I'd still want to confirm with @doug-lovett how the new report API works. The design assumes that all reports are generated on demand, so for smaller reports I'm assuming we can generate them quickly (within 10 sec).

chdivyareddy commented 1 year ago

@forgeuxGH5 Yes, you are right! The reports are generated on demand for the smaller ones (within 10 secs).

Can also confirm with Doug once he is available.

mstanton1 commented 1 year ago

Moved back to grooming and we can revisit when Doug is back:)

dimak1 commented 1 year ago

Pending discussion with Scott to clarify some of the questions.

dimak1 commented 1 year ago

Had a discussion with Scott and have already completed desired changes. Working on updating the tests.

dimak1 commented 1 year ago

PR is under review. Quick recap on changes:

The change

PDF icon will be displayed only once, before the user clicks and tries to download a large search report. After that, 'i' will be shown (with a updated tooltip) until report is available

The flow

  1. PDF icon is displayed for all search results (small and large)
  2. Clicking on large search results, will change the icon to a loading/spinner state for 5 seconds
  3. If the report is still not available, the icon will switch to 'i' (instead of PDF)
  4. Subsequent clicks will still show 'i' icon until PDF is ready for download

cc: @forgeuxGH5 @chdivyareddy - this needs to be tested properly

dimak1 commented 1 year ago

Pushed to Dev env if you want to take a look (since there is no uxa label on this task) @forgeuxGH5

chdivyareddy commented 1 year ago

@dimak1 I just tried a large search for PPR 'Telus communications Inc.' and once the result got added to the table, PDF icon displayed as expected, but when tried to click on the PDF icon to download, then the spinner loaded for 5 secs and displayed 'Unable to open document' modal on the UI which shouldn't be.

Tried clicking on the i icon to download after 20 mints and I see the same modal again, but when I reloaded the dashboard, the i icon changed to PDF icon and was able to download and view the PDF.

image.png

When the dashboard is reloaded: image.png

dimak1 commented 1 year ago

Hmm after 5 second delay the PDF should be downloaded as normal. I'll take a look.

forgeuxGH5 commented 1 year ago

Same issue for me ^

dimak1 commented 1 year ago

I see there an API error in DEV /ppr/api/v1/search-results/11894 400 (Bad Request) errorMessage: "API backend third party service error."

dimak1 commented 1 year ago

I can now see that 'Unable to open document' modal is showing for PENDING report. @forgeuxGH5

dimak1 commented 1 year ago

Looks like the 'Unable to open document' modal is showing up only for large PPR searches. I'm looking into it.

dimak1 commented 1 year ago

@forgeuxGH5 i fixed it - modal that was showing only for PPR is not coming up anymore. Same as for MHR, the icon will change from 'PDF' to 'i' without modal. Please confirm if that's what we want so I can open the PR.

forgeuxGH5 commented 1 year ago

We do want it as you describe but I'm still get the modal after the spinner... image.png

dimak1 commented 1 year ago

OK thanks for confirming. The code is not committed yet. I will let you know once it's ready for verification. Thanks!

dimak1 commented 1 year ago

@forgeuxGH5 just to note, if I remove dialog, there won't be any user feedback in case if there is a real error scenario (when trying to download the PDF). Thoughts? cc: @chdivyareddy

dimak1 commented 1 year ago

PR is opened and under review.

chdivyareddy commented 1 year ago

Hey @dimak1 , When the PDF is pending the modal is not displayed which is working as expected, but when I tried to click on the 'i' icon to generate the PDF after 20 to 30 mints, still the i icon is displayed after spinner as Pending. But, when I reloaded the dashboard, the i icon changed to PDF icon and was able to download and view the PDF.

image.png

After reloading the dashboard:

image.png

cc @forgeuxGH5

dimak1 commented 1 year ago

@chdivyareddy in this case I assume when you tried to download the PDF, it was still not ready, hence the PENDING state.

chdivyareddy commented 1 year ago

@dimak1 I believe the PDF is usually available within 20 mints to download. But I can try the search again to reload the dashboard within 20 mints and see whether the PDF is available or not, thanks:)

chdivyareddy commented 1 year ago

@dimak1 , Just tried with the same search again around 11:40 AM and clicked on the i icon at 12:00 pm to generate the PDF, but it still was in a PENDING state and then reloaded the dashboard immediately and the i icon changed to PDF icon and was able to download and view the PDF. image.png

dimak1 commented 1 year ago

@chdivyareddy ok let me take a look. Thanks for re-testing.

dimak1 commented 1 year ago

@chdivyareddy just to note, every time page loads, the initial icon will be a "PDF", only after it is clicked it will change to "i". If you reload, it will change back to "PDF". cc: @forgeuxGH5

forgeuxGH5 commented 1 year ago

So I don't see the modal anymore but @dimak1 are you saying the modal won't display even there is an error like making / returning the API call?

dimak1 commented 1 year ago

@forgeuxGH5 correct. There were no user feedback for MHR, and now there is no user feedback for PPR PDFs.

forgeuxGH5 commented 1 year ago

So there's no way to have the PDF / "i" icon work the way we have it AND have a dialog display when there is an actual error?

dimak1 commented 1 year ago

@forgeuxGH5 No, not without API changes. Pending (PDF not available) comes back as an error, so unless we make some changes to API to separate the two states (pending vs error), we won't be able to show it on the UI.

dimak1 commented 1 year ago

@forgeuxGH5, however, I looked into the code/error, and we might be able to show something. If you want us to investigate, then maybe we can have a ticket for that unless you believe it is still part of this ticket.

dimak1 commented 1 year ago

@chdivyareddy, regarding the PDF generation issue, I'm able to reproduce it. The PDF is PENDING unless I refresh the page. I'm investigating.

chdivyareddy commented 1 year ago

Thanks @dimak1 !

mstanton1 commented 1 year ago

@dimak1 Thank you for investigating. I have concerns with the lack of error modal / PDF icon showing upon page refresh so hope we can resolve these before moving to PROD. Can you continue to work on the items identified in this ticket - and I imagine the size should be updated after? To your comment on potentially needing an API change, that's also something we could discuss with Doug but it would need to follow rules outlined in our API Release Management so may not be something we could do right away (https://developer.bcregistry.daxiom.ca/apis-summary).

dimak1 commented 1 year ago

@mstanton1 agree, it is not great that there is no user feedback. That's why I mentioned that we didn't have any error modal when trying to download MHR reports. If we want PPR error modal to make it to PROD tomorrow, then we need to revert the change. I can do that easily. We would have to follow the standard promotion process (PR -> DEV -> TEST). Please let me know. cc: @forgeuxGH5 @chdivyareddy

forgeuxGH5 commented 1 year ago

@dimak1 ugh - I drafted a comment but it seems to have gotten lost in zenhub. Anyway I've added additional AC here for the icon handling - @mstanton1 is aware of this change too and we want to get this in before we release and increase the estimate if needed.

dimak1 commented 1 year ago

thanks @forgeuxGH5. Few things here:

EDIT: I just read the AC again and it looks like we are reverting back to showing 'i' icon on page load/refresh if PDF is not available?

I'm available to discuss the above.

chdivyareddy commented 1 year ago

Hey @dimak1 ! So, keeping that in mind for now we are holding the release until this is done and ready to go, because a part of this change was already in TEST (error modal is displayed for large searches when i icon is clicked) and it will impact the users once it is in PROD, thanks!!

dimak1 commented 1 year ago

@forgeuxGH5 @chdivyareddy going back to the issue where PDF won't download until the age is reloaded.

I did more investigation. I went back to an earlier state of the app and discovered that the same functionality existed before I made any changes. The error modal was showing up and PDF was not downloaded until I refreshed the page. Upon refresh, I was able to download the PDF.

Further looking into the code, I see that the PDF-ready state (for each doc) is only loaded with all the search results during page load/reload. The ready-state is not refreshed when an individual icon is clicked. This explains why we are having this issue above.

We'll discuss later today.

dimak1 commented 1 year ago

Moving on to the next task until we discuss this later today.

dimak1 commented 1 year ago

To recap our conversation, @forgeuxGH5 will update AC of this ticket (so we can move it along) and then create a new ticket for all additional changes to PDF download functionality.

dimak1 commented 1 year ago

This task will be going into the 15.6.2 release (since we pulled out the code for 15.6.1 release).

dimak1 commented 1 year ago

Implemented the following requirements:

chdivyareddy commented 1 year ago

Verified!

Working as expected for the PPR searches:

Screenshot (107).png

image.png

dimak1 commented 1 year ago

@doug-lovett I opened a draft PR for UI changes to remove a delay for MHR specific reports. Once you are done with API updates, I'll push my changes.