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

Track Progress on Strategies #1719

Closed
wants to merge 52 commits into from

Conversation

GayathriVenkatesh
Copy link
Contributor

@GayathriVenkatesh GayathriVenkatesh commented Apr 14, 2020

Description

This PR creates a Task page that renders all your strategies and displays your progress in each one of them. I have added a column 'Mark as Finished' to the strategies table. I have also created a task strategies:update which automatically runs every 24 hours and updates no_of_days_followed for each strategy (based on its 'finished' value) and the total_no_of_days (date.today - date of creation).

The page looks like this so far :

aa

Screenshot from 2020-04-19 09-42-10

My initial thought was to also leverage this data to render progress charts and help in easy visualisation of data. Hence, this PR is not complete. If you have any suggestions on what else the page could render and make it more usable, please leave your thoughts in the comments below!

Corresponding Issue

#1687


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

@nshki
Copy link
Member

nshki commented Apr 18, 2020

@GayathriVenkatesh thanks for the PR! Would you mind providing a PR description of the general strategies you used? This is a pretty large PR, so contextual help from you as the author would be very appreciated. 🙇

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! Let me know if you have any questions about my comments. In addition to them, we should be testing all these new controllers and models that are being added.

.rake_tasks~ Outdated Show resolved Hide resolved
Gemfile Outdated Show resolved Hide resolved
app/assets/stylesheets/scaffolds.scss Outdated Show resolved Hide resolved
app/controllers/strategies_controller.rb Outdated Show resolved Hide resolved
app/controllers/strategies_controller.rb Outdated Show resolved Hide resolved
app/views/todo_items/_todo_item.html.erb Outdated Show resolved Hide resolved
config/env/development.example.env Outdated Show resolved Hide resolved
config/env/test.example.env Outdated Show resolved Hide resolved
@@ -1,5 +0,0 @@
class AddVisibleToStrategies < ActiveRecord::Migration[5.2]
def change
add_column :strategies, :visible, :boolean, default: true
Copy link
Member

Choose a reason for hiding this comment

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

Why is this being deleted?

Copy link
Member

Choose a reason for hiding this comment

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

Let's not modify this file. I would remove changes to this file from your PR. We shouldn't be modifying previous migration files in any way. This may be responsible for the test migration error in CircleCI.

Copy link
Member

Choose a reason for hiding this comment

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

So you have to remove this change entirely from this pull request. This is still causing the test migration error in CircleCI. There are two ways you can do this:

  1. You should do this by squashing all your commits into one. Doing a soft reset and remove this file and re-commit everything else.

  2. Revert the specific commit that made this change

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.

Looking good so far! Let's do more testing.

@@ -94,12 +103,14 @@ def update
end
empty_array_for :viewers, :category
shared_update(@strategy, strategy_params)
create_task(@strategy)
Copy link
Member

Choose a reason for hiding this comment

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

We should be testing for this new task functionality in the test for update.

end

# DELETE /strategies/1
# DELETE /strategies/1.json
def destroy
shared_destroy(@strategy)
Task.where(id: @strategy.id).destroy_all
Copy link
Member

Choose a reason for hiding this comment

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

We should be testing for this new task functionality in the test for destroy.

app/controllers/strategies_controller.rb Outdated Show resolved Hide resolved
app/controllers/tasks_controller.rb Show resolved Hide resolved
app/controllers/todo_items_controller.rb Show resolved Hide resolved
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module TasksHelper
Copy link
Member

Choose a reason for hiding this comment

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

We should be unit testing this helper.

app/controllers/strategies_controller.rb Outdated Show resolved Hide resolved
app/controllers/strategies_controller.rb Outdated Show resolved Hide resolved
@tasks = Task.all
end

def show; end
Copy link
Member

Choose a reason for hiding this comment

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

Do we actually need this route?

app/helpers/strategies_helper.rb Outdated Show resolved Hide resolved
Gemfile Outdated Show resolved Hide resolved
config/schedule.rb Outdated Show resolved Hide resolved
db/schema.rb Outdated Show resolved Hide resolved
spec/controllers/tasks_controller_spec.rb Outdated Show resolved Hide resolved
@Manasa2850
Copy link
Member

@julianguyen could you help with the circleci build error. It says lines 155 and 171 of strategies_helper are causing it. But we haven't changed those lines at all.
Thanks

@julianguyen
Copy link
Member

@Manasa2850 It looks like you have two tests in the StrategiesHelper spec failing. You'll want to compare the the expected output and actual output to determine what went wrong. Your changes do affect these tests because you are adding strategy_finished.

@julianguyen julianguyen closed this Oct 2, 2020
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.

4 participants