Page MenuHomePhabricator

[web] Move `onDelete` up from `ThreadSettingsModal` to `ConnectedThreadSettingsModal`
ClosedPublic

Authored by atul on Apr 20 2022, 2:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 2:01 PM
Unknown Object (File)
Fri, Nov 22, 2:01 PM
Unknown Object (File)
Fri, Nov 22, 2:01 PM
Unknown Object (File)
Fri, Nov 22, 2:01 PM
Unknown Object (File)
Fri, Nov 22, 1:59 PM
Unknown Object (File)
Fri, Nov 15, 9:06 AM
Unknown Object (File)
Fri, Nov 15, 9:06 AM
Unknown Object (File)
Fri, Nov 15, 9:06 AM

Details

Summary

Move onDelete out from inner class component to outer "Connected" functional component.

As part of the work to refactor ThreadSettingsModal... specifically to turn it into a functional component


Depends on D3783

Test Plan
  1. Create delete-able thread
  2. Navigate to ThreadSettingsModal and go to "Delete" tab
  3. Try to delete thread and ensure that it works as expected

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Apr 20 2022, 2:25 PM
tomek added inline comments.
web/modals/threads/thread-settings-modal.react.js
466 ↗(On Diff #11678)

Why do we prevent default here and not in the other places?

This revision is now accepted and ready to land.Apr 21 2022, 3:20 AM
web/modals/threads/thread-settings-modal.react.js
466 ↗(On Diff #11678)

It looks like we do event.preventDefault() for onDelete and onSubmit which are callbacks that are passed to the onClick prop of <Button /> components.

It looks like we don't do event.preventDefault()for the onChange callbacks passed to the <Input /> components.