-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
Remove results and add accountability to decidim #1926
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1926 +/- ##
==========================================
- Coverage 98.56% 98.55% -0.02%
==========================================
Files 1149 1167 +18
Lines 25941 26499 +558
==========================================
+ Hits 25570 26117 +547
- Misses 371 382 +11 |
@beagleknight what deprecation strategy will we use? I'd warn the users and provide a script (pure SQL?) to migrate from plain results to accountability results. Maybe even just a migration? |
@josepjaume I think it's better to provide some kind of documentation like we did with the followable resources. I agree using plain SQL to migrate those results. We can use this as a starting point: |
Oh, nice @beagleknight ! |
da09af4
to
d4fd753
Compare
559fba9
to
98acb07
Compare
@@ -9,8 +9,7 @@ class ResultsController < Decidim::Accountability::ApplicationController | |||
|
|||
helper_method :results, :result, :stats_calculator, :first_class_categories, :category, :progress_calculator, :count_calculator, :current_scope, :template_texts | |||
|
|||
def home | |||
end | |||
def home; end |
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 is not needed.
@@ -19,7 +19,7 @@ def display_count(count) | |||
end | |||
|
|||
def active_class_if_current(scope) | |||
%Q{class=active} if scope.to_s == current_scope.to_s | |||
%(class=active) if scope.to_s == current_scope.to_s |
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.
use normal string?
@@ -26,7 +26,7 @@ def call | |||
|
|||
transaction do | |||
update_result | |||
result.touch if form_proposal_ids != current_proposal_ids | |||
result.save! if form_proposal_ids != current_proposal_ids |
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.
unneeded? (update_result
is already saving the result)
@@ -1,6 +1,7 @@ | |||
# -*- coding: utf-8 -*- |
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.
Or this...
# frozen_string_literal: true | ||
|
||
shared_examples "manage results" do | ||
RSpec.shared_examples "manage results" do |
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.
We don't use RSpec.shared_examples
but just shared_examples
.
@@ -91,7 +93,7 @@ | |||
end | |||
|
|||
within "table" do | |||
expect(page).to have_no_content(translated(result2.title)) | |||
expect(page).not_to have_content(translated(result2.title)) |
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.
Better the previous way since it waits for the content to disappear.
@@ -0,0 +1,89 @@ | |||
# -*- coding: utf-8 -*- |
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.
RuboCop.... 🤔
decidim-core/decidim-core.gemspec
Outdated
@@ -57,5 +57,4 @@ Gem::Specification.new do |s| | |||
s.add_development_dependency "decidim-participatory_processes", Decidim.version |
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.
Should we add decidim-assemblies
and/or decidim-accountability
here?
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.
To be honest, decidim-core
shouldn't depend on neither of them, and we should probably remove all the other dependencies as well, except for decidim-dev
.
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.
Seems sensible.
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.
In reality, decidim-core
might not work by itself. But it's a first step to detect unnecessary coupling.
decidim-core/spec/factories.rb
Outdated
@@ -5,4 +5,4 @@ | |||
require "decidim/participatory_processes/test/factories" | |||
require "decidim/proposals/test/factories" | |||
require "decidim/meetings/test/factories" | |||
require "decidim/results/test/factories" | |||
# require "decidim/results/test/factories" |
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.
Remove this, I guess.
decidim-meetings/spec/factories.rb
Outdated
@@ -4,7 +4,7 @@ | |||
require "decidim/participatory_processes/test/factories" | |||
require "decidim/assemblies/test/factories" | |||
require "decidim/proposals/test/factories" | |||
require "decidim/results/test/factories" | |||
# require "decidim/results/test/factories" |
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.
Remove this I guess.
decidim-proposals/spec/factories.rb
Outdated
@@ -5,7 +5,7 @@ | |||
require "decidim/assemblies/test/factories" | |||
require "decidim/comments/test/factories" | |||
require "decidim/meetings/test/factories" | |||
require "decidim/results/test/factories" | |||
# require "decidim/results/test/factories" |
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.
Remove this I guess.
@@ -157,6 +157,7 @@ en: | |||
filters: | |||
linked_classes: | |||
all: All | |||
dummyresource: Dummy resources |
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.
Is this key correctly not including a hyphen? Nice decoupling of the decidim-results
dependency for tests, by the way.
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.
Looks like it is!
@beagleknight Awesome and tough work! 💪 I did a bit of CI-style reviewing, quite a lot of comments but easy to fix! |
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.
Can we address the isssues found by @deivid-rodriguez please?
@mrcasals @deivid-rodriguez can I ask for a re-review? |
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.
Looks good to me!
🎩 What? Why?
Remove
decidim-results
from thedecidim
gem and includesdecidim-assemblies
anddecidim-accountability
.📌 Related Issues
📋 Subtasks
decidim-results
(https://github.com/decidim/decidim-results)decidim-assemblies
decidim-accountability
TemplateTexts
to global settings📷 Screenshots (optional)
N/A
👻 GIF
Nope.