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

display percentage of achievement of todo in markdown #557

Merged
merged 7 commits into from
May 20, 2017

Conversation

sosukesuzuki
Copy link
Member

I heard that There are people who using Boostnote as todo list. So, I made percentage of achievement it visible.

todolist

@LetItRock
Copy link
Contributor

Hello @sosukesuzuki,
I have a question - maybe it would be better to show something like this: "2 of 6 tasks complete" instead of percentage progress, like the same way as Github does?

@sosukesuzuki
Copy link
Member Author

Thank you for commenting @LetItRock ! That might be nice! I will discuss it.

Copy link
Contributor

@asmsuechan asmsuechan left a comment

Choose a reason for hiding this comment

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

Hi! I commented 🖊️


for (let i = 0; i < splitted.length; i++) {
let trimmedLine = splitted[i].trim()
if (trimmedLine.match(/^- \[\s|x\] ./)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to add + and * as statements.

+

screen shot 2017-05-06 at 08 20 40

*

screen shot 2017-05-06 at 08 22 05

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for telling me. Oh... I had overlooked + and *. I'll add these operator.

let numberOfTodo = 0
let numberOfCompletedTodo = 0

for (let i = 0; i < splitted.length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume forEach is better than for in this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for commenting! Surely, It's long to using for than using foreach. So, I'll fix it.

@@ -95,6 +96,24 @@ class MarkdownNoteDetail extends React.Component {
return title
}

getPercentageOfCompleteTodo (value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer the name of the argument is noteContent.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for commenting ! Surely it is difficult to understand it mean. I'll fix it.

}) => (
<div styleName='percentageBar' style={{display: isNaN(percentageOfTodo) ? 'none' : ''}}>
<div styleName='progressBar' style={{width: percentageOfTodo + '%'}}>
<p styleName='percentageText'>{percentageOfTodo + '%'}</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use string literal 😄

@kazup01 kazup01 requested a review from asmsuechan May 10, 2017 06:18
@kazup01
Copy link
Member

kazup01 commented May 14, 2017

I will fix this UI at sometime soon🎨

@kazup01 kazup01 added the awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. label May 17, 2017
@kazup01 kazup01 self-assigned this May 18, 2017
@kazup01 kazup01 added the UI label May 18, 2017
@kazup01 kazup01 merged commit e52b74b into master May 20, 2017
@kazup01 kazup01 added Next Release and removed UI awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. labels May 20, 2017
@kazup01 kazup01 deleted the feature-todo-percentage branch May 20, 2017 06:21
@kohei-takata kohei-takata mentioned this pull request Jun 12, 2017
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

5 participants