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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Changed

- Automatically stashes (and pops) uncommitted changes on Pull ([#4296](https://github.com/gitkraken/vscode-gitlens/issues/4296))
- Removes the option to associate an issue from cards in the RECENT section of the _Home_ view ([#4333](https://github.com/gitkraken/vscode-gitlens/issues/4333))

### Fixed

Expand Down
22 changes: 22 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 { isSubscriptionTrialOrPaidFromState } from '../../../../../plus/gk/utils/subscription.utils';
import type { AssociateIssueWithBranchCommandArgs } from '../../../../../plus/startWork/startWork';
import { createCommandLink } from '../../../../../system/commands';
import { createWebviewCommandLink } from '../../../../../system/webview';
import type {
Expand Down Expand Up @@ -511,4 +512,25 @@ export class GlActiveBranchCard extends GlBranchCardBase {
protected getCollapsedActions(): TemplateResult[] {
return [];
}

protected override renderIssuesItem(): TemplateResult | NothingType {
const issues = [...(this.issues ?? []), ...(this.autolinks ?? [])];
if (!issues.length) {
if (!this.expanded) return nothing;

return html`<gl-button
class="branch-item__missing"
appearance="secondary"
full
href=${this.createCommandLink<AssociateIssueWithBranchCommandArgs>('gitlens.associateIssueWithBranch', {
branch: this.branch.reference,
source: 'home',
})}
>Associate an Issue</gl-button
>`;
}
return super.renderIssuesItem();
}
}

type NothingType = typeof nothing;
14 changes: 1 addition & 13 deletions src/webviews/apps/plus/home/components/branch-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
launchpadGroupIconMap,
launchpadGroupLabelMap,
} from '../../../../../plus/launchpad/models/launchpad';
import type { AssociateIssueWithBranchCommandArgs } from '../../../../../plus/startWork/startWork';
import { createCommandLink } from '../../../../../system/commands';
import { fromNow } from '../../../../../system/date';
import { interpolate, pluralize } from '../../../../../system/string';
Expand Down Expand Up @@ -916,18 +915,7 @@ export abstract class GlBranchCardBase extends GlElement {
protected renderIssuesItem(): TemplateResult | NothingType {
const issues = [...(this.issues ?? []), ...(this.autolinks ?? [])];
if (!issues.length) {
if (!this.expanded) return nothing;

return html`<gl-button
class="branch-item__missing"
appearance="secondary"
full
href=${this.createCommandLink<AssociateIssueWithBranchCommandArgs>('gitlens.associateIssueWithBranch', {
branch: this.branch.reference,
source: 'home',
})}
>Associate an Issue</gl-button
>`;
return nothing;
}

const indicator: GlCard['indicator'] = this.branch.opened ? 'base' : undefined;
Expand Down