summaryrefslogtreecommitdiff
path: root/app/models/label.rb
Commit message (Collapse)AuthorAgeFilesLines
* Make quick action "commands applied" banner more useful🙈 jacopo beschi 🙉2019-07-291-0/+4
| | | | | Extends the quick actions "commands applied" banner to show the quick action preview text, but with everything in past tense.
* Add where condition to filter out invalid labels with nil type63730-fix-500-status-labels-pdPatrick Derichs2019-07-241-1/+1
|
* Remove some deprecated codedz-cleanup-deprecated-codeDmitriy Zaporozhets2019-06-071-1/+0
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Move scoped_label into label presenterJan Provaznik2019-04-231-0/+5
| | | | | | | When rendering a label we want to check 'scoped_label' feature availability on a project/group where label is being used. For this reason a label presenter is used in UI and information about context project/group is passed to this presenter.
* Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ↵jarv/dev-to-gitlab-2019-04-02John Jarvis2019-04-021-0/+4
|\ | | | | | | jarv/dev-to-gitlab-2019-04-02
| * Check if labels are available for target issuableJarka Košanová2019-03-281-0/+4
| | | | | | | | | | - labels have to be in the same project/group as an issuable
* | Inherit from ApplicationRecord instead of ActiveRecord::BaseNick Thomas2019-03-281-1/+1
|/
* Allow filtering labels by a single characterSean McGivern2019-03-131-0/+7
| | | | | | | | | | | | When we use Gitlab::SQL::Pattern, this typically relates to a trigram index. As the 'tri' indicates, we need at least three characters to be able to use that index. Labels don't have a trigram index, because we never allow you to search for them globally: it's always in the context of a project or a group. In that context, it's just as fast to search for a single character (in general) because there is already a pretty specific index being used.
* Fix inconsistent label foreground color53714-inconsistent-text-color-for-labelsNathan Friend2019-01-181-0/+1
| | | | | | | In different parts of the application, the same label was being rendered with a different foreground color. This was due to the "textColor" JSON property not being generated by the backend. This commit adds this property to JSON representation of labels.
* Filter by `None`/`Any` for labels in issues/mrs APIJacopo2018-11-231-7/+2
| | | | | | | | | | | | | | By using the parameters `?labels=None|Any` the user can filter issues/mrs from the API that has `none/any` label. Affected endpoints are: - /api/issues - /api/projects/:id/issues - /api/groups/:id/issues - /api/merge_requests - /api/projects/:id/merge_requests - /api/groups/:id/merge_requests
* Fixed label removal from issueccr/51052_keep_labels_on_issueChantal Rollison2018-11-051-1/+1
|
* Add subscribe filter to labels pageDmitriy Zaporozhets2018-10-041-0/+9
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Added FromUnion to easily select from a UNIONYorick Peterse2018-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the module `FromUnion`, which provides the class method `from_union`. This simplifies the process of selecting data from the result of a UNION, and reduces the likelihood of making mistakes. As a result, instead of this: union = Gitlab::SQL::Union.new([foo, bar]) Foo.from("(#{union.to_sql}) #{Foo.table_name}") We can now write this instead: Foo.from_union([foo, bar]) This commit also includes some changes to make this new setup work properly. For example, a bug in Rails 4 (https://github.com/rails/rails/issues/24193) would break the use of `from("sub-query-here").includes(:relation)` in certain cases. There was also a CI query which appeared to repeat a lot of conditions from an outer query on an inner query, which isn't necessary. Finally, we include a RuboCop cop to ensure developers use this new module, instead of using Gitlab::SQL::Union directly. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
* Add sort dropdown to project labels page and group labels pageDmitriy Zaporozhets2018-09-101-0/+3
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Use optionally_search for group labels index pageDmitriy Zaporozhets2018-09-071-0/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branch 'frozen-string-enable-app-models' into 'master'Rémy Coutable2018-08-021-0/+2
|\ | | | | | | | | Enable frozen string in app/models/*.rb See merge request gitlab-org/gitlab-ce!20851
| * Enable frozen string in app/models/*.rbrepo-forks/gitlab-ce-frozen-string-enable-app-modelsgfyoung2018-07-261-0/+2
| | | | | | | | Partially addresses #47424.
* | Add ability to filter labels by title or descriptionDmitriy Zaporozhets2018-07-311-0/+12
|/ | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Properly detect label reference if followed by period or question markDouwe Maan2018-06-181-5/+10
|
* Merge remote-tracking branch 'origin/master' into ↵Luke Bennett2018-05-281-2/+2
|\ | | | | | | 39549-label-list-page-redesign-with-draggable-labels
| * Revert the addition of goldiloaderYorick Peterse2018-04-181-2/+2
| | | | | | | | | | | | | | | | | | This reverts the addition of the "goldiloader" Gem and all use of it. While this Gem is very promising it's causing a variety of problems on GitLab.com due to it eager-loading too much data in places where we don't expect/can handle this. At least for the time being this means we have to go back to manually fixing N+1 query problems, but at least those should not cause a negative impact on availability.
* | Add/use Label#priority? and remove weird paddingLuke Bennett2018-04-191-0/+4
|/
* Use Goldiloader for handling N+1 queriesYorick Peterse2018-04-091-2/+2
| | | | | | | Goldiloader (https://github.com/salsify/goldiloader) can eager load associations automatically. This removes the need for adding "includes" calls in a variety of different places. This also comes with the added benefit of not having to eager load data if it's not used.
* Bring one group board to CEFelipe Artur2018-03-031-0/+1
|
* Adds Rubocop rule for line break around conditionals🙈 jacopo beschi 🙉2018-01-111-0/+1
|
* Fix link text from group contextJarka Kadlecova2017-11-231-3/+3
|
* fix another N+1 query for label priorities34510-board-issues-sql-speedupmicael.bergeron2017-09-121-1/+6
| | | | added a QueryRecorder for IssuesController#index.json
* Fix failing specee_issue_928_backportFelipe Artur2017-09-061-1/+1
|
* Continue BE backportFelipe Artur2017-08-311-0/+1
|
* Group boards CE backportFelipe Artur2017-08-281-1/+2
|
* Added Cop to blacklist the use of `dependent:`Yorick Peterse2017-07-061-2/+2
| | | | | | | | This is allowed for existing instances so we don't end up 76 offenses right away, but for new code one should _only_ use this if they _have_ to remove non database data. Even then it's usually better to do this in a service class as this gives you more control over how to remove the data (e.g. in bulk).
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-6/+6
|
* Enable the Style/PreferredHashMethods coprc/enable-PreferredHashMethods-copRémy Coutable2017-06-021-1/+1
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Provide default for calculating label text color (!11681)winh2017-05-251-0/+4
|
* Add board_move slash commandAlex Sanford2017-04-281-0/+1
|
* Remove heading and trailing spaces from label's color and titleblackst0ne2017-04-121-0/+6
|
* Added labels to the issue web hookLuke "Jared" Bennett2017-03-171-0/+4
|
* Revert "Enable Style/DotPosition"Douwe Maan2017-02-231-3/+3
| | | | | | | | | | | | | | | This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9. # Conflicts: # .rubocop.yml # .rubocop_todo.yml # lib/gitlab/ci/config/entry/global.rb # lib/gitlab/ci/config/entry/jobs.rb # spec/lib/gitlab/ci/config/entry/factory_spec.rb # spec/lib/gitlab/ci/config/entry/global_spec.rb # spec/lib/gitlab/ci/config/entry/job_spec.rb # spec/lib/gitlab/ci/status/build/factory_spec.rb # spec/lib/gitlab/incoming_email_spec.rb
* Revert "Prefer leading style for Style/DotPosition"Douwe Maan2017-02-231-9/+9
| | | | This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
* Prefer leading style for Style/DotPositionDouwe Maan2017-02-231-9/+9
|
* Enable Style/MutableConstantDouwe Maan2017-02-231-1/+1
|
* Enable Style/DotPositionDouwe Maan2017-02-231-3/+3
|
* validate length of label.titleTomáš Kukrál2017-01-091-0/+1
| | | | + add test for label.title length validation
* Fix cross-project references copy to include the project referencefix/cross-project-ref-pathJames Lopez2017-01-031-5/+5
| | | | Also added relevant specs and refactored to_references in a bunch of places to be more consistent.
* Add shorthand support to gitlab markdown referencesOswaldo Ferreira2016-12-021-9/+6
|
* Use label subject to calculate number of issues/mrs within the groupDouglas Barbosa Alexandre2016-10-311-15/+15
|
* Use join instead of subquery on Label.unprioritized scopeDouglas Barbosa Alexandre2016-10-191-1/+8
|
* Abstract LabelPriority away into methods on Label modelDouglas Barbosa Alexandre2016-10-191-1/+15
|
* Fix issue board related controllers to expose label priority per projectDouglas Barbosa Alexandre2016-10-191-0/+6
|
* Fix sorting by label prioritiesDouglas Barbosa Alexandre2016-10-191-0/+11
|