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

Plans admin #1474

Merged
merged 20 commits into from
Mar 2, 2018
Merged

Plans admin #1474

merged 20 commits into from
Mar 2, 2018

Conversation

apradillap
Copy link
Contributor

Closes #1457

✌️ What does this PR do?

New admin section: Plans

You can modify details in plans and plan types.

If you need more help, I 've added documentation:

https://github.com/PopulateTools/gobierto/blob/staging/docs/manual_admin.md

🔍 How should this be manually tested?

Create/update/archive a plan

Create/update/archive a plan type

👀 Screenshots

After this PR

captura de pantalla 2018-02-23 a las 13 21 33

captura de pantalla 2018-02-23 a las 13 22 02

Copy link
Member

@ferblape ferblape left a comment

Choose a reason for hiding this comment

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

Code looks good. Review just these small details

@plan = find_plan

@plan_form = PlanForm.new(
plan_params.merge(id: params[:id], site_id: current_site.id)
Copy link
Member

Choose a reason for hiding this comment

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

no need to add the id to the plan_params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if I don't add it, when I update a plan, it generates a new one

Copy link
Member

Choose a reason for hiding this comment

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

You are right, sorry!

</h2>
<p>
<%= t(".description") %>
<%= @plan.introduction %>
</p>
<p>
<%= t(".latest_update_html", date: l(@plan.updated_at.to_date, format: :long)) %>
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 the plan.updated_at, use the activity gobierto_plans.plan_type_updated. That activity should be generated when the plans are updated in the API script. Check how is done for budgets.

config/routes.rb Outdated
namespace :gobierto_plans, as: :plans, path: :plans do
get "/" => "welcome#index"

resources :plans, only: [:show, :new, :create, :edit, :update, :destroy], path: "" do
Copy link
Member

Choose a reason for hiding this comment

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

I think those are all the actions 💃 You can remove the only.

config/routes.rb Outdated
get :data
put :recover
end
resources :plan_types, only: [:new, :create, :edit, :update, :destroy], path: :plan_types do
Copy link
Member

Choose a reason for hiding this comment

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

except: [:show]

@@ -370,6 +370,100 @@ ToDo

Los datos del módulo de Observatorio se cargan y se visualizan automáticamente.

### Planes
Copy link
Member

Choose a reason for hiding this comment

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

👏

@codecov-io
Copy link

codecov-io commented Feb 23, 2018

Codecov Report

Merging #1474 into master will increase coverage by 0.04%.
The diff coverage is 81.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1474      +/-   ##
==========================================
+ Coverage   78.47%   78.52%   +0.04%     
==========================================
  Files         518      533      +15     
  Lines       13485    13849     +364     
==========================================
+ Hits        10583    10875     +292     
- Misses       2902     2974      +72
Impacted Files Coverage Δ
...porters/gobierto_indicators/indicators_importer.rb 0% <0%> (ø)
app/publishers/gobierto_plans_plan_activity.rb 100% <100%> (ø)
...models/gobierto_admin/permission/gobierto_plans.rb 100% <100%> (ø)
...blishers/gobierto_indicators_indicator_activity.rb 100% <100%> (ø)
app/models/gobierto_plans/plan_type.rb 100% <100%> (ø) ⬆️
...scribers/gobierto_indicators_indicator_activity.rb 100% <100%> (ø)
...s/gobierto_admin/gobierto_plans/base_controller.rb 100% <100%> (ø)
app/subscribers/gobierto_plans_plan_activity.rb 100% <100%> (ø)
app/models/gobierto_admin/admin.rb 92.45% <100%> (+0.14%) ⬆️
app/models/site.rb 96.96% <100%> (+0.03%) ⬆️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6892c54...c8878b9. Read the comment docs.

@apradillap
Copy link
Contributor Author

I uploaded the latest changes for the front of Plans, now you see GobiertoPlans through plan types and filtering by year you see the plan you want, so the year is a required field.

captura de pantalla 2018-03-01 a las 16 14 54

I made a refactor of the indicators, as the update date was missing and an importer has been added to the indicators, so there was a PR in populate-data-indicators.

captura de pantalla 2018-03-01 a las 16 14 03

@ferblape
Copy link
Member

ferblape commented Mar 1, 2018

The other PR has been merged, can you review the conflicts @apradillap?

@ferblape
Copy link
Member

ferblape commented Mar 2, 2018

In Plans / new the title is: "New plan type" instead of "New plan". We are creating plans, not plan types in this page.

screen shot 2018-03-02 at 09 03 01

@ferblape ferblape merged commit a8de47a into master Mar 2, 2018
@ferblape ferblape deleted the 1457-plans-admin branch March 2, 2018 14:24
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

4 participants