Commit Graph
101 Commits
Author SHA1 Message Date
Phil Hughes 88024b17c0 Standardised the output of the JSON to always include the name
The frontend will then always use the name as the ID - like previous
2016-03-29 11:59:13 +01:00
Phil Hughes 7ff6af19cc Dropdown bug fixes
Added back upcoming to milestone filter
Fixed bug that would cause the currently selected value to disappear on filters
Fixed bug that throw an error when filtering by upcoming when there is only a milestone in the past
2016-03-29 11:57:04 +01:00
Douwe Maan 31266c5be4 Address feedback 2016-03-22 00:09:20 +01:00
Felipe Artur 8d544645f0 Add specs and add visibility level to admin groups 2016-03-21 19:11:24 -03:00
Douwe Maan 3058a8fa4c Fix "Shared projects" tab 2016-03-20 21:30:08 +01:00
Douwe Maan fd8d44ca61 Fix group project selection in IssuableFinder 2016-03-20 21:14:39 +01:00
Douwe Maan 8db1292139 Tweaks, refactoring, and specs 2016-03-20 21:04:07 +01:00
Douwe Maan 2eb19ea3ea Merge branch 'master' into issue_12658 2016-03-20 14:57:25 +01:00
Douglas Barbosa Alexandre 34ee75379c Restrict access to confidential issues 2016-03-17 20:55:38 -03:00
Felipe Artur 0a7f716119 Code fixes 2016-03-17 19:42:46 -03:00
Felipe Artur a18ac62756 Block internal groups/projects visibility to external users 2016-03-16 21:23:59 -03:00
Felipe Artur 44c127447b Merge 4009-external-users into issue_12658 2016-03-16 20:16:42 -03:00
Felipe Artur ec20fdf366 Code improvements and add Create group service 2016-03-16 19:44:33 -03:00
Zeger-Jan van de Weg ab418e27a9 Improve external users feature 2016-03-14 22:06:23 +01:00
Zeger-Jan van de Weg 88f8d3a4d6 Merge branch 'master' into 4009-external-users 2016-03-14 20:08:02 +01:00
Dmitriy Zaporozhets d324bf8434 Merge branch 'share-project-ce' into 'master'
Bring from EE: Share Project with Group

- [x] Models and migrations
- [x] Logic, UI
- [x] Tests
- [x] Documentation
- [x] Share with group lock
- [x] Api feature
- [x] Api docs
- [x] Api tests

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

For #12831 

cc @DouweM @rspeicher @vsizov

See merge request !3186
2016-03-14 16:38:52 +00:00
Zeger-Jan van de Weg 76eeb316df Create an external users tab on Admin user list
Also incorporates the review into this, mainly spec changes.
2016-03-13 19:10:33 +01:00
Zeger-Jan van de Weg 42fcd3881f External Users
The user has the rights of a public user execpt it can never create a project,
 group, or team. Also it cant view internal projects.
2016-03-13 19:08:04 +01:00
tiagonbotelho d3b7633da4 fixes small issues 2016-03-13 12:19:27 +00:00
tiagonbotelho 0291473b98 fixes issues 2016-03-12 18:08:01 +00:00
tiagonbotelho 7530827eca fixes issues for mr acceptance 2016-03-12 18:08:01 +00:00
tiagonbotelho b9d13c11de implements upcoming filter in milstones 2016-03-12 18:08:01 +00:00
Yorick Peterse 3b76b73ab1 Removed User#project_relations
GitLab EE adds an extra relation that selects a "project_id" column
instead of an "id" column, making it very hard for this method to be
re-used in EE. Since using User#authorized_groups in
ProjectsFinder#all_groups apparently has no performance impact we can
just use it and keep everything compatible with EE.
2016-03-12 15:44:48 +01:00
Yorick PeterseandRobert Speicher 9e00a23716 Clean up ProjectsFinder for getting user projects
We don't need the extra layer of nesting of UNION queries here (as
User#authorized_projects already returns a UNION'd query).
2016-03-11 15:25:23 -05:00
Dmitriy Zaporozhets 068fd5de8a Add finders logic and tests for shared projects feature
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-11 18:55:17 +01:00
Felipe Artur c3e70280df Prevent projects to have higher visibility than groups
Prevent Groups to have smaller visibility than projects
Add default_group_visibility_level to configuration
Code improvements
2016-03-10 10:38:36 -03:00
Felipe Artur 5551ccd720 Code improvements 2016-03-10 10:38:36 -03:00
Felipe Artur f2a9ee258e Add permission level to groups 2016-03-10 10:38:36 -03:00
Dmitriy Zaporozhets bc14d81af0 Merge branch 'rs-snippets-dont-expire' into 'master'
Remove `Snippet#expires_at`

This was removed from the interface in
https://github.com/gitlabhq/gitlabhq/pull/6027 but its implementation
lingered around for two years.

See merge request !3103
2016-03-09 09:02:17 +00:00
Rubén Dávila 95b06a62c0 Updates from last code review. 2016-03-06 23:07:19 -05:00
Robert Speicher 836d593033 Remove Snippet#expires_at
This was removed from the interface in
https://github.com/gitlabhq/gitlabhq/pull/6027 but its implementation
lingered around for two years.
2016-03-05 18:12:17 -05:00
Douglas Barbosa Alexandre 3d52e139b1 Rename Tasks to Todos 2016-02-20 12:39:27 -02:00
Douglas Barbosa Alexandre 07eb334c25 Add filters by project, author, type, and action to task queue page list 2016-02-20 12:12:05 -02:00
Tap cec57275f0 Missing @ in @labels 2016-02-19 20:40:50 +08:00
Tap 44a9e26049 Find label in issues_finder 2016-02-19 13:50:47 +08:00
Yorick Peterse d6a8021ea1 Scope issue projects to a Group when possible
When using IssuableFinder with a Group we can greatly reduce the amount
of projects operated on (due to not including all public/internal
projects) by simply passing it down to the ProjectsFinder class.

This reduces the timings of the involved queries from roughly 300
ms to roughly 20 ms.

Fixes gitlab-org/gitlab-ce#4071, gitlab-org/gitlab-ce#3707
2016-01-18 12:27:33 +01:00
Yorick Peterse fc443ea7bc Drop projects order in IssuableFinder
When grabbing the projects to filter issues by we don't care about the
order they're returned in. By removing the ORDER BY the resulting query
can be quite a bit faster.
2016-01-07 14:53:02 +01:00
Valery Sizov 8b18449125 remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00
Greg Smethells dbbd2b863b sort milestones by due_date 2015-12-03 08:53:34 -06:00
Yorick Peterse fed059a12d Port GitLab EE ProjectsFinder changes
These changes were added in GitLab EE commit
d39de0ea91. The tests were a bit bugged
(they used a non existing group, thus not testing a crucial part) which
I only noticed when porting CE changes to EE.
2015-11-20 15:53:04 +01:00
Dmitriy Zaporozhets 68d4ab2381 Merge branch 'emoji_votes' into 'master'
Award Emoji

This it first iteration of award emoji feature.
We have plan to extend emoji picker by the next release.

For now, you can add award by clicking to the emoji picker or posting a regular comment with emoji like "👍" and any other. You can post not only emoji that listed in the emoji picker.

See merge request !1825
2015-11-19 21:34:38 +00:00
Yorick Peterse 8591cc02be Use a JOIN in IssuableFinder#by_project
When using IssuableFinder/IssuesFinder to find issues for multiple
projects it's more efficient to use a JOIN + a "WHERE project_id IN"
condition opposed to running a sub-query.

This change means that when finding issues without labels we're now
using the following SQL:

    SELECT issues.*
    FROM issues
    JOIN projects ON projects.id = issues.project_id

    LEFT JOIN label_links ON label_links.target_type = 'Issue'
                          AND label_links.target_id  = issues.id

    WHERE (
        projects.id IN (...)
        OR projects.visibility_level IN (20, 10)
    )
    AND issues.state IN ('opened','reopened')
    AND label_links.id IS NULL
    ORDER BY issues.id DESC;

instead of:

    SELECT issues.*
    FROM issues
    LEFT JOIN label_links ON label_links.target_type = 'Issue'
                          AND label_links.target_id  = issues.id

    WHERE issues.project_id IN (
        SELECT id
        FROM projects
        WHERE id IN (...)
        OR visibility_level IN (20,10)
    )
    AND issues.state IN ('opened','reopened')
    AND label_links.id IS NULL
    ORDER BY issues.id DESC;

The big benefit here is that in the last case PostgreSQL can't properly
use all available indexes. In particular it ends up performing a
sequence scan on the "label_links" table (processing around 290 000
rows). The new query is roughly 2x as fast as the old query.
2015-11-19 11:58:05 +01:00
Yorick Peterse e9cd58f5d5 Memoize IssuableFinder#projects
Since this method's returned data doesn't change between calls on the
same IssuableFinder instance we can just memoize this similar to the
"project" method.
2015-11-19 11:48:50 +01:00
Yorick Peterse c232a0f97f Removed trailing whitespace from IssuableFinder 2015-11-19 11:48:50 +01:00
Valery Sizov 06a4fd1035 css improvements 2015-11-19 01:25:59 +02:00
Yorick Peterse f486b06c4d Return internal projects in PersonalProjectsFinder
When getting the projects of a user we should get the public _and_
internal projects, not just the public ones.
2015-11-18 15:08:28 +01:00
Yorick Peterse fbcf3bd3fc Refactor ProjectsFinder to not pluck IDs
This class now uses a UNION (when needed) instead of plucking tens of
thousands of project IDs into memory. The tests have also been
re-written to ensure all different use cases are tested properly
(assuming I didn't forget any cases).

The finder has also been broken up into 3 different finder classes:

* ContributedProjectsFinder: class for getting the projects a user
  contributed to.
* PersonalProjectsFinder: class for getting the personal projects of a
  user.
* ProjectsFinder: class for getting generic projects visible to a given
  user.

Previously a lot of the logic of these finders was handled directly in
the users controller.
2015-11-18 13:05:45 +01:00
Yorick Peterse 2110247f83 Refactoed GroupsFinder into two separate classes
In the previous setup the GroupsFinder class had two distinct tasks:

1. Finding the projects user A could see
2. Finding the projects of user A that user B could see

Task two was actually handled outside of the GroupsFinder (in the
UsersController) by restricting the returned list of groups to those the
viewed user was a member of. Moving all this logic into a single finder
proved to be far too complex and confusing, hence there are now two
finders:

* GroupsFinder: for finding groups a user can see
* JoinedGroupsFinder: for finding groups that user A is a member of,
  restricted to either public groups or groups user B can also see.
2015-11-18 13:05:45 +01:00
Dmitriy Zaporozhets 8a03cb8744 Lets add more tests to Milestones services
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-16 14:39:19 +01:00
Dmitriy Zaporozhets 986695e136 Refactor global and group milestones logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-16 14:07:38 +01:00