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

delete tag through context menu #2497

Merged
merged 4 commits into from
Oct 23, 2018
Merged

delete tag through context menu #2497

merged 4 commits into from
Oct 23, 2018

Conversation

daiyam
Copy link
Contributor

@daiyam daiyam commented Oct 15, 2018

This change adds the possibility to delete a tag through its context menu.

screenshot

@ZeroX-DG ZeroX-DG added the awaiting review ❇️ Pull request is awaiting a review. label Oct 15, 2018
@@ -65,7 +65,7 @@ class MarkdownNoteDetail extends React.Component {
}

componentWillReceiveProps (nextProps) {
if (nextProps.note.key !== this.props.note.key && !this.state.isMovingNote) {
if (!this.state.isMovingNote && (nextProps.note.key !== this.props.note.key || nextProps.note.tags.length < this.props.note.tags.length)) {
Copy link
Member

Choose a reason for hiding this comment

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

This condition is really long and may confuse new contributors, can you assign some parts of the condition into variables with meaningful names?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So that's is the reason for temporary variables I've seen in the code.
It's to increase the readability of the code 👍

if (
  !this.state.isMovingNote &&
  (
    // if it's a new note
    nextProps.note.key !== this.props.note.key ||
    // if there is deleted tags
    nextProps.note.tags.length < this.props.note.tags.length
  )
) {
const isNewNote = nextProps.note.key !== this.props.note.key
const hasDeletedTags = nextProps.note.tags.length < this.props.note.tags.length
if (!this.state.isMovingNote && (isNewNote || hasDeletedTags)) {

I can see why it is more readable 😉

@ZeroX-DG ZeroX-DG added awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. and removed awaiting review ❇️ Pull request is awaiting a review. labels Oct 16, 2018
Copy link
Member

@ZeroX-DG ZeroX-DG left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@ZeroX-DG ZeroX-DG added approved 👍 Pull request has been approved by sufficient reviewers. and removed awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. labels Oct 17, 2018
@Rokt33r Rokt33r added next release (v0.11.11) and removed approved 👍 Pull request has been approved by sufficient reviewers. labels Oct 23, 2018
@Rokt33r Rokt33r merged commit 6e8b370 into BoostIO:master Oct 23, 2018
@daiyam daiyam deleted the delete-tag branch November 27, 2018 22:13
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.

3 participants