Commit Graph
79 Commits
Author SHA1 Message Date
Rémy Coutable 515205d3c1 UI and copywriting improvements
+ Move 'Edit Project/Group' out of membership-related partial
+ Show the access request buttons only to logged-in users
+ Put the request access buttons out of in a more visible button
+ Improve the copy in the #remove_member_message helper

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:18:14 +02:00
Rémy Coutable d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Douglas Barbosa Alexandre b56c456750 Project members with guest role can't access confidential issues 2016-06-13 19:32:00 -03:00
Alejandro Rodríguez fade1a4cde Fix pseudo n+1 queries with Note and Note Authors in issuables APIs
This was not a clear cut n+1 query, given that if you're directly subscribed to all issues
that the API is returning you never really need to check for the notes. However, if you're
subscribed to _all_ of them, then for each issuable you need to go once to `notes`, and
once to `users` (for the authors). By preemtively loading notes and authors, at worst you have
1 extra query, and at best you saved 2n extra queries. We also took advantage of this preloading
of notes when counting user notes.
2016-06-08 10:26:05 -04:00
Grzegorz Bizon b75945e9e4 Fix rubocop offense in awardable specs 2016-06-06 07:42:12 +02:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Paco Guzman 078ba8c090 issuable#labels_array explicitly load the labels
This will be useful when you want to ask for the 
number of items and later iterate over them, without 
needing to ask if the association is load or not.

So you avoid extra database queries
2016-06-02 21:43:01 +02:00
Douwe Maan 2d084dd848 Merge branch 'separate-banzai-references' into 'master'
Separate reference gathering from rendering

This is a required step to allow batch processing when gathering references. This in turn would allow grabbing (for example) all mentioned users of an issue/merge request using a single query.

cc @rspeicher @DouweM 

See merge request !3969
2016-06-01 15:51:59 +00:00
Yorick Peterse 580d250166 Refactor Participable
There are several changes to this module:

1. The use of an explicit stack in Participable#participants
2. Proc behaviour has been changed
3. Batch permissions checking

== Explicit Stack

Participable#participants no longer uses recursion to process "self" and
all child objects, instead it uses an Array and processes objects in
breadth-first order. This allows us to for example create a single
Gitlab::ReferenceExtractor instance and pass this to any Procs. Re-using
a ReferenceExtractor removes the need for running potentially many SQL
queries every time a Proc is called on a new object.

== Proc Behaviour Changed

Previously a Proc in Participable was expected to return an Array of
User instances. This has been changed and instead it's now expected that
a Proc modifies the Gitlab::ReferenceExtractor passed to it. The return
value of the Proc is ignored.

== Permissions Checking

The method Participable#participants uses
Ability.users_that_can_read_project to check if the returned users have
access to the project of "self" _without_ running multiple SQL queries
for every user.
2016-06-01 16:22:35 +02:00
Rémy Coutable 46ac3107a4 Merge branch 'issue_15557' into 'master'
Fix error 500 when sorting issues by milestone due date and filtering by labels

fixes #15557 

See merge request !4327
2016-06-01 08:42:36 +00:00
Felipe Artur 56f3b243ce Add leading comment space cop 2016-05-31 19:33:46 -03:00
ZJ van de Weg cbd7801b3d Merge branch 'master' into awardables 2016-05-30 18:54:08 +02:00
Grzegorz BizonandRobert Speicher fc57d36018 Minor changes in note validation specs 2016-05-29 15:03:00 -04:00
Grzegorz BizonandRobert Speicher e558edd1ce Update specs to carry out changes in note factory 2016-05-29 15:03:00 -04:00
Dmitriy Zaporozhets c04f85a333 Merge branch 'rs-rubocop-nottonot' into 'master'
Enable RSpec/NotToNot cop and auto-correct offenses

Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/17761

See merge request !4267
2016-05-25 16:46:29 +00:00
ZJ van de Weg 7ae536002a Merge branch 'master' into awardables 2016-05-25 14:41:25 +02:00
Felipe Artur 45e516b817 Fix bug when ordering by milestone due date and filtering by milestone 2016-05-24 16:49:15 -04:00
Felipe Artur 3b2223f116 improve ordering sql for milestones 2016-05-24 16:49:15 -04:00
Felipe Artur 673196e0a8 Fix ordering for Mysql 2016-05-24 16:49:15 -04:00
Felipe Artur 996240a489 Fix issues/MRs filter when ordering by milestone due date 2016-05-24 16:49:15 -04:00
Robert Speicher 75739e54be Enable RSpec/NotToNot cop and auto-correct offenses
Also removes the note from the development/testing.md guide
2016-05-24 15:40:29 -04:00
Robert Speicher 3ba72f69af Enable Style/SpaceAroundKeyword cop and fix offenses 2016-05-23 14:16:35 -04:00
Fatih Acet bb883387f9 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables
# Conflicts:
#	app/controllers/projects/merge_requests_controller.rb
#	app/models/note.rb
#	db/schema.rb
#	spec/models/note_spec.rb
2016-05-18 13:05:53 -05:00
Ahmad Sherif 0c22698bd4 Add API endpoints for un/subscribing from/to a label
Closes #15638
2016-05-12 22:48:09 +02:00
Zeger-Jan van de Weg 7a4e7ad04e Fix tests and wrong choices during merge 2016-05-12 09:23:21 +02:00
Zeger-Jan van de Weg 4558b5b9fe Incorporate feedback 2016-05-11 22:43:58 +02:00
Zeger-Jan van de Weg 7e6dcf9cd0 Merge branch 'master' into awardables 2016-05-11 08:47:04 +02:00
Zeger-Jan van de Weg dccf8a9fc8 Add tests on Awardables and Award Emoji 2016-05-10 12:03:13 +02:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00
Grzegorz Bizon bdb86ea6cf Render canceled status if any of the jobs canceled
This status will be returned only when there are no failed jobs
that are not allowed to fail.
2016-04-27 14:16:01 +02:00
Douwe Maan 7ded28ff99 Merge branch 'fix/label-filters' into 'master'
Filter labels by including ALL filter titles

Fixed query to use `AND` and not `OR`. Refactored relevant specs

See merge request !3815
2016-04-21 13:13:10 +00:00
James Lopez b09b175def refactored specs based on feedback 2016-04-21 13:20:00 +02:00
James Lopez 6865bc16f8 refactored specs, adding more scenarios 2016-04-21 09:12:03 +02:00
James Lopez 976593fa7f final line missing 2016-04-20 11:50:07 +02:00
James Lopez c0948396d1 fix rubocop warning 2016-04-20 11:25:33 +02:00
James Lopez af18cddddf udpated a few things based on MR feedback. Also added model spec 2016-04-20 10:56:28 +02:00
Kamil Trzcinski 0b1655e7b2 Rename CiStatus to Statusable 2016-04-16 21:46:26 +02:00
Douglas Barbosa Alexandre 9b93f8adc8 Destroy related todos when an issue is deleted 2016-03-30 12:09:34 -03:00
Douglas Barbosa Alexandre 482bfd1a6d Restrict access for confidential issues on milestone view 2016-03-17 20:55:59 -03:00
Douglas Barbosa Alexandre 43d8bdb4f0 Restrict access to references for confidential issues 2016-03-17 20:55:59 -03:00
Rémy Coutable 54ec7e9599 Improving the original label-subscribing implementation
1. Make the "subscribed" text in Issuable sidebar reflect the labels
   subscription status

2. Current user mut be logged-in to toggle issue/MR/label subscription
2016-03-15 18:22:02 +01:00
Timothy AndrewandRémy Coutable 0444fa560a Original implementation to allow users to subscribe to labels
1. Allow subscribing (the current user) to a label

- Refactor the `Subscription` coffeescript class
  - The main change is that it accepts a container, and conducts all
    DOM queries within its scope. We need this because the labels
    page has multiple instances of `Subscription` on the same page.

2. Creating an issue or MR with labels notifies users subscribed to those labels

- Label `has_many` subscribers through subscriptions.

3. Adding a label to an issue or MR notifies users subscribed to those labels

- This only applies to subscribers of the label that has just been
  added, not all labels for the issue.
2016-03-15 17:25:37 +01:00
Yorick PeterseandRobert Speicher 0ab9571ad7 Fixed a few spec typos 2016-03-11 15:25:23 -05:00
Yorick PeterseandRobert Speicher 87e7c3e132 Use ILIKE/LIKE for Issuable.search and full_search 2016-03-11 15:25:21 -05:00
Kirill ZaitsevandRémy Coutable b123171d3d Add new data to project in push, issue, merge-request and note webhooks data
- Add `avatar_url`, `description`, `git_ssh_url`, `git_http_url`,
  `path_with_namespace` and `default_branch` in `project` in push, issue,
  merge-request and note webhooks data
- Deprecate the `ssh_url` in favor of `git_ssh_url` and `http_url` in
  favor of `git_http_url` in `project` for push, issue, merge-request and
  note webhooks data
- Deprecate the `repository` key in push, issue, merge-request and
  note webhooks data, use `project` instead
2016-02-11 17:22:11 +01:00
Bram DaamsandRémy Coutable d146d9fd83 Add assignee data to Issuables' hook_data 2016-02-10 09:40:00 +01:00
James Lopez 902baa2e1c trick rubocop and temporarily add ruby 2.1 images for any branch 2016-01-28 11:41:58 +01:00
James Lopez ee209cc936 fix rubocop new 2.2 syntax issues 2016-01-25 11:44:25 +01:00
Valery Sizov eeba266e3d Merge branch 'upvote_count_to_api' into 'master'
Revert upvotes and downvotes params back to MR API

issue https://gitlab.com/gitlab-org/gitlab-ce/issues/3672

See merge request !2212
2015-12-29 16:07:12 +00:00
Valery Sizov 83d42c1518 Revert upvotes and downvotes params to MR API 2015-12-28 11:41:16 +02:00