Skip to content

Commit 83616c7

Browse files
committed
v 0.22.2
Bug Fixes - Fixed add comment feature
1 parent f8b4ef0 commit 83616c7

27 files changed

+147
-137
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.22.2
2+
3+
### Bug Fixes
4+
5+
- Fixed add comment feature
6+
17
## 0.22.1
28

39
### Bug Fixes

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "jira-plugin",
33
"displayName": "Jira Plugin",
44
"description": "Manage your on-premises/cloud Jira in vscode",
5-
"version": "0.22.1",
5+
"version": "0.22.2",
66
"publisher": "gioboa",
77
"icon": "images/icons/icon.png",
88
"galleryBanner": {

src/commands/change-issue-status.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export default async function changeIssueStatus(issueItem: IssueItem): Promise<v
1313
issueKey: issue.key,
1414
transition: {
1515
transition: {
16-
id: newTransitionId
17-
}
18-
}
16+
id: newTransitionId,
17+
},
18+
},
1919
});
2020
await vscode.commands.executeCommand('jira-plugin.refresh');
2121
}

src/commands/create-issue.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
2020
// user cannot modify the values
2121
issueHelper.populateRequest({
2222
issuetype: {
23-
id: issueHelper.issueTypeSelected.id
23+
id: issueHelper.issueTypeSelected.id,
2424
},
2525
project: {
26-
key: project
27-
}
26+
key: project,
27+
},
2828
});
2929
let loopStatus = issueHelper.NEW_ISSUE_STATUS.CONTINUE;
3030
// this variable is used for retrieve only one time the available values inside the loop
@@ -54,7 +54,7 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
5454
? issueHelper.newIssueIstance[fieldName].toString()
5555
: `Insert ${field.name}`,
5656
pickValue: field,
57-
fieldSchema: field.schema
57+
fieldSchema: field.schema,
5858
});
5959
}
6060
}
@@ -65,23 +65,23 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
6565
{
6666
field: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.field,
6767
label: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.label,
68-
description: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.description
68+
description: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.description,
6969
},
7070
{
7171
field: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.field,
7272
label: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.label,
73-
description: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.description
73+
description: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.description,
7474
},
7575
{
7676
field: issueHelper.NEW_ISSUE_FIELDS.EXIT.field,
7777
label: issueHelper.NEW_ISSUE_FIELDS.EXIT.label,
78-
description: issueHelper.NEW_ISSUE_FIELDS.EXIT.description
78+
description: issueHelper.NEW_ISSUE_FIELDS.EXIT.description,
7979
}
8080
);
8181
// second selector with all the fields
8282
const fieldToModifySelection = await vscode.window.showQuickPick(newIssuePicks, {
8383
placeHolder: `Insert Jira issue`,
84-
matchOnDescription: true
84+
matchOnDescription: true,
8585
});
8686
// manage the selected field from selector
8787
if (!!fieldToModifySelection && fieldToModifySelection.field !== issueHelper.NEW_ISSUE_FIELDS.DIVIDER.field) {
@@ -116,11 +116,11 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
116116
// from the preloaded values we generate selector items
117117
const generatePicks = (values: any[]) => {
118118
return values
119-
.map(value => {
119+
.map((value) => {
120120
return {
121121
pickValue: value,
122122
label: issueHelper.getPickValue(value),
123-
description: value.description || value.summary || ''
123+
description: value.description || value.summary || '',
124124
};
125125
})
126126
.sort((a, b) => (a.label < b.label ? -1 : a.label > b.label ? 1 : 0));
@@ -138,20 +138,20 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
138138
value:
139139
fieldToModifySelection.description !== `Insert ${fieldToModifySelection.pickValue.name}`
140140
? fieldToModifySelection.description
141-
: undefined
141+
: undefined,
142142
});
143143
// update user choices
144144
issueHelper.newIssueIstance[fieldToModifySelection.field] = text;
145145
// update payload
146146
if (issueHelper.isIssueTimetrackingOriginalEstimateField(fieldToModifySelection.field)) {
147147
issueHelper.requestJson[issueHelper.timetrakingJsonField] = {
148148
...issueHelper.requestJson[issueHelper.timetrakingJsonField],
149-
originalEstimate: text
149+
originalEstimate: text,
150150
};
151151
} else if (issueHelper.isIssueTimetrackingRemainingEstimateField(fieldToModifySelection.field)) {
152152
issueHelper.requestJson[issueHelper.timetrakingJsonField] = {
153153
...issueHelper.requestJson[issueHelper.timetrakingJsonField],
154-
remainingEstimate: text
154+
remainingEstimate: text,
155155
};
156156
} else {
157157
issueHelper.requestJson[fieldToModifySelection.field] = text;
@@ -167,7 +167,7 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
167167
value:
168168
fieldToModifySelection.description !== `Insert ${fieldToModifySelection.pickValue.name}`
169169
? fieldToModifySelection.description
170-
: undefined
170+
: undefined,
171171
});
172172
if (!!text) {
173173
// update user choices
@@ -189,7 +189,7 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
189189
{
190190
placeHolder: `Insert value`,
191191
matchOnDescription: true,
192-
canPickMany
192+
canPickMany,
193193
}
194194
);
195195
// clear previous selection
@@ -238,9 +238,9 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
238238
const values = newValueSelected.map((value: any) => value.pickValue[jsonField]);
239239
issueHelper.requestJson[fieldToModifySelection.field] = !canPickMany
240240
? {
241-
[jsonField]: values[0]
241+
[jsonField]: values[0],
242242
}
243-
: values.map(value => {
243+
: values.map((value) => {
244244
return { [jsonField]: value };
245245
});
246246
}

src/commands/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default {
6868
registerCommand('jira-plugin.openGitHubRepo', openGitHubRepo),
6969

7070
// git integration commands
71-
registerCommand('jira-plugin.checkoutGitBranch', gitIntegration.invokeCheckoutBranch)
71+
registerCommand('jira-plugin.checkoutGitBranch', gitIntegration.invokeCheckoutBranch),
7272
];
73-
}
73+
},
7474
};

src/commands/issue-add-comment.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default async function issueAddComment(issueItem: IssueItem, markAsIntern
99
let issue = issueItem.issue;
1010
let text = await vscode.window.showInputBox({
1111
ignoreFocusOut: true,
12-
placeHolder: 'Comment text...'
12+
placeHolder: 'Comment text...',
1313
});
1414
if (!!text) {
1515
// ask for assignee if there is one or more [@] in the comment
@@ -32,10 +32,10 @@ export default async function issueAddComment(issueItem: IssueItem, markAsIntern
3232
{
3333
key: 'sd.public.comment',
3434
value: {
35-
internal: true
36-
}
37-
}
38-
]
35+
internal: true,
36+
},
37+
},
38+
],
3939
};
4040
const response = await store.state.jira.addNewComment({ issueKey: issue.key, comment });
4141
await vscode.commands.executeCommand('jira-plugin.refresh');

src/commands/set-working-issue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default async function setWorkingIssue(storedWorkingIssue: IWorkingIssue,
5050
action === ACTIONS.YES_WITH_COMMENT
5151
? await vscode.window.showInputBox({
5252
ignoreFocusOut: true,
53-
placeHolder: 'Add worklog comment...'
53+
placeHolder: 'Add worklog comment...',
5454
})
5555
: '';
5656
if (action === ACTIONS.YES || action === ACTIONS.YES_WITH_COMMENT) {

src/commands/setup-credentials.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async function setupCredentials(): Promise<void> {
1919
await vscode.window.showInputBox({
2020
ignoreFocusOut: true,
2121
password: false,
22-
placeHolder: 'Your Jira url'
22+
placeHolder: 'Your Jira url',
2323
})
2424
);
2525

@@ -28,15 +28,15 @@ export default async function setupCredentials(): Promise<void> {
2828
await vscode.window.showInputBox({
2929
ignoreFocusOut: true,
3030
password: false,
31-
placeHolder: 'Your Jira username or full email for OAuth'
31+
placeHolder: 'Your Jira username or full email for OAuth',
3232
})
3333
);
3434

3535
configuration.setPassword(
3636
await vscode.window.showInputBox({
3737
ignoreFocusOut: true,
3838
password: true,
39-
placeHolder: 'Your Jira password or token for OAuth'
39+
placeHolder: 'Your Jira password or token for OAuth',
4040
})
4141
);
4242

src/commands/stop-working-issue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default async function stopWorkingIssue(storedWorkingIssue: IWorkingIssue
1818
// To re-implement being asked if you want to store a comment, remove the following let, uncomment until the if (!!comment) and replace it with the if (action...)
1919
let comment = await vscode.window.showInputBox({
2020
ignoreFocusOut: true,
21-
placeHolder: 'Add worklog comment...'
21+
placeHolder: 'Add worklog comment...',
2222
});
2323
// let action = await vscode.window.showInformationMessage(
2424
// `Add worklog for the previous working issue ${workingIssue.issue.key} | timeSpent: ${utilities.secondsToHHMMSS(

src/explorer/issues-explorer.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
5555
const description = this.descPropertyFromField(item.issue.fields[field.value]);
5656
if (
5757
!groupItems.find(
58-
el => el.item.contextValue === new GroupItem('', '').contextValue && this.getLabel(field.label, description) === el.item.label
58+
(el) => el.item.contextValue === new GroupItem('', '').contextValue && this.getLabel(field.label, description) === el.item.label
5959
)
6060
) {
6161
groupItems.push({ index, item: new GroupItem(this.getLabel(field.label, description), description) });
6262
}
6363
}
6464
});
6565
let pushed = 0;
66-
groupItems.forEach(groupItem => {
66+
groupItems.forEach((groupItem) => {
6767
items.splice(groupItem.index + pushed, 0, groupItem.item);
6868
pushed += 1;
6969
});
@@ -81,7 +81,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
8181
const subtasksKeysToRemove: string[] = [];
8282
// check if subtasks has same field group value
8383
for (let subtask of issue.fields.subtasks) {
84-
const issuesElement = issues.find(issue => issue.key === subtask.key);
84+
const issuesElement = issues.find((issue) => issue.key === subtask.key);
8585
// if isn't in issue list in not filter compliant
8686
if (!issuesElement) {
8787
subtasksKeysToRemove.push(subtask.key);
@@ -100,7 +100,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
100100
// if subtask has different group field value I will delete from subtasks list and I will change issue label
101101
issue.fields.subtasks = issue.fields.subtasks.filter((subtask: IIssue) => !subtasksKeysToRemove.includes(subtask.key));
102102
for (let subtaskKey of subtasksKeysToRemove) {
103-
const element = issues.find(issue => issue.key === subtaskKey);
103+
const element = issues.find((issue) => issue.key === subtaskKey);
104104
if (element) {
105105
element.fields.summary += ` - Parent Task: ${issue.key}`;
106106
}
@@ -117,7 +117,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
117117
let issues = store.state.issues;
118118
// generate all the item from issues saved in global state
119119
if (issues.length > 0) {
120-
if (issues.some(issue => !issue.fields.hasOwnProperty(this.groupByField.value))) {
120+
if (issues.some((issue) => !issue.fields.hasOwnProperty(this.groupByField.value))) {
121121
logger.printErrorMessageInOutputAndShowAlert(
122122
`Invalid grouping field: ${this.groupByField.value} - fallback is ${this.fallbackGroupByField.label}`
123123
);
@@ -131,11 +131,11 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
131131

132132
const items: IssueItem[] = issues
133133
.map(
134-
issue =>
134+
(issue) =>
135135
new IssueItem(issue, {
136136
command: 'jira-plugin.openIssue',
137137
title: 'Open issue in the browser',
138-
arguments: [`${issue.key}`]
138+
arguments: [`${issue.key}`],
139139
})
140140
)
141141
.sort((itemA: IssueItem, itemB: IssueItem) => {
@@ -164,7 +164,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
164164
return [
165165
new FilterInfoItem(project, store.state.currentSearch.filter, issues.length),
166166
new DividerItem('------'),
167-
new NoResultItem(project)
167+
new NoResultItem(project),
168168
];
169169
}
170170
} else {
@@ -174,7 +174,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
174174
new IssueItem(subtask, {
175175
command: 'jira-plugin.openIssue',
176176
title: 'Open issue in the browser',
177-
arguments: [`${subtask.key}`]
177+
arguments: [`${subtask.key}`],
178178
})
179179
);
180180
}

src/explorer/item/filter-info-item.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class FilterInfoItem extends vscode.TreeItem {
1313

1414
iconPath = {
1515
light: utilities.getIconsPath(`light/${STATUS_ICONS.DEFAULT.file}`),
16-
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`)
16+
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`),
1717
};
1818

1919
contextValue = 'FilterInfoItem';

src/explorer/item/issue-item.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class IssueItem extends vscode.TreeItem {
1010
super(`${issue.key} - ${issue.fields.summary}`, vscode.TreeItemCollapsibleState.None);
1111
if (configuration.get(CONFIG.GROUP_TASK_AND_SUBTASKS) && this.isCollapsible(issue)) {
1212
this.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;
13-
this.label += ' - subtasks: ' + (issue.fields.subtasks || []).map(issue => issue.key).join(', ');
13+
this.label += ' - subtasks: ' + (issue.fields.subtasks || []).map((issue) => issue.key).join(', ');
1414
}
1515
}
1616

src/explorer/item/limit-info.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class LimitInfoItem extends vscode.TreeItem {
1414
private icon(status: string): string {
1515
let icon = STATUS_ICONS.DEFAULT.file;
1616
if (!!status) {
17-
Object.values(STATUS_ICONS).forEach(value => {
17+
Object.values(STATUS_ICONS).forEach((value) => {
1818
if (status.toUpperCase().indexOf(value.text.toUpperCase()) !== -1) {
1919
icon = value.file;
2020
}
@@ -25,7 +25,7 @@ export class LimitInfoItem extends vscode.TreeItem {
2525

2626
iconPath = {
2727
light: utilities.getIconsPath(`light/${STATUS_ICONS.DEFAULT.file}`),
28-
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`)
28+
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`),
2929
};
3030

3131
contextValue = 'LimitInfoItem';

src/explorer/item/loading-item.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class LoadingItem extends vscode.TreeItem {
1313

1414
iconPath = {
1515
light: utilities.getIconsPath(`light/${LOADING.file}`),
16-
dark: utilities.getIconsPath(`dark/${LOADING.file}`)
16+
dark: utilities.getIconsPath(`dark/${LOADING.file}`),
1717
};
1818

1919
contextValue = 'LoadingItem';

src/explorer/item/no-result-item.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class NoResultItem extends vscode.TreeItem {
1313

1414
iconPath = {
1515
light: utilities.getIconsPath(`light/${STATUS_ICONS.DEFAULT.file}`),
16-
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`)
16+
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`),
1717
};
1818

1919
contextValue = 'NoResultItem';

src/explorer/item/status-item.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class GroupItem extends vscode.TreeItem {
1414
private icon(status: string): string {
1515
let icon = STATUS_ICONS.DEFAULT.file;
1616
if (!!status) {
17-
Object.values(STATUS_ICONS).forEach(value => {
17+
Object.values(STATUS_ICONS).forEach((value) => {
1818
if (status.toUpperCase().indexOf(value.text.toUpperCase()) !== -1) {
1919
icon = value.file;
2020
}
@@ -25,7 +25,7 @@ export class GroupItem extends vscode.TreeItem {
2525

2626
iconPath = {
2727
light: utilities.getIconsPath(`light/${this.icon(this.fileName)}`),
28-
dark: utilities.getIconsPath(`dark/${this.icon(this.fileName)}`)
28+
dark: utilities.getIconsPath(`dark/${this.icon(this.fileName)}`),
2929
};
3030

3131
contextValue = 'GroupItem';

src/picks/no-working-issue-pick.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ export default class NoWorkingIssuePick implements QuickPickItem {
1818
fields: {
1919
summary: '',
2020
status: {
21-
name: ''
21+
name: '',
2222
},
2323
project: {
2424
id: '',
2525
key: '',
26-
name: ''
27-
}
28-
}
26+
name: '',
27+
},
28+
},
2929
};
3030
}
3131
}

0 commit comments

Comments
 (0)