Skip to content

Commit

Permalink
DEVPROD-3003 Remove JIRA custom fields (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadjri authored May 2, 2024
1 parent 544b709 commit 5c6c09b
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 149 deletions.
8 changes: 0 additions & 8 deletions apps/spruce/src/gql/fragments/projectSettings/plugins.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ fragment ProjectPluginsSettings on Project {
endpoint
secret
}
jiraCustomFields {
displayText
field
}
}
}

Expand All @@ -39,9 +35,5 @@ fragment RepoPluginsSettings on RepoRef {
endpoint
secret
}
jiraCustomFields {
displayText
field
}
}
}
55 changes: 0 additions & 55 deletions apps/spruce/src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3775,11 +3775,6 @@ export type ProjectSettingsFieldsFragment = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers?: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -3977,11 +3972,6 @@ export type RepoSettingsFieldsFragment = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -4238,11 +4228,6 @@ export type ProjectPluginsSettingsFragment = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
};

Expand All @@ -4268,11 +4253,6 @@ export type RepoPluginsSettingsFragment = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
};

Expand Down Expand Up @@ -4379,11 +4359,6 @@ export type ProjectEventSettingsFragment = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers?: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -6851,11 +6826,6 @@ export type ProjectEventLogsQuery = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers?: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -7065,11 +7035,6 @@ export type ProjectEventLogsQuery = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers?: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -7358,11 +7323,6 @@ export type ProjectSettingsQuery = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers?: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -7620,11 +7580,6 @@ export type RepoEventLogsQuery = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers?: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -7834,11 +7789,6 @@ export type RepoEventLogsQuery = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers?: Array<{
__typename?: "TriggerAlias";
Expand Down Expand Up @@ -8053,11 +8003,6 @@ export type RepoSettingsQuery = {
endpoint: string;
secret: string;
};
jiraCustomFields?: Array<{
__typename?: "JiraField";
displayText: string;
field: string;
}> | null;
};
triggers: Array<{
__typename?: "TriggerAlias";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ const projectSettingsMock: ApolloMock<
ticketCreateIssueType: "",
},
taskAnnotationSettings: {
jiraCustomFields: null,
fileTicketWebhook: {
endpoint: "",
secret: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ const projectEventsQuery: ProjectEventLogsQuery = {
ticketCreateIssueType: "",
},
taskAnnotationSettings: {
jiraCustomFields: null,
fileTicketWebhook: {
endpoint: "",
secret: "",
Expand Down Expand Up @@ -206,7 +205,6 @@ const projectEventsQuery: ProjectEventLogsQuery = {
ticketCreateIssueType: "",
},
taskAnnotationSettings: {
jiraCustomFields: null,
fileTicketWebhook: {
endpoint: "",
secret: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ const projectForm: PluginsFormState = {
},
ticketSearchProjects: [],
useBuildBaron: false,
taskAnnotationSettings: {
jiraCustomFields: [],
},
fileTicketWebhook: {
endpoint: null,
secret: null,
Expand Down Expand Up @@ -71,7 +68,6 @@ const projectResult: Pick<ProjectSettingsInput, "projectId" | "projectRef"> = {
id: "project",
perfEnabled: true,
taskAnnotationSettings: {
jiraCustomFields: [],
fileTicketWebhook: {
endpoint: null,
secret: null,
Expand Down Expand Up @@ -109,14 +105,6 @@ const repoForm: PluginsFormState = {
issueType: "Epic",
},
useBuildBaron: false,
taskAnnotationSettings: {
jiraCustomFields: [
{
field: "customField",
displayText: "Custom Field",
},
],
},
fileTicketWebhook: {
endpoint: "endpoint",
secret: "secret",
Expand Down Expand Up @@ -144,12 +132,6 @@ const repoResult: Pick<RepoSettingsInput, "repoId" | "projectRef"> = {
id: "repo",
perfEnabled: true,
taskAnnotationSettings: {
jiraCustomFields: [
{
field: "customField",
displayText: "Custom Field",
},
],
fileTicketWebhook: {
endpoint: "endpoint",
secret: "secret",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
7 changes: 0 additions & 7 deletions apps/spruce/src/pages/projectSettings/tabs/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const projectBase: ProjectSettingsQuery["projectSettings"] = {
ticketCreateIssueType: JiraTicketType.Epic,
},
taskAnnotationSettings: {
jiraCustomFields: [],
fileTicketWebhook: {
endpoint: null,
secret: null,
Expand Down Expand Up @@ -215,12 +214,6 @@ const repoBase: RepoSettingsQuery["repoSettings"] = {
ticketCreateIssueType: JiraTicketType.Epic,
},
taskAnnotationSettings: {
jiraCustomFields: [
{
field: "customField",
displayText: "Custom Field",
},
],
fileTicketWebhook: {
endpoint: "endpoint",
secret: "secret",
Expand Down

0 comments on commit 5c6c09b

Please sign in to comment.