pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

Address TypeScript issues for withActionsDisabled

Open bugzilla-to-github opened this issue 4 years ago • 2 comments

This issue was created automatically by a script.

Bug 1710215

Bug Reporter: @Pike CC: @adngdb, @mathjazz Blocker for: Bug 1685565

The migration to TS isn't happy with withActionsDisabled.js. I'd love for someone to take a look at that, mostly Adrian or Matjaz.

When Matjaz originally added that (Higher Order?) Component, it had a bunch of users, but now it's just src/modules/history/components/Translation.js. And the latter does use quite a bit of outer state, which I stared at cluelessly.

Maybe this needs a refactor?

bugzilla-to-github avatar May 07 '21 23:05 bugzilla-to-github

Comment Author: @adngdb

Yes, withActionsDisabled.js was added as a solution to the "button spamming" problem, but is actually not the correct solution. The correct solution is to have the associated action disable itself until the server has sent a response. I believe we have implemented that in some places, but not all of them. I would indeed recommend to refactor withActionsDisabled.js into non-existence. :-)

bugzilla-to-github avatar May 10 '21 19:05 bugzilla-to-github

Comment Author: @Pike

I dared to dig into this, and when trying to find out which actions needed to be wrapped I hit https://github.com/mozilla/pontoon/blob/dda49774209fb4d98bddffa96d4fb28a88a679a5/frontend/src/modules/entitydetails/components/EntityDetails.js#L399-L403, which is a hook now elsewhere. As in, the method that comment refers to doesn't exist anymore. Or, I tried to punch above my weight, and then saw the light, and ran away scared.

bugzilla-to-github avatar May 14 '21 04:05 bugzilla-to-github