Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/telemetry-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ void
'repoPrivacy': 'private' | 'public' | 'local',
'repository.visibility': 'private' | 'public' | 'local',
// Provided for compatibility with other GK surfaces
'source': 'account' | 'subscription' | 'graph' | 'patchDetails' | 'settings' | 'timeline' | 'home' | 'view' | 'code-suggest' | 'ai' | 'ai:picker' | 'associateIssueWithBranch' | 'cloud-patches' | 'commandPalette' | 'deeplink' | 'inspect' | 'inspect-overview' | 'integrations' | 'launchpad' | 'launchpad-indicator' | 'launchpad-view' | 'notification' | 'prompt' | 'quick-wizard' | 'remoteProvider' | 'startWork' | 'trial-indicator' | 'scm-input' | 'walkthrough' | 'whatsnew' | 'worktrees'
'source': 'account' | 'subscription' | 'graph' | 'patchDetails' | 'settings' | 'timeline' | 'home' | 'view' | 'code-suggest' | 'ai' | 'ai:picker' | 'associateIssueWithBranch' | 'cloud-patches' | 'commandPalette' | 'deeplink' | 'inspect' | 'inspect-overview' | 'integrations' | 'launchpad' | 'launchpad-indicator' | 'launchpad-view' | 'merge-target' | 'notification' | 'prompt' | 'quick-wizard' | 'remoteProvider' | 'startWork' | 'trial-indicator' | 'scm-input' | 'walkthrough' | 'whatsnew' | 'worktrees'
}
```

Expand Down
1 change: 1 addition & 0 deletions src/constants.telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ export type Sources =
| 'launchpad'
| 'launchpad-indicator'
| 'launchpad-view'
| 'merge-target'
| 'notification'
| 'patchDetails'
| 'prompt'
Expand Down
6 changes: 6 additions & 0 deletions src/webviews/apps/plus/home/components/active-work.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { css, html, LitElement, nothing } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { when } from 'lit/directives/when.js';
import { isSubscriptionStatePaidOrTrial } from '../../../../../plus/gk/utils/subscription.utils';
import { createCommandLink } from '../../../../../system/commands';
import { createWebviewCommandLink } from '../../../../../system/webview';
import type { GetActiveOverviewResponse, GetOverviewBranch, OpenInGraphParams, State } from '../../../../home/protocol';
Expand Down Expand Up @@ -65,6 +66,10 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
@consume({ context: activeOverviewStateContext })
private _activeOverviewState!: ActiveOverviewState;

get isPro() {
return isSubscriptionStatePaidOrTrial(this._homeState.subscription.state);
}

override connectedCallback(): void {
super.connectedCallback();

Expand Down Expand Up @@ -185,6 +190,7 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
.branch=${branch}
.repo=${repo}
?busy=${isFetching}
?showUpgrade=${!this.isPro}
></gl-active-branch-card>`;
}

Expand Down
7 changes: 7 additions & 0 deletions src/webviews/apps/plus/home/components/branch-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export abstract class GlBranchCardBase extends GlElement {
@property()
repo!: string;

@property({ type: Boolean })
showUpgrade = false;

private _branch!: GetOverviewBranch;
get branch(): GetOverviewBranch {
return this._branch;
Expand Down Expand Up @@ -794,6 +797,10 @@ export abstract class GlBranchCardBase extends GlElement {
}

protected renderMergeTargetStatus(): TemplateResult | NothingType {
if (this.showUpgrade) {
return html`<gl-merge-target-upgrade class="branch-item__merge-target"></gl-merge-target-upgrade>`;
}

if (!this.branch.mergeTarget) return nothing;

return html`<gl-merge-target-status
Expand Down
Loading