Skip to content

Commit 82df8ca

Browse files
committed
Updates tracking on home & welcome
1 parent c7d6e34 commit 82df8ca

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

src/webviews/apps/home/home.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class HomeApp extends App<State> {
6363
this.state.subscription = msg.params.subscription;
6464
this.setState(this.state);
6565
this.updatePromos();
66-
this.updateSubscription();
66+
this.updateSourceAndSubscription();
6767

6868
break;
6969

@@ -155,10 +155,11 @@ export class HomeApp extends App<State> {
155155
}
156156
}
157157

158-
private updateSubscription() {
158+
private updateSourceAndSubscription() {
159159
const { subscription } = this.state;
160160
const els = document.querySelectorAll<GlFeatureBadge>('gl-feature-badge');
161161
for (const el of els) {
162+
el.source = { source: 'home', detail: 'badge' };
162163
el.subscription = subscription;
163164
}
164165
}
@@ -170,7 +171,7 @@ export class HomeApp extends App<State> {
170171
private updateState() {
171172
this.updateNoRepo();
172173
this.updatePromos();
173-
this.updateSubscription();
174+
this.updateSourceAndSubscription();
174175
this.updateOrgSettings();
175176
this.updateCollapsedSections();
176177
}

src/webviews/apps/welcome/welcome.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,15 @@ <h2 class="sticky">Get Started</h2>
9898
<div data-visible="try-pro">
9999
<p class="h-space-half">Unlock the full power of GitLens</p>
100100
<p>
101-
<gl-button appearance="secondary" href="command:gitlens.plus.signUp"
101+
<gl-button
102+
appearance="secondary"
103+
href="command:gitlens.plus.signUp?%7B%22source%22%3A%22welcome%22%7D"
102104
>Start Pro trial</gl-button
103105
>
104-
&nbsp;or <a href="command:gitlens.plus.login" title="Sign In">sign in</a>
106+
&nbsp;or
107+
<a href="command:gitlens.plus.login?%7B%22source%22%3A%22welcome%22%7D" title="Sign In"
108+
>sign in</a
109+
>
105110
</p>
106111
</div>
107112
</div>
@@ -568,10 +573,15 @@ <h2 class="sticky">Get Started</h2>
568573
<div data-visible="try-pro">
569574
<p class="h-space-half">Unlock the full power of GitLens</p>
570575
<p>
571-
<gl-button appearance="secondary" href="command:gitlens.plus.signUp"
576+
<gl-button
577+
appearance="secondary"
578+
href="command:gitlens.plus.signUp?%7B%22source%22%3A%22welcome%22%7D"
572579
>Start Pro Trial</gl-button
573580
>
574-
&nbsp;or <a href="command:gitlens.plus.login" title="Sign In">sign in</a>
581+
&nbsp;or
582+
<a href="command:gitlens.plus.login?%7B%22source%22%3A%22welcome%22%7D" title="Sign In"
583+
>sign in</a
584+
>
575585
</p>
576586
</div>
577587
</div>

src/webviews/apps/welcome/welcome.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { IpcMessage } from '../../protocol';
55
import type { State } from '../../welcome/protocol';
66
import { DidChangeNotification, DidChangeOrgSettings, UpdateConfigurationCommand } from '../../welcome/protocol';
77
import { App } from '../shared/appBase';
8+
import type { GlFeatureBadge } from '../shared/components/feature-badge';
89
import { DOM } from '../shared/dom';
910
import type { BlameSvg } from './components/svg-blame';
1011
// import { Snow } from '../shared/snow';
@@ -101,6 +102,7 @@ export class WelcomeApp extends App<State> {
101102
this.updateRepoState();
102103
this.updateAccountState();
103104
this.updatePromo();
105+
this.updateSource();
104106
this.updateOrgSettings();
105107
}
106108

@@ -118,6 +120,13 @@ export class WelcomeApp extends App<State> {
118120
document.getElementById('promo')!.hidden = !(canShowPromo ?? false);
119121
}
120122

123+
private updateSource() {
124+
const els = document.querySelectorAll<GlFeatureBadge>('gl-feature-badge');
125+
for (const el of els) {
126+
el.source = { source: 'welcome', detail: 'badge' };
127+
}
128+
}
129+
121130
private updateVersion() {
122131
document.getElementById('version')!.textContent = this.state.version;
123132
}

0 commit comments

Comments
 (0)