Skip to content

Commit c74f1c8

Browse files
committed
Add link to configure repo access in gh
1 parent 7e9dff3 commit c74f1c8

File tree

1 file changed

+16
-4
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings

1 file changed

+16
-4
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings/route.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ import { useEnvironment } from "~/hooks/useEnvironment";
7878
import { DateTime } from "~/components/primitives/DateTime";
7979
import { checkGitHubBranchExists } from "~/services/gitHub.server";
8080
import { tryCatch } from "@trigger.dev/core";
81+
import { TextLink } from "~/components/primitives/TextLink";
82+
import { cn } from "~/utils/cn";
8183

8284
export const meta: MetaFunction = () => {
8385
return [
@@ -154,6 +156,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
154156
id: true,
155157
accountHandle: true,
156158
targetType: true,
159+
appInstallationId: true,
157160
repositories: {
158161
select: {
159162
id: true,
@@ -660,6 +663,7 @@ type GitHubRepository = {
660663

661664
type GitHubAppInstallation = {
662665
id: string;
666+
appInstallationId: bigint;
663667
targetType: string;
664668
accountHandle: string;
665669
repositories: GitHubRepository[];
@@ -810,6 +814,16 @@ function ConnectGitHubRepoModal({
810814
))
811815
}
812816
</Select>
817+
<Hint className={cn("invisible", selectedInstallation && "visible")}>
818+
Configure repository access in{" "}
819+
<TextLink
820+
target="_blank"
821+
to={`https://github.com/settings/installations/${selectedInstallation?.appInstallationId}`}
822+
>
823+
GitHub
824+
</TextLink>
825+
.
826+
</Hint>
813827
<FormError id={repositoryId.errorId}>{repositoryId.error}</FormError>
814828
</InputGroup>
815829
<FormError>{form.error}</FormError>
@@ -965,16 +979,14 @@ function ConnectedGitHubRepoForm({
965979
</div>
966980
<Dialog>
967981
<DialogTrigger asChild>
968-
<Button variant="minimal/small">
969-
Disconnect
970-
</Button>
982+
<Button variant="minimal/small">Disconnect</Button>
971983
</DialogTrigger>
972984
<DialogContent className="max-w-md">
973985
<DialogHeader>Disconnect GitHub repository</DialogHeader>
974986
<div className="flex flex-col gap-3 pt-3">
975987
<Paragraph className="mb-1">
976988
Are you sure you want to disconnect{" "}
977-
<span className="font-semibold">{connectedGitHubRepo.repository.fullName}</span>?
989+
<span className="font-semibold">{connectedGitHubRepo.repository.fullName}</span>?
978990
This will stop automatic deployments from GitHub.
979991
</Paragraph>
980992
<FormButtons

0 commit comments

Comments
 (0)