Commit Graph
73 Commits
Author SHA1 Message Date
Rémy Coutable bb3801268b Fix specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-06 17:52:59 +02:00
Rémy Coutable 22ba5d8a7f New :request_access ability to replace a ugly helper
- Group / project members cannot request access
- Group members cannot request access to a group's project

This addresses an issue where project owners could request access
to their own project, leading to UI inconsistency where their requester
status would replace their owner status.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-05 14:35:26 +02:00
Douwe Maan d1c94f034b Merge branch 'explicit-requesters-scope' into 'master'
Exclude requesters from Project#members, Group#members and User#members

## What does this MR do?

It excludes requesters from the `Project#members`, `Group#members` and `User#members` associations, and adds new `Project#requesters` and `Group#requesters` associations.

## Are there points in the code the reviewer needs to double check?

No.

## Why was this MR needed?

Without this, if you call `project.members`, requesters are included in the results! This is at best misleading, and at worst can lead to security issues. By excluding requesters from the `#members` associations, we avoid introducing security inadvertently since you have to call the `#requesters` association explicitly to get requesters.

## What are the relevant issue numbers?

This is something I realized while fixing the security issue #19102.

## Does this MR meet the acceptance criteria?

- [x] I don't think this needs a CHANGELOG since this is an internal change
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4946
2016-07-01 22:23:26 +00:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Rémy Coutable bd78f5733c Exclude requesters from Project#members, Group#members and User#members
And create new Project#requesters, Group#requesters scopes.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-01 17:44:46 +02:00
James Lopez d6d0a35598 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/import-export-events 2016-07-01 14:52:38 +02:00
Grzegorz Bizon 9798ac77ed Enable Style/SpaceAfterColon Rubocop cops 2016-06-29 15:16:04 +02:00
James Lopez 29b78800b5 updated integration test file 2016-06-29 13:59:21 +02:00
Alfredo Sumaran 73fdc9b6d3 Update tests to check if label is set after picking a template 2016-06-23 12:48:59 -05:00
Douwe Maan 4dcf107b26 Merge branch '18871-check-improve-how-we-display-access-requesters-in-admin-area' into 'master'
Display group/project access requesters separately in admin

## What does this MR do?

It displays the access requesters in a separate list in group & project members pages.

It also harmonize the members counter UI to use `%span.badge` everywhere (in the admin & non-admin members views).

## Are there points in the code the reviewer needs to double check?

No.

## Why was this MR needed?

To not confuse access requesters with actual members.

## What are the relevant issue numbers?

Closes #18871.

## Screenshots

### Group members

| Before | After |
| --------- | ---- |
| ![group-members-before](/uploads/2f15137e073fd3a63bc2cb7b2217cb6c/group-members-before.png) | ![group-members-after](/uploads/5b643974505cfa57783fa0320d3bf8b2/group-members-after.png) |

### Project members

| Before | After |
| --------- | ---- |
| ![project-members-before](/uploads/9c48dcd3736e42de84061b1201ee0b06/project-members-before.png) | ![project-members-after](/uploads/8e04c92ef0bba3de7e2405618632b27d/project-members-after.png) |

### Admin group members

| Before | After |
| --------- | ---- |
| ![admin-group-members-before](/uploads/7fda8c2c94b697bea6655ba892ba45e7/admin-group-members-before.png) | ![admin-group-members-after](/uploads/ea25717001794f75939c679b80308c3a/admin-group-members-after.png) |

### Admin project members

| Before | After |
| --------- | ---- |
| ![admin-project-members-before](/uploads/ba9d3ec52adbda6bb3d45ad9ac5243d3/admin-project-members-before.png) | ![admin-project-members-after](/uploads/3b889a029a9756e9ed2781b45c4dd9cb/admin-project-members-after.png) |

## Does this MR meet the acceptance criteria?

- [x] No CHANGELOG since this is related to the original "request access" MR.
- [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4798
2016-06-22 01:17:08 +00:00
Douwe Maan c11006ac6c Merge branch '18755-fix-destroy-project-causes-post_decline_request-to-be-executed' into 'master'
Resolve "Destroying a project causes post_decline_request to be executed"

## What does this MR do?

Ensure we don't send "access request declined" to access requesters when a project is deleted.

## Are there points in the code the reviewer needs to double check?

I've created a service to decouple the notification sending from the AR model.

## Why was this MR needed?

Because there was an issue.

## What are the relevant issue numbers?

Fixes #18755, #18750.

## Does this MR meet the acceptance criteria?

- [x] No CHANGELOG needed.
- [x] Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4744
2016-06-22 01:15:29 +00:00
Alfredo Sumaran a18df1d15a Add feature test for gitab CI dropdown 2016-06-20 14:48:28 -05:00
Rémy Coutable 00ac7ae84a Fix specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-20 16:40:35 +02:00
Phil Hughes d2362e2edf Tests fix for ref switcher 2016-06-18 21:49:20 +01:00
Rémy Coutable bceee98713 Show 'Leave project' only if member can actually leave the project
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-18 06:06:34 +02:00
Douwe Maan 33d8972bf9 Merge branch 'fix-18717' into 'master'
Ensure that group owner cannot request access to a project of their group

## What does this MR do?

It fixes two things:

- 91ad995d69e1a0f8991fd896f1d9febc109273fe Ensure that group owner cannot request access to a project of their group
- ec3ff061148d556757e7cd486cdc6083d77acf34 Ensure group/project owners can see their members' access_level (see the commit message for details)

## Are there points in the code the reviewer needs to double check?

Not really, these are pretty simple fixes.

## Why was this MR needed?

Because there was an issue created!

## What are the relevant issue numbers?

Fixes #18717.

## Does this MR meet the acceptance criteria?

- [x] CHANGELOG is not needed since the bug is only present in a 8.9 RC
- [x] Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4729
2016-06-17 22:47:19 +00:00
Rémy Coutable 7c9571a3ba Address Douwe's feedback
- Make it more explicit that `source` must respond to `#group` and that
`#group` must be present.
- Indent subsequent lines of a multi-line condition.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-17 18:37:53 +02:00
Douwe Maan 8c2697eaed Merge branch '18724-dont-show-leave-project-to-group-member' into 'master'
Don't show 'Leave Project' to group members

## What does this MR do?

It hides the 'Leave Project' button to group members that are not explicitly a member of the project.

## Are there points in the code the reviewer needs to double check?

No.

## Why was this MR needed?

Because there was an issue opened!

## What are the relevant issue numbers?

Fixes #18724.

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4739
2016-06-17 15:42:49 +00:00
Douwe Maan 9b7fd74805 Merge branch 'feature/project-export' into 'master'
Export project functionality

This is a MR for the export functionality of https://gitlab.com/gitlab-org/gitlab-ce/issues/3050, which adds the ability to export single projects.

- [x] members
- DB data
  - [x] issues
  - [x] issue comments
  - [x] merge requests
  - [x] merge request diff
  - [x] merge request comments
  - [x] labels
  - [x] milestones
  - [x] snippets
  - [x] releases
  - [x] events
  - [x] commit statuses
  - [x] CI builds
- File system data
  - [x] Git repository
  - [x] wiki
  - [x] uploads
  - [ ] ~~CI build traces~~
  - [ ] ~~CI build artifacts~~
  - [ ] ~~LFS objects~~
- DB configuration
  - [x] services
  - [x] web hooks
  - [x] protected branches
  - [x] deploy keys
  - [x] CI variables
  - [x] CI triggers

See merge request !3114
2016-06-17 15:35:27 +00:00
Rémy Coutable b2dc917601 Group owner cannot request access to a project of their group
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-17 13:03:19 +02:00
Rémy Coutable 1c944a22de Don't show 'Leave Project' to group members
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-17 12:16:59 +02:00
James Lopez b3a0a1c315 fixed merge conflicts on UI branch 2016-06-16 15:01:27 +02:00
Alfredo Sumaran e8a467e094 Implements TemplateDropdown class to create custom template dropdowns
Also License dropdown has been ported to use our GL dropdown instead of Select2.
Fixes tests to make it work with current implementation
2016-06-16 00:28:45 -05:00
James Lopez 4bde59341f lots of refactoring again based on feedback. Changed the UI slightly and also fixed a small bug 2016-06-15 17:31:00 +02:00
James Lopez cbd0201fdb fixing specs and some code cleanup 2016-06-15 10:37:17 +02:00
James Lopez fc5f6943f8 yay finally importing working with the new services structure 2016-06-14 21:41:40 +02:00
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
James Lopez e83fc684a5 Merge branches 'feature/project-export-ui-experimental' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental
# Conflicts:
#	Gemfile.lock
#	app/helpers/todos_helper.rb
#	app/models/todo.rb
#	app/views/projects/edit.html.haml
#	lib/gitlab/import_export/import_service.rb
2016-06-13 14:00:19 +02:00
Sean McGivern b997752539 Only show branches for revert / cherry-pick
Tags are immutable, so we can't add a commit to either revert or
cherry-pick another commit to them.
2016-06-13 11:05:22 +01:00
Jacob Schatz 5b83abcc01 Merge branch 'issue_14189' into 'master'
Ability to prioritize labels

Closes #14189 

See merge request !4009
2016-06-07 15:15:07 +00:00
Sean McGivern ee26c3cab4 Fix label order by priority on labels page 2016-06-07 14:01:30 +01:00
Kamil Trzcinski dbf235f514 Fix tests failures 2016-06-07 10:25:57 +02:00
Sean McGivernandAlfredo Sumaran 7bc65b2bef Clarify issue priority spec
We don't care particularly about the ordering within a priority level,
just that the levels are in the right order.
2016-06-06 11:59:49 -05:00
Alfredo Sumaran b0ec4b9cc3 Remove comment
Just to trigger CI
2016-06-06 11:59:49 -05:00
Alfredo Sumaran 2ca32a09b6 Add test for the case when user can't prioritize labels 2016-06-06 11:59:49 -05:00
Sean McGivernandAlfredo Sumaran 1cc0209a80 Fix style
- `reorder(nil)` is better than `reorder('')`
- Only use ASCII in comments
2016-06-06 11:59:49 -05:00
Alfredo Sumaran 6aea7666c3 Add tests for issues with multiple labels 2016-06-06 11:59:49 -05:00
Alfredo Sumaran 91e6bc1258 Add tests for issue prioritization 2016-06-06 11:59:49 -05:00
Alfredo Sumaran 0960cba090 Add tests for label prioritization 2016-06-06 11:59:49 -05:00
Kamil Trzcinski 20c7144ed2 Rename all [ci_]commit to [ci_]pipeline in specs and features 2016-06-03 16:22:26 +02:00
Grzegorz Bizon 1abb0ed97d Move feature specs for shortcuts to valid directory 2016-06-02 11:05:54 +02:00
Dmitriy Zaporozhets 2f4dc1ee16 Merge branch 'master' into project-navigation-redesign 2016-05-23 22:41:11 +02:00
Connor Shea 2bf818c4d0 Fix some specs which would have broken in 2017 to not break anymore by using a dynamic year value. 2016-05-22 19:50:49 -06:00
Alfredo Sumaran 1f5fcb638d Dropdown implementation 2016-05-20 15:58:36 -05:00
James Lopez becd9bfdc6 updated spec file 2016-05-19 16:42:41 +02:00
James Lopez dac1d0d812 updated test project file 2016-05-18 18:15:28 +02:00
James Lopez ee2993040c updated test file with DB config 2016-05-18 11:20:38 +02:00
Dmitriy Zaporozhets 7365ac60f1 Fix spec for new project navigation
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-05-16 12:25:37 -05:00
James Lopez 7ea68d006e updated file import spec 2016-05-16 15:17:44 +02:00