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
F2146728: D5860.id19372.diff
Sun, Jun 30, 12:18 AM
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)
May 30 2024, 1:58 AM
Unknown Object (File)
May 29 2024, 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
Branch
policy-stuff-5
Lint
No Lint Coverage
Unit
No Test Coverage

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

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