feat: show banner for bare mirror repositories
- Add isMirror prop to GitToolbar\n- Show warning banner when repo is a bare mirror\n- Explain that editing/committing/pulling/merging are unavailable\n- Suggest deleting and recreating to enable full features\n\nQuality gates: vitest (43 passed)
This commit is contained in:
@@ -18,6 +18,7 @@ interface GitToolbarProps {
|
|||||||
currentBranch: string;
|
currentBranch: string;
|
||||||
branches: string[];
|
branches: string[];
|
||||||
hasRemote: boolean;
|
hasRemote: boolean;
|
||||||
|
isMirror: boolean;
|
||||||
onBranchChange: (branch: string) => void;
|
onBranchChange: (branch: string) => void;
|
||||||
onRefresh: () => void;
|
onRefresh: () => void;
|
||||||
}
|
}
|
||||||
@@ -28,6 +29,7 @@ export const GitToolbar = ({
|
|||||||
currentBranch,
|
currentBranch,
|
||||||
branches,
|
branches,
|
||||||
hasRemote,
|
hasRemote,
|
||||||
|
isMirror,
|
||||||
onBranchChange,
|
onBranchChange,
|
||||||
onRefresh,
|
onRefresh,
|
||||||
}: GitToolbarProps) => {
|
}: GitToolbarProps) => {
|
||||||
@@ -136,7 +138,13 @@ export const GitToolbar = ({
|
|||||||
return (
|
return (
|
||||||
<div className="git-toolbar">
|
<div className="git-toolbar">
|
||||||
{error && <div className="toolbar-error">{error}</div>}
|
{error && <div className="toolbar-error">{error}</div>}
|
||||||
|
{isMirror && (
|
||||||
|
<div className="warning-message">
|
||||||
|
<Icon name="warning" size="sm" /> This repository is a bare mirror.
|
||||||
|
Editing, committing, pulling, and merging are not available.
|
||||||
|
Delete and recreate it to enable full workspace features.
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className="toolbar-row">
|
<div className="toolbar-row">
|
||||||
<div className="toolbar-group">
|
<div className="toolbar-group">
|
||||||
<select
|
<select
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ export const RepoWorkspace = () => {
|
|||||||
currentBranch={currentBranch}
|
currentBranch={currentBranch}
|
||||||
branches={branches}
|
branches={branches}
|
||||||
hasRemote={Boolean(selectedRepo?.remote_url)}
|
hasRemote={Boolean(selectedRepo?.remote_url)}
|
||||||
|
isMirror={Boolean(selectedRepo?.is_mirror)}
|
||||||
onBranchChange={(branch) => {
|
onBranchChange={(branch) => {
|
||||||
setCurrentBranch(branch);
|
setCurrentBranch(branch);
|
||||||
const newParams = new URLSearchParams(searchParams);
|
const newParams = new URLSearchParams(searchParams);
|
||||||
|
|||||||
Reference in New Issue
Block a user