topcoder-platform / micro-frontends-taas-admin-app

taas-admin-app for managing taas administrative activities
MIT License
0 stars 5 forks source link

Watch data updates #39

Open maxceem opened 3 years ago

maxceem commented 3 years ago

At the moment after we process the payment we don't update the data loaded in the table in any way. Though after payment processing it is expected that the statuses of all the payments would be updated to scheduled.

If we just reload the data for the page after payments processing the data returned by the server might be still outdated because such updates take place not immediately.

So I suggest the next solution:

  1. When we process payment for selected items or all records
  2. For all the records for which we processed the payment (if it not failed) we should show a loading indicator, we can replace the payment status label with a label which stays Loading... inside and color 5FB7EE.
  3. The same time in the background we should reload data for the current page (but don't show loading indicator on the whole page). And as soon as we see that paymentStatus which was before changed to in-progres update data for that row (not only status but other values also). This means that the payment for this record is in progress.
  4. We should get reload data with some interval, like 5 seconds (should be configurable) until we see that all success records got updated status.
  5. We should stop reloading data if:
    • we already got all the success records updated on the current page
    • 5 minutes passed (should be configurable) - in such case for all records which weren't updated, show the previous status
    • we make any action like: filter, change, change per page, change data, process another payment or go to another URL

NOTES:

maxceem commented 3 years ago

@MadOPcode please, hold a bit working on this issue, I'm going to make some improvements to this task.

maxceem commented 3 years ago

The biggest issue with implementing this issue is that if we have some filter by pyamentStatus applied, and we would like to reload data for the current page, some rows may disappear due to changed status so it's hard to get updated status for all the items on the page with one request and making individual requests for each item feel heavy.