Skip to content

Commit c31bb08

Browse files
authored
feat: add github app configuration link (Kong#9651)
1 parent 5cbda1a commit c31bb08

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/insomnia/src/ui/components/git-credentials/git-repository-select.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Button, ComboBox, FieldError, Input, Label, ListBox, ListBoxItem, Popov
33

44
import { fuzzyMatch } from '~/common/misc';
55
import { useGitProviderRepositoriesLoaderFetcher } from '~/routes/git-provider.repositories';
6+
import type { GitRemoteProviderType } from '~/sync/git/providers/types';
67

78
import { Icon } from '../icon';
89

@@ -11,11 +12,13 @@ export const GitRepositorySelect = ({
1112
onSelect,
1213
credentialsId,
1314
allConnectedRepoURIProjectNameMap,
15+
providerType,
1416
}: {
1517
onSelect: (repoUri: string) => void;
1618
uri?: string;
1719
credentialsId?: string;
1820
allConnectedRepoURIProjectNameMap?: Record<string, string> | undefined;
21+
providerType?: GitRemoteProviderType;
1922
}) => {
2023
const getGitProviderRepositoriesFetcher = useGitProviderRepositoriesLoaderFetcher();
2124
const lastLoadedCredentialsIdRef = useRef<string | undefined>();
@@ -86,6 +89,7 @@ export const GitRepositorySelect = ({
8689
<Icon icon="caret-down" className="w-5 shrink-0" />
8790
</Button>
8891
</div>
92+
8993
{/* There ought to be only on react-aria Button under ComboBox, so we use the original button here */}
9094
<button
9195
type="button"
@@ -101,6 +105,18 @@ export const GitRepositorySelect = ({
101105
<Icon icon="refresh" className={loading ? 'animate-spin' : ''} />
102106
</button>
103107
</div>
108+
{providerType === 'github' && (
109+
<span className={`flex gap-1 p-2 text-xs ${loading ? 'opacity-40' : ''}`}>
110+
<Icon icon="info-circle" className="text-(--hl)" />
111+
<span>Can't find a repository?</span>
112+
<a
113+
className="flex items-center gap-1 text-(--color-surprise)"
114+
href="https://github.com/apps/insomnia-desktop/installations/select_target"
115+
>
116+
Configure on GitHub <i className="fa-solid fa-up-right-from-square" />
117+
</a>
118+
</span>
119+
)}
104120
<Popover
105121
className="grid w-(--trigger-width) min-w-max grid-flow-col divide-x divide-solid divide-(--hl-md) overflow-y-auto rounded-md border border-solid border-(--hl-sm) bg-(--color-bg) text-sm shadow-lg select-none focus:outline-hidden"
106122
placement="bottom start"

packages/insomnia/src/ui/components/project/git-repo-form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ export const GitRepoForm: FC<Props> = ({
273273
}))
274274
}
275275
credentialsId={selectedCredentialsId}
276+
providerType={selectedProvider.type}
276277
/>
277278
) : (
278279
<Input

0 commit comments

Comments
 (0)