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)
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
Unknown Object (File)
Sun, Dec 15, 8:19 PM
Unknown Object (File)
Thu, Dec 12, 12:26 AM
Unknown Object (File)
Sun, Nov 24, 11:02 AM
Unknown Object (File)
Nov 8 2024, 10:00 AM
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