Page MenuHomePhabricator

[web] refactor modal API to return modal key
ClosedPublic

Authored by kamil on Dec 13 2022, 6:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 7:01 PM
Unknown Object (File)
Wed, Jun 26, 12:22 PM
Unknown Object (File)
Tue, Jun 25, 6:29 PM
Unknown Object (File)
Mon, Jun 24, 7:37 AM
Unknown Object (File)
Sun, Jun 16, 9:24 PM
Unknown Object (File)
Thu, May 30, 1:58 AM
Unknown Object (File)
Wed, May 29, 10:56 PM
Unknown Object (File)
Wed, May 29, 10:56 PM
Subscribers

Details

Summary

In policy acknowledging logic we need to track whether modal is visible or not. As suggested in https://phab.comm.dev/D5830#inline-39308 we want to avoid duplicated state and what is more important have single source of truth. We need to have the modal key and then we will be able to check if given modal is present in modals array or no.

Test Plan

This code does not affect logic, but worth checking if modals on website works properly

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Dec 13 2022, 8:22 AM
tomek added inline comments.
lib/components/modal-provider.react.js
13 ↗(On Diff #19318)

We can define React.Node => string as a separate type and use in all the places where pushModal is used

This revision is now accepted and ready to land.Dec 14 2022, 5:06 AM

introduce separate type for pushModal