Page MenuHomePhabricator

[native] Create invitation modal
ClosedPublic

Authored by tomek on Apr 19 2023, 5:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 8, 11:05 AM
Unknown Object (File)
Fri, Jun 7, 7:09 PM
Unknown Object (File)
Fri, Jun 7, 7:10 AM
Unknown Object (File)
Fri, Jun 7, 7:00 AM
Unknown Object (File)
Thu, May 30, 5:09 PM
Unknown Object (File)
Wed, May 22, 11:10 AM
Unknown Object (File)
Sun, May 19, 7:27 PM
Unknown Object (File)
Sun, May 19, 5:45 PM
Subscribers

Details

Summary

After user clicks a link, we're going to call link verification endpoint. Based on the result, we will navigate user to this modal.

invite-invalid.png (2×1 px, 226 KB)
invite-valid.png (2×1 px, 220 KB)

Depends on D7522

Test Plan

Open a link that:

  • is valid => user should see two buttons, one for joining and one for canceling
  • is invalid => user should see an error message
  • points to a community where the user is a member => modal should not be displayed

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/navigation/invite-link-modal.react.js
62 ↗(On Diff #25339)

This function is introduced in later diff

tomek requested review of this revision.Apr 19 2023, 6:03 AM

Would it make sense to add an invariant to check that this modal is not called with `status: 'already_joined'? Currently there is nothing stopping someone from doing that, because there is no type checking. And the modal would be displayed without errors, with a message that would be incorrect and misleading.

This revision is now accepted and ready to land.Apr 21 2023, 2:25 AM
In D7524#223171, @inka wrote:

Would it make sense to add an invariant to check that this modal is not called with `status: 'already_joined'? Currently there is nothing stopping someone from doing that, because there is no type checking. And the modal would be displayed without errors, with a message that would be incorrect and misleading.

Yeah, adding some validation is a good idea!

Do not show a modal in already_joined state

In D7524#226197, @tomek wrote:
In D7524#223171, @inka wrote:

Would it make sense to add an invariant to check that this modal is not called with `status: 'already_joined'? Currently there is nothing stopping someone from doing that, because there is no type checking. And the modal would be displayed without errors, with a message that would be incorrect and misleading.

Yeah, adding some validation is a good idea!

Instead of using an invariant I decided that we can simply close the modal. This is consistent with our approach that a modal shouldn't be opened when a user is a member of the community.

This revision was automatically updated to reflect the committed changes.