File tree Expand file tree Collapse file tree 3 files changed +38
-7
lines changed
webviews/apps/plus/home/components Expand file tree Collapse file tree 3 files changed +38
-7
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export class QuickWizardRootStep implements QuickPickStep<QuickCommand> {
115
115
}
116
116
117
117
if ( args ?. command === 'startWork' ) {
118
- this . hiddenItems . push ( new StartWorkCommand ( container ) ) ;
118
+ this . hiddenItems . push ( new StartWorkCommand ( container , args ) ) ;
119
119
}
120
120
}
121
121
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ type StartWorkTypeItem = { type: StartWorkType };
65
65
export interface StartWorkCommandArgs {
66
66
readonly command : 'startWork' ;
67
67
source ?: Sources ;
68
+ type ?: StartWorkType ;
68
69
}
69
70
70
71
export const supportedStartWorkIntegrations = [ HostingIntegrationId . GitHub , IssueIntegrationId . Jira ] ;
@@ -87,7 +88,8 @@ export class StartWorkCommand extends QuickCommand<State> {
87
88
}
88
89
89
90
this . initialState = {
90
- counter : 0 ,
91
+ counter : args ?. type != null ? 1 : 0 ,
92
+ type : args ?. type ,
91
93
} ;
92
94
}
93
95
@@ -108,7 +110,7 @@ export class StartWorkCommand extends QuickCommand<State> {
108
110
const hasConnectedIntegrations = this . hasConnectedIntegrations ( context ) ;
109
111
context . title = this . title ;
110
112
111
- if ( state . counter < 1 ) {
113
+ if ( state . counter < 1 || state . type == null ) {
112
114
if ( this . container . telemetry . enabled ) {
113
115
this . container . telemetry . sendEvent (
114
116
opened ? 'startWork/steps/type' : 'startWork/opened' ,
@@ -124,6 +126,7 @@ export class StartWorkCommand extends QuickCommand<State> {
124
126
const result = yield * this . selectTypeStep ( state ) ;
125
127
if ( result === StepResultBreak ) continue ;
126
128
state . type = result . type ;
129
+
127
130
if ( this . container . telemetry . enabled ) {
128
131
this . container . telemetry . sendEvent (
129
132
'startWork/type/chosen' ,
Original file line number Diff line number Diff line change @@ -112,7 +112,30 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
112
112
} ) ;
113
113
114
114
get startWorkCommand ( ) {
115
- return createCommandLink < StartWorkCommandArgs > ( Commands . StartWork , { command : 'startWork' , source : 'home' } ) ;
115
+ return createCommandLink < StartWorkCommandArgs > ( Commands . StartWork , {
116
+ command : 'startWork' ,
117
+ source : 'home' ,
118
+ type : 'issue' ,
119
+ } ) ;
120
+ }
121
+
122
+ get createBranchCommand ( ) {
123
+ return createCommandLink < StartWorkCommandArgs > ( Commands . StartWork , {
124
+ command : 'startWork' ,
125
+ source : 'home' ,
126
+ type : 'branch' ,
127
+ } ) ;
128
+ // TODO: Switch to using the base git command once we support sending source telemetry to that command, and then clean up start work
129
+ // command to just be for issues and remove "type" param
130
+ /*return createCommandLink<BranchGitCommandArgs>(Commands.GitCommands, {
131
+ command: 'branch',
132
+ state: {
133
+ subcommand: 'create',
134
+ suggestNameOnly: true,
135
+ suggestRepoOnly: true,
136
+ confirmOptions: ['--switch', '--worktree'],
137
+ },
138
+ });*/
116
139
}
117
140
118
141
override connectedCallback ( ) {
@@ -133,9 +156,14 @@ export class GlLaunchpad extends SignalWatcher(LitElement) {
133
156
< span slot ="heading "> GitLens Launchpad</ span >
134
157
< div class ="summary "> ${ this . renderSummaryResult ( ) } </ div >
135
158
< button-container >
136
- < gl-button full class ="start-work " href =${ this . startWorkCommand }
137
- > < code-icon icon ="custom-start-work " slot ="prefix "> </ code-icon > Start Work</ gl-button
138
- >
159
+ < gl-button full class ="start-work " href =${ this . startWorkCommand } > Start Work on an Issue</ gl-button >
160
+ < gl-button
161
+ appearance ="secondary "
162
+ density ="compact "
163
+ class ="start-work "
164
+ href =${ this . createBranchCommand }
165
+ > < code-icon icon ="custom-start-work "> </ code-icon
166
+ > </ gl-button >
139
167
</ button-container >
140
168
</ gl-section >
141
169
` ;
You can’t perform that action at this time.
0 commit comments