Procházet zdrojové kódy

Adds a notification when results view is first shown

main
Eric Amodio před 7 roky
rodič
revize
499d99e705
5 změnil soubory, kde provedl 23 přidání a 4 odebrání
  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 Zobrazit soubor

@ -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 *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 a helpful notification the first time the **GitLens Results** view is shown
### Changed
- Renames *Rebase Commit (via Terminal)* command (`gitlens.terminalRebaseCommit`) to *Rebase to Commit (via Terminal)*

+ 5
- 0
package.json Zobrazit soubor

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

+ 2
- 0
src/configuration.ts Zobrazit soubor

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

+ 7
- 2
src/messages.ts Zobrazit soubor

@ -12,6 +12,7 @@ export enum SuppressedMessages {
GitVersionWarning = 'suppressGitVersionWarning',
LineUncommittedWarning = 'suppressLineUncommittedWarning',
NoRepositoryWarning = 'suppressNoRepositoryWarning',
ResultsExplorerNotice = 'suppressResultsExplorerNotice',
UpdateNotice = 'suppressUpdateNotice',
WelcomeNotice = 'suppressWelcomeNotice'
}
@ -39,8 +40,12 @@ export class Messages {
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> {
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> {
@ -54,7 +59,7 @@ export class Messages {
static async showWelcomeMessage(): Promise<string | undefined> {
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) {
commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens'));
}

+ 8
- 2
src/views/resultsExplorer.ts Zobrazit soubor

@ -8,6 +8,7 @@ import { RefreshNodeCommandArgs } from './explorerCommands';
import { CommitResultsNode, CommitsResultsNode, ComparisionResultsNode, ExplorerNode, MessageNode, RefreshReason, ResourceType } from './explorerNodes';
import { clearGravatarCache, GitLog, GitLogCommit } from '../gitService';
import { Logger } from '../logger';
import { Messages } from '../messages';
export * from './explorerNodes';
@ -115,12 +116,12 @@ export class ResultsExplorer implements TreeDataProvider {
async showComparisonInResults(repoPath: string, ref1: string, ref2: string) {
this.addResults(new ComparisionResultsNode(repoPath, ref1, ref2, this));
setCommandContext(CommandContext.ResultsExplorer, true);
this.showResults();
}
showCommitInResults(commit: GitLogCommit) {
this.addResults(new CommitResultsNode(commit, this));
setCommandContext(CommandContext.ResultsExplorer, true);
this.showResults();
}
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.showResults();
}
private showResults() {
Messages.showResultExplorerInfoMessage();
setCommandContext(CommandContext.ResultsExplorer, true);
}

Načítá se…
Zrušit
Uložit