Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rename boards #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add Rename boards #73

wants to merge 3 commits into from

Conversation

pavlochernovyy
Copy link

  • Rename boards by specifying

- [x] Rename boards by specifying <old-name> <last-name>
@pavlochernovyy pavlochernovyy changed the title Add: Add Rename boards by specifying <old-name> <last-name> Aug 8, 2018
@pavlochernovyy pavlochernovyy changed the title Add Rename boards by specifying <old-name> <last-name> Add Rename boards Aug 8, 2018
@pavlochernovyy pavlochernovyy mentioned this pull request Aug 8, 2018
lib/help.js Outdated
@@ -19,6 +19,7 @@ module.exports = `
--priority, -p Update priority of task
--archive, -a Display archived items
--restore, -r Restore items from archive
--renameBoard -r Rename board; boards with spaces - specify via "_" symbol like My_Board

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like --rename-board would be more standard here :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, --rename-board is more standard.

Copy link

@colingm colingm Aug 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it looks like your alias -r conflicts with the restore command, and you could use a comma after the full command name

@@ -39,4 +40,5 @@ module.exports = `
$ tb --list pending coding
$ tb --archive
$ tb --restore 4
$ tb --rename-board My_Board Todo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: But can we keep the stylizing of the board names consistent. Elsewhere, boards are referred to as all lower case, single words. Here, you've introduced a camel-case, "_" separated pattern that clashes a bit with the above examples

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use quotes?
This would be the only place in the application where we need to replace spaces with underscores.

Why not:
tb --rename-board "My Board" Todo
?

@@ -242,6 +242,18 @@ class Render {
error({prefix, message});
}

missingStorage() {
const prefix = '\n';
const message = 'There are no any boards, please create some task at least to start';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the copy to: "There are currently no boards"


missingBoardName(name) {
const prefix = '\n';
const message = `There are no any board with name: ${name}`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the copy here to:
"There are no boards with the name: ${name}"

@@ -108,6 +108,35 @@ class Storage {
return archive;
}

renameBoardsWithName(oldName, newName) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with this approach.

The task data manipulation is not done in the Storage class, this class is supposed to read and write the data, not perform logic like this.
You should move this logic to the TaskBoard class itself and just use the Storage to read and write data back.

@@ -39,4 +40,5 @@ module.exports = `
$ tb --list pending coding
$ tb --archive
$ tb --restore 4
$ tb --rename-board My_Board Todo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use quotes?
This would be the only place in the application where we need to replace spaces with underscores.

Why not:
tb --rename-board "My Board" Todo
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants