Skip to content

Commit

Permalink
v 0.18.1
Browse files Browse the repository at this point in the history
Bug Fixes

- solved work log submitting
  • Loading branch information
gioboa committed Jul 5, 2019
1 parent 79dfbe0 commit 6e60273
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.18.1

### Bug Fixes

- solved work log submitting

## 0.18.0

### Features
Expand Down
20 changes: 16 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jira-plugin",
"displayName": "Jira Plugin",
"description": "Manage your on-premises/cloud Jira in vscode",
"version": "0.18.0",
"version": "0.18.1",
"publisher": "gioboa",
"icon": "images/icons/icon.png",
"galleryBanner": {
Expand Down Expand Up @@ -408,6 +408,6 @@
"vscode": "^1.1.35"
},
"dependencies": {
"jira-connector": "^2.15.3"
"jira-connector": "^2.15.5"
}
}
11 changes: 9 additions & 2 deletions src/commands/issue-add-worklog.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import * as vscode from 'vscode';
import { logger, store } from '../services';
import { NO_WORKING_ISSUE } from '../shared/constants';
import openIssue from './open-issue';

export default async function issueAddWorklog(issueKey: string, timeSpentSeconds: number, comment: string): Promise<void> {
try {
if (issueKey !== NO_WORKING_ISSUE.key) {
if (store.canExecuteJiraAPI()) {
// call Jira API
const response = await store.state.jira.addWorkLog({
issueKey: issueKey,
worklog: { timeSpentSeconds: Math.ceil(timeSpentSeconds / 60) * 60, comment }
issueKey,
timeSpentSeconds: Math.ceil(timeSpentSeconds / 60) * 60,
comment
});
const action = await vscode.window.showInformationMessage(`Worklog added`, 'Open in browser');
if (action === 'Open in browser') {
openIssue(issueKey);
}
}
}
} catch (err) {
Expand Down
3 changes: 2 additions & 1 deletion src/services/http.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface IJira {
setTransition(params: { issueKey: string; transition: ISetTransition }): Promise<void>;
setAssignIssue(params: { issueKey: string; assignee: string }): Promise<void>;
addNewComment(params: { issueKey: string; comment: IAddComment }): Promise<IAddCommentResponse>;
addWorkLog(params: { issueKey: string; worklog: IAddWorkLog }): Promise<void>;
addWorkLog(params: IAddWorkLog): Promise<void>;
getAllIssueTypes(): Promise<IIssueType[]>;
createIssue(params: ICreateIssue): Promise<any>;
getAllPriorities(): Promise<IPriority[]>;
Expand Down Expand Up @@ -109,6 +109,7 @@ export interface IWorkingIssue {
}

export interface IAddWorkLog {
issueKey: string;
timeSpentSeconds: number;
comment?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class Jira implements IJira {
return await this.jiraInstance.issue.addComment(params);
}

async addWorkLog(params: { issueKey: string; worklog: IAddWorkLog }): Promise<void> {
async addWorkLog(params: IAddWorkLog): Promise<void> {
return await this.jiraInstance.issue.addWorkLog(params);
}

Expand Down

0 comments on commit 6e60273

Please sign in to comment.