Kaynağa Gözat

Fixes missing id on some nodes

main
Eric Amodio 3 yıl önce
ebeveyn
işleme
f8787030c5
10 değiştirilmiş dosya ile 16 ekleme ve 15 silme
  1. +3
    -3
      src/views/nodes/branchNode.ts
  2. +1
    -1
      src/views/nodes/branchesNode.ts
  3. +5
    -5
      src/views/nodes/compareBranchNode.ts
  4. +1
    -0
      src/views/nodes/compareResultsNode.ts
  5. +1
    -1
      src/views/nodes/pullRequestNode.ts
  6. +1
    -2
      src/views/nodes/remoteNode.ts
  7. +1
    -1
      src/views/nodes/repositoryNode.ts
  8. +1
    -1
      src/views/nodes/resultsCommitsNode.ts
  9. +1
    -1
      src/views/nodes/resultsFilesNode.ts
  10. +1
    -0
      src/views/nodes/searchResultsNode.ts

+ 3
- 3
src/views/nodes/branchNode.ts Dosyayı Görüntüle

@ -403,15 +403,15 @@ export class BranchNode
this.label,
this.options.expanded ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.Collapsed,
);
item.id = this.id;
item.contextValue = contextValue;
item.description = description;
item.iconPath = this.options.showAsCommits
? new ThemeIcon('git-commit', color)
: {
dark: Container.context.asAbsolutePath(`images/dark/icon-branch${iconSuffix}.svg`),
light: Container.context.asAbsolutePath(`images/light/icon-branch${iconSuffix}.svg`),
};
item.contextValue = contextValue;
item.description = description;
item.id = this.id;
item.tooltip = tooltip;
item.resourceUri = Uri.parse(
`gitlens-view://branch/status/${await this.branch.getStatus()}${

+ 1
- 1
src/views/nodes/branchesNode.ts Dosyayı Görüntüle

@ -86,12 +86,12 @@ export class BranchesNode extends ViewNode {
async getTreeItem(): Promise<TreeItem> {
const item = new TreeItem('Branches', TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ContextValues.Branches;
if (await this.repo.hasRemotes()) {
item.contextValue += '+remotes';
}
item.iconPath = new ThemeIcon('git-branch');
item.id = this.id;
return item;
}

+ 5
- 5
src/views/nodes/compareBranchNode.ts Dosyayı Görüntüle

@ -160,6 +160,11 @@ export class CompareBranchNode extends ViewNode
const item = new TreeItem(label, state);
if (this._compareWith == null) {
item.id = this.id;
item.contextValue = `${ContextValues.CompareBranch}${this.branch.current ? '+current' : ''}+${
this.comparisonType
}${this._compareWith == null ? '' : '+comparing'}${this.root ? '+root' : ''}`;
item.description = description;
item.command = {
title: `Compare ${this.branch.name}${this.compareWithWorkingTree ? ' (working)' : ''} with${
GlyphChars.Ellipsis
@ -168,12 +173,7 @@ export class CompareBranchNode extends ViewNode
arguments: [this],
};
}
item.contextValue = `${ContextValues.CompareBranch}${this.branch.current ? '+current' : ''}+${
this.comparisonType
}${this._compareWith == null ? '' : '+comparing'}${this.root ? '+root' : ''}`;
item.description = description;
item.iconPath = new ThemeIcon('git-compare');
item.id = this.id;
item.tooltip = tooltip;
return item;

+ 1
- 0
src/views/nodes/compareResultsNode.ts Dosyayı Görüntüle

@ -157,6 +157,7 @@ export class CompareResultsNode extends ViewNode {
}`,
TreeItemCollapsibleState.Collapsed,
);
item.id = this.id;
item.contextValue = `${ContextValues.CompareResults}${this._pinned ? '+pinned' : ''}`;
item.description = description;
if (this._pinned) {

+ 1
- 1
src/views/nodes/pullRequestNode.ts Dosyayı Görüntüle

@ -43,6 +43,7 @@ export class PullRequestNode extends ViewNode<
getTreeItem(): TreeItem {
const item = new TreeItem(`#${this.pullRequest.id}: ${this.pullRequest.title}`, TreeItemCollapsibleState.None);
item.id = this.id;
item.contextValue = ContextValues.PullRequest;
item.description = `${this.pullRequest.state}, ${this.pullRequest.formatDateFromNow()}`;
item.iconPath = new ThemeIcon(
@ -55,7 +56,6 @@ export class PullRequestNode extends ViewNode<
: Colors.OpenPullRequestIconColor,
),
);
item.id = this.id;
item.tooltip = `${this.pullRequest.title}\n#${this.pullRequest.id} by ${this.pullRequest.author.name} was ${
this.pullRequest.state === PullRequestState.Open ? 'opened' : this.pullRequest.state.toLowerCase()
} ${this.pullRequest.formatDateFromNow()}`;

+ 1
- 2
src/views/nodes/remoteNode.ts Dosyayı Görüntüle

@ -107,6 +107,7 @@ export class RemoteNode extends ViewNode {
}
const item = new TreeItem(this.remote.name, TreeItemCollapsibleState.Collapsed);
item.id = this.id;
if (this.remote.provider != null) {
const { provider } = this.remote;
@ -144,8 +145,6 @@ export class RemoteNode extends ViewNode {
item.resourceUri = Uri.parse('gitlens-view://remote/default');
}
item.id = this.id;
for (const { type, url } of this.remote.urls) {
item.tooltip += `\n${url} (${type})`;
}

+ 1
- 1
src/views/nodes/repositoryNode.ts Dosyayı Görüntüle

@ -257,6 +257,7 @@ export class RepositoryNode extends SubscribeableViewNode {
}
const item = new TreeItem(label, TreeItemCollapsibleState.Expanded);
item.id = this.id;
item.contextValue = contextValue;
item.description = `${description ?? ''}${
lastFetched
@ -267,7 +268,6 @@ export class RepositoryNode extends SubscribeableViewNode {
dark: Container.context.asAbsolutePath(`images/dark/icon-repo${iconSuffix}.svg`),
light: Container.context.asAbsolutePath(`images/light/icon-repo${iconSuffix}.svg`),
};
item.id = this.id;
item.tooltip = new MarkdownString(tooltip, true);
return item;

+ 1
- 1
src/views/nodes/resultsCommitsNode.ts Dosyayı Görüntüle

@ -139,10 +139,10 @@ export class ResultsCommitsNode
}
const item = new TreeItem(label ?? this._label, state);
item.id = this.id;
item.contextValue =
this._results.comparison != null ? ContextValues.CompareResultsCommits : ContextValues.SearchResultsCommits;
item.description = this._options.description;
item.id = this.id;
return item;
}

+ 1
- 1
src/views/nodes/resultsFilesNode.ts Dosyayı Görüntüle

@ -134,11 +134,11 @@ export class ResultsFilesNode extends ViewNode {
`${this.filtered && files != null ? `Showing ${files.length} of ` : ''}${label}`,
state,
);
item.id = this.id;
item.iconPath = icon;
item.contextValue = `${ContextValues.ResultsFiles}${this.filterable ? '+filterable' : ''}${
this.filtered ? `+filtered~${this.filter}` : ''
}`;
item.id = this.id;
return item;
}

+ 1
- 0
src/views/nodes/searchResultsNode.ts Dosyayı Görüntüle

@ -130,6 +130,7 @@ export class SearchResultsNode extends ViewNode implements
async getTreeItem(): Promise<TreeItem> {
const item = await this.ensureResults().getTreeItem();
item.id = this.id;
item.contextValue = `${ContextValues.SearchResults}${this._pinned ? '+pinned' : ''}`;
if ((await Container.git.getRepositoryCount()) > 1) {
const repo = await Container.git.getRepository(this.repoPath);

Yükleniyor…
İptal
Kaydet