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)
Thu, Dec 19, 3:38 PM
Unknown Object (File)
Wed, Dec 18, 4:24 PM
Unknown Object (File)
Wed, Dec 18, 3:55 PM
Unknown Object (File)
Wed, Dec 18, 12:45 PM
Unknown Object (File)
Sun, Dec 15, 8:30 PM
Unknown Object (File)
Sun, Dec 15, 8:30 PM
Unknown Object (File)
Sun, Dec 15, 8:30 PM
Unknown Object (File)
Sun, Dec 15, 8:29 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