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 Bookmark switch to Moments and Strategies #1727

Merged
merged 23 commits into from
Apr 25, 2020

Conversation

GayathriVenkatesh
Copy link
Contributor

@GayathriVenkatesh GayathriVenkatesh commented Apr 21, 2020

Description

Added column 'bookmarked: boolean' to Moments and Strategies table.
Created a bookmark toggle on the Moments/Strategies page.

This is a subtask for issue #187

Screenshots

Screenshot from 2020-04-21 13-42-33

Corresponding Issue

#1580


Reviewing this pull request? Check out our Code Review Practices guide if you haven't already!

Copy link
Member

@julianguyen julianguyen left a comment

Choose a reason for hiding this comment

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

Thanks for getting started on this! :)

app/helpers/moments_form_helper.rb Show resolved Hide resolved
app/helpers/strategies_form_helper.rb Show resolved Hide resolved
def moment_form_inputs
[
moment_name, moment_why, moment_fix, moment_category, moment_mood,
moment_strategy, get_viewers_input(
@viewers, 'moment', 'moments', @moment
),
moment_comment, moment_publishing
moment_comment, moment_publishing,
Rails.env.development? ? moment_bookmarked : ''
Copy link
Member

Choose a reason for hiding this comment

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

Instead of returning an empty string if the env if production, I think it should be nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @julianguyen, some tests seem to fail when I make this change. I had noticed this previously and hence replaced it with an empty string. Is there another way to solve this?

@@ -34,6 +34,7 @@ def strategy_form_inputs(strategy, viewers)
get_viewers_input(viewers, 'strategy', 'strategies', strategy),
build_strategy_comment(strategy), build_strategy_publishing(strategy),
build_strategy_visible(strategy),
Rails.env.development? ? build_strategy_bookmarked(strategy) : '',
Copy link
Member

Choose a reason for hiding this comment

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

Similar comment as above, let's replace the empty string with nil.

Copy link
Member

@julianguyen julianguyen left a comment

Choose a reason for hiding this comment

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

Solid work! :)

Just one more thing and I think we should be good to merge!

app/helpers/moments_form_helper.rb Outdated Show resolved Hide resolved
app/helpers/strategies_helper.rb Outdated Show resolved Hide resolved
Copy link
Member

@julianguyen julianguyen left a comment

Choose a reason for hiding this comment

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

Great work! Looking forward to seeing more PRs for this feature. Thanks for tackling it. It's been on our wishlist for a while now :)

@julianguyen julianguyen merged commit 4552312 into ifmeorg:master Apr 25, 2020
@GayathriVenkatesh
Copy link
Contributor Author

Sure @julianguyen! I agree, this is a feature that a lot of users would like to have!
@Manasa2850 and I would love to work on this once our existing PRs get merged :)

@julianguyen
Copy link
Member

That would be great! :) It would be helpful to continue to scope the work based on what @LMulvey had laid things out!

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