[INS-1473] fix credentials not reloading in Git form (#9470)

* fix: ensure credentials are returned as an object for GitHub and GitLab loaders

* chore: update padding tailwind class in project create form checkbox

* fix: prevent default behavior on sign out button click for GitHub and GitLab forms
This commit is contained in:
James Gatz
2025-12-11 19:24:48 +01:00
committed by GitHub
parent 20e48b11d7
commit aa2f2b1b23
5 changed files with 11 additions and 7 deletions

View File

@@ -8,7 +8,9 @@ import type { Route } from './+types/git-credentials.github';
export async function clientLoader(_args: Route.ClientActionArgs) {
const credentials = await gitCredentials.getByProvider('github');
return credentials;
return {
credentials,
};
}
export const useGitHubCredentialsFetcher = createFetcherLoadHook(

View File

@@ -8,7 +8,7 @@ import type { Route } from './+types/git-credentials.gitlab';
export async function clientLoader(_args: Route.ClientActionArgs) {
const credentials = await gitCredentials.getByProvider('gitlab');
return credentials;
return { credentials };
}
export const useGitLabCredentialsFetcher = createFetcherLoadHook(

View File

@@ -28,7 +28,7 @@ export const GitHubRepositorySetupFormGroup = (props: Props) => {
}
}, [githubTokenLoader]);
const credentials = githubTokenLoader.data;
const credentials = githubTokenLoader.data?.credentials;
if (!credentials?.token) {
return <GitHubSignInForm />;
@@ -123,7 +123,8 @@ const GitHubRepositoryForm = ({
</div>
<PromptButton
confirmMessage="Confirm"
onClick={() => {
onClick={e => {
e.preventDefault();
signOutFetcher.submit();
}}
>

View File

@@ -27,7 +27,7 @@ export const GitLabRepositorySetupFormGroup = (props: Props) => {
}
}, [gitlabTokenLoader]);
const credentials = gitlabTokenLoader.data;
const credentials = gitlabTokenLoader.data?.credentials;
if (!credentials?.token) {
return <GitLabSignInForm />;
@@ -105,7 +105,8 @@ const GitLabRepositoryForm = ({ uri, credentials, onSubmit }: GitLabRepositoryFo
</div>
</div>
<PromptButton
onClick={() => {
onClick={e => {
e.preventDefault();
signOutFetcher.submit();
}}
>

View File

@@ -141,7 +141,7 @@ export const ProjectCreateForm: FC<Props> = ({
slot={null}
isSelected={projectData.connectRepositoryLater}
onChange={isSelected => setProjectData(prev => ({ ...prev, connectRepositoryLater: isSelected }))}
className="group mt-4 flex h-full items-center gap-2 p-0 pl-[1px]"
className="group mt-4 flex h-full items-center gap-2 p-0 pl-px"
>
<div className="flex h-4 w-4 items-center justify-center rounded-sm ring-1 ring-(--hl-sm) transition-colors group-focus:ring-2 group-data-selected:bg-(--hl-xs)">
<Icon