From 5c6c09bf5210260d883ec835c7aa619c67924ac6 Mon Sep 17 00:00:00 2001 From: Malik Hadjri <19805673+hadjri@users.noreply.github.com> Date: Thu, 2 May 2024 15:31:51 -0500 Subject: [PATCH] DEVPROD-3003 Remove JIRA custom fields (#96) --- .../fragments/projectSettings/plugins.graphql | 8 --- apps/spruce/src/gql/generated/types.ts | 55 ------------------- .../projectSettings/CopyProjectModal.test.tsx | 1 - .../tabs/EventLogTab/EventLogTab.test.tsx | 2 - .../tabs/PluginsTab/getFormSchema.tsx | 39 ------------- .../tabs/PluginsTab/transformers.test.ts | 18 ------ .../tabs/PluginsTab/transformers.ts | 13 ----- .../projectSettings/tabs/PluginsTab/types.ts | 6 -- .../pages/projectSettings/tabs/testData.ts | 7 --- 9 files changed, 149 deletions(-) diff --git a/apps/spruce/src/gql/fragments/projectSettings/plugins.graphql b/apps/spruce/src/gql/fragments/projectSettings/plugins.graphql index 6d0b94e07..abd30f183 100644 --- a/apps/spruce/src/gql/fragments/projectSettings/plugins.graphql +++ b/apps/spruce/src/gql/fragments/projectSettings/plugins.graphql @@ -15,10 +15,6 @@ fragment ProjectPluginsSettings on Project { endpoint secret } - jiraCustomFields { - displayText - field - } } } @@ -39,9 +35,5 @@ fragment RepoPluginsSettings on RepoRef { endpoint secret } - jiraCustomFields { - displayText - field - } } } diff --git a/apps/spruce/src/gql/generated/types.ts b/apps/spruce/src/gql/generated/types.ts index 129384b33..c0ef016bd 100644 --- a/apps/spruce/src/gql/generated/types.ts +++ b/apps/spruce/src/gql/generated/types.ts @@ -3775,11 +3775,6 @@ export type ProjectSettingsFieldsFragment = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers?: Array<{ __typename?: "TriggerAlias"; @@ -3977,11 +3972,6 @@ export type RepoSettingsFieldsFragment = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers: Array<{ __typename?: "TriggerAlias"; @@ -4238,11 +4228,6 @@ export type ProjectPluginsSettingsFragment = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; }; @@ -4268,11 +4253,6 @@ export type RepoPluginsSettingsFragment = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; }; @@ -4379,11 +4359,6 @@ export type ProjectEventSettingsFragment = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers?: Array<{ __typename?: "TriggerAlias"; @@ -6851,11 +6826,6 @@ export type ProjectEventLogsQuery = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers?: Array<{ __typename?: "TriggerAlias"; @@ -7065,11 +7035,6 @@ export type ProjectEventLogsQuery = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers?: Array<{ __typename?: "TriggerAlias"; @@ -7358,11 +7323,6 @@ export type ProjectSettingsQuery = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers?: Array<{ __typename?: "TriggerAlias"; @@ -7620,11 +7580,6 @@ export type RepoEventLogsQuery = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers?: Array<{ __typename?: "TriggerAlias"; @@ -7834,11 +7789,6 @@ export type RepoEventLogsQuery = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers?: Array<{ __typename?: "TriggerAlias"; @@ -8053,11 +8003,6 @@ export type RepoSettingsQuery = { endpoint: string; secret: string; }; - jiraCustomFields?: Array<{ - __typename?: "JiraField"; - displayText: string; - field: string; - }> | null; }; triggers: Array<{ __typename?: "TriggerAlias"; diff --git a/apps/spruce/src/pages/projectSettings/CopyProjectModal.test.tsx b/apps/spruce/src/pages/projectSettings/CopyProjectModal.test.tsx index 2b111109a..779745812 100644 --- a/apps/spruce/src/pages/projectSettings/CopyProjectModal.test.tsx +++ b/apps/spruce/src/pages/projectSettings/CopyProjectModal.test.tsx @@ -323,7 +323,6 @@ const projectSettingsMock: ApolloMock< ticketCreateIssueType: "", }, taskAnnotationSettings: { - jiraCustomFields: null, fileTicketWebhook: { endpoint: "", secret: "", diff --git a/apps/spruce/src/pages/projectSettings/tabs/EventLogTab/EventLogTab.test.tsx b/apps/spruce/src/pages/projectSettings/tabs/EventLogTab/EventLogTab.test.tsx index b06d166b5..3dc571436 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/EventLogTab/EventLogTab.test.tsx +++ b/apps/spruce/src/pages/projectSettings/tabs/EventLogTab/EventLogTab.test.tsx @@ -118,7 +118,6 @@ const projectEventsQuery: ProjectEventLogsQuery = { ticketCreateIssueType: "", }, taskAnnotationSettings: { - jiraCustomFields: null, fileTicketWebhook: { endpoint: "", secret: "", @@ -206,7 +205,6 @@ const projectEventsQuery: ProjectEventLogsQuery = { ticketCreateIssueType: "", }, taskAnnotationSettings: { - jiraCustomFields: null, fileTicketWebhook: { endpoint: "", secret: "", diff --git a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx index 8702c3f8b..51ad686d1 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx +++ b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/getFormSchema.tsx @@ -58,33 +58,6 @@ export const getFormSchema = ( type: "object" as "object", title: "Ticket Creation", properties: { - taskAnnotationSettings: { - title: "", - type: "object" as "object", - properties: { - jiraCustomFields: { - type: "array" as "array", - title: "Custom JIRA Fields", - items: { - type: "object" as "object", - properties: { - field: { - type: "string" as "string", - title: "Field", - minLength: 1, - default: "", - }, - displayText: { - type: "string" as "string", - title: "Display Text", - minLength: 1, - default: "", - }, - }, - }, - }, - }, - }, useBuildBaron: { type: "boolean" as "boolean", oneOf: radioBoxOptions([ @@ -233,18 +206,6 @@ export const getFormSchema = ( buildBaronSettings: { "ui:rootFieldId": "buildBaron", "ui:ObjectFieldTemplate": CardFieldTemplate, - taskAnnotationSettings: { - "ui:rootFieldId": "taskAnnotation", - jiraCustomFields: { - "ui:description": - "Add any custom JIRA fields that you want displayed on any listed JIRA tickets, for example: assigned teams.", - "ui:addButtonText": "Add Custom JIRA Field", - "ui:orderable": false, - items: { - "ui:label": false, - }, - }, - }, useBuildBaron: { "ui:widget": widgets.RadioBoxWidget, "ui:showLabel": false, diff --git a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.test.ts b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.test.ts index fcb3cbc77..c94187589 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.test.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.test.ts @@ -41,9 +41,6 @@ const projectForm: PluginsFormState = { }, ticketSearchProjects: [], useBuildBaron: false, - taskAnnotationSettings: { - jiraCustomFields: [], - }, fileTicketWebhook: { endpoint: null, secret: null, @@ -71,7 +68,6 @@ const projectResult: Pick = { id: "project", perfEnabled: true, taskAnnotationSettings: { - jiraCustomFields: [], fileTicketWebhook: { endpoint: null, secret: null, @@ -109,14 +105,6 @@ const repoForm: PluginsFormState = { issueType: "Epic", }, useBuildBaron: false, - taskAnnotationSettings: { - jiraCustomFields: [ - { - field: "customField", - displayText: "Custom Field", - }, - ], - }, fileTicketWebhook: { endpoint: "endpoint", secret: "secret", @@ -144,12 +132,6 @@ const repoResult: Pick = { id: "repo", perfEnabled: true, taskAnnotationSettings: { - jiraCustomFields: [ - { - field: "customField", - displayText: "Custom Field", - }, - ], fileTicketWebhook: { endpoint: "endpoint", secret: "secret", diff --git a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.ts b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.ts index 7a0969e0d..0891ec231 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/transformers.ts @@ -14,15 +14,6 @@ export const gqlToForm = ((data) => { perfEnabled: projectRef?.perfEnabled, }, buildBaronSettings: { - taskAnnotationSettings: { - jiraCustomFields: - projectRef?.taskAnnotationSettings?.jiraCustomFields?.map( - ({ displayText, field }) => ({ - field, - displayText, - }), - ) ?? [], - }, useBuildBaron: projectRef?.taskAnnotationSettings?.fileTicketWebhook?.endpoint === "", ticketSearchProjects: @@ -66,10 +57,6 @@ export const formToGql = (( buildBaronSettings.useBuildBaron, buildBaronSettings.fileTicketWebhook, ), - jiraCustomFields: - buildBaronSettings.taskAnnotationSettings?.jiraCustomFields - .map(({ displayText, field }) => ({ field, displayText })) - .filter((str) => !!str), }, externalLinks: externalLinks.length > 0 diff --git a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/types.ts b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/types.ts index 8cd3971fe..2619cdd1d 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/types.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/PluginsTab/types.ts @@ -5,12 +5,6 @@ export interface PluginsFormState { perfEnabled: boolean | null; }; buildBaronSettings: { - taskAnnotationSettings: { - jiraCustomFields: Array<{ - field: string; - displayText: string; - }>; - }; useBuildBaron: boolean | null; ticketSearchProjects: Array<{ searchProject: string }>; ticketCreateProject: { diff --git a/apps/spruce/src/pages/projectSettings/tabs/testData.ts b/apps/spruce/src/pages/projectSettings/tabs/testData.ts index f439d09e8..caa99a715 100644 --- a/apps/spruce/src/pages/projectSettings/tabs/testData.ts +++ b/apps/spruce/src/pages/projectSettings/tabs/testData.ts @@ -80,7 +80,6 @@ const projectBase: ProjectSettingsQuery["projectSettings"] = { ticketCreateIssueType: JiraTicketType.Epic, }, taskAnnotationSettings: { - jiraCustomFields: [], fileTicketWebhook: { endpoint: null, secret: null, @@ -215,12 +214,6 @@ const repoBase: RepoSettingsQuery["repoSettings"] = { ticketCreateIssueType: JiraTicketType.Epic, }, taskAnnotationSettings: { - jiraCustomFields: [ - { - field: "customField", - displayText: "Custom Field", - }, - ], fileTicketWebhook: { endpoint: "endpoint", secret: "secret",