Skip to content

Display issue crm contacts in UI

Lee Tickett requested to merge 2256-display-issue-contacts-in-ui into master

What does this MR do and why?

#2256

This MR adds a new "real-time" widget to the issue page to display the attached crm contacts.

For now we are just display a comma separated list of names with a popover when hovering to show email/phone/description etc if they exist.

Screenshots or screen recordings

Collapsed state without contacts

image

Collapsed state with contacts

image

Expanded without contacts

image

Expanded with contacts

image

Help text

image

Realtime amazingness (old video from before component was moved, but ultimately still works in the same "magical" way)

realtime-gql-subscription

How to set up and validate locally

From rails console:
1. Enable feature flag:
Feature.enable(:customer_relations)
From GraphiQL (http://gdk.test:3000/-/graphql-explorer):
2. Pick a an issue (I used http://gdk.test:3000/flightjs/Flight/-/issues/30)
3. Create a few contacts for the group the issue belongs to:
mutation {
  customerRelationsContactCreate(input:
    {
      groupId: "gid://gitlab/Group/26"
      firstName: "Lee"
      lastName: "Tickett"
      email: "example@gitlab.com"
    }) {
    contact {
      id
      firstName
      lastName
    }
    errors
  }
}
4. Attempt to add/remove those contacts from your issue:
mutation {
  issueSetCrmContacts(input:
    {
      projectPath: "flightjs/Flight"
      iid: "30"
      operationMode: REPLACE
	crmContactIds: [
        "gid://gitlab/CustomerRelations::Contact/14",
        "gid://gitlab/CustomerRelations::Contact/12"
      ]
    }) {
    issue {
     id
      customerRelationsContacts {
        nodes {
          id
          firstName
          lastName
        }
      }
    }
    errors
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lee Tickett

Merge request reports

Loading