From 9cd976e2031d409dcf29be0c293794b2550b37d3 Mon Sep 17 00:00:00 2001 From: Jeremy Sfez Date: Sat, 9 Nov 2024 08:53:48 +0100 Subject: [PATCH] feat: send notifications to Slack --- .../20241107214041_project_slack_channel.js | 17 +++ apps/backend/db/seeds/seeds.js | 9 +- .../src/build-notification/notifications.ts | 90 ++++++++++++- apps/backend/src/database/models/Project.ts | 2 + .../graphql/__generated__/resolver-types.ts | 4 + .../src/graphql/__generated__/schema.gql | 4 + .../src/graphql/definitions/Project.ts | 16 ++- apps/backend/src/slack/index.ts | 27 +++- .../src/containers/BuildModeIndicator.tsx | 2 +- .../frontend/src/containers/Project/Slack.tsx | 118 ++++++++++++++++++ apps/frontend/src/gql/gql.ts | 14 ++- apps/frontend/src/gql/graphql.ts | 21 +++- apps/frontend/src/pages/Project/Settings.tsx | 14 +++ package.json | 1 + 14 files changed, 322 insertions(+), 17 deletions(-) create mode 100644 apps/backend/db/migrations/20241107214041_project_slack_channel.js create mode 100644 apps/frontend/src/containers/Project/Slack.tsx diff --git a/apps/backend/db/migrations/20241107214041_project_slack_channel.js b/apps/backend/db/migrations/20241107214041_project_slack_channel.js new file mode 100644 index 000000000..939999cfd --- /dev/null +++ b/apps/backend/db/migrations/20241107214041_project_slack_channel.js @@ -0,0 +1,17 @@ +/** + * @param {import('knex').Knex} knex + */ +export const up = async (knex) => { + await knex.schema.alterTable("projects", async (table) => { + table.string("slackChannelId"); + }); +}; + +/** + * @param {import('knex').Knex} knex + */ +export const down = async (knex) => { + await knex.schema.alterTable("projects", async (table) => { + table.dropColumn("slackChannelId"); + }); +}; diff --git a/apps/backend/db/seeds/seeds.js b/apps/backend/db/seeds/seeds.js index f084dffc5..3aef852e5 100644 --- a/apps/backend/db/seeds/seeds.js +++ b/apps/backend/db/seeds/seeds.js @@ -116,27 +116,28 @@ export const seed = async (knex) => { { ...timeStamps, name: "big", - token: "big-xxx", + token: "big-650ded7d72e85b52e099df6e56aa204d4fe9", accountId: smoothAccount.id, private: false, + forcePlanId: 2, }, { ...timeStamps, name: "awesome", - token: "awesome-xxx", + token: "awesome-650ded7d72e85b52e099df6e56aa204d", accountId: helloAccount.id, defaultBaseBranch: "main", }, { ...timeStamps, name: "zone-51", - token: "zone-51-xxx", + token: "zone-51-650ded7d72e85b52e099df6e56aa204d", accountId: gregAccount.id, }, { ...timeStamps, name: "lalouland", - token: "lalouland-xxx", + token: "lalouland-650ded7d72e85b52e099df6e56aa20", accountId: jeremyAccount.id, }, ]); diff --git a/apps/backend/src/build-notification/notifications.ts b/apps/backend/src/build-notification/notifications.ts index 72aa65856..05ee99c48 100644 --- a/apps/backend/src/build-notification/notifications.ts +++ b/apps/backend/src/build-notification/notifications.ts @@ -1,5 +1,6 @@ import { invariant } from "@argos/util/invariant"; import type { Octokit, RestEndpointMethodTypes } from "@octokit/rest"; +import Bolt from "@slack/bolt"; import { Build, @@ -16,6 +17,7 @@ import { getGitlabClientFromAccount } from "@/gitlab/index.js"; import { UnretryableError } from "@/job-core/index.js"; import { getRedisLock } from "@/util/redis/index.js"; +import { postMessageToSlackChannel } from "../slack/index.js"; import { getAggregatedNotification } from "./aggregated.js"; import { getCommentBody } from "./comment.js"; import { job as buildNotificationJob } from "./job.js"; @@ -214,11 +216,91 @@ const sendGitlabNotification = async (ctx: Context) => { } }; +const sendSlackNotification = async (ctx: Context) => { + const { build, notification } = ctx; + invariant(build, "no build found", UnretryableError); + + if (build.jobStatus !== "complete") { + return; + } + + const { project, compareScreenshotBucket } = build; + invariant( + compareScreenshotBucket, + "no compare screenshot bucket found", + UnretryableError, + ); + invariant(project, "no project found", UnretryableError); + + const { account, slackChannelId } = project; + + invariant(account, "no account found", UnretryableError); + + if (!account.slackInstallation) { + return; + } + + if (!slackChannelId) { + return; + } + + const buildUrl = await build.getUrl(); + + await postMessageToSlackChannel({ + installation: account.slackInstallation, + channel: slackChannelId, + text: notification.description, + blocks: [ + { + type: "section", + text: { + type: "mrkdwn", + text: `*project ${project.name} | <${buildUrl}|Build ${build.number}: ${build.name}> of*\n*Visual Changes:* _${notification.description}_`, + }, + accessory: { + type: "button", + text: { + type: "plain_text", + text: "Review Changes", + }, + url: buildUrl, + action_id: "build-link", + }, + }, + { type: "divider" }, + { + type: "section", + fields: [ + { type: "mrkdwn", text: `*Type:* ${build.type}` }, + { type: "mrkdwn", text: `*Commit:* ${ctx.commit.slice(0, 7)}` }, + { + type: "mrkdwn", + text: `*Branch:* ${build.compareScreenshotBucket?.branch}`, + }, + { + type: "mrkdwn", + text: `*Screenshots Compared:* ${build.compareScreenshotBucket?.screenshotCount}`, + }, + ], + }, + build.pullRequest?.number && { + type: "section", + fields: [ + { + type: "mrkdwn", + text: `*Pull Request #`, + }, + ], + }, + ].filter(Boolean) as Bolt.types.Block[], + }); +}; + export const processBuildNotification = async ( buildNotification: BuildNotification, ) => { await buildNotification.$fetchGraph( - `build.[project.[gitlabProject, githubRepository.[githubAccount,repoInstallations.installation], account], compareScreenshotBucket]`, + `build.[project.[gitlabProject, githubRepository.[githubAccount,repoInstallations.installation], account.slackInstallation], compareScreenshotBucket]`, ); invariant(buildNotification.build, "No build found", UnretryableError); @@ -265,5 +347,9 @@ export const processBuildNotification = async ( aggregatedNotification, }; - await Promise.all([sendGithubNotification(ctx), sendGitlabNotification(ctx)]); + await Promise.all([ + sendGithubNotification(ctx), + sendGitlabNotification(ctx), + sendSlackNotification(ctx), + ]); }; diff --git a/apps/backend/src/database/models/Project.ts b/apps/backend/src/database/models/Project.ts index 2dc3d765d..358f0f98d 100644 --- a/apps/backend/src/database/models/Project.ts +++ b/apps/backend/src/database/models/Project.ts @@ -50,6 +50,7 @@ export class Project extends Model { gitlabProjectId: { type: ["null", "string"] }, prCommentEnabled: { type: "boolean" }, summaryCheck: { type: "string", enum: ["always", "never", "auto"] }, + slackChannelId: { type: ["null", "string"] }, }, }); @@ -63,6 +64,7 @@ export class Project extends Model { gitlabProjectId!: string | null; prCommentEnabled!: boolean; summaryCheck!: "always" | "never" | "auto"; + slackChannelId!: string | null; override $formatDatabaseJson(json: Pojo) { json = super.$formatDatabaseJson(json); diff --git a/apps/backend/src/graphql/__generated__/resolver-types.ts b/apps/backend/src/graphql/__generated__/resolver-types.ts index 78131ade1..ef2e4dea5 100644 --- a/apps/backend/src/graphql/__generated__/resolver-types.ts +++ b/apps/backend/src/graphql/__generated__/resolver-types.ts @@ -648,6 +648,8 @@ export type IProject = INode & { public: Scalars['Boolean']['output']; /** Repository associated to the project */ repository?: Maybe; + /** Slack channel */ + slackChannelId?: Maybe; /** Project slug */ slug: Scalars['String']['output']; /** Summary check */ @@ -1104,6 +1106,7 @@ export type IUpdateProjectInput = { id: Scalars['ID']['input']; name?: InputMaybe; private?: InputMaybe; + slackChannelId?: InputMaybe; summaryCheck?: InputMaybe; }; @@ -1744,6 +1747,7 @@ export type IProjectResolvers, ParentType, ContextType>; public?: Resolver; repository?: Resolver, ParentType, ContextType>; + slackChannelId?: Resolver, ParentType, ContextType>; slug?: Resolver; summaryCheck?: Resolver; token?: Resolver, ParentType, ContextType>; diff --git a/apps/backend/src/graphql/__generated__/schema.gql b/apps/backend/src/graphql/__generated__/schema.gql index b40864cec..32816d854 100644 --- a/apps/backend/src/graphql/__generated__/schema.gql +++ b/apps/backend/src/graphql/__generated__/schema.gql @@ -541,6 +541,9 @@ type Project implements Node { """Repository associated to the project""" repository: Repository + """Slack channel""" + slackChannelId: String + """Project slug""" slug: String! @@ -892,6 +895,7 @@ input UpdateProjectInput { id: ID! name: String private: Boolean + slackChannelId: String summaryCheck: SummaryCheck } diff --git a/apps/backend/src/graphql/definitions/Project.ts b/apps/backend/src/graphql/definitions/Project.ts index 7e7d82fa2..063109c9d 100644 --- a/apps/backend/src/graphql/definitions/Project.ts +++ b/apps/backend/src/graphql/definitions/Project.ts @@ -116,6 +116,8 @@ export const typeDefs = gql` prCommentEnabled: Boolean! "Summary check" summaryCheck: SummaryCheck! + "Slack channel" + slackChannelId: String "Build names" buildNames: [String!]! "Contributors" @@ -157,6 +159,7 @@ export const typeDefs = gql` private: Boolean name: String summaryCheck: SummaryCheck + slackChannelId: String } input TransferProjectInput { @@ -550,9 +553,9 @@ export const resolvers: IResolvers = { return null; } - const permssions = await project.$getPermissions(ctx.auth?.user ?? null); + const permissions = await project.$getPermissions(ctx.auth?.user ?? null); - if (!permssions.includes("view")) { + if (!permissions.includes("view")) { return null; } @@ -567,9 +570,9 @@ export const resolvers: IResolvers = { return null; } - const permssions = await project.$getPermissions(ctx.auth?.user ?? null); + const permissions = await project.$getPermissions(ctx.auth?.user ?? null); - if (!permssions.includes("view")) { + if (!permissions.includes("view")) { return null; } @@ -618,6 +621,7 @@ export const resolvers: IResolvers = { const project = await getAdminProject({ id: args.input.id, user: ctx.auth?.user, + withGraphFetched: "account.slackInstallation", }); const data: PartialModelObject = {}; @@ -638,6 +642,10 @@ export const resolvers: IResolvers = { data.summaryCheck = args.input.summaryCheck; } + if (args.input.slackChannelId != null) { + data.slackChannelId = args.input.slackChannelId; + } + if (args.input.name != null && project.name !== args.input.name) { await checkGqlProjectName({ name: args.input.name, diff --git a/apps/backend/src/slack/index.ts b/apps/backend/src/slack/index.ts index 915178690..df02dd309 100644 --- a/apps/backend/src/slack/index.ts +++ b/apps/backend/src/slack/index.ts @@ -172,7 +172,13 @@ const receiver = new Bolt.ExpressReceiver({ clientId: config.get("slack.clientId"), clientSecret: config.get("slack.clientSecret"), stateSecret: config.get("slack.stateSecret"), - scopes: ["links:read", "links:write", "team:read"], + scopes: [ + "links:read", + "links:write", + "team:read", + "chat:write", + "chat:write.public", + ], installationStore, redirectUri: config.get("server.url") + "/auth/slack/oauth_redirect", installerOptions: { @@ -382,4 +388,23 @@ export async function uninstallSlackInstallation( ]); } +/** + * Post a message to a Slack channel. + */ +export async function postMessageToSlackChannel({ + installation, + channel, + text, + blocks, +}: { + installation: SlackInstallation; + channel: string; + text: string; + blocks?: Bolt.types.AnyBlock[]; +}) { + const token = installation.installation.bot?.token; + invariant(token, "Expected bot token to be defined"); + await boltApp.client.chat.postMessage({ token, channel, text, blocks }); +} + export const slackMiddleware: Router = receiver.router; diff --git a/apps/frontend/src/containers/BuildModeIndicator.tsx b/apps/frontend/src/containers/BuildModeIndicator.tsx index ae3d658b5..b8c7bbc76 100644 --- a/apps/frontend/src/containers/BuildModeIndicator.tsx +++ b/apps/frontend/src/containers/BuildModeIndicator.tsx @@ -65,7 +65,7 @@ export const BuildModeIndicator = memo(function BuildModeIndicator(props: { >
diff --git a/apps/frontend/src/containers/Project/Slack.tsx b/apps/frontend/src/containers/Project/Slack.tsx new file mode 100644 index 000000000..1430d36d5 --- /dev/null +++ b/apps/frontend/src/containers/Project/Slack.tsx @@ -0,0 +1,118 @@ +import { useApolloClient } from "@apollo/client"; +import { FormProvider, SubmitHandler, useForm } from "react-hook-form"; +import { useParams } from "react-router-dom"; + +import { FragmentType, graphql, useFragment } from "@/gql"; +import { + Card, + CardBody, + CardFooter, + CardParagraph, + CardTitle, +} from "@/ui/Card"; +import { Form } from "@/ui/Form"; +import { FormCardFooter } from "@/ui/FormCardFooter"; + +import { LinkButton } from "../../ui/Button"; +import { FormTextInput } from "../../ui/FormTextInput"; +import { Link } from "../../ui/Link"; + +const UpdateProjectSlackMutation = graphql(` + mutation ProjectSlack_updateProject($id: ID!, $slackChannelId: String) { + updateProject(input: { id: $id, slackChannelId: $slackChannelId }) { + id + slackChannelId + } + } +`); + +type Inputs = { + slackChannelId: string; +}; + +const ProjectFragment = graphql(` + fragment ProjectSlack_Project on Project { + id + slackChannelId + } +`); + +const SectionTitle = () => Slack; + +export const ProjectSlack = (props: { + project: FragmentType; + slackTeamName: string | null; +}) => { + const { accountSlug } = useParams(); + const project = useFragment(ProjectFragment, props.project); + const client = useApolloClient(); + const form = useForm({ + defaultValues: { + slackChannelId: project.slackChannelId ?? "", + }, + }); + const onSubmit: SubmitHandler = async (data) => { + await client.mutate({ + mutation: UpdateProjectSlackMutation, + variables: { + id: project.id, + slackChannelId: data.slackChannelId, + }, + }); + }; + + return ( + + {props.slackTeamName ? ( + +
+ + + + Setup Slack to get Argos build notifications on{" "} + {props.slackTeamName}{" "} + workspace. + + + {" "} + +
+ The Argos bot can only post in public channels. To enable + posting in a private channel, just invite the Argos bot to it on + Slack. +
+
+ + You can update the connected Slack workspace in{" "} + Team Settings. + +
+
+ ) : ( + <> + + + + Setup Slack to get Argos notifications on your workspace. Connect + your workspace on Team Settings to get started. + + + + + Team Settings + + + + )} +
+ ); +}; diff --git a/apps/frontend/src/gql/gql.ts b/apps/frontend/src/gql/gql.ts index 0b9f08455..a24f10edd 100644 --- a/apps/frontend/src/gql/gql.ts +++ b/apps/frontend/src/gql/gql.ts @@ -61,6 +61,8 @@ const documents = { "\n mutation ProjectGitRepository_linkGitlabProject(\n $projectId: ID!\n $gitlabProjectId: ID!\n ) {\n linkGitlabProject(\n input: { projectId: $projectId, gitlabProjectId: $gitlabProjectId }\n ) {\n id\n ...ProjectGitRepository_Project\n }\n }\n": types.ProjectGitRepository_LinkGitlabProjectDocument, "\n mutation ProjectGitRepository_unlinkGitlabProject($projectId: ID!) {\n unlinkGitlabProject(input: { projectId: $projectId }) {\n id\n ...ProjectGitRepository_Project\n }\n }\n": types.ProjectGitRepository_UnlinkGitlabProjectDocument, "\n mutation ProjectGitRepository_updateEnablePrComment(\n $projectId: ID!\n $enabled: Boolean!\n ) {\n updateProjectPrComment(\n input: { projectId: $projectId, enabled: $enabled }\n ) {\n id\n prCommentEnabled\n }\n }\n": types.ProjectGitRepository_UpdateEnablePrCommentDocument, + "\n mutation ProjectSlack_updateProject($id: ID!, $slackChannelId: String) {\n updateProject(input: { id: $id, slackChannelId: $slackChannelId }) {\n id\n slackChannelId\n }\n }\n": types.ProjectSlack_UpdateProjectDocument, + "\n fragment ProjectSlack_Project on Project {\n id\n slackChannelId\n }\n": types.ProjectSlack_ProjectFragmentDoc, "\n mutation ProjectStatusChecks_updateProject(\n $id: ID!\n $summaryCheck: SummaryCheck\n ) {\n updateProject(input: { id: $id, summaryCheck: $summaryCheck }) {\n id\n summaryCheck\n }\n }\n": types.ProjectStatusChecks_UpdateProjectDocument, "\n fragment ProjectStatusChecks_Project on Project {\n id\n summaryCheck\n }\n": types.ProjectStatusChecks_ProjectFragmentDoc, "\n fragment ProjectToken_Project on Project {\n token\n }\n": types.ProjectToken_ProjectFragmentDoc, @@ -128,7 +130,7 @@ const documents = { "\n query ProjectBuilds_project_Builds(\n $accountSlug: String!\n $projectName: String!\n $after: Int!\n $first: Int!\n $buildName: String\n ) {\n project(\n accountSlug: $accountSlug\n projectName: $projectName\n buildName: $buildName\n ) {\n id\n builds(first: $first, after: $after, buildName: $buildName) {\n pageInfo {\n totalCount\n hasNextPage\n }\n edges {\n id\n number\n createdAt\n name\n branch\n commit\n mode\n stats {\n ...BuildStatsIndicator_BuildStats\n }\n pullRequest {\n id\n ...PullRequestButton_PullRequest\n }\n ...BuildStatusChip_Build\n }\n }\n }\n }\n": types.ProjectBuilds_Project_BuildsDocument, "\n fragment GettingStarted_Project on Project {\n token\n }\n": types.GettingStarted_ProjectFragmentDoc, "\n query ProjectLatestAutoApproved_project(\n $accountSlug: String!\n $projectName: String!\n ) {\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n latestAutoApprovedBuild {\n id\n number\n }\n }\n }\n": types.ProjectLatestAutoApproved_ProjectDocument, - "\n query ProjectSettings_project($accountSlug: String!, $projectName: String!) {\n account(slug: $accountSlug) {\n id\n ... on Team {\n plan {\n id\n fineGrainedAccessControlIncluded\n }\n }\n }\n\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n ...ProjectBadge_Project\n ...ProjectChangeName_Project\n ...ProjectToken_Project\n ...ProjectBranches_Project\n ...ProjectStatusChecks_Project\n ...ProjectVisibility_Project\n ...ProjectTransfer_Project\n ...ProjectDelete_Project\n ...ProjectGitRepository_Project\n ...ProjectContributors_Project\n }\n }\n": types.ProjectSettings_ProjectDocument, + "\n query ProjectSettings_project($accountSlug: String!, $projectName: String!) {\n account(slug: $accountSlug) {\n id\n ... on Team {\n slackInstallation {\n id\n teamName\n }\n plan {\n id\n fineGrainedAccessControlIncluded\n }\n }\n }\n\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n ...ProjectBadge_Project\n ...ProjectChangeName_Project\n ...ProjectToken_Project\n ...ProjectBranches_Project\n ...ProjectStatusChecks_Project\n ...ProjectVisibility_Project\n ...ProjectSlack_Project\n ...ProjectTransfer_Project\n ...ProjectDelete_Project\n ...ProjectGitRepository_Project\n ...ProjectContributors_Project\n }\n }\n": types.ProjectSettings_ProjectDocument, "\n query Project_project($accountSlug: String!, $projectName: String!) {\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n permissions\n name\n account {\n id\n ...PaymentBanner_Account\n }\n }\n }\n": types.Project_ProjectDocument, }; @@ -334,6 +336,14 @@ export function graphql(source: "\n mutation ProjectGitRepository_unlinkGitlabP * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n mutation ProjectGitRepository_updateEnablePrComment(\n $projectId: ID!\n $enabled: Boolean!\n ) {\n updateProjectPrComment(\n input: { projectId: $projectId, enabled: $enabled }\n ) {\n id\n prCommentEnabled\n }\n }\n"): (typeof documents)["\n mutation ProjectGitRepository_updateEnablePrComment(\n $projectId: ID!\n $enabled: Boolean!\n ) {\n updateProjectPrComment(\n input: { projectId: $projectId, enabled: $enabled }\n ) {\n id\n prCommentEnabled\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n mutation ProjectSlack_updateProject($id: ID!, $slackChannelId: String) {\n updateProject(input: { id: $id, slackChannelId: $slackChannelId }) {\n id\n slackChannelId\n }\n }\n"): (typeof documents)["\n mutation ProjectSlack_updateProject($id: ID!, $slackChannelId: String) {\n updateProject(input: { id: $id, slackChannelId: $slackChannelId }) {\n id\n slackChannelId\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n fragment ProjectSlack_Project on Project {\n id\n slackChannelId\n }\n"): (typeof documents)["\n fragment ProjectSlack_Project on Project {\n id\n slackChannelId\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -605,7 +615,7 @@ export function graphql(source: "\n query ProjectLatestAutoApproved_project(\n /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query ProjectSettings_project($accountSlug: String!, $projectName: String!) {\n account(slug: $accountSlug) {\n id\n ... on Team {\n plan {\n id\n fineGrainedAccessControlIncluded\n }\n }\n }\n\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n ...ProjectBadge_Project\n ...ProjectChangeName_Project\n ...ProjectToken_Project\n ...ProjectBranches_Project\n ...ProjectStatusChecks_Project\n ...ProjectVisibility_Project\n ...ProjectTransfer_Project\n ...ProjectDelete_Project\n ...ProjectGitRepository_Project\n ...ProjectContributors_Project\n }\n }\n"): (typeof documents)["\n query ProjectSettings_project($accountSlug: String!, $projectName: String!) {\n account(slug: $accountSlug) {\n id\n ... on Team {\n plan {\n id\n fineGrainedAccessControlIncluded\n }\n }\n }\n\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n ...ProjectBadge_Project\n ...ProjectChangeName_Project\n ...ProjectToken_Project\n ...ProjectBranches_Project\n ...ProjectStatusChecks_Project\n ...ProjectVisibility_Project\n ...ProjectTransfer_Project\n ...ProjectDelete_Project\n ...ProjectGitRepository_Project\n ...ProjectContributors_Project\n }\n }\n"]; +export function graphql(source: "\n query ProjectSettings_project($accountSlug: String!, $projectName: String!) {\n account(slug: $accountSlug) {\n id\n ... on Team {\n slackInstallation {\n id\n teamName\n }\n plan {\n id\n fineGrainedAccessControlIncluded\n }\n }\n }\n\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n ...ProjectBadge_Project\n ...ProjectChangeName_Project\n ...ProjectToken_Project\n ...ProjectBranches_Project\n ...ProjectStatusChecks_Project\n ...ProjectVisibility_Project\n ...ProjectSlack_Project\n ...ProjectTransfer_Project\n ...ProjectDelete_Project\n ...ProjectGitRepository_Project\n ...ProjectContributors_Project\n }\n }\n"): (typeof documents)["\n query ProjectSettings_project($accountSlug: String!, $projectName: String!) {\n account(slug: $accountSlug) {\n id\n ... on Team {\n slackInstallation {\n id\n teamName\n }\n plan {\n id\n fineGrainedAccessControlIncluded\n }\n }\n }\n\n project(accountSlug: $accountSlug, projectName: $projectName) {\n id\n ...ProjectBadge_Project\n ...ProjectChangeName_Project\n ...ProjectToken_Project\n ...ProjectBranches_Project\n ...ProjectStatusChecks_Project\n ...ProjectVisibility_Project\n ...ProjectSlack_Project\n ...ProjectTransfer_Project\n ...ProjectDelete_Project\n ...ProjectGitRepository_Project\n ...ProjectContributors_Project\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/apps/frontend/src/gql/graphql.ts b/apps/frontend/src/gql/graphql.ts index 5eb09d38c..076e94762 100644 --- a/apps/frontend/src/gql/graphql.ts +++ b/apps/frontend/src/gql/graphql.ts @@ -643,6 +643,8 @@ export type Project = Node & { public: Scalars['Boolean']['output']; /** Repository associated to the project */ repository?: Maybe; + /** Slack channel */ + slackChannelId?: Maybe; /** Project slug */ slug: Scalars['String']['output']; /** Summary check */ @@ -1099,6 +1101,7 @@ export type UpdateProjectInput = { id: Scalars['ID']['input']; name?: InputMaybe; private?: InputMaybe; + slackChannelId?: InputMaybe; summaryCheck?: InputMaybe; }; @@ -1526,6 +1529,16 @@ export type ProjectGitRepository_UpdateEnablePrCommentMutationVariables = Exact< export type ProjectGitRepository_UpdateEnablePrCommentMutation = { __typename?: 'Mutation', updateProjectPrComment: { __typename?: 'Project', id: string, prCommentEnabled: boolean } }; +export type ProjectSlack_UpdateProjectMutationVariables = Exact<{ + id: Scalars['ID']['input']; + slackChannelId?: InputMaybe; +}>; + + +export type ProjectSlack_UpdateProjectMutation = { __typename?: 'Mutation', updateProject: { __typename?: 'Project', id: string, slackChannelId?: string | null } }; + +export type ProjectSlack_ProjectFragment = { __typename?: 'Project', id: string, slackChannelId?: string | null } & { ' $fragmentName'?: 'ProjectSlack_ProjectFragment' }; + export type ProjectStatusChecks_UpdateProjectMutationVariables = Exact<{ id: Scalars['ID']['input']; summaryCheck?: InputMaybe; @@ -2032,9 +2045,9 @@ export type ProjectSettings_ProjectQueryVariables = Exact<{ }>; -export type ProjectSettings_ProjectQuery = { __typename?: 'Query', account?: { __typename?: 'Team', id: string, plan?: { __typename?: 'Plan', id: string, fineGrainedAccessControlIncluded: boolean } | null } | { __typename?: 'User', id: string } | null, project?: ( +export type ProjectSettings_ProjectQuery = { __typename?: 'Query', account?: { __typename?: 'Team', id: string, slackInstallation?: { __typename?: 'SlackInstallation', id: string, teamName: string } | null, plan?: { __typename?: 'Plan', id: string, fineGrainedAccessControlIncluded: boolean } | null } | { __typename?: 'User', id: string } | null, project?: ( { __typename?: 'Project', id: string } - & { ' $fragmentRefs'?: { 'ProjectBadge_ProjectFragment': ProjectBadge_ProjectFragment;'ProjectChangeName_ProjectFragment': ProjectChangeName_ProjectFragment;'ProjectToken_ProjectFragment': ProjectToken_ProjectFragment;'ProjectBranches_ProjectFragment': ProjectBranches_ProjectFragment;'ProjectStatusChecks_ProjectFragment': ProjectStatusChecks_ProjectFragment;'ProjectVisibility_ProjectFragment': ProjectVisibility_ProjectFragment;'ProjectTransfer_ProjectFragment': ProjectTransfer_ProjectFragment;'ProjectDelete_ProjectFragment': ProjectDelete_ProjectFragment;'ProjectGitRepository_ProjectFragment': ProjectGitRepository_ProjectFragment;'ProjectContributors_ProjectFragment': ProjectContributors_ProjectFragment } } + & { ' $fragmentRefs'?: { 'ProjectBadge_ProjectFragment': ProjectBadge_ProjectFragment;'ProjectChangeName_ProjectFragment': ProjectChangeName_ProjectFragment;'ProjectToken_ProjectFragment': ProjectToken_ProjectFragment;'ProjectBranches_ProjectFragment': ProjectBranches_ProjectFragment;'ProjectStatusChecks_ProjectFragment': ProjectStatusChecks_ProjectFragment;'ProjectVisibility_ProjectFragment': ProjectVisibility_ProjectFragment;'ProjectSlack_ProjectFragment': ProjectSlack_ProjectFragment;'ProjectTransfer_ProjectFragment': ProjectTransfer_ProjectFragment;'ProjectDelete_ProjectFragment': ProjectDelete_ProjectFragment;'ProjectGitRepository_ProjectFragment': ProjectGitRepository_ProjectFragment;'ProjectContributors_ProjectFragment': ProjectContributors_ProjectFragment } } ) | null }; export type Project_ProjectQueryVariables = Exact<{ @@ -2072,6 +2085,7 @@ export const RemoveFromProjectDialog_UserFragmentDoc = {"kind":"Document","defin export const ContributorListRow_UserFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorListRow_user"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"projectsContributedOn"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"IntValue","value":"1"}},{"kind":"Argument","name":{"kind":"Name","value":"projectId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"level"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserListRow_user"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AccountAvatarFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AccountAvatar"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"size"},"value":{"kind":"IntValue","value":"64"}}]},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"initial"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserListRow_user"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AccountAvatarFragment"}}]}}]}}]} as unknown as DocumentNode; export const ProjectDelete_ProjectFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectDelete_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]} as unknown as DocumentNode; export const ProjectGitRepository_ProjectFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectGitRepository_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"prCommentEnabled"}}]}}]} as unknown as DocumentNode; +export const ProjectSlack_ProjectFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectSlack_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slackChannelId"}}]}}]} as unknown as DocumentNode; export const ProjectStatusChecks_ProjectFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectStatusChecks_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"summaryCheck"}}]}}]} as unknown as DocumentNode; export const ProjectToken_ProjectFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectToken_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}}]}}]} as unknown as DocumentNode; export const ProjectTransfer_AccountFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectTransfer_Account"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Account"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AccountAvatarFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AccountAvatarFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AccountAvatar"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"size"},"value":{"kind":"IntValue","value":"64"}}]},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"initial"}}]}}]} as unknown as DocumentNode; @@ -2133,6 +2147,7 @@ export const ProjectGitRepository_UnlinkGithubRepositoryDocument = {"kind":"Docu export const ProjectGitRepository_LinkGitlabProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ProjectGitRepository_linkGitlabProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gitlabProjectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"linkGitlabProject"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"projectId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"gitlabProjectId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gitlabProjectId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectGitRepository_Project"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectGitRepository_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"prCommentEnabled"}}]}}]} as unknown as DocumentNode; export const ProjectGitRepository_UnlinkGitlabProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ProjectGitRepository_unlinkGitlabProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unlinkGitlabProject"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"projectId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectGitRepository_Project"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectGitRepository_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"prCommentEnabled"}}]}}]} as unknown as DocumentNode; export const ProjectGitRepository_UpdateEnablePrCommentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ProjectGitRepository_updateEnablePrComment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"enabled"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateProjectPrComment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"projectId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"enabled"},"value":{"kind":"Variable","name":{"kind":"Name","value":"enabled"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"prCommentEnabled"}}]}}]}}]} as unknown as DocumentNode; +export const ProjectSlack_UpdateProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ProjectSlack_updateProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slackChannelId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateProject"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"slackChannelId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slackChannelId"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slackChannelId"}}]}}]}}]} as unknown as DocumentNode; export const ProjectStatusChecks_UpdateProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ProjectStatusChecks_updateProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"summaryCheck"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SummaryCheck"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateProject"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"summaryCheck"},"value":{"kind":"Variable","name":{"kind":"Name","value":"summaryCheck"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"summaryCheck"}}]}}]}}]} as unknown as DocumentNode; export const TransferProject_MeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"TransferProject_me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AccountItem_Account"}},{"kind":"Field","name":{"kind":"Name","value":"teams"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AccountItem_Account"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AccountAvatarFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AccountAvatar"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"size"},"value":{"kind":"IntValue","value":"64"}}]},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"initial"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AccountPlanChip_Account"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Account"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionStatus"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AccountItem_Account"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Account"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AccountAvatarFragment"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AccountPlanChip_Account"}}]}}]} as unknown as DocumentNode; export const ProjectTransfer_ReviewDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectTransfer_Review"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"actualAccountId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"targetAccountId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projectById"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"builds"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalScreenshots"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"actualAccount"},"name":{"kind":"Name","value":"accountById"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"actualAccountId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectTransfer_Account"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"targetAccount"},"name":{"kind":"Name","value":"accountById"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"targetAccountId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectTransfer_Account"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AccountAvatarFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AccountAvatar"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"size"},"value":{"kind":"IntValue","value":"64"}}]},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"initial"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectTransfer_Account"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Account"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AccountAvatarFragment"}}]}}]}}]} as unknown as DocumentNode; @@ -2165,5 +2180,5 @@ export const Invite_AcceptInvitationDocument = {"kind":"Document","definitions": export const ProjectBuilds_ProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectBuilds_project"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"projectName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"buildNames"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"GettingStarted_Project"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GettingStarted_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}}]}}]} as unknown as DocumentNode; export const ProjectBuilds_Project_BuildsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectBuilds_project_Builds"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"buildName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"projectName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}}},{"kind":"Argument","name":{"kind":"Name","value":"buildName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"buildName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"builds"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}},{"kind":"Argument","name":{"kind":"Name","value":"buildName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"buildName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"branch"}},{"kind":"Field","name":{"kind":"Name","value":"commit"}},{"kind":"Field","name":{"kind":"Name","value":"mode"}},{"kind":"Field","name":{"kind":"Name","value":"stats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BuildStatsIndicator_BuildStats"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pullRequest"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"PullRequestButton_PullRequest"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"BuildStatusChip_Build"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PullRequestStatusIcon_PullRequest"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PullRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"draft"}},{"kind":"Field","name":{"kind":"Name","value":"merged"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PullRequestInfo_PullRequest"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PullRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"draft"}},{"kind":"Field","name":{"kind":"Name","value":"merged"}},{"kind":"Field","name":{"kind":"Name","value":"mergedAt"}},{"kind":"Field","name":{"kind":"Name","value":"closedAt"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"PullRequestStatusIcon_PullRequest"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GithubPullRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"creator"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BuildStatusDescription_Build"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Build"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"mode"}},{"kind":"Field","name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","name":{"kind":"Name","value":"stats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}}]}},{"kind":"Field","name":{"kind":"Name","value":"parallel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"received"}},{"kind":"Field","name":{"kind":"Name","value":"nonce"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BuildStatsIndicator_BuildStats"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BuildStats"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"failure"}},{"kind":"Field","name":{"kind":"Name","value":"changed"}},{"kind":"Field","name":{"kind":"Name","value":"added"}},{"kind":"Field","name":{"kind":"Name","value":"removed"}},{"kind":"Field","name":{"kind":"Name","value":"unchanged"}},{"kind":"Field","name":{"kind":"Name","value":"retryFailure"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PullRequestButton_PullRequest"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PullRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"PullRequestStatusIcon_PullRequest"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"PullRequestInfo_PullRequest"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BuildStatusChip_Build"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Build"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BuildStatusDescription_Build"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]} as unknown as DocumentNode; export const ProjectLatestAutoApproved_ProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectLatestAutoApproved_project"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"projectName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"latestAutoApprovedBuild"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"number"}}]}}]}}]}}]} as unknown as DocumentNode; -export const ProjectSettings_ProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectSettings_project"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Team"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fineGrainedAccessControlIncluded"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"projectName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectBadge_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectChangeName_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectToken_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectBranches_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectStatusChecks_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectVisibility_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectTransfer_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectDelete_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectGitRepository_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectContributors_Project"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectBadge_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectChangeName_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectToken_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectBranches_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"customDefaultBaseBranch"}},{"kind":"Field","name":{"kind":"Name","value":"customAutoApprovedBranchGlob"}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"defaultBranch"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectStatusChecks_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"summaryCheck"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectVisibility_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"private"}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"private"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectTransfer_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectDelete_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectGitRepository_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"prCommentEnabled"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectContributors_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"}}]}}]} as unknown as DocumentNode; +export const ProjectSettings_ProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectSettings_project"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"account"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Team"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slackInstallation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"teamName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fineGrainedAccessControlIncluded"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"projectName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectBadge_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectChangeName_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectToken_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectBranches_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectStatusChecks_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectVisibility_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectSlack_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectTransfer_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectDelete_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectGitRepository_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectContributors_Project"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectBadge_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectChangeName_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectToken_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectBranches_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"customDefaultBaseBranch"}},{"kind":"Field","name":{"kind":"Name","value":"customAutoApprovedBranchGlob"}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"defaultBranch"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectStatusChecks_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"summaryCheck"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectVisibility_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"private"}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"private"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectSlack_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slackChannelId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectTransfer_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectDelete_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectGitRepository_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repository"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fullName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"prCommentEnabled"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectContributors_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"}}]}}]} as unknown as DocumentNode; export const Project_ProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Project_project"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"accountSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"accountSlug"}}},{"kind":"Argument","name":{"kind":"Name","value":"projectName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectName"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"account"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"PaymentBanner_Account"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PaymentBanner_Account"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Account"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subscriptionStatus"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"}},{"kind":"Field","name":{"kind":"Name","value":"stripeCustomerId"}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"trialDaysRemaining"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/apps/frontend/src/pages/Project/Settings.tsx b/apps/frontend/src/pages/Project/Settings.tsx index 0d1117b14..c661ba75f 100644 --- a/apps/frontend/src/pages/Project/Settings.tsx +++ b/apps/frontend/src/pages/Project/Settings.tsx @@ -9,6 +9,7 @@ import { ProjectChangeName } from "@/containers/Project/ChangeName"; import { ProjectContributors } from "@/containers/Project/Contributors"; import { ProjectDelete } from "@/containers/Project/Delete"; import { ProjectGitRepository } from "@/containers/Project/GitRepository"; +import { ProjectSlack } from "@/containers/Project/Slack"; import { ProjectStatusChecks } from "@/containers/Project/StatusChecks"; import { ProjectToken } from "@/containers/Project/Token"; import { ProjectTransfer } from "@/containers/Project/Transfer"; @@ -27,6 +28,10 @@ const ProjectQuery = graphql(` account(slug: $accountSlug) { id ... on Team { + slackInstallation { + id + teamName + } plan { id fineGrainedAccessControlIncluded @@ -42,6 +47,7 @@ const ProjectQuery = graphql(` ...ProjectBranches_Project ...ProjectStatusChecks_Project ...ProjectVisibility_Project + ...ProjectSlack_Project ...ProjectTransfer_Project ...ProjectDelete_Project ...ProjectGitRepository_Project @@ -105,6 +111,14 @@ export function Component() { {hasAdminPermission && } {hasAdminPermission && } + {hasAdminPermission && ( + + )} {fineGrainedAccessControlIncluded && ( )} diff --git a/package.json b/package.json index 9725fe70a..e1b0ec3a2 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "github-light-webhook-proxy": "NODE_TLS_REJECT_UNAUTHORIZED=0 smee --url https://smee.io/T3JFnf2lr3Zq6 --target https://api.argos-ci.dev:4001/github-light/event-handler", "slack-webhook-proxy": "ngrok http --host-header=rewrite --domain=foal-great-publicly.ngrok-free.app https://app.argos-ci.dev:4001", "stripe-webhook-proxy": "stripe listen --forward-to https://api.argos-ci.dev:4001/stripe/event-handler", + "create-local-build": "NODE_TLS_REJECT_UNAUTHORIZED=0 ARGOS_API_BASE_URL=https://api.argos-ci.dev:4001/v2 npm exec -- @argos-ci/cli upload --token big-650ded7d72e85b52e099df6e56aa204d4fe9 ./apps/backend/src/screenshot-diff/__fixtures__/", "lint": "eslint .", "check-types": "turbo run check-types", "check-format": "turbo run check-format",