-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put logic for formatting Alfred items in one module.
- Loading branch information
C. Thomas Bailey
committed
Jan 5, 2017
1 parent
be92ffc
commit 0105ed5
Showing
6 changed files
with
15 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
const alfy = require('alfy') | ||
const config = require('./config') | ||
|
||
const userPermissionToken = alfy.config.get('userPermissionToken') | ||
const developerKey = alfy.config.get('developerKey') | ||
const boardId = alfy.config.get('boardId') | ||
if (config.complete()) { | ||
|
||
} | ||
// TODO: finish this module. Should prompt user to provide userPermissionToken | ||
// etc. if not present. Otherwise, should call show-lists module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
const alfy = require('alfy') | ||
const { getCards } = require('./trello') | ||
const alfred = require('./alfred') | ||
|
||
const formatCard = ({ id, name, url }) => ({ | ||
title: name, | ||
arg: url, | ||
quicklookurl: url | ||
}) | ||
const { listId } = process.env | ||
const gotCards = alfred.getCards(listId) | ||
const gotCreateCard = alfred.getCreateCard(alfy.input, listId) | ||
|
||
const listId = process.env.listId | ||
getCards(listId).then(cards => { | ||
const items = cards.map(formatCard) | ||
alfy.output(items) | ||
Promise.all([gotCards, gotCreateCard]).then(([cardItems, createCardItem]) => { | ||
cardItems.unshift(createCardItem) | ||
alfy.output(cardItems) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
const alfy = require('alfy') | ||
const { getLists } = require('./trello') | ||
const alfred = require('./alfred') | ||
|
||
const formatList = ({ id, name, icon, uid }) => ({ | ||
title: name, | ||
arg: id, | ||
icon, | ||
uid | ||
}) | ||
|
||
getLists().then(lists => { | ||
var items = lists.map(formatList) | ||
alfy.output(items) | ||
}) | ||
alfred.getLists().then(listItems => alfy.output(listItems)) |