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,
|
||||
} from 'shared/types';
|
||||
import NiceModal, { useModal } from '@ebay/nice-modal-react';
|
||||
import { useAuth } from '@/hooks';
|
||||
import { LoginRequiredPrompt } from '@/components/dialogs/shared/LoginRequiredPrompt';
|
||||
|
||||
export interface GitActionsDialogProps {
|
||||
attemptId: string;
|
||||
@@ -104,7 +102,6 @@ export const GitActionsDialog = NiceModal.create<GitActionsDialogProps>(
|
||||
const modal = useModal();
|
||||
const { t } = useTranslation('tasks');
|
||||
const { project } = useProject();
|
||||
const { isSignedIn, isLoaded } = useAuth();
|
||||
|
||||
const effectiveProjectId = providedProjectId ?? project?.id;
|
||||
const { data: attempt } = useTaskAttempt(attemptId);
|
||||
@@ -129,7 +126,7 @@ export const GitActionsDialog = NiceModal.create<GitActionsDialogProps>(
|
||||
};
|
||||
|
||||
const isLoading =
|
||||
!attempt || !effectiveProjectId || loadingBranches || !task || !isLoaded;
|
||||
!attempt || !effectiveProjectId || loadingBranches || !task;
|
||||
|
||||
return (
|
||||
<Dialog open={modal.visible} onOpenChange={handleOpenChange}>
|
||||
@@ -142,16 +139,6 @@ export const GitActionsDialog = NiceModal.create<GitActionsDialogProps>(
|
||||
<div className="py-8">
|
||||
<Loader size={24} />
|
||||
</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}>
|
||||
<ExecutionProcessesProvider
|
||||
|
||||
Reference in New Issue
Block a user