Skip to content
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

Iagirre autocomplete tags #1905

Merged
merged 4 commits into from
Sep 26, 2017

Conversation

iagirre
Copy link

@iagirre iagirre commented Sep 21, 2017

Where

What

When the user is writting the tags for a proposal, a debate or an investment project, the page should suggest other tags that already exist so that users can select those tags instead of creating new and similiar ones (e.g. motorbike and motorcycle).

How

I used the autocomplete widget from jquery-ui to do it. When the user is writing, the widget looks for similar words in the DB using the pg_search gem. The gem retrieves the results and they are shown in a list under the text field. The user can select one of the results using the mouse or the down and up arrows on the keyboard. When an option is selected, it is automatically added to the list.

Screenshots

autocomplete_tags

Test

I increased the test coverage for the tags' search function.

Deployment

Not to apply

Warnings

Not to apply

iagirre added 3 commits September 19, 2017 17:37
 Cambios para hacer commit:
	modificado:    app/assets/javascripts/tag_autocomplete.js.coffee
	modificado:    app/assets/stylesheets/autocomplete_overrides.scss
	nuevo archivo: app/controllers/tags_controller.rb
	modificado:    app/models/abilities/common.rb
	modificado:    app/views/debates/_form.html.erb
	modificado:    app/views/proposals/_form.html.erb
	modificado:    config/initializers/acts_as_taggable_on.rb
	modificado:    config/routes.rb
	modificado:    spec/lib/acts_as_taggable_on_spec.rb
@decabeza
Copy link
Collaborator

Hi @iagirre! Thanks for the PR! 👍

For the scss file autocomplete_overrides.scss please run scss-lint on console to check some minor erros (don't care about other scss, only included on this PR) 😉

@bertocq bertocq merged commit 73c47dc into consuldemocracy:master Sep 26, 2017
@iagirre iagirre deleted the iagirre-autocomplete-tags branch January 16, 2018 07:20
@bertocq bertocq mentioned this pull request Jan 21, 2018
javierm pushed a commit to javierm/consul that referenced this pull request Mar 18, 2019
…ing_proposals_validations

Migrate special supports and votes
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.

3 participants