Skip to content

Commit 74d0e5d

Browse files
committed
Fixes timeline gate
Removes sign in from gate when signed in
1 parent d511fc6 commit 74d0e5d

File tree

4 files changed

+17
-27
lines changed

4 files changed

+17
-27
lines changed

src/webviews/apps/plus/graph/gate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export class GlGraphGate extends GlElement {
4242
)}
4343
appearance="alert"
4444
featureWithArticleIfNeeded="the Commit Graph"
45+
?hidden=${this.state.allowed !== false}
4546
.source=${{ source: 'graph', detail: 'gate' } as const}
4647
.state=${this.state.subscription?.state}
4748
.webroot=${this.state.webroot}
48-
?visible=${!this.state.allowed}
4949
>
5050
<p slot="feature">
5151
<a href="https://help.gitkraken.com/gitlens/gitlens-features/#commit-graph-pro">Commit Graph</a>

src/webviews/apps/plus/shared/components/feature-gate-plus-state.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ export class GlFeatureGatePlusState extends LitElement {
207207
...(this.source ?? { source: 'feature-gate' }),
208208
})}"
209209
>Upgrade to Pro</gl-button
210-
><span
211-
>or
212-
<a href="${createCommandLink<Source>('gitlens.plus.login', this.source)}" title="Sign In"
213-
>sign in</a
214-
></span
215210
>
216211
</p>
217212
<p>${this.renderPromo()}</p>`;
@@ -224,11 +219,6 @@ export class GlFeatureGatePlusState extends LitElement {
224219
appearance="${ifDefined(appearance)}"
225220
href="${createCommandLink<Source>('gitlens.plus.reactivateProTrial', this.source)}"
226221
>Continue</gl-button
227-
><span
228-
>or
229-
<a href="${createCommandLink<Source>('gitlens.plus.login', this.source)}" title="Sign In"
230-
>sign in</a
231-
></span
232222
>
233223
</p>
234224
<p>

src/webviews/apps/plus/timeline/timeline.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class GlTimelineApp extends GlApp<State> {
4040
delegatesFocus: true,
4141
};
4242

43-
static override styles = [timelineBaseStyles, timelineStyles];
43+
static override styles = [linkStyles, timelineBaseStyles, timelineStyles];
4444

4545
@query('#chart')
4646
private _chart?: GlTimelineChart;
@@ -95,12 +95,19 @@ export class GlTimelineApp extends GlApp<State> {
9595

9696
override render(): unknown {
9797
return html`
98-
${this.allowed
99-
? html`<gl-feature-gate
100-
.source=${{ source: 'timeline' as const, detail: 'gate' }}
101-
.state=${this.subscription?.state}
102-
></gl-feature-gate>`
103-
: nothing}
98+
<gl-feature-gate
99+
?hidden=${this.allowed !== false}
100+
.source=${{ source: 'timeline' as const, detail: 'gate' }}
101+
.state=${this.subscription?.state}
102+
><p slot="feature">
103+
<a href="https://help.gitkraken.com/gitlens/gitlens-features/#visual-file-history-pro"
104+
>Visual File History</a
105+
>
106+
<gl-feature-badge></gl-feature-badge>
107+
&mdash; visualize the evolution of a file and quickly identify when the most impactful changes were
108+
made and by whom.
109+
</p></gl-feature-gate
110+
>
104111
<div class="container">
105112
<progress-indicator ?active=${this._loading}></progress-indicator>
106113
<header class="header" ?hidden=${!this.uri}>

src/webviews/apps/shared/components/feature-gate.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type { SubscriptionState } from '../../../../constants.subscription';
44
import type { Source } from '../../../../constants.telemetry';
55
import type { FeaturePreview } from '../../../../features';
66
import { isSubscriptionStatePaidOrTrial } from '../../../../plus/gk/utils/subscription.utils';
7-
import '../../plus/shared/components/feature-gate-plus-state';
87
import { linkStyles } from '../../plus/shared/components/vscode.css';
8+
import '../../plus/shared/components/feature-gate-plus-state';
99

1010
declare global {
1111
interface HTMLElementTagNameMap {
@@ -114,18 +114,11 @@ export class GlFeatureGate extends LitElement {
114114
@property({ attribute: false, type: Number })
115115
state?: SubscriptionState;
116116

117-
@property({ type: Boolean })
118-
visible?: boolean;
119-
120117
@property({ type: String })
121118
webroot?: string;
122119

123120
override render(): unknown {
124-
const hidden = !this.visible || (this.state != null && isSubscriptionStatePaidOrTrial(this.state));
125-
// eslint-disable-next-line lit/no-this-assign-in-render
126-
this.hidden = hidden;
127-
128-
if (hidden) return undefined;
121+
if (this.hidden || isSubscriptionStatePaidOrTrial(this.state)) return undefined;
129122

130123
const appearance =
131124
this.appearance ?? (document.body.getAttribute('data-placement') ?? 'editor') === 'editor'

0 commit comments

Comments
 (0)