Skip to content

Commit

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

- Fixed add comment feature
  • Loading branch information
gioboa committed Oct 27, 2020
1 parent f8b4ef0 commit 83616c7
Show file tree
Hide file tree
Showing 27 changed files with 147 additions and 137 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.22.2

### Bug Fixes

- Fixed add comment feature

## 0.22.1

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion 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.22.1",
"version": "0.22.2",
"publisher": "gioboa",
"icon": "images/icons/icon.png",
"galleryBanner": {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/change-issue-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default async function changeIssueStatus(issueItem: IssueItem): Promise<v
issueKey: issue.key,
transition: {
transition: {
id: newTransitionId
}
}
id: newTransitionId,
},
},
});
await vscode.commands.executeCommand('jira-plugin.refresh');
}
Expand Down
34 changes: 17 additions & 17 deletions src/commands/create-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
// user cannot modify the values
issueHelper.populateRequest({
issuetype: {
id: issueHelper.issueTypeSelected.id
id: issueHelper.issueTypeSelected.id,
},
project: {
key: project
}
key: project,
},
});
let loopStatus = issueHelper.NEW_ISSUE_STATUS.CONTINUE;
// this variable is used for retrieve only one time the available values inside the loop
Expand Down Expand Up @@ -54,7 +54,7 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
? issueHelper.newIssueIstance[fieldName].toString()
: `Insert ${field.name}`,
pickValue: field,
fieldSchema: field.schema
fieldSchema: field.schema,
});
}
}
Expand All @@ -65,23 +65,23 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
{
field: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.field,
label: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.label,
description: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.description
description: issueHelper.NEW_ISSUE_FIELDS.DIVIDER.description,
},
{
field: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.field,
label: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.label,
description: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.description
description: issueHelper.NEW_ISSUE_FIELDS.INSERT_ISSUE.description,
},
{
field: issueHelper.NEW_ISSUE_FIELDS.EXIT.field,
label: issueHelper.NEW_ISSUE_FIELDS.EXIT.label,
description: issueHelper.NEW_ISSUE_FIELDS.EXIT.description
description: issueHelper.NEW_ISSUE_FIELDS.EXIT.description,
}
);
// second selector with all the fields
const fieldToModifySelection = await vscode.window.showQuickPick(newIssuePicks, {
placeHolder: `Insert Jira issue`,
matchOnDescription: true
matchOnDescription: true,
});
// manage the selected field from selector
if (!!fieldToModifySelection && fieldToModifySelection.field !== issueHelper.NEW_ISSUE_FIELDS.DIVIDER.field) {
Expand Down Expand Up @@ -116,11 +116,11 @@ export default async function createIssue(issueItem: IssueItem): Promise<void> {
// from the preloaded values we generate selector items
const generatePicks = (values: any[]) => {
return values
.map(value => {
.map((value) => {
return {
pickValue: value,
label: issueHelper.getPickValue(value),
description: value.description || value.summary || ''
description: value.description || value.summary || '',
};
})
.sort((a, b) => (a.label < b.label ? -1 : a.label > b.label ? 1 : 0));
Expand All @@ -138,20 +138,20 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
value:
fieldToModifySelection.description !== `Insert ${fieldToModifySelection.pickValue.name}`
? fieldToModifySelection.description
: undefined
: undefined,
});
// update user choices
issueHelper.newIssueIstance[fieldToModifySelection.field] = text;
// update payload
if (issueHelper.isIssueTimetrackingOriginalEstimateField(fieldToModifySelection.field)) {
issueHelper.requestJson[issueHelper.timetrakingJsonField] = {
...issueHelper.requestJson[issueHelper.timetrakingJsonField],
originalEstimate: text
originalEstimate: text,
};
} else if (issueHelper.isIssueTimetrackingRemainingEstimateField(fieldToModifySelection.field)) {
issueHelper.requestJson[issueHelper.timetrakingJsonField] = {
...issueHelper.requestJson[issueHelper.timetrakingJsonField],
remainingEstimate: text
remainingEstimate: text,
};
} else {
issueHelper.requestJson[fieldToModifySelection.field] = text;
Expand All @@ -167,7 +167,7 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
value:
fieldToModifySelection.description !== `Insert ${fieldToModifySelection.pickValue.name}`
? fieldToModifySelection.description
: undefined
: undefined,
});
if (!!text) {
// update user choices
Expand All @@ -189,7 +189,7 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
{
placeHolder: `Insert value`,
matchOnDescription: true,
canPickMany
canPickMany,
}
);
// clear previous selection
Expand Down Expand Up @@ -238,9 +238,9 @@ const manageSelectedField = async (fieldToModifySelection: any): Promise<void> =
const values = newValueSelected.map((value: any) => value.pickValue[jsonField]);
issueHelper.requestJson[fieldToModifySelection.field] = !canPickMany
? {
[jsonField]: values[0]
[jsonField]: values[0],
}
: values.map(value => {
: values.map((value) => {
return { [jsonField]: value };
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default {
registerCommand('jira-plugin.openGitHubRepo', openGitHubRepo),

// git integration commands
registerCommand('jira-plugin.checkoutGitBranch', gitIntegration.invokeCheckoutBranch)
registerCommand('jira-plugin.checkoutGitBranch', gitIntegration.invokeCheckoutBranch),
];
}
},
};
10 changes: 5 additions & 5 deletions src/commands/issue-add-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function issueAddComment(issueItem: IssueItem, markAsIntern
let issue = issueItem.issue;
let text = await vscode.window.showInputBox({
ignoreFocusOut: true,
placeHolder: 'Comment text...'
placeHolder: 'Comment text...',
});
if (!!text) {
// ask for assignee if there is one or more [@] in the comment
Expand All @@ -32,10 +32,10 @@ export default async function issueAddComment(issueItem: IssueItem, markAsIntern
{
key: 'sd.public.comment',
value: {
internal: true
}
}
]
internal: true,
},
},
],
};
const response = await store.state.jira.addNewComment({ issueKey: issue.key, comment });
await vscode.commands.executeCommand('jira-plugin.refresh');
Expand Down
2 changes: 1 addition & 1 deletion src/commands/set-working-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default async function setWorkingIssue(storedWorkingIssue: IWorkingIssue,
action === ACTIONS.YES_WITH_COMMENT
? await vscode.window.showInputBox({
ignoreFocusOut: true,
placeHolder: 'Add worklog comment...'
placeHolder: 'Add worklog comment...',
})
: '';
if (action === ACTIONS.YES || action === ACTIONS.YES_WITH_COMMENT) {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/setup-credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function setupCredentials(): Promise<void> {
await vscode.window.showInputBox({
ignoreFocusOut: true,
password: false,
placeHolder: 'Your Jira url'
placeHolder: 'Your Jira url',
})
);

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

configuration.setPassword(
await vscode.window.showInputBox({
ignoreFocusOut: true,
password: true,
placeHolder: 'Your Jira password or token for OAuth'
placeHolder: 'Your Jira password or token for OAuth',
})
);

Expand Down
2 changes: 1 addition & 1 deletion src/commands/stop-working-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function stopWorkingIssue(storedWorkingIssue: IWorkingIssue
// 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...)
let comment = await vscode.window.showInputBox({
ignoreFocusOut: true,
placeHolder: 'Add worklog comment...'
placeHolder: 'Add worklog comment...',
});
// let action = await vscode.window.showInformationMessage(
// `Add worklog for the previous working issue ${workingIssue.issue.key} | timeSpent: ${utilities.secondsToHHMMSS(
Expand Down
18 changes: 9 additions & 9 deletions src/explorer/issues-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
const description = this.descPropertyFromField(item.issue.fields[field.value]);
if (
!groupItems.find(
el => el.item.contextValue === new GroupItem('', '').contextValue && this.getLabel(field.label, description) === el.item.label
(el) => el.item.contextValue === new GroupItem('', '').contextValue && this.getLabel(field.label, description) === el.item.label
)
) {
groupItems.push({ index, item: new GroupItem(this.getLabel(field.label, description), description) });
}
}
});
let pushed = 0;
groupItems.forEach(groupItem => {
groupItems.forEach((groupItem) => {
items.splice(groupItem.index + pushed, 0, groupItem.item);
pushed += 1;
});
Expand All @@ -81,7 +81,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
const subtasksKeysToRemove: string[] = [];
// check if subtasks has same field group value
for (let subtask of issue.fields.subtasks) {
const issuesElement = issues.find(issue => issue.key === subtask.key);
const issuesElement = issues.find((issue) => issue.key === subtask.key);
// if isn't in issue list in not filter compliant
if (!issuesElement) {
subtasksKeysToRemove.push(subtask.key);
Expand All @@ -100,7 +100,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
// if subtask has different group field value I will delete from subtasks list and I will change issue label
issue.fields.subtasks = issue.fields.subtasks.filter((subtask: IIssue) => !subtasksKeysToRemove.includes(subtask.key));
for (let subtaskKey of subtasksKeysToRemove) {
const element = issues.find(issue => issue.key === subtaskKey);
const element = issues.find((issue) => issue.key === subtaskKey);
if (element) {
element.fields.summary += ` - Parent Task: ${issue.key}`;
}
Expand All @@ -117,7 +117,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
let issues = store.state.issues;
// generate all the item from issues saved in global state
if (issues.length > 0) {
if (issues.some(issue => !issue.fields.hasOwnProperty(this.groupByField.value))) {
if (issues.some((issue) => !issue.fields.hasOwnProperty(this.groupByField.value))) {
logger.printErrorMessageInOutputAndShowAlert(
`Invalid grouping field: ${this.groupByField.value} - fallback is ${this.fallbackGroupByField.label}`
);
Expand All @@ -131,11 +131,11 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem

const items: IssueItem[] = issues
.map(
issue =>
(issue) =>
new IssueItem(issue, {
command: 'jira-plugin.openIssue',
title: 'Open issue in the browser',
arguments: [`${issue.key}`]
arguments: [`${issue.key}`],
})
)
.sort((itemA: IssueItem, itemB: IssueItem) => {
Expand Down Expand Up @@ -164,7 +164,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
return [
new FilterInfoItem(project, store.state.currentSearch.filter, issues.length),
new DividerItem('------'),
new NoResultItem(project)
new NoResultItem(project),
];
}
} else {
Expand All @@ -174,7 +174,7 @@ export default class IssuesExplorer implements vscode.TreeDataProvider<IssueItem
new IssueItem(subtask, {
command: 'jira-plugin.openIssue',
title: 'Open issue in the browser',
arguments: [`${subtask.key}`]
arguments: [`${subtask.key}`],
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/explorer/item/filter-info-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class FilterInfoItem extends vscode.TreeItem {

iconPath = {
light: utilities.getIconsPath(`light/${STATUS_ICONS.DEFAULT.file}`),
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`)
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`),
};

contextValue = 'FilterInfoItem';
Expand Down
2 changes: 1 addition & 1 deletion src/explorer/item/issue-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class IssueItem extends vscode.TreeItem {
super(`${issue.key} - ${issue.fields.summary}`, vscode.TreeItemCollapsibleState.None);
if (configuration.get(CONFIG.GROUP_TASK_AND_SUBTASKS) && this.isCollapsible(issue)) {
this.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;
this.label += ' - subtasks: ' + (issue.fields.subtasks || []).map(issue => issue.key).join(', ');
this.label += ' - subtasks: ' + (issue.fields.subtasks || []).map((issue) => issue.key).join(', ');
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/explorer/item/limit-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class LimitInfoItem extends vscode.TreeItem {
private icon(status: string): string {
let icon = STATUS_ICONS.DEFAULT.file;
if (!!status) {
Object.values(STATUS_ICONS).forEach(value => {
Object.values(STATUS_ICONS).forEach((value) => {
if (status.toUpperCase().indexOf(value.text.toUpperCase()) !== -1) {
icon = value.file;
}
Expand All @@ -25,7 +25,7 @@ export class LimitInfoItem extends vscode.TreeItem {

iconPath = {
light: utilities.getIconsPath(`light/${STATUS_ICONS.DEFAULT.file}`),
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`)
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`),
};

contextValue = 'LimitInfoItem';
Expand Down
2 changes: 1 addition & 1 deletion src/explorer/item/loading-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class LoadingItem extends vscode.TreeItem {

iconPath = {
light: utilities.getIconsPath(`light/${LOADING.file}`),
dark: utilities.getIconsPath(`dark/${LOADING.file}`)
dark: utilities.getIconsPath(`dark/${LOADING.file}`),
};

contextValue = 'LoadingItem';
Expand Down
2 changes: 1 addition & 1 deletion src/explorer/item/no-result-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class NoResultItem extends vscode.TreeItem {

iconPath = {
light: utilities.getIconsPath(`light/${STATUS_ICONS.DEFAULT.file}`),
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`)
dark: utilities.getIconsPath(`dark/${STATUS_ICONS.DEFAULT.file}`),
};

contextValue = 'NoResultItem';
Expand Down
4 changes: 2 additions & 2 deletions src/explorer/item/status-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class GroupItem extends vscode.TreeItem {
private icon(status: string): string {
let icon = STATUS_ICONS.DEFAULT.file;
if (!!status) {
Object.values(STATUS_ICONS).forEach(value => {
Object.values(STATUS_ICONS).forEach((value) => {
if (status.toUpperCase().indexOf(value.text.toUpperCase()) !== -1) {
icon = value.file;
}
Expand All @@ -25,7 +25,7 @@ export class GroupItem extends vscode.TreeItem {

iconPath = {
light: utilities.getIconsPath(`light/${this.icon(this.fileName)}`),
dark: utilities.getIconsPath(`dark/${this.icon(this.fileName)}`)
dark: utilities.getIconsPath(`dark/${this.icon(this.fileName)}`),
};

contextValue = 'GroupItem';
Expand Down
8 changes: 4 additions & 4 deletions src/picks/no-working-issue-pick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export default class NoWorkingIssuePick implements QuickPickItem {
fields: {
summary: '',
status: {
name: ''
name: '',
},
project: {
id: '',
key: '',
name: ''
}
}
name: '',
},
},
};
}
}
Loading

0 comments on commit 83616c7

Please sign in to comment.