Parcourir la source

Restricts graph filter options for virtual repos

main
Keith Daulton il y a 1 an
Parent
révision
019ea6a230
3 fichiers modifiés avec 40 ajouts et 27 suppressions
  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 Voir le fichier

@ -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 Voir le fichier

@ -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 Voir le fichier

@ -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"

Chargement…
Annuler
Enregistrer