Browse Source

Adds a notification when results view is first shown

main
Eric Amodio 7 years ago
parent
commit
499d99e705
5 changed files with 23 additions and 4 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +5
    -0
      package.json
  3. +2
    -0
      src/configuration.ts
  4. +7
    -2
      src/messages.ts
  5. +8
    -2
      src/views/resultsExplorer.ts

+ 1
- 0
CHANGELOG.md View File

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds *Revert Commit (via Terminal)* command (`gitlens.explorers.terminalRevertCommit`) to revision (commit) nodes in the **GitLens** & **GitLens Results** views - Adds *Revert Commit (via Terminal)* command (`gitlens.explorers.terminalRevertCommit`) to revision (commit) nodes in the **GitLens** & **GitLens Results** views
- Adds *Create Tag (via Terminal)...* command (`gitlens.explorers.terminalCreateTag`) to branch and revision (commit) nodes in the **GitLens** & **GitLens Results** views - Adds *Create Tag (via Terminal)...* command (`gitlens.explorers.terminalCreateTag`) to branch and revision (commit) nodes in the **GitLens** & **GitLens Results** views
- Adds *Delete Tag (via Terminal)* command (`gitlens.explorers.terminalDeleteTag`) to tag nodes in the **GitLens** view - Adds *Delete Tag (via Terminal)* command (`gitlens.explorers.terminalDeleteTag`) to tag nodes in the **GitLens** view
- Adds a helpful notification the first time the **GitLens Results** view is shown
### Changed ### Changed
- Renames *Rebase Commit (via Terminal)* command (`gitlens.terminalRebaseCommit`) to *Rebase to Commit (via Terminal)* - Renames *Rebase Commit (via Terminal)* command (`gitlens.terminalRebaseCommit`) to *Rebase to Commit (via Terminal)*

+ 5
- 0
package.json View File

@ -1028,6 +1028,7 @@
"suppressGitVersionWarning": false, "suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": false, "suppressLineUncommittedWarning": false,
"suppressNoRepositoryWarning": false, "suppressNoRepositoryWarning": false,
"suppressResultsExplorerNotice": false,
"suppressUpdateNotice": false, "suppressUpdateNotice": false,
"suppressWelcomeNotice": false "suppressWelcomeNotice": false
}, },
@ -1056,6 +1057,10 @@
"type": "boolean", "type": "boolean",
"default": false "default": false
}, },
"suppressResultsExplorerNotice": {
"type": "boolean",
"default": false
},
"suppressUpdateNotice": { "suppressUpdateNotice": {
"type": "boolean", "type": "boolean",
"default": false "default": false

+ 2
- 0
src/configuration.ts View File

@ -121,6 +121,7 @@ export interface IAdvancedConfig {
suppressGitVersionWarning: boolean, suppressGitVersionWarning: boolean,
suppressLineUncommittedWarning: boolean, suppressLineUncommittedWarning: boolean,
suppressNoRepositoryWarning: boolean, suppressNoRepositoryWarning: boolean,
suppressResultsExplorerNotice: boolean,
suppressUpdateNotice: boolean, suppressUpdateNotice: boolean,
suppressWelcomeNotice: boolean suppressWelcomeNotice: boolean
}; };
@ -506,6 +507,7 @@ const emptyConfig: IConfig = {
suppressGitVersionWarning: false, suppressGitVersionWarning: false,
suppressLineUncommittedWarning: false, suppressLineUncommittedWarning: false,
suppressNoRepositoryWarning: false, suppressNoRepositoryWarning: false,
suppressResultsExplorerNotice: false,
suppressUpdateNotice: false, suppressUpdateNotice: false,
suppressWelcomeNotice: false suppressWelcomeNotice: false
}, },

+ 7
- 2
src/messages.ts View File

@ -12,6 +12,7 @@ export enum SuppressedMessages {
GitVersionWarning = 'suppressGitVersionWarning', GitVersionWarning = 'suppressGitVersionWarning',
LineUncommittedWarning = 'suppressLineUncommittedWarning', LineUncommittedWarning = 'suppressLineUncommittedWarning',
NoRepositoryWarning = 'suppressNoRepositoryWarning', NoRepositoryWarning = 'suppressNoRepositoryWarning',
ResultsExplorerNotice = 'suppressResultsExplorerNotice',
UpdateNotice = 'suppressUpdateNotice', UpdateNotice = 'suppressUpdateNotice',
WelcomeNotice = 'suppressWelcomeNotice' WelcomeNotice = 'suppressWelcomeNotice'
} }
@ -39,8 +40,12 @@ export class Messages {
return Messages.showMessage('warn', `${message}. No repository could be found`, SuppressedMessages.NoRepositoryWarning); return Messages.showMessage('warn', `${message}. No repository could be found`, SuppressedMessages.NoRepositoryWarning);
} }
static showResultExplorerInfoMessage(): Promise<string | undefined> {
return Messages.showMessage('info', `If you can't find your results, click on "GITLENS RESULTS" at the bottom of the Explorer view`, SuppressedMessages.ResultsExplorerNotice, null);
}
static showUnsupportedGitVersionErrorMessage(version: string): Promise<string | undefined> { static showUnsupportedGitVersionErrorMessage(version: string): Promise<string | undefined> {
return Messages.showMessage('error', `GitLens requires a newer version of Git (>= 2.2.0) than is currently installed (${version}). Please install a more recent version of Git.`, SuppressedMessages.GitVersionWarning);
return Messages.showMessage('error', `GitLens requires a newer version of Git (>= 2.2.0) than is currently installed (${version}). Please install a more recent version of Git`, SuppressedMessages.GitVersionWarning);
} }
static async showUpdateMessage(version: string): Promise<string | undefined> { static async showUpdateMessage(version: string): Promise<string | undefined> {
@ -54,7 +59,7 @@ export class Messages {
static async showWelcomeMessage(): Promise<string | undefined> { static async showWelcomeMessage(): Promise<string | undefined> {
const viewDocs = 'View Docs'; const viewDocs = 'View Docs';
const result = await Messages.showMessage('info', `Thank you for choosing GitLens! GitLens is powerful, feature rich, and highly configurable, so please be sure to view the docs and tailor it to suit your needs.`, SuppressedMessages.WelcomeNotice, null, viewDocs);
const result = await Messages.showMessage('info', `Thank you for choosing GitLens! GitLens is powerful, feature rich, and highly configurable, so please be sure to view the docs and tailor it to suit your needs`, SuppressedMessages.WelcomeNotice, null, viewDocs);
if (result === viewDocs) { if (result === viewDocs) {
commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens')); commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens'));
} }

+ 8
- 2
src/views/resultsExplorer.ts View File

@ -8,6 +8,7 @@ import { RefreshNodeCommandArgs } from './explorerCommands';
import { CommitResultsNode, CommitsResultsNode, ComparisionResultsNode, ExplorerNode, MessageNode, RefreshReason, ResourceType } from './explorerNodes'; import { CommitResultsNode, CommitsResultsNode, ComparisionResultsNode, ExplorerNode, MessageNode, RefreshReason, ResourceType } from './explorerNodes';
import { clearGravatarCache, GitLog, GitLogCommit } from '../gitService'; import { clearGravatarCache, GitLog, GitLogCommit } from '../gitService';
import { Logger } from '../logger'; import { Logger } from '../logger';
import { Messages } from '../messages';
export * from './explorerNodes'; export * from './explorerNodes';
@ -115,12 +116,12 @@ export class ResultsExplorer implements TreeDataProvider {
async showComparisonInResults(repoPath: string, ref1: string, ref2: string) { async showComparisonInResults(repoPath: string, ref1: string, ref2: string) {
this.addResults(new ComparisionResultsNode(repoPath, ref1, ref2, this)); this.addResults(new ComparisionResultsNode(repoPath, ref1, ref2, this));
setCommandContext(CommandContext.ResultsExplorer, true);
this.showResults();
} }
showCommitInResults(commit: GitLogCommit) { showCommitInResults(commit: GitLogCommit) {
this.addResults(new CommitResultsNode(commit, this)); this.addResults(new CommitResultsNode(commit, this));
setCommandContext(CommandContext.ResultsExplorer, true);
this.showResults();
} }
showCommitsInResults(results: GitLog, resultsLabel: string | { label: string, resultsType?: { singular: string, plural: string } }) { showCommitsInResults(results: GitLog, resultsLabel: string | { label: string, resultsType?: { singular: string, plural: string } }) {
@ -143,6 +144,11 @@ export class ResultsExplorer implements TreeDataProvider {
}; };
this.addResults(new CommitsResultsNode(results.repoPath, labelFn, Functions.seeded(query, results), this, ResourceType.SearchResults)); this.addResults(new CommitsResultsNode(results.repoPath, labelFn, Functions.seeded(query, results), this, ResourceType.SearchResults));
this.showResults();
}
private showResults() {
Messages.showResultExplorerInfoMessage();
setCommandContext(CommandContext.ResultsExplorer, true); setCommandContext(CommandContext.ResultsExplorer, true);
} }

Loading…
Cancel
Save