Skip to content

Commit 16533b5

Browse files
committed
Removes create PR when missing upstream
1 parent b4394c4 commit 16533b5

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

src/webviews/apps/plus/home/components/active-work.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,30 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
8989
<span slot="heading"
9090
><code-icon icon="repo" class="heading-icon"></code-icon> ${overview!.repository.name}</span
9191
>
92-
${when(
93-
this._homeState.repositories.openCount > 1,
94-
() =>
95-
html`<span slot="heading-actions"
96-
><gl-button
92+
<span slot="heading-actions"
93+
><gl-button
94+
aria-busy="${ifDefined(isFetching)}"
95+
?disabled=${isFetching}
96+
class="section-heading-action"
97+
appearance="toolbar"
98+
tooltip="Open in Commit Graph"
99+
@click=${(e: MouseEvent) => this.onChange(e)}
100+
><code-icon icon="gl-graph"></code-icon
101+
></gl-button>
102+
${when(
103+
this._homeState.repositories.openCount > 1,
104+
() =>
105+
html`<gl-button
97106
aria-busy="${ifDefined(isFetching)}"
98107
?disabled=${isFetching}
99108
class="section-heading-action"
100109
appearance="toolbar"
101110
tooltip="Change Repository"
102111
@click=${(e: MouseEvent) => this.onChange(e)}
103-
><code-icon icon="chevron-down"></code-icon></gl-button
104-
></span>`,
105-
)}
112+
><code-icon icon="chevron-down"></code-icon
113+
></gl-button>`,
114+
)}</span
115+
>
106116
${activeBranches.map(branch => this.renderRepoBranchCard(branch, repo.path, isFetching))}
107117
</gl-section>
108118
`;
@@ -161,7 +171,7 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
161171
href=${createCommandLink('gitlens.home.openPullRequestOnRemote', branchRefs)}
162172
></action-item>`,
163173
);
164-
} else {
174+
} else if (branch.upstream?.missing === false) {
165175
actions.push(
166176
html`<action-item
167177
label="Create Pull Request..."

src/webviews/apps/plus/home/components/branch-section.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,32 @@ import '../../../shared/components/actions/action-nav';
1717

1818
type OverviewBranch = GetOverviewBranch;
1919

20-
export const sectionHeadingStyles = css`
21-
.section-heading {
22-
font-size: 1.3rem;
23-
font-weight: normal;
24-
margin-block: 0 0.8rem;
25-
text-transform: uppercase;
26-
}
27-
.section-heading--actions {
28-
display: flex;
29-
justify-content: space-between;
30-
gap: 8px;
31-
}
32-
`;
33-
3420
@customElement('gl-section')
3521
export class GlSection extends LitElement {
3622
static override styles = [
37-
sectionHeadingStyles,
3823
css`
3924
.section {
4025
margin-bottom: 1.2rem;
4126
}
27+
.section__heading {
28+
display: flex;
29+
justify-content: space-between;
30+
gap: 8px;
31+
margin-block: 0 0.8rem;
32+
font-size: 1.3rem;
33+
}
34+
.section__headline {
35+
font-weight: normal;
36+
text-transform: uppercase;
37+
}
4238
`,
4339
];
4440

4541
override render() {
4642
return html`
4743
<div class="section">
48-
<h3 class="section-heading section-heading--actions">
49-
<slot name="heading"></slot><slot name="heading-actions"></slot>
44+
<h3 class="section__heading section__heading--actions">
45+
<slot name="heading" class="section__headline"></slot><slot name="heading-actions"></slot>
5046
</h3>
5147
<slot></slot>
5248
</div>
@@ -321,7 +317,7 @@ export class GlBranchCard extends LitElement {
321317
href=${this.createCommandLink('gitlens.home.openPullRequestOnRemote')}
322318
></action-item>`,
323319
);
324-
} else {
320+
} else if (this.branch.upstream?.missing === false) {
325321
actions.push(
326322
html`<action-item
327323
label="Create Pull Request..."

0 commit comments

Comments
 (0)