Browse Source

Adds notification for GL14 upgrade

main
Eric Amodio 1 year ago
committed by Ramin Tadayon
parent
commit
2dad63df6e
No known key found for this signature in database GPG Key ID: 79D60DDE3DFB95F5
2 changed files with 16 additions and 12 deletions
  1. +9
    -6
      src/extension.ts
  2. +7
    -6
      src/messages.ts

+ 9
- 6
src/extension.ts View File

@ -315,17 +315,20 @@ async function showWelcomeOrWhatsNew(container: Container, version: string, prev
Logger.log(`GitLens upgraded from v${previousVersion} to v${version}; window.focused=${window.state.focused}`);
}
const [major, minor] = version.split('.').map(v => parseInt(v, 10));
const [prevMajor, prevMinor] = previousVersion.split('.').map(v => parseInt(v, 10));
const current = fromString(version);
const previous = fromString(previousVersion);
// Don't notify on downgrades
if (major === prevMajor || major < prevMajor || (major === prevMajor && minor < prevMinor)) {
if (current.major < previous.major || (current.major === previous.major && current.minor < previous.minor)) {
return;
}
if (major !== prevMajor) {
version = String(major);
}
// TODO@eamodio GL14: uncomment when ready to release
const majorPrerelease = false; //satisfies(previous, '< 2023.6.0700');
if (current.major === previous.major && !majorPrerelease) return;
version = majorPrerelease ? '14' : String(current.major);
void executeCommand(Commands.ShowHomeView);

+ 7
- 6
src/messages.ts View File

@ -1,5 +1,5 @@
import type { MessageItem } from 'vscode';
import { ConfigurationTarget, env, Uri, window } from 'vscode';
import { ConfigurationTarget, window } from 'vscode';
import { SuppressedMessages } from './config';
import { Commands } from './constants';
import type { GitCommit } from './git/models/commit';
@ -176,17 +176,18 @@ export function showIntegrationRequestTimedOutWarningMessage(providerName: strin
}
export async function showWhatsNewMessage(version: string) {
const whatsnew = { title: "See What's New"; };
const reset = { title: 'Switch to New Layout'; };
const result = await showMessage(
'info',
`GitLens ${version} is here — check out what's new!`,
// TODO@eamodio GL14: update links
`Upgraded to GitLens ${version} — [see what's new](https://help.gitkraken.com/gitlens/gitlens-release-notes-current/ "See what's new in GitLens ${version}").\nWe've rearranged our views for greater focus and productivity, and recommend switching to the new layout — [learn more](https://help.gitkraken.com/gitlens/gitlens-release-notes-current/ "Learn more about what's changed").`,
undefined,
null,
whatsnew,
reset,
);
if (result === whatsnew) {
void (await env.openExternal(Uri.parse('https://help.gitkraken.com/gitlens/gitlens-release-notes-current/')));
if (result === reset) {
void executeCommand(Commands.ResetViewsLayout);
}
}

Loading…
Cancel
Save