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)
Wed, Dec 25, 12:52 PM
Unknown Object (File)
Wed, Dec 25, 12:52 PM
Unknown Object (File)
Wed, Dec 25, 12:52 PM
Unknown Object (File)
Wed, Dec 25, 12:52 PM
Unknown Object (File)
Wed, Dec 25, 12:50 PM
Unknown Object (File)
Sat, Dec 14, 12:34 AM
Unknown Object (File)
Sat, Dec 7, 10:05 PM
Unknown Object (File)
Sat, Nov 30, 7:11 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.