Browse Source

Removes heart from views & simplifies sponsor cmd

main
Eric Amodio 4 years ago
parent
commit
23b4e53865
5 changed files with 15 additions and 49 deletions
  1. +12
    -17
      package.json
  2. +3
    -3
      src/commands/supportGitLens.ts
  3. +0
    -1
      src/config.ts
  4. +0
    -1
      src/constants.ts
  5. +0
    -27
      src/messages.ts

+ 12
- 17
package.json View File

@ -1914,8 +1914,7 @@
"suppressGitDisabledWarning": false,
"suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": false,
"suppressNoRepositoryWarning": false,
"suppressSupportGitLensNotification": false
"suppressNoRepositoryWarning": false
},
"properties": {
"suppressCommitHasNoPreviousCommitWarning": {
@ -1945,10 +1944,6 @@
"suppressNoRepositoryWarning": {
"type": "boolean",
"default": false
},
"suppressSupportGitLensNotification": {
"type": "boolean",
"default": false
}
},
"markdownDescription": "Specifies which messages should be suppressed",
@ -2118,7 +2113,7 @@
"commands": [
{
"command": "gitlens.supportGitLens",
"title": "Sponsor GitLens",
"title": "Sponsor GitLens",
"category": "GitLens",
"icon": "$(heart)"
},
@ -4835,34 +4830,34 @@
"group": "1_gitlens@0"
},
{
"command": "gitlens.supportGitLens",
"when": "view =~ /^gitlens\\.views\\..*:/ && config.gitlens.advanced.messages.suppressSupportGitLensNotification != true && gitlens:views:supportGitLens:hide != true",
"group": "navigation@1"
},
{
"command": "gitlens.showSettingsPage#repositories-view",
"when": "view =~ /^gitlens\\.views\\.repositories:/",
"group": "9_gitlens"
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage#file-history-view",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/",
"group": "9_gitlens"
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage#line-history-view",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/",
"group": "9_gitlens"
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage#search-commits-view",
"when": "view =~ /^gitlens\\.views\\.search:/",
"group": "9_gitlens"
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"group": "9_gitlens"
"group": "9_gitlens@1"
},
{
"command": "gitlens.supportGitLens",
"when": "view =~ /^gitlens\\.views\\..*:/",
"group": "9_gitlens@-1"
}
],
"view/item/context": [

+ 3
- 3
src/commands/supportGitLens.ts View File

@ -1,6 +1,6 @@
'use strict';
import { env, Uri } from 'vscode';
import { command, Command, Commands } from './common';
import { Messages } from '../messages';
@command()
export class SupportGitLensCommand extends Command {
@ -8,7 +8,7 @@ export class SupportGitLensCommand extends Command {
super(Commands.SupportGitLens);
}
execute() {
return Messages.showSupportGitLensMessage();
async execute() {
await env.openExternal(Uri.parse('https://gitlens.amod.io/#sponsor'));
}
}

+ 0
- 1
src/config.ts View File

@ -273,7 +273,6 @@ export interface AdvancedConfig {
suppressGitVersionWarning: boolean;
suppressLineUncommittedWarning: boolean;
suppressNoRepositoryWarning: boolean;
suppressSupportGitLensNotification: boolean;
};
quickPick: {
closeOnFocusOut: boolean;

+ 0
- 1
src/constants.ts View File

@ -41,7 +41,6 @@ export enum CommandContext {
ViewsCanCompare = 'gitlens:views:canCompare',
ViewsCanCompareFile = 'gitlens:views:canCompare:file',
ViewsCompareKeepResults = 'gitlens:views:compare:keepResults',
ViewsHideSupportGitLens = 'gitlens:views:supportGitLens:hide',
ViewsFileHistoryEditorFollowing = 'gitlens:views:fileHistory:editorFollowing',
ViewsLineHistoryEditorFollowing = 'gitlens:views:lineHistory:editorFollowing',
ViewsRepositoriesAutoRefresh = 'gitlens:views:repositories:autoRefresh',

+ 0
- 27
src/messages.ts View File

@ -1,7 +1,6 @@
'use strict';
import { ConfigurationTarget, env, MessageItem, Uri, window } from 'vscode';
import { configuration } from './configuration';
import { CommandContext, setCommandContext } from './constants';
import { GitCommit } from './git/git';
import { Logger } from './logger';
@ -13,7 +12,6 @@ export enum SuppressedMessages {
GitVersionWarning = 'suppressGitVersionWarning',
LineUncommittedWarning = 'suppressLineUncommittedWarning',
NoRepositoryWarning = 'suppressNoRepositoryWarning',
SupportGitLensNotification = 'suppressSupportGitLensNotification',
}
export class Messages {
@ -96,31 +94,6 @@ export class Messages {
);
}
static async showSupportGitLensMessage() {
const actions: MessageItem[] = [{ title: 'Sponsor GitLens' }];
const result = await Messages.showMessage(
'info',
'While GitLens is offered to everyone for free, if you find it useful, please consider [sponsoring](https://gitlens.amod.io/#sponsor) it. Thank you! ❤',
undefined,
null,
...actions,
);
if (result != null) {
let uri;
if (result === actions[0]) {
uri = Uri.parse('https://gitlens.amod.io/#sponsor');
}
if (uri !== undefined) {
await setCommandContext(CommandContext.ViewsHideSupportGitLens, true);
await this.suppressedMessage(SuppressedMessages.SupportGitLensNotification);
await env.openExternal(uri);
}
}
}
static async showWhatsNewMessage(version: string) {
const actions: MessageItem[] = [{ title: "What's New" }, { title: 'Release Notes' }, { title: '❤' }];

Loading…
Cancel
Save