Skip to content

Close a meeting#525

Merged
josepjaume merged 2 commits intomasterfrom
feature/basic_meeting_close
Jan 23, 2017
Merged

Close a meeting#525
josepjaume merged 2 commits intomasterfrom
feature/basic_meeting_close

Conversation

@oriolgual
Copy link
Copy Markdown
Contributor

@oriolgual oriolgual commented Jan 17, 2017

🎩 What? Why?

Adds a feature to close a meeting. In order to close it, you need to specify which proposals where created during that meeting.

To do this I've created a way to link resources (meetings, proposals, whatever) between them without having to create dependencies between engines.

📌 Related Issues

📋 Subtasks

  • Close a meeting
  • Specs & docs for Resourceable
  • Specs & docs for ResourceManifest
  • Specs & docs for ResourceHelper
  • Feature specs when viewing a proposal that has been linked
  • Feature specs when viewing a meeting that has linked proposals
  • Specs & docs for CloseMeeting
  • Specs & docs for CloseMeetingForm
  • Autocomplete field with simple API to select the proposals to link at the admin
  • Extract icon helper fix into another PR and add specs

📷 Screenshots (optional)

screen shot 2017-01-17 at 12 40 13
screen shot 2017-01-17 at 12 39 53

👻 GIF

@oriolgual oriolgual added the wip label Jan 17, 2017
@mention-bot
Copy link
Copy Markdown

@oriolgual, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mrcasals, @Dor3nz and @josepjaume to be potential reviewers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing top-level module documentation comment.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing top-level class documentation comment.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Useless private access modifier.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jan 17, 2017

Current coverage is 97.26% (diff: 98.76%)

Merging #525 into master will increase coverage by 0.05%

@@             master       #525   diff @@
==========================================
  Files           262        269     +7   
  Lines          4116       4277   +161   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           4001       4160   +159   
- Misses          115        117     +2   
  Partials          0          0          

Powered by Codecov. Last update 3a0693a...f6d79a2

@oriolgual oriolgual force-pushed the feature/basic_meeting_close branch from dbc5691 to 16e9c64 Compare January 17, 2017 15:31
@mention-bot
Copy link
Copy Markdown

@oriolgual, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mrcasals, @josepjaume and @Dor3nz to be potential reviewers.

@oriolgual oriolgual force-pushed the feature/basic_meeting_close branch 6 times, most recently from 87b6334 to e4c3745 Compare January 20, 2017 15:25
@oriolgual
Copy link
Copy Markdown
Contributor Author

I'll handle the autocomplete field in another PR

@oriolgual oriolgual removed the wip label Jan 20, 2017
@oriolgual oriolgual force-pushed the feature/basic_meeting_close branch 2 times, most recently from 4840706 to 718694f Compare January 21, 2017 12:02
@oriolgual oriolgual requested a review from josepjaume January 21, 2017 12:20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need to decide a style for this so everyone uses _ for private methods or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong opinion on this, but I'm OK with doing it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

docs are outdated (the only param is a block)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/this/these

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/is sets/sets/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if this can break things at L'Hospitalet repo. In order to diferentiate the built-in engines form the ones from Decidim, I named the survey engine as decidim_hospitalet/surveys, and it looks like this could not work well. Is there any way to Overwrite this? Can we use an attribute for this and, if blank, delegate to this value?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is confusing as the mounted_engine_name doesn't have anything to do with the engine_name, as routes are mounted using the feature_name instead.

@oriolgual maybe you could change this to mounted_feature_name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually the name of the mounted route: https://github.com/AjuntamentdeBarcelona/decidim/blob/master/decidim-core/config/routes.rb#L32

I guess it isn't related to the engine name per se (the class)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@oriolgual what I said holds true, maybe a renaming is due 🎩

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, I hope we don't have collisions on this :/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@josepjaume but what I actually want is the name of the mounted engine that rails is suing so I can call: decidim_meetings.meeting_path for example, and this is not a feature it's an engine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh ok, nevermind!

@mrcasals
Copy link
Copy Markdown
Contributor

Shouldn't we define the ResourceManifest in each existing feature, or this works automagically?

Copy link
Copy Markdown
Contributor

@beagleknight beagleknight left a comment

Choose a reason for hiding this comment

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

Outstanding work man! I just commented a few things because I don't understand some decisions. If you can elaborate them it will be useful.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/eachother/each other

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the link_name is supposed to be a String why do you need to call to_s?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This to_s is redundant, since if you pass a Symbol it will automatically be converted to a String when performing the query

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ditto

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need that dependency as development and not as a normal one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because this way you could have the meetings engine without the proposals one (this why I added the ResourceLink concept). But it's needed at dev in order to test it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why didn't use a scoped resource here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Umm I guess I can do it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ditto.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO this should be new/create instead of edit/update, since what you are dealing with here is the event of closing a meeting, not the meeting itself, so you are creating a "close this meeting" event, not editing the meeting

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The thing is that there aren't any close meeting model, it's just updating an existing model. I guess I can add edit/update too but they'll do the same as new/create.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I know there's no model for this. See this controller:

https://github.com/AjuntamentdeBarcelona/decidim/blob/master/decidim-admin/app/controllers/decidim/admin/participatory_process_step_activations_controller.rb

Activating a step is not related to an "activation model" either, but I'm creating the activation, that's why I used create/destroy there (destroy was removed since we decided that we could not deactivate steps anymore).

Anyway, that might just be me here, might be just my opinion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess I can use new/create even when we're re-closing a meeting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrong identation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be add_dependency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, because we don't want meetings to depend on proposals.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Group of People Complaining About Something LOL

Copy link
Copy Markdown
Contributor

@mrcasals mrcasals left a comment

Choose a reason for hiding this comment

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

See comments

@oriolgual
Copy link
Copy Markdown
Contributor Author

@mrcasals you only need to define a ResourceManifest if you want to expose a resource (that's what we'll need to do at Results).

Copy link
Copy Markdown
Contributor

@josepjaume josepjaume left a comment

Choose a reason for hiding this comment

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

Epic work you did here. Can't help to think all this could be moved to a decidim-resources module.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still unsure wether the header should belong here, but let's leave it like that for the moment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Even if we don't allow null names in the DB, I think we should validate presence here anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's just on the previous line!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

JúsepCI: Remove blank line

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrong docs: this line is just a copy-paste from FeatureManifest and doesn't make sense in this context

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is confusing as the mounted_engine_name doesn't have anything to do with the engine_name, as routes are mounted using the feature_name instead.

@oriolgual maybe you could change this to mounted_feature_name?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't this kind of private-ish?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not really, I'm using it at CloseMeetingForm to load all the proposals in the same process.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we split this feature in smaller files somewhere else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe, but after having to deal with it and understanding it felt that it was easier to use it and modify it when everything is together. Otherwise it might be difficult to see the whole picture. I can split it though if you think it's worth it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not present??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we need to specify a resource name like register_feature?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can, but since it's optional you can do it at the block.

@oriolgual oriolgual force-pushed the feature/basic_meeting_close branch from ba85bfb to f6d79a2 Compare January 23, 2017 11:27
@josepjaume josepjaume merged commit d93fdf1 into master Jan 23, 2017
@josepjaume josepjaume deleted the feature/basic_meeting_close branch January 23, 2017 13:01
aitorlb pushed a commit to CodiTramuntana/decidim that referenced this pull request Aug 8, 2019
aitorlb pushed a commit to CodiTramuntana/decidim that referenced this pull request Aug 8, 2019
- revert 7b6f2e5 for `author_event`
- add conditional checks for `UserPresenter` on Organization class
aitorlb pushed a commit to CodiTramuntana/decidim that referenced this pull request Aug 8, 2019
- reverting 25bd9a4
- reverting 7b6f2e5
- better fix comes from decidim@7372946
aitorlb pushed a commit to CodiTramuntana/decidim that referenced this pull request Aug 8, 2019
* [BACKPORT] Fix user presenter for user groups (decidim#4974)

* Fix user presenter for user groups (decidim#4973)

* Fix user presenter for user groups

The user groups do not have a `.deleted?` method defined for them
which caused the user presenter to break the notifications view
in case the notification was linking to a group user.

* Add CHANGELOG entry

* Fix changelog

* 🐛 ⏪ Better fixes for decidim#525

- reverting 25bd9a4
- reverting 7b6f2e5
- better fix comes from decidim@7372946

* 🌐 amendable event FR label decidim#532

* 🐛 HashtagRenderer in comment events decidim#532

* 🐛 fix step_cta_path decidim#488

* 🌐 [pages] FR "Titre" >> "Page" !
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.

7 participants