From fef1090a855dfa62197548e94ebb70a05be349ef Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Fri, 14 Oct 2022 01:24:27 -0400 Subject: [PATCH] Removes preview banner from commit graph --- src/plus/webviews/graph/graphWebview.ts | 11 +---- src/plus/webviews/graph/protocol.ts | 3 +- src/webviews/apps/plus/graph/GraphWrapper.tsx | 62 ++++++--------------------- 3 files changed, 17 insertions(+), 59 deletions(-) diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 851fd41..ae53137 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -209,7 +209,6 @@ export class GraphWebview extends WebviewBase { private _theme: ColorTheme | undefined; private _repositoryEventsDisposable: Disposable | undefined; - private previewBanner?: boolean; private trialBanner?: boolean; constructor(container: Container) { @@ -547,9 +546,7 @@ export class GraphWebview extends WebviewBase { } private dismissBanner(e: DismissBannerParams) { - if (e.key === 'preview') { - this.previewBanner = false; - } else if (e.key === 'trial') { + if (e.key === 'trial') { this.trialBanner = false; } @@ -1300,11 +1297,8 @@ export class GraphWebview extends WebviewBase { private async getState(deferRows?: boolean): Promise { if (this.container.git.repositoryCount === 0) return { allowed: true, repositories: [] }; - if (this.previewBanner == null || this.trialBanner == null) { + if (this.trialBanner == null) { const banners = this.container.storage.getWorkspace('graph:banners:dismissed'); - if (this.previewBanner == null) { - this.previewBanner = !banners?.['preview']; - } if (this.trialBanner == null) { this.trialBanner = !banners?.['trial']; } @@ -1355,7 +1349,6 @@ export class GraphWebview extends WebviewBase { const columns = this.getColumns(); return { - previewBanner: this.previewBanner, trialBanner: this.trialBanner, repositories: formatRepositories(this.container.git.openRepositories), selectedRepository: this.repository.path, diff --git a/src/plus/webviews/graph/protocol.ts b/src/plus/webviews/graph/protocol.ts index 6a1cc8f..47411de 100644 --- a/src/plus/webviews/graph/protocol.ts +++ b/src/plus/webviews/graph/protocol.ts @@ -53,7 +53,6 @@ export interface State { config?: GraphComponentConfig; context?: GraphContexts; nonce?: string; - previewBanner?: boolean; trialBanner?: boolean; workingTreeStats?: GraphWorkingTreeStats; searchResults?: DidSearchParams['results']; @@ -180,7 +179,7 @@ export const UpdateRefsVisibilityCommandType = new IpcCommandType('graph/ref/doubleclick'); diff --git a/src/webviews/apps/plus/graph/GraphWrapper.tsx b/src/webviews/apps/plus/graph/GraphWrapper.tsx index 8967feb..4d13795 100644 --- a/src/webviews/apps/plus/graph/GraphWrapper.tsx +++ b/src/webviews/apps/plus/graph/GraphWrapper.tsx @@ -179,8 +179,6 @@ export function GraphWrapper({ const [pagingHasMore, setPagingHasMore] = useState(state.paging?.hasMore ?? false); const [isLoading, setIsLoading] = useState(state.loading); const [styleProps, setStyleProps] = useState(state.theming); - // banner - const [showPreview, setShowPreview] = useState(state.previewBanner); // account const [showAccount, setShowAccount] = useState(state.trialBanner); const [isAccessAllowed, setIsAccessAllowed] = useState(state.allowed ?? false); @@ -528,11 +526,6 @@ export function GraphWrapper({ onSelectionChange?.(rows); }; - const handleDismissPreview = () => { - setShowPreview(false); - onDismissBanner?.('preview'); - }; - const handleDismissAccount = () => { setShowAccount(false); onDismissBanner?.('trial'); @@ -675,53 +668,26 @@ export function GraphWrapper({ } return ( -
- -
- {content} - {actions &&
{actions}
} +
+
+ +
+ {content} + {actions &&
{actions}
} +
+ {isAccessAllowed && ( + + )}
- {isAccessAllowed && ( - - )} -
+ ); }; return ( <> -
- {showPreview && ( -
- -
-

GitLens+ Feature Preview

-

- The Commit Graph is currently in preview. It will always be freely available for local - and public repos, while private repos require a paid plan. -

-

- Join the{' '} - - discussion on GitHub - - ! We'd love to hear from you. -

-

- GitLens+{' '} - introductory pricing will end with the next - release (late Sept, early Oct). -

-
- -
- )} - {renderAlertContent()} -
+ {renderAlertContent()} {isAccessAllowed && (