Link to git credentials in case of 401, improve Force Push text

This commit is contained in:
Alex Gleason committed 2025-12-24 18:05:44 -06:00
1 parent 99764670ef
commit 21df7fe3dd
2 files changed
+9 -8

No files matched your search

@@ -33,11 +33,11 @@ export function ForcePushDialog({
<DialogHeader>
<DialogTitle className="flex items-center gap-2">
<AlertTriangle className="h-5 w-5 text-destructive" />
Force Push - Overwrite Remote History?
Force Push to {remoteName}?
</DialogTitle>
<DialogDescription className="space-y-3">
<p>
This will <strong className="text-destructive">completely overwrite the remote repository</strong> on <strong>{remoteName}</strong> with your local version, permanently deleting any commits and changes on {remoteName} that don't exist locally.
This will <strong className="text-destructive">completely overwrite the commit history on {remoteName}</strong> with your local version, permanently deleting any commits and changes on {remoteName} that don't exist locally.
</p>
<div className="rounded-md bg-destructive/10 p-3 text-sm border border-destructive/20">
<p className="font-medium text-destructive mb-1">What will be deleted from {remoteName}:</p>
@@ -1,7 +1,8 @@
import { Errors as GitErrors } from 'isomorphic-git';
import { AlertTriangle, X, ArrowDown } from 'lucide-react';
import { X, ArrowDown, ArrowUp } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Alert, AlertDescription } from '@/components/ui/alert';
import { Link } from 'react-router-dom';
interface SyncStepErrorProps {
error: Error;
@@ -19,7 +20,7 @@ export function SyncStepError({ error, onDismiss, onForcePull, onForcePush, onPu
onClick={onForcePull}
className="w-full hover:bg-destructive-foreground/20 border-destructive-foreground/20"
>
<AlertTriangle className="h-4 w-4" />
<ArrowDown className="size-4" />
Force Pull
</Button>
);
@@ -31,7 +32,7 @@ export function SyncStepError({ error, onDismiss, onForcePull, onForcePush, onPu
onClick={onForcePush}
className="w-full hover:bg-destructive-foreground/20 border-destructive-foreground/20"
>
<AlertTriangle className="h-4 w-4" />
<ArrowUp className="size-4" />
Force Push
</Button>
);
@@ -42,7 +43,7 @@ export function SyncStepError({ error, onDismiss, onForcePull, onForcePush, onPu
size="sm"
onClick={onPull}
>
<ArrowDown className="h-4 w-4" />
<ArrowDown className="size-4" />
Pull
</Button>
);
@@ -120,11 +121,11 @@ export function SyncStepError({ error, onDismiss, onForcePull, onForcePush, onPu
// HTTP errors
if (error instanceof GitErrors.HttpError) {
let message: string;
let message: React.ReactNode;
switch (error.data.statusCode) {
case 401:
message = 'Authentication failed. Please check your credentials.';
message = <>Authentication failed. Please check your <Link to="/settings/git" className="underline">git credentials</Link>.</>
break;
case 403:
message = 'Access forbidden. You do not have permission to access this repository.';