Perfect! I've successfully removed the authentication requirement from the GitActionsDialog. Here's what I changed: (#1291)
## Changes Made
**File: `frontend/src/components/dialogs/tasks/GitActionsDialog.tsx`**
1. **Removed imports** (lines 27-28):
- Removed `useAuth` hook import
- Removed `LoginRequiredPrompt` component import
2. **Removed auth check** (line 107):
- Removed `const { isSignedIn, isLoaded } = useAuth();`
3. **Updated loading condition** (line 129):
- Removed `!isLoaded` from the isLoading check
4. **Removed login prompt** (lines 145-154):
- Deleted the entire `!isSignedIn` conditional block that displayed `LoginRequiredPrompt`
- Now the `GitOperations` component is always rendered when data is loaded
## Result
The Git Actions dialog is now accessible to everyone without requiring VK sign-in. Users can perform:
- ✅ **Merge** operations (local git)
- ✅ **Rebase** operations (local git)
- ✅ **Branch changes** (local git)
- ⚠️ **Push/PR operations** will still require `gh` CLI authentication, but the backend will handle those errors appropriately
The dialog will no longer block users with a login prompt - all git operations are accessible immediately.
This commit is contained in:
committed by
Louis Knight-Webb
parent
e1f69e2a9d
commit
abf3242402
@@ -24,8 +24,6 @@ import type {
|
|||||||
TaskWithAttemptStatus,
|
TaskWithAttemptStatus,
|
||||||
} from 'shared/types';
|
} from 'shared/types';
|
||||||
import NiceModal, { useModal } from '@ebay/nice-modal-react';
|
import NiceModal, { useModal } from '@ebay/nice-modal-react';
|
||||||
import { useAuth } from '@/hooks';
|
|
||||||
import { LoginRequiredPrompt } from '@/components/dialogs/shared/LoginRequiredPrompt';
|
|
||||||
|
|
||||||
export interface GitActionsDialogProps {
|
export interface GitActionsDialogProps {
|
||||||
attemptId: string;
|
attemptId: string;
|
||||||
@@ -104,7 +102,6 @@ export const GitActionsDialog = NiceModal.create<GitActionsDialogProps>(
|
|||||||
const modal = useModal();
|
const modal = useModal();
|
||||||
const { t } = useTranslation('tasks');
|
const { t } = useTranslation('tasks');
|
||||||
const { project } = useProject();
|
const { project } = useProject();
|
||||||
const { isSignedIn, isLoaded } = useAuth();
|
|
||||||
|
|
||||||
const effectiveProjectId = providedProjectId ?? project?.id;
|
const effectiveProjectId = providedProjectId ?? project?.id;
|
||||||
const { data: attempt } = useTaskAttempt(attemptId);
|
const { data: attempt } = useTaskAttempt(attemptId);
|
||||||
@@ -129,7 +126,7 @@ export const GitActionsDialog = NiceModal.create<GitActionsDialogProps>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isLoading =
|
const isLoading =
|
||||||
!attempt || !effectiveProjectId || loadingBranches || !task || !isLoaded;
|
!attempt || !effectiveProjectId || loadingBranches || !task;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={modal.visible} onOpenChange={handleOpenChange}>
|
<Dialog open={modal.visible} onOpenChange={handleOpenChange}>
|
||||||
@@ -142,16 +139,6 @@ export const GitActionsDialog = NiceModal.create<GitActionsDialogProps>(
|
|||||||
<div className="py-8">
|
<div className="py-8">
|
||||||
<Loader size={24} />
|
<Loader size={24} />
|
||||||
</div>
|
</div>
|
||||||
) : !isSignedIn ? (
|
|
||||||
<div className="py-6">
|
|
||||||
<LoginRequiredPrompt
|
|
||||||
buttonVariant="default"
|
|
||||||
buttonSize="default"
|
|
||||||
title={t('git.actions.loginRequired.title')}
|
|
||||||
description={t('git.actions.loginRequired.description')}
|
|
||||||
actionLabel={t('git.actions.loginRequired.action')}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
) : (
|
) : (
|
||||||
<GitOperationsProvider attemptId={attempt.id}>
|
<GitOperationsProvider attemptId={attempt.id}>
|
||||||
<ExecutionProcessesProvider
|
<ExecutionProcessesProvider
|
||||||
|
|||||||
Reference in New Issue
Block a user