Skip to content

Replace bootstrap-tagsinput npm package with tom-select#11076

Merged
ahukkanen merged 9 commits intodevelopfrom
deps/tom-select
Jun 22, 2023
Merged

Replace bootstrap-tagsinput npm package with tom-select#11076
ahukkanen merged 9 commits intodevelopfrom
deps/tom-select

Conversation

@andreslucena
Copy link
Copy Markdown
Member

🎩 What? Why?

We're using an unmaintained JS package for the input tags feature in /system panel, in the File uploads' organization form.

Last release was 8 years ago: https://www.npmjs.com/package/bootstrap-tagsinput
This has a dependabot alert:

Dependabot alerts for bootstrap-tagsinput

Sometime ago we discussed some alternatives for this feature (see #8683). One of the alternatives proposed was tom-select, that I think that we could also use for other select fields (as I mentioned in #11039 (comment))

📌 Related Issues

Testing

  1. Go to http://localhost:3000/system
  2. Sign in as system@example.org
  3. Edit the organization
  4. Click on "Show advanced settings"
  5. Go to the "File uploads" section
  6. It should work the same

📷 Screenshots

Before

decidim-system-input_tags-2023-06-21_14.45.07.mp4

After

decidim-system-input_tags-tom.select-2023-06-21_15.26.09.mp4

♥️ Thank you!

@andreslucena andreslucena added module: system dependencies Pull requests that update a dependency file or issues that talk about updating dependencies type: change PRs that implement a change for an existing feature labels Jun 21, 2023
@andreslucena andreslucena changed the title Remove bootstrap-tagsinput npm package Replace bootstrap-tagsinput npm package with tom-select Jun 21, 2023
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

@andreslucena Thanks for taking the lead on this.

The implementation of tom-select looks nice. I have a small recommendation regarding the approach on the .scss files

image

Comment thread decidim-system/app/packs/stylesheets/decidim/system/_forms.scss Outdated
Comment thread decidim-core/app/packs/stylesheets/decidim/modules/_input-tags.scss
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks @andreslucena ! Feel free to merge.

Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen left a comment

Choose a reason for hiding this comment

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

👍

@ahukkanen ahukkanen merged commit c7db070 into develop Jun 22, 2023
@ahukkanen ahukkanen deleted the deps/tom-select branch June 22, 2023 07:55
entantoencuanto added a commit that referenced this pull request Jul 3, 2023
* redesign/sync-develop-2: (150 commits)
  Adapt tests to redesign
  Fix stylelint offenses
  Fix linter offenses
  Fix sanitizer
  Recover deleted translation
  Recover test fix
  Fix method definition and syntax
  Check for supported locale in Emoji picker (#11079)
  Fix configuration param and documentation links in CSP (#11098)
  Show all projects if none is selected when the voting has finished (#11090)
  Add Content Security Policy support (#10700)
  Replace `bootstrap-tagsinput` npm package with `tom-select` (#11076)
  Avoid password change to be requested when user registration mode is disabled (#11070)
  Lock sass-embedded to 1.62 (#11074)
  Add a button to send a newsletter to the admin (#10896)
  Fixing more tests
  Fixing more specs
  Fixing most of the failings specs
  Fixing most of the failings specs
  Bump doorkeeper from 5.5.4 to 5.6.6 (#11002)
  ...
andreslucena added a commit that referenced this pull request Jul 18, 2023
* Remove bootstrap-tagsinput npm package

* Add tom-select npm package

* Remove 'No results found' message

* Fix CSS margins

* Sync input-tags.scss from decidim-core with the decidim-system CSS

* Enable 'remove button' feature

* Fix eslint offenses

* Reference the same SCSS file instead of duplicating it

Suggested by code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file or issues that talk about updating dependencies module: system type: change PRs that implement a change for an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants