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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly members #3008

Merged
merged 22 commits into from May 10, 2018

Conversation

@rbngzlv
Member

rbngzlv commented Mar 14, 2018

馃帺 What? Why?

An assembly can have members (president, vice president, ...)

馃搶 Related Issues

馃搵 Subtasks

  • Add admin log
  • Add seeds
  • Specs
  • Add CHANGELOG entry

馃摲 Screenshots

screen shot 2018-04-23 at 12 36 46

@rbngzlv rbngzlv self-assigned this Mar 14, 2018

@rbngzlv rbngzlv force-pushed the feature/assembly_members branch from d2d76e4 to 0f424f6 Mar 16, 2018

@codecov

This comment has been minimized.

codecov bot commented Mar 16, 2018

Codecov Report

鉂楋笍 No coverage uploaded for pull request base (master@d858433). Click here to learn what that means.
The diff coverage is 90.32%.

@@            Coverage Diff            @@
##             master    #3008   +/-   ##
=========================================
  Coverage          ?   97.52%           
=========================================
  Files             ?     1688           
  Lines             ?    40348           
  Branches          ?        0           
=========================================
  Hits              ?    39349           
  Misses            ?      999           
  Partials          ?        0

@rbngzlv rbngzlv force-pushed the feature/assembly_members branch 5 times, most recently from 3b2d991 to 3292bbb Mar 21, 2018

@rbngzlv rbngzlv force-pushed the feature/assembly_members branch 4 times, most recently from 18ed118 to bda7e91 Apr 5, 2018

@rbngzlv rbngzlv force-pushed the feature/assembly_members branch 3 times, most recently from 0578433 to 5e9a8b5 Apr 19, 2018

@rbngzlv

This comment has been minimized.

Member

rbngzlv commented Apr 20, 2018

Hi! I'm introducing a custom reusable component that uses selectize.js react-select under the hook to power a select box with autocomplete ajax functionality.

selectize decidim

My idea is to add a form.autocomplete_select method that will render a valid select input div with some data attributes to make the use of this functionality easy for others.

I'm almost finished (not code uploaded yet) but I wanted to ask if there is any any concern about this.

@rbngzlv rbngzlv force-pushed the feature/assembly_members branch 2 times, most recently from 72d64dd to e0b710f Apr 23, 2018

@rbngzlv

This comment has been minimized.

Member

rbngzlv commented Apr 23, 2018

Hi, I need some opinions/guidance/help in my implementation of a autocomplete select with React. Can do a fast review on this commit, please? e0b710f

I need to implement specs, pass linters, etc. but in the meanwhile are the pieces in the right place?

/cc @decidim/lot-core @deivid-rodriguez

Edit: wrong commit link

format.json do
render json: [] && return if params.fetch(:term, "").empty?
query = current_organization.users&.order(name: :asc)

This comment has been minimized.

@oriolgual

oriolgual Apr 24, 2018

Collaborator

This code is very similar to another PR, maybe we should extract this?

This comment has been minimized.

@rbngzlv

rbngzlv Apr 26, 2018

Member

@oriolgual What do you propose? Extract it to a concern? It's a good fit for an API endpoint, but it has no authentication, right?

This comment has been minimized.

@rbngzlv

rbngzlv Apr 26, 2018

Member

Also, we would have to add the api as dependency for the admin ... 馃槙

include Decidim::Traceable
include Decidim::Loggable
GENDERS = %w(man woman).freeze

This comment has been minimized.

@oriolgual

oriolgual Apr 24, 2018

Collaborator

@decidim/product do we really need to save the gender? I'm not an expert but in terms of LOPD isn't this considered a different level of data?

Also, if we really want to know the gender of the members, maybe we should consider an extra field with a free text option.

This comment has been minimized.

@carolromero

carolromero Apr 25, 2018

Member

Hi @oriolgual, this is a specific requirement from Barcelona Participation Regulation, which states that the composition of assemblies must be proportional in terms of age, gender and origin.

That said, I think a drop-down field with binary option is not a good solution. As the gender issue can be quite tricky (see the 71 gender options offered by Facebook) I would leave this field as an open text field.

In the end, it should serve to make parity issues visible. I understand that using an open text field is the simplest change.

create_table :decidim_assembly_members do |t|
t.references :decidim_assembly, index: true
t.references :decidim_user, index: true
t.integer :weight, null: false, default: 0

This comment has been minimized.

@oriolgual

oriolgual Apr 24, 2018

Collaborator

Please add an index here since it's the column used as default sorting.

designation_mode: Designation mode
full_name: Full name
gender: Gender
origin: Origin

This comment has been minimized.

@oriolgual

oriolgual Apr 24, 2018

Collaborator

@decidim/product what do we actually need to save here? Where the member is native from? See https://www.wordnik.com/words/origin

This comment has been minimized.

@carolromero

carolromero Apr 25, 2018

Member

@oriolgual sorry I forgot to answer this one. Yes, this refers to place of birth (again, data required from Barcelona Participation Regulations)

This comment has been minimized.

@oriolgual

oriolgual Apr 26, 2018

Collaborator

Maybe birthplace would be a better naming?

This comment has been minimized.

@rbngzlv

rbngzlv Apr 26, 2018

Member

I'll be working on this today, I'll change this field to birthplace.

@deivid-rodriguez

This comment has been minimized.

Collaborator

deivid-rodriguez commented Apr 24, 2018

@rbngzlv Sorry I don't have time to review your work at the moment but at first glance it seems like a fantastic piece of job that's very interesting for other places of decidim as well, and helps up better integrating react in our workflows. Love what you're building 馃挭

@tramuntanal

This comment has been minimized.

Member

tramuntanal commented May 7, 2018

@rbngzlv @isaacmg410 this PR is expected to be merged this week to enter v0.12. Do you expect to have it finished soon?

@mrcasals

This comment has been minimized.

Collaborator

mrcasals commented May 8, 2018

@rbngzlv some conflicts appeared, can you work on them?

I can help you if you need to, since those conflicts are related to #3029

rbngzlv added some commits May 8, 2018

Merge branch 'master' into feature/assembly_members
# Conflicts:
#	decidim-assemblies/app/models/decidim/assemblies/abilities/admin/admin_ability.rb
#	decidim-assemblies/app/models/decidim/assemblies/abilities/admin/assembly_admin_ability.rb
#	decidim-assemblies/app/models/decidim/assemblies/abilities/admin_ability.rb
#	decidim-assemblies/app/models/decidim/assemblies/abilities/assembly_role_ability.rb
#	decidim-assemblies/app/models/decidim/assemblies/abilities/everyone_ability.rb
#	decidim-assemblies/app/views/layouts/decidim/admin/assembly.html.erb
#	decidim-assemblies/lib/decidim/assemblies/test/factories.rb
@rbngzlv

This comment has been minimized.

Member

rbngzlv commented May 8, 2018

@decidim/lot-core updated with master and conflicts fixed.

@mrcasals can you check my implementation for the new permissions system?

@rbngzlv rbngzlv removed the status: WIP label May 8, 2018

@mrcasals

This comment has been minimized.

Collaborator

mrcasals commented May 9, 2018

@rbngzlv yup, the permissions commit looks good to me! I'll check the rest of the PR too and try to merge it 馃槃

helper_method :collection
def index
redirect_to "/404" if members.none?

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

I think we should raise ActionController::RoutingError, "No members for this assembly" here. In development we'd see the error, in production we'd be redirected to /404.

Thoughts?

module Abilities
module Admin
# Defines the abilities for an admin user. Intended to be used with `cancancan`.
class AdminAbility < Decidim::Abilities::AdminAbility

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

These ability classes should be removed

module Assemblies
module Abilities
# Defines the abilities for an admin user. Intended to be used with `cancancan`.
class AdminAbility < Decidim::Abilities::AdminAbility

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

This should be removed

module Abilities
# Defines the abilities for any user that can manage assemblies (whatever their role).
# Intended to be used with `cancancan`.
class AssemblyRoleAbility

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

This should be removed

module Abilities
# Defines the base abilities related to assemblies for any user. Guest users
# will use these too. Intended to be used with `cancancan`.
class EveryoneAbility < Decidim::Abilities::EveryoneAbility

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

This should be removed

@@ -0,0 +1,29 @@
<% member_presenter = Decidim::AssemblyMemberPresenter.new(assembly_member) %>
<div class="column">

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

Move this to a cell, maybe? 馃槃

This comment has been minimized.

@rbngzlv

rbngzlv May 9, 2018

Member

I'm not sure about this, for now we're not going to reuse this view.

Anyway, if we want to have this moved to a cell, I can make the commitment to do it in a future PR, but not now. We need this feature to be merged before the end of this week, and we have two more related PR's pending. What do you think?

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

Sounds reasonable to me, 馃憤

module Admin
# Defines the abilities for an assembly admin user. Intended to be used
# with `cancancan`.
class AssemblyAdminAbility < Decidim::Assemblies::Abilities::Admin::AssemblyRoleAbility

This comment has been minimized.

@mrcasals

mrcasals May 9, 2018

Collaborator

This one should be removed too

@wafflebot wafflebot bot added the status: WIP label May 9, 2018

@mrcasals

This comment has been minimized.

Collaborator

mrcasals commented May 9, 2018

@rbngzlv you need to update the test after adding the exception 馃槃

@rbngzlv rbngzlv force-pushed the feature/assembly_members branch from 783aed9 to bc1aa2f May 9, 2018

@oriolgual oriolgual merged commit 4656577 into master May 10, 2018

27 checks passed

ci/circleci: accountability Your tests passed on CircleCI!
Details
ci/circleci: admin Your tests passed on CircleCI!
Details
ci/circleci: api Your tests passed on CircleCI!
Details
ci/circleci: assemblies Your tests passed on CircleCI!
Details
ci/circleci: blogs Your tests passed on CircleCI!
Details
ci/circleci: budgets Your tests passed on CircleCI!
Details
ci/circleci: build_design_app Your tests passed on CircleCI!
Details
ci/circleci: build_test_app Your tests passed on CircleCI!
Details
ci/circleci: comments Your tests passed on CircleCI!
Details
ci/circleci: consultations Your tests passed on CircleCI!
Details
ci/circleci: core Your tests passed on CircleCI!
Details
ci/circleci: debates Your tests passed on CircleCI!
Details
ci/circleci: generators Your tests passed on CircleCI!
Details
ci/circleci: initiatives Your tests passed on CircleCI!
Details
ci/circleci: main Your tests passed on CircleCI!
Details
ci/circleci: meetings Your tests passed on CircleCI!
Details
ci/circleci: pages Your tests passed on CircleCI!
Details
ci/circleci: participatory_processes Your tests passed on CircleCI!
Details
ci/circleci: proposals Your tests passed on CircleCI!
Details
ci/circleci: sortitions Your tests passed on CircleCI!
Details
ci/circleci: surveys Your tests passed on CircleCI!
Details
ci/circleci: system Your tests passed on CircleCI!
Details
ci/circleci: upload-coverage Your tests passed on CircleCI!
Details
ci/circleci: verifications Your tests passed on CircleCI!
Details
codeclimate All good!
Details
codeclimate/diff-coverage 99% (80% threshold)
Details
codeclimate/total-coverage 98% (0.0% change)
Details

@wafflebot wafflebot bot removed the status: WIP label May 10, 2018

@rbngzlv rbngzlv deleted the feature/assembly_members branch May 10, 2018

isaacmg410 added a commit to CodiTramuntana/decidim that referenced this pull request May 25, 2018

Assembly members (decidim#3008)
* Add AssemblyMember entity

* Show/Hide and Disable/Enable position other input

* Implement admin log

* Add seeds for assembly members

* Basic public UI

* Add weight attribute to order members

* A member can be ceased

* Allow to filter and search members in admin

* Apply final design

* Add specs

* Rename origin to birthplace

* Change gender from select to text field

* Add changelog entry

* Fix locales, rubocop and remove unnecessary specs

* Add birthplace to factories

* Implement new permissions sytem

* Remove cancancan abilities

* raise ActionController::RoutingError instead of redirect

* Update spec

@mrcasals mrcasals referenced this pull request May 31, 2018

Merged

Fix broken test #3551

@isaacmg410 isaacmg410 referenced this pull request Oct 24, 2018

Merged

add paginate on admin assembly members #4369

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment