Conversation
81071e7 to
01527dc
Compare
Current coverage is 93.58% (diff: 100%)@@ master #399 diff @@
==========================================
Files 346 350 +4
Lines 5044 5115 +71
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 4717 4787 +70
- Misses 327 328 +1
Partials 0 0
|
There was a problem hiding this comment.
Please create a decidim_paginate helper so we don't mutate params.
There was a problem hiding this comment.
This has to be changed in the proposals engine too.
There was a problem hiding this comment.
Also, this helper could also set the theme
7262125 to
458f446
Compare
There was a problem hiding this comment.
We should bind this event on turbolinks:load as well. I recommend moving this code into a class, something like MeetingFilterFormComponent. Then you can bind both events document:ready and turbolinks:load and create an instance of this class (or method, or whatev) to bind the form events.
Also I'm not a huge fan of exposing random globals so it's better if you use a namespace to include the previous class (or method, or whatev) into a global called DecidimMeetings.
There was a problem hiding this comment.
@beagleknight I'll need your help on this then.
There was a problem hiding this comment.
I think it will be more maintainable if we move those regex into separate variables or just factor out some kind of function to extract the params. We can review it later @mrcasals
89179ec to
5cbb664
Compare
There was a problem hiding this comment.
Use only ascii symbols in comments.
8992cda to
0c52659
Compare
There was a problem hiding this comment.
Docs? I used jsdoc to document my components. Take a look at decidim-comments components.
There was a problem hiding this comment.
This is not transpiled so I recommend using var instead of const.
There was a problem hiding this comment.
This code still feels very strange to me... I'm not really sure why we need to mix document events with turbolinks ones. Can you add some documentation about this so we remember why we didn't use turbolinks:load event instead of document ready event.
ee1aa5f to
2b5ec3f
Compare
There was a problem hiding this comment.
?? Shouldn't you use paginate_params?
There was a problem hiding this comment.
No, since the paginate helper uses the global params. paginate_params are extra parameters that need to be sent to the helper but do not affect the current URL.
There was a problem hiding this comment.
Since kaminari will merge the given params with the global ones, instead of deleting them from params we can pass "participatory_process_id" and "feature_id" as empty values.
There was a problem hiding this comment.
I don't like using ids here, see Admin::ProposalForm since it also has scope & category.
There was a problem hiding this comment.
Should be the same for category?
There was a problem hiding this comment.
Use objects instead of ids
decidim-meetings/spec/factories.rb
Outdated
There was a problem hiding this comment.
start_time.advance(hours: 2)
There was a problem hiding this comment.
You aren't passing the params here. Maybe we should pass the with params.to_h or .dup
There was a problem hiding this comment.
I can't pass the URL params here, since paginate (from Kaminari) will keep using the global params object to generate the pagination. The hash containing random_seed is the one passed to the decidim_paginate helper as extra params.
18caa10 to
cf388be
Compare
cf388be to
759ac3c
Compare
| _onPopState() { | ||
| this._clearForm(); | ||
|
|
||
| let [sortValue] = this._getLocationParams(/order_start_time=([^&]*)/g) || ["asc"]; |
There was a problem hiding this comment.
So freaking sad that JavaScript doesn't have a built-in way to deal with GET parameters.
🎩 What? Why?
This PR adds a way to filter meetings by scope and to order them by start time.
📌 Related Issues
📋 Subtasks
MeetingSearchdestroycallback tobefore_destroydecidim_paginatehelper to encapsulate the pagination logicparams.deletepart (See @oriolgual's first review)📷 Screenshots (optional)