Feature/2348 proposal selection from accountability with autoComplete#2584
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2584 +/- ##
==========================================
+ Coverage 98.73% 98.73% +<.01%
==========================================
Files 1647 1649 +2
Lines 39070 39172 +102
==========================================
+ Hits 38575 38677 +102
Misses 495 495 |
|
You may take a look at #2684. The |
|
@Crashillo , @decidim/lot-core I'm not sure about the callbacks this new component offers but what I see in #2684 is different from what I need.
@decidim/product @decidim/lot-core I also think that this issue should have been taken into account before implementing a custom autocomplete solution because it took 2 weeks of work to have the current implementation with data-picker and now we're ignoring it and:
|
|
The good point of Tribute.js is that you can initialize it whatever you want with. |
|
Yes, the same characteristics as the ultra fast autoComplete 👅 Also we have a collision with symbol '#' wich will have different use cases. I think it is better to stay with |
50fbadd to
4f98de6
Compare
…ntability-autoComplete
|
Hi @decidim/lot-core, how can I make jquery-autocomplete.css and .js files being ignored by codeclimate? I'm adding it into codeclimate.yml excludes but keeps analyzing them. |
|
@tramuntanal please rebase against master, move those files to the |
…oComplete' of https://github.com/decidim/decidim into feature/2348-proposal_selection_from_accountability-autoComplete
…ntability-autoComplete
|
@decidim/lot-core all checks pass now 😄 |
…ry parameter from :q to :term.
josepjaume
left a comment
There was a problem hiding this comment.
Please just remove these comment lines and that's it!
| end | ||
| end | ||
|
|
||
| #----------------------------------------------------------------------- |
There was a problem hiding this comment.
This is now not needed since there's nothing in the middle haha
|
|
||
| private | ||
|
|
||
| #----------------------------------------------------------------------- |
There was a problem hiding this comment.
Now there's no need to have this here 👍
| def proposals | ||
| @proposals ||= Decidim.find_resource_manifest(:proposals).try(:resource_scope, current_feature)&.order(title: :asc)&.pluck(:title, :id) | ||
| @proposals ||= Decidim.find_resource_manifest(:proposals) | ||
| .try(:resource_scope, current_feature) |
There was a problem hiding this comment.
I think it's a bug that rubocop didn't catch this. I reported it: rubocop/rubocop#5621...
| }, | ||
| renderItem: function (item, search) { | ||
| let sanitizedSearch= search.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); | ||
| let re= new RegExp(`(${sanitizedSearch.split(' ').join('|')})`, "gi"); |
There was a problem hiding this comment.
Please add spaces between the variable name and = 😄
| {}, | ||
| { multiple: true, class: "chosen-select" } | ||
| %> | ||
| <% picker_options= { id: "decidim_accountability_proposals", class: "picker-multiple", name: 'result[proposal_ids]', multiple: true } |
There was a problem hiding this comment.
Space between variable name and = please 😄
| # | ||
| # Returns an html String. | ||
| def data_picker(attribute, options = {}, prompt_params = {}) | ||
| picker_options = { id: "#{@object_name}_#{attribute}", class: "picker-#{options[:multiple] ? "multiple" : "single"}", |
There was a problem hiding this comment.
Can you normalize this hash please? Each key in a single line, etc
There was a problem hiding this comment.
Note that rubocop explicitly accepts this style and this file is using that same style in other places, so I think it's fine to leave it since otherwise we're introducing "in-file" inconsistency.
As a note, I made a very related feature request to rubocop a while ago, but nobody has stepped to implement it. It's not even clear if it should be a different cop or a configuration option for existing cops.
| end | ||
| end | ||
|
|
||
| #----------------------------------------------------------------------- |
|
|
||
| private | ||
|
|
||
| #----------------------------------------------------------------------- |
|
This PR is ready again @decidim/lot-core |
|
@tramuntanal I still see some comments that have not been addressed yet, can you remove those extra lines please? |
|
@tramuntanal - @mrcasals is referring to the comment lines ( |
|
@decidim/lot-core I've removed both better readability lines on your command, feeling bad about that. |
|
@tramuntanal hey no prob! There's a lot of things going on right now, only natural to forget about some comments now and then 👍 |
Delegated approval to me via telegram xD
|
Merging!! 🎉 🎉 🎉 🎉 🎉 🎉 🎉 |
|
@josepjaume I was sad for having to remove the lines that I think were positive because they added better readability to code but well.. Merged at the end 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 |
🎩 What? Why?
Widget to allow the administrators to associate Proposals to results in a more agile manner.
📌 Related Issues
📋 Subtasks
CHANGELOGentry📷 Screenshots (optional)