Skip to content

Commit 33e3cd8

Browse files
authored
Add inline action for start working
And a few linting errors Fixes #1717
1 parent bcfdc1b commit 33e3cd8

3 files changed

Lines changed: 29 additions & 12 deletions

File tree

package.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,14 @@
642642
{
643643
"command": "issue.startWorking",
644644
"title": "Start Working on Issue",
645-
"category": "GitHub Issues"
645+
"category": "GitHub Issues",
646+
"icon": "$(arrow-right)"
646647
},
647648
{
648649
"command": "issue.continueWorking",
649650
"title": "Continue Working on Issue",
650-
"category": "GitHub Issues"
651+
"category": "GitHub Issues",
652+
"icon": "$(arrow-right)"
651653
},
652654
{
653655
"command": "issue.startWorkingBranchPrompt",
@@ -657,7 +659,8 @@
657659
{
658660
"command": "issue.stopWorking",
659661
"title": "Stop Working on Issue",
660-
"category": "GitHub Issues"
662+
"category": "GitHub Issues",
663+
"icon": "$(primitive-square)"
661664
},
662665
{
663666
"command": "issue.statusBar",
@@ -1009,13 +1012,23 @@
10091012
{
10101013
"command": "issue.openIssue",
10111014
"when": "view =~ /issues:github/ && viewItem =~ /(current|continue)?issue/",
1012-
"group": "inline"
1015+
"group": "inline@2"
10131016
},
10141017
{
10151018
"command": "issue.openIssue",
10161019
"when": "view =~ /issues:github/ && viewItem =~ /(current|continue)?issue/",
10171020
"group": "issues_0@0"
10181021
},
1022+
{
1023+
"command": "issue.startWorking",
1024+
"when": "view =~ /issues:github/ && viewItem == issue",
1025+
"group": "inline@1"
1026+
},
1027+
{
1028+
"command": "issue.startWorking",
1029+
"when": "view =~ /issues:github/ && viewItem == continueissue",
1030+
"group": "inline@1"
1031+
},
10191032
{
10201033
"command": "issue.startWorking",
10211034
"alt": "issue.startWorkingBranchPrompt",
@@ -1037,6 +1050,11 @@
10371050
"when": "view =~ /issues:github/ && viewItem == currentissue",
10381051
"group": "issues_0@2"
10391052
},
1053+
{
1054+
"command": "issue.stopWorking",
1055+
"when": "view =~ /issues:github/ && viewItem == currentissue",
1056+
"group": "inline@1"
1057+
},
10401058
{
10411059
"command": "issue.copyIssueNumber",
10421060
"when": "view =~ /issues:github/ && viewItem =~ /(current|continue)?issue/",

src/commands.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { resolveCommentHandler, CommentReply } from './commentHandlerResolver';
2929
import { ITelemetry } from './common/telemetry';
3030
import { TreeNode } from './view/treeNodes/treeNode';
3131
import { CredentialStore, GitHub } from './github/credentials';
32-
import { debounce, throttle } from './common/async';
3332
import { GitAPI } from './typings/git';
3433

3534
const _onDidUpdatePR = new vscode.EventEmitter<PullRequest | undefined>();
@@ -590,12 +589,12 @@ export function registerGlobalCommands(context: vscode.ExtensionContext, gitAPI:
590589
let repo: string | undefined;
591590

592591
const onDidChangeValue = async () => {
593-
const repo = sanitizeRepositoryName(quickpick.value);
592+
const sanitizedRepo = sanitizeRepositoryName(quickpick.value);
594593

595-
if (!repo) {
594+
if (!sanitizedRepo) {
596595
quickpick.items = [];
597596
} else {
598-
quickpick.items = [{ label: `$(repo) Create private repository`, description: `$(github) ${owner}/${repo}`, alwaysShow: true, repo: repo }];
597+
quickpick.items = [{ label: `$(repo) Create private repository`, description: `$(github) ${owner}/${sanitizedRepo}`, alwaysShow: true, repo: sanitizedRepo }];
599598
}
600599
};
601600

@@ -636,7 +635,7 @@ export function registerGlobalCommands(context: vscode.ExtensionContext, gitAPI:
636635
private: true
637636
});
638637

639-
const githubRepository = res.data;
638+
const createdGithubRepository = res.data;
640639

641640
progress.report({ message: 'Creating first commit', increment: 25 });
642641
const repository = await gitAPI.init(folder.uri);
@@ -648,10 +647,10 @@ export function registerGlobalCommands(context: vscode.ExtensionContext, gitAPI:
648647
await repository.commit('first commit', { all: true });
649648

650649
progress.report({ message: 'Uploading files', increment: 25 });
651-
await repository.addRemote('origin', githubRepository.clone_url);
650+
await repository.addRemote('origin', createdGithubRepository.clone_url);
652651
await repository.push('origin', 'master', true);
653652

654-
return githubRepository;
653+
return createdGithubRepository;
655654
});
656655

657656
if (!githubRepository) {

src/issues/issueFeatureRegistrar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ export class IssueFeatureRegistrar implements vscode.Disposable {
332332
} catch (e) {
333333
// leave defaults undefined
334334
}
335-
const stopWorkingText: string = `$(circle-slash) Stop working on #${this._stateManager.currentIssue.issue.number}`;
335+
const stopWorkingText: string = `$(primitive-square) Stop working on #${this._stateManager.currentIssue.issue.number}`;
336336
const choices = this._stateManager.currentIssue.branchName && defaults ? [openIssueText, pullRequestText, draftPullRequestText, stopWorkingText] : [openIssueText, pullRequestText, draftPullRequestText, stopWorkingText];
337337
const response: string | undefined = await vscode.window.showQuickPick(choices, { placeHolder: 'Current issue options' });
338338
switch (response) {

0 commit comments

Comments
 (0)