Skip to content

Commit

Permalink
Merge pull request #36 from Ho-Wan/develop
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
ho-wan authored Feb 6, 2019
2 parents 7644983 + 85dff48 commit 1e8be13
Show file tree
Hide file tree
Showing 19 changed files with 78 additions and 52 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.5.1 (06 Feb 2019)
- Enable Add comment to card functionality.
- Update icons to use Octicons.

## 0.5.0 (03 Feb 2019)
- Enable Archive card functionality.
- Allow user to remove themself from card.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
Welcome to Trello Viewer for VS Code! This extension provides the following features:

- Browse Trello boards, lists and cards in the side bar.
- Add cards or archive existing card
- Add cards or archive existing card.
- Add and remove user to card.
- Edit title and description of card.
- Edit title and description of card and add comments.
- View selected card using the markdown previewer and open to the side.
- See formatted checklists and cover image for the card.
- Assign a favourite list to easily access cards.
Expand Down
5 changes: 1 addition & 4 deletions images/dark/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions images/dark/key.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions images/dark/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion images/dark/refresh.svg

This file was deleted.

4 changes: 1 addition & 3 deletions images/dark/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/dark/sync.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions images/dark/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions images/light/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions images/light/key.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions images/light/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion images/light/refresh.svg

This file was deleted.

4 changes: 1 addition & 3 deletions images/light/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/light/sync.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions images/light/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 29 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "vscode-trello-viewer",
"displayName": "Trello Viewer",
"description": "View Trello cards in VS Code, browse user's boards and lists.",
"version": "0.5.0",
"description": "View, add, edit Trello cards in VS Code.",
"version": "0.5.1",
"publisher": "Ho-Wan",
"author": {
"name": "Ho-Wan To",
Expand Down Expand Up @@ -75,17 +75,17 @@
"title": "Trello Viewer: Refresh",
"category": "Trello Viewer",
"icon": {
"light": "images/light/refresh.svg",
"dark": "images/dark/refresh.svg"
"light": "images/light/sync.svg",
"dark": "images/dark/sync.svg"
}
},
{
"command": "trelloViewer.refreshFavoriteList",
"title": "Trello Viewer: Refresh Favorite List",
"category": "Trello Viewer",
"icon": {
"light": "images/light/refresh.svg",
"dark": "images/dark/refresh.svg"
"light": "images/light/sync.svg",
"dark": "images/dark/sync.svg"
}
},
{
Expand Down Expand Up @@ -115,28 +115,33 @@
}
},
{
"command": "trelloViewer.editCardTitle",
"title": "Edit title of card",
"command": "trelloViewer.addComment",
"title": "Add comment to card",
"category": "Trello Viewer"
},
{
"command": "trelloViewer.editCardDescription",
"title": "Edit description of card",
"command": "trelloViewer.addUserToCard",
"title": "Add user to card",
"category": "Trello Viewer"
},
{
"command": "trelloViewer.addUserToCard",
"title": "Add user to card",
"command": "trelloViewer.archiveCard",
"title": "Archive Card",
"category": "Trello Viewer"
},
{
"command": "trelloViewer.removeUserFromCard",
"title": "Remove user from card",
"command": "trelloViewer.editCardTitle",
"title": "Edit title of card",
"category": "Trello Viewer"
},
{
"command": "trelloViewer.archiveCard",
"title": "Archive Card",
"command": "trelloViewer.editCardDescription",
"title": "Edit description of card",
"category": "Trello Viewer"
},
{
"command": "trelloViewer.removeUserFromCard",
"title": "Remove user from card",
"category": "Trello Viewer"
}
],
Expand Down Expand Up @@ -167,6 +172,10 @@
"command": "trelloViewer.addCard",
"when": "false"
},
{
"command": "trelloViewer.addComment",
"when": "false"
},
{
"command": "trelloViewer.addUserToCard",
"when": "false"
Expand Down Expand Up @@ -235,6 +244,10 @@
"command": "trelloViewer.archiveCard",
"when": "viewItem == card"
},
{
"command": "trelloViewer.addComment",
"when": "viewItem == card"
},
{
"command": "trelloViewer.addUserToCard",
"when": "viewItem == card"
Expand Down
1 change: 1 addition & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function activate(context: vscode.ExtensionContext) {

vscode.commands.registerCommand("trelloViewer.addCard", (list: TrelloItem) => trello.addCardToList(list));
vscode.commands.registerCommand("trelloViewer.archiveCard", (card: TrelloItem) => trello.archiveCard(card));
vscode.commands.registerCommand("trelloViewer.addComment", (card: TrelloItem) => trello.addComment(card));
vscode.commands.registerCommand("trelloViewer.addUserToCard", (card: TrelloItem) => trello.addUserToCard(card));
vscode.commands.registerCommand("trelloViewer.removeUserFromCard", (card: TrelloItem) =>
trello.removeUserFromCard(card)
Expand Down
30 changes: 30 additions & 0 deletions src/trello/TrelloUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,36 @@ export class TrelloUtils {
return 0;
}


async addComment(card: TrelloItem): Promise<Number> {
if (!card) {
vscode.window.showErrorMessage("Could not get valid card");
return 1;
}

const comment = await vscode.window.showInputBox({
ignoreFocusOut: true,
placeHolder: "Add comment",
});
if (comment === undefined) return 2;

const resData = await this.trelloApiPostRequest(`/1/cards/${card.id}/actions/comments`, {
key: this.API_KEY,
token: this.API_TOKEN,
text: comment,
});

if (!resData) return 3;

vscode.commands.executeCommand("trelloViewer.refresh");
if (card.parentId === this.FAVORITE_LIST_ID) {
vscode.commands.executeCommand("trelloViewer.refreshFavoriteList");
}

this.showSuccessMessage(`Added comment to card: ${resData.data.card.name}`);
return 0;
}

resetFavoriteList(): void {
this.globalState.update(GLOBALSTATE_CONFIG.FAVORITE_LIST_ID, null);
this.getFavoriteList();
Expand Down

0 comments on commit 1e8be13

Please sign in to comment.