uwasystemhealth / IndEAA

A web application that streamlines course review by industry advisory panels
https://indeaa.systemhealthlab.com
2 stars 0 forks source link

Adding Request Guards in buttons that do requests #83

Open frinzekt opened 3 years ago

frinzekt commented 3 years ago

Further to #82, it would be recommended that there are request guards that prevents a user to click the same button twice. The effect of pressing the button twice means that it will send 2 requests in the server, when there are only supposed to be 1.

Tip: Use the existing state "isLoading" of the service methods. With that property, disable the button or whatever is requesting

MouseAndKeyboard commented 3 years ago

Admin page:

Coordinator page:

Reviewer:

Feel free to extend this list if you find something that should have a request guard of some kind

MouseAndKeyboard commented 3 years ago

I'm curious what you mean by the preexisting state "isLoading" of the service methods. Could you link me the docs about this so I can use it. Thanks ;)

frinzekt commented 3 years ago

Nice list! See this https://github.com/feathersjs-ecosystem/feathers-redux#shape-of-the-store look at this very carefully for the isLoading.

MouseAndKeyboard commented 3 years ago

Nice list! See this https://github.com/feathersjs-ecosystem/feathers-redux#shape-of-the-store look at this very carefully for the isLoading.

How exactly would I access this field

frinzekt commented 3 years ago

Currently you are already doing it using

useSelector

If you take a look at the redux dev tools especially the chart, you will that... you also see the log that are changing also with the state difference

On Wed, Feb 3, 2021 at 9:59 PM MouseAndKeyboard notifications@github.com wrote:

Nice list! See this https://github.com/feathersjs-ecosystem/feathers-redux#shape-of-the-store look at this very carefully for the isLoading.

How exactly would I access this field

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/uwasystemhealth/IndEAA/issues/83#issuecomment-772530431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKSVXXJDUIVSMXDZL4MHD3TS5FJCTANCNFSM4WWFRVEA .