Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Proper messages for unchecking and unstarring items #51
Proper messages for unchecking and unstarring items #51
Changes from 5 commits
d50b2db
ff1b2af
f692546
abfbb8f
03f383e
0136768
0d91317
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to check if the
ids
array is empty from within the method, so we can directly call it later on, without having to wrap it inside anif
statement:The same can be done for the
markComplete
,markStarred
&markUnstarred
methods.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this condition check is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if statement is necessary, @ashinzekene should add them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is completely Ok to avoid the camel-case here and go for
unchecked
as a variable name:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can go for a ternary operator as the conditional expression:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part has not been updated yet, i can help out if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items whose
isComplete
attribute is updated totrue
should be placed in thechecked
array and items whoseisComplete
attribute is updated tofalse
should be placed in theunchecked
one:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I think it is right this way. The line above has already changed the status of the tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
render.markIncomplete(checked);
and then this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The process you are describing is indeed identical, but these arrays,
checked[]
&unchecked[]
, are meant to store item IDs based on each item's updatedisComplete
attribute value, and not on the original/database-stored one, thus reversing them will lead to a clearer and more obvious behavior for future readers. For example: an item stored in the database with itsisComplete
attribute set tofalse
(unchecked), once selected & checked by the user, will have its value updated to its oppositetrue
(checked), thus its ID should be passed to thechecked
array. The same holds for the opposite case, where the item is initially marked as complete.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked items should be displayed before the unchecked ones, just like with the display of the starred/unstarred items on line 476:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The camel-case can be dropped here as well:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part still hasnt been updated, please let me know if you need help, happy to contribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.