Skip to content

Ability to invite users to minds/tenants minds#4555

Fausto Arcidiacono requested to merge feat/tenant-invites-4555 into master

Ticket(s) / Related Merge Requests

Summary of Changes

Testing Considerations

Mutation to create an invite

mutation createInvite(
  $emails: String!,
  $bespokeMessage: String!,
  $roles: [Int!],
  $groups: [Int!]
) {
  invite(
    emails: $emails
    bespokeMessage: $bespokeMessage
    roles: $roles
    groups: $groups
  )
}

Query to get an invite by invite token (only for future editing capabilities)

query getInvite(
  $inviteId: Int!
) {
  invite(
    inviteId: $inviteId
  ) {
    inviteId
    email
    status
    bespokeMessage
    createdTimestamp
    sendTimestamp
    id
    roles
    groups
  } 
}

Query to get invites

query getInvites(
  $first: Int!,
  $after: String,
  $search: String
) {
  invites(
    first: $first
    after: $after
    search: $search
  ) {
    edges {
      node {
        inviteId
        email
        status
        bespokeMessage
        createdTimestamp
        sendTimestamp
        id
        roles
        groups
      } 
      cursor
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    id
  } 
}

Mutation to cancel invite

mutation cancelInvite(
  $inviteId: Int!
) {
  cancelInvite(
    inviteId: $inviteId
  )
}

Mutation to resend invite

mutation resendInvite(
  $inviteId: Int!
) {
  resendInvite(
    inviteId: $inviteId
  )
}

Deployment Considerations

Add new table to Vitess

CREATE TABLE IF NOT EXISTS `minds`.`minds_tenant_invites`
(
    id int PRIMARY KEY AUTO_INCREMENT,
    tenant_id int NOT NULL,
    owner_guid bigint NOT NULL,
    email varchar(512) NOT NULL,
    invite_token text NOT NULL,
    target_roles text DEFAULT NULL,
    target_group_guids text DEFAULT NULL,
    custom_message text,
    created_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    send_timestamp TIMESTAMP DEFAULT NULL,
    status tinyint(6) NOT NULL,
    INDEX (tenant_id, owner_guid),
    INDEX (status),
    UNIQUE INDEX (tenant_id, email)
) ENGINE = "InnoDB";

Regression Scope

Platform Affected (web, mobile, etc)

Developer Testing Completed

Screenshots / Screen Recording

Does this impact

  • Localization
  • Dark/light mode
  • Guest mode

Definition of Done Checklist

  • The Acceptance Criteria has been met
  • Code is tested: Testing includes unit/spec, E2E/automated and manual testing
  • Merge requests description has been filled out
Edited by Fausto Arcidiacono

Merge request reports