Skip to content

Commit e969614

Browse files
Updates Start Work and Associate Issue flows
1 parent 0641c88 commit e969614

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

src/commands/quickCommand.steps.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,28 @@ export async function* ensureAccessStep<
27052705
createQuickPickSeparator(),
27062706
);
27072707
break;
2708+
case PlusFeatures.StartWork:
2709+
directives.splice(
2710+
0,
2711+
0,
2712+
createDirectiveQuickPickItem(Directive.Noop, undefined, {
2713+
label: 'Start work on an issue from your connected integrations',
2714+
iconPath: new ThemeIcon('issues'),
2715+
}),
2716+
createQuickPickSeparator(),
2717+
);
2718+
break;
2719+
case PlusFeatures.AssociateIssueWithBranch:
2720+
directives.splice(
2721+
0,
2722+
0,
2723+
createDirectiveQuickPickItem(Directive.Noop, undefined, {
2724+
label: 'Connect your branches to their associated issues in Home view',
2725+
iconPath: new ThemeIcon('issues'),
2726+
}),
2727+
createQuickPickSeparator(),
2728+
);
2729+
break;
27082730
case PlusFeatures.Worktrees:
27092731
directives.splice(
27102732
0,

src/features.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export const enum PlusFeatures {
4141
Worktrees = 'worktrees',
4242
Graph = 'graph',
4343
Launchpad = 'launchpad',
44+
StartWork = 'startWork',
45+
AssociateIssueWithBranch = 'associateIssueWithBranch',
4446
}
4547

4648
export type FeaturePreviews = 'graph';

src/plus/startWork/startWork.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ import {
2626
OpenOnGitLabQuickInputButton,
2727
OpenOnJiraQuickInputButton,
2828
} from '../../commands/quickCommand.buttons';
29+
import { ensureAccessStep } from '../../commands/quickCommand.steps';
2930
import { getSteps } from '../../commands/quickWizard.utils';
3031
import { proBadge } from '../../constants';
3132
import type { IntegrationId } from '../../constants.integrations';
3233
import { HostingIntegrationId, IssueIntegrationId, SelfHostedIntegrationId } from '../../constants.integrations';
3334
import type { Source, Sources, StartWorkTelemetryContext, TelemetryEvents } from '../../constants.telemetry';
3435
import type { Container } from '../../container';
36+
import { PlusFeatures } from '../../features';
3537
import type { Issue, IssueShape } from '../../git/models/issue';
3638
import type { GitBranchReference } from '../../git/models/reference';
3739
import type { Repository } from '../../git/models/repository';
@@ -214,6 +216,18 @@ export abstract class StartWorkBaseCommand extends QuickCommand<State> {
214216
}
215217
}
216218

219+
let plusFeature: PlusFeatures | undefined;
220+
if (this.key === 'startWork') {
221+
plusFeature = PlusFeatures.StartWork;
222+
} else if (this.key === 'associateIssueWithBranch') {
223+
plusFeature = PlusFeatures.AssociateIssueWithBranch;
224+
}
225+
226+
if (plusFeature != null) {
227+
const result = yield* ensureAccessStep(this.container, state, context, plusFeature);
228+
if (result === StepResultBreak) continue;
229+
}
230+
217231
if (state.counter < 1 || state.item == null) {
218232
if (this.container.telemetry.enabled) {
219233
this.container.telemetry.sendEvent(

0 commit comments

Comments
 (0)