Kaynağa Gözat

Restricts graph filter options for virtual repos

main
Keith Daulton 1 yıl önce
ebeveyn
işleme
019ea6a230
3 değiştirilmiş dosya ile 40 ekleme ve 27 silme
  1. +2
    -1
      src/plus/webviews/graph/graphWebview.ts
  2. +1
    -0
      src/plus/webviews/graph/protocol.ts
  3. +37
    -26
      src/webviews/apps/plus/graph/GraphWrapper.tsx

+ 2
- 1
src/plus/webviews/graph/graphWebview.ts Dosyayı Görüntüle

@ -2207,13 +2207,14 @@ export class GraphWebview extends WebviewBase {
}
function formatRepositories(repositories: Repository[]): GraphRepository[] {
if (repositories.length === 0) return repositories;
if (repositories.length === 0) return [];
return repositories.map(r => ({
formattedName: r.formattedName,
id: r.id,
name: r.name,
path: r.path,
isVirtual: r.provider.virtual,
}));
}

+ 1
- 0
src/plus/webviews/graph/protocol.ts Dosyayı Görüntüle

@ -83,6 +83,7 @@ export interface GraphRepository {
id: string;
name: string;
path: string;
isVirtual: boolean;
}
export interface GraphCommitIdentity {

+ 37
- 26
src/webviews/apps/plus/graph/GraphWrapper.tsx Dosyayı Görüntüle

@ -872,39 +872,50 @@ export function GraphWrapper({
<MenuItem role="none">
<VSCodeRadioGroup
orientation="vertical"
value={isAllBranches ? 'branch-all' : 'branch-current'}
value={
isAllBranches && repo?.isVirtual !== true
? 'branch-all'
: 'branch-current'
}
readOnly={repo?.isVirtual === true}
>
<VSCodeRadio
name="branching-toggle"
value="branch-all"
onChange={handleLocalBranchFiltering}
>
Show All Local Branches
</VSCodeRadio>
{repo?.isVirtual !== true && (
<VSCodeRadio
name="branching-toggle"
value="branch-all"
onChange={handleLocalBranchFiltering}
>
Show All Local Branches
</VSCodeRadio>
)}
<VSCodeRadio name="branching-toggle" value="branch-current">
Show Current Branch Only
</VSCodeRadio>
</VSCodeRadioGroup>
</MenuItem>
<MenuDivider></MenuDivider>
<MenuItem role="none">
<VSCodeCheckbox
value="remotes"
onChange={handleExcludeTypeChange}
defaultChecked={excludeTypes?.remotes ?? false}
>
Hide Remote Branches
</VSCodeCheckbox>
</MenuItem>
<MenuItem role="none">
<VSCodeCheckbox
value="stashes"
onChange={handleExcludeTypeChange}
defaultChecked={excludeTypes?.stashes ?? false}
>
Hide Stashes
</VSCodeCheckbox>
</MenuItem>
{repo?.isVirtual !== true && (
<>
<MenuItem role="none">
<VSCodeCheckbox
value="remotes"
onChange={handleExcludeTypeChange}
defaultChecked={excludeTypes?.remotes ?? false}
>
Hide Remote Branches
</VSCodeCheckbox>
</MenuItem>
<MenuItem role="none">
<VSCodeCheckbox
value="stashes"
onChange={handleExcludeTypeChange}
defaultChecked={excludeTypes?.stashes ?? false}
>
Hide Stashes
</VSCodeCheckbox>
</MenuItem>
</>
)}
<MenuItem role="none">
<VSCodeCheckbox
value="tags"

Yükleniyor…
İptal
Kaydet