[PR #58] Add the possibility to add multiple labels for one snippet #75

Open
opened 2026-02-27 23:18:47 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/snibox/snibox/pull/58
Author: @annabplr
Created: 8/19/2019
Status: 🔄 Open

Base: masterHead: pr/add-muliple-labels


📝 Commits (2)

  • d00c4db add the possibility to add multiple labels for one snippet
  • 3ead610 add gemfile.lock

📊 Changes

29 files changed (+10206 additions, -77 deletions)

View changed files

📝 Gemfile (+1 -1)
📝 Gemfile.lock (+3 -3)
📝 app/controllers/api/v1/data_controller.rb (+1 -1)
📝 app/controllers/api/v1/snippets_controller.rb (+37 -5)
📝 app/javascript/snibox/components/SearchBox.vue (+5 -6)
📝 app/javascript/snibox/components/SnippetItem.vue (+1 -1)
📝 app/javascript/snibox/components/Snippets.vue (+4 -1)
📝 app/javascript/snibox/components/snippet/Form.vue (+4 -3)
📝 app/javascript/snibox/components/snippet/Show.vue (+8 -1)
📝 app/javascript/snibox/mixins/data_helpers.js (+3 -0)
📝 app/javascript/snibox/mixins/snippets_builder.js (+2 -2)
📝 app/javascript/snibox/store/getters.js (+1 -1)
📝 app/javascript/snibox/store/helpers.js (+34 -21)
📝 app/javascript/styles/snibox/components/_card.scss (+16 -0)
📝 app/models/label.rb (+2 -1)
app/models/labeling.rb (+5 -0)
📝 app/models/snippet.rb (+4 -3)
📝 app/serializers/snippet_serializer.rb (+3 -3)
db/migrate/20190722064514_create_labelings.rb (+10 -0)
db/migrate/20190722070023_remove_label_id_from_snippet.rb (+11 -0)

...and 9 more files

📄 Description

This PR adds the possibility to add multiple labels for one snippet, as requested in this old issue.
A new table (Labeling) has been added to allow the has_many / has_many relationship between Label and Snippet.

Labels should be separated by a comma.

Tests have been edited to fit those changes and one has been added, to check if 2 labels separated by a comma are saved as 2 labels.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/snibox/snibox/pull/58 **Author:** [@annabplr](https://github.com/annabplr) **Created:** 8/19/2019 **Status:** 🔄 Open **Base:** `master` ← **Head:** `pr/add-muliple-labels` --- ### 📝 Commits (2) - [`d00c4db`](https://github.com/snibox/snibox/commit/d00c4db65f0d5a5afcde126732fadbc54480f7f2) add the possibility to add multiple labels for one snippet - [`3ead610`](https://github.com/snibox/snibox/commit/3ead6102d0ac21b19adf7c5a3cba53d243584822) add gemfile.lock ### 📊 Changes **29 files changed** (+10206 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `Gemfile` (+1 -1) 📝 `Gemfile.lock` (+3 -3) 📝 `app/controllers/api/v1/data_controller.rb` (+1 -1) 📝 `app/controllers/api/v1/snippets_controller.rb` (+37 -5) 📝 `app/javascript/snibox/components/SearchBox.vue` (+5 -6) 📝 `app/javascript/snibox/components/SnippetItem.vue` (+1 -1) 📝 `app/javascript/snibox/components/Snippets.vue` (+4 -1) 📝 `app/javascript/snibox/components/snippet/Form.vue` (+4 -3) 📝 `app/javascript/snibox/components/snippet/Show.vue` (+8 -1) 📝 `app/javascript/snibox/mixins/data_helpers.js` (+3 -0) 📝 `app/javascript/snibox/mixins/snippets_builder.js` (+2 -2) 📝 `app/javascript/snibox/store/getters.js` (+1 -1) 📝 `app/javascript/snibox/store/helpers.js` (+34 -21) 📝 `app/javascript/styles/snibox/components/_card.scss` (+16 -0) 📝 `app/models/label.rb` (+2 -1) ➕ `app/models/labeling.rb` (+5 -0) 📝 `app/models/snippet.rb` (+4 -3) 📝 `app/serializers/snippet_serializer.rb` (+3 -3) ➕ `db/migrate/20190722064514_create_labelings.rb` (+10 -0) ➕ `db/migrate/20190722070023_remove_label_id_from_snippet.rb` (+11 -0) _...and 9 more files_ </details> ### 📄 Description This PR adds the possibility to add multiple labels for one snippet, as requested in [this old issue](https://github.com/snibox/snibox/issues/5). A new table (Labeling) has been added to allow the has_many / has_many relationship between Label and Snippet. Labels should be separated by a **comma**. Tests have been edited to fit those changes and one has been added, to check if 2 labels separated by a comma are saved as 2 labels. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/snibox#75
No description provided.