Skip to content

Commit

Permalink
Updates Start Work and Associate Issue flows
Browse files Browse the repository at this point in the history
  • Loading branch information
axosoft-ramint committed Mar 10, 2025
1 parent 0641c88 commit e969614
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/commands/quickCommand.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2705,6 +2705,28 @@ export async function* ensureAccessStep<
createQuickPickSeparator(),
);
break;
case PlusFeatures.StartWork:
directives.splice(
0,
0,
createDirectiveQuickPickItem(Directive.Noop, undefined, {
label: 'Start work on an issue from your connected integrations',
iconPath: new ThemeIcon('issues'),
}),
createQuickPickSeparator(),
);
break;
case PlusFeatures.AssociateIssueWithBranch:
directives.splice(
0,
0,
createDirectiveQuickPickItem(Directive.Noop, undefined, {
label: 'Connect your branches to their associated issues in Home view',
iconPath: new ThemeIcon('issues'),
}),
createQuickPickSeparator(),
);
break;
case PlusFeatures.Worktrees:
directives.splice(
0,
Expand Down
2 changes: 2 additions & 0 deletions src/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export const enum PlusFeatures {
Worktrees = 'worktrees',
Graph = 'graph',
Launchpad = 'launchpad',
StartWork = 'startWork',
AssociateIssueWithBranch = 'associateIssueWithBranch',
}

export type FeaturePreviews = 'graph';
Expand Down
14 changes: 14 additions & 0 deletions src/plus/startWork/startWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ import {
OpenOnGitLabQuickInputButton,
OpenOnJiraQuickInputButton,
} from '../../commands/quickCommand.buttons';
import { ensureAccessStep } from '../../commands/quickCommand.steps';
import { getSteps } from '../../commands/quickWizard.utils';
import { proBadge } from '../../constants';
import type { IntegrationId } from '../../constants.integrations';
import { HostingIntegrationId, IssueIntegrationId, SelfHostedIntegrationId } from '../../constants.integrations';
import type { Source, Sources, StartWorkTelemetryContext, TelemetryEvents } from '../../constants.telemetry';
import type { Container } from '../../container';
import { PlusFeatures } from '../../features';
import type { Issue, IssueShape } from '../../git/models/issue';
import type { GitBranchReference } from '../../git/models/reference';
import type { Repository } from '../../git/models/repository';
Expand Down Expand Up @@ -214,6 +216,18 @@ export abstract class StartWorkBaseCommand extends QuickCommand<State> {
}
}

let plusFeature: PlusFeatures | undefined;
if (this.key === 'startWork') {
plusFeature = PlusFeatures.StartWork;
} else if (this.key === 'associateIssueWithBranch') {
plusFeature = PlusFeatures.AssociateIssueWithBranch;
}

if (plusFeature != null) {
const result = yield* ensureAccessStep(this.container, state, context, plusFeature);
if (result === StepResultBreak) continue;
}

if (state.counter < 1 || state.item == null) {
if (this.container.telemetry.enabled) {
this.container.telemetry.sendEvent(
Expand Down

0 comments on commit e969614

Please sign in to comment.