Commit Graph
7280 Commits
Author SHA1 Message Date
Dmitriy Zaporozhets 998f990714 Merge branch 'post-receive-base64' into 'master'
Prevent gitlab-shell character encoding issues by receiving its changes as raw data.

Depends on gitlab/gitlab-shell!65.

Fixes:

- https://github.com/gitlabhq/gitlabhq/issues/7486
- https://gitlab.com/gitlab-org/gitlab-ce/issues/858
- https://gitlab.com/gitlab-org/gitlab-ce/issues/877
- https://gitlab.com/gitlab-org/gitlab-ce/issues/965

See merge request !1701
2015-03-16 17:53:26 +00:00
Dmitriy Zaporozhets 648f38cd98 Merge branch 'fix-restricted-visibility' into 'master'
Restricted visibility levels - bug fix and new feature

This allows admin users to override restricted visibility settings when creating and updating projects and snippets, and moves the restricted visibility configuration from gitlab.yml to the web UI.  See #1903.

## Move configuration location

I added a new section to the application settings page for restricted visibility levels.  Each level has a checkbox, styled with Bootstrap to look like a toggle button.  A checked box means that the level is restricted.  I added a glowing text shadow and changed the background color for checked buttons because the default styles made it hard to distinguish between checked and unchecked.  This image shows the new section with the "Public" box checked:

![restricted_visibility_settings](https://dev.gitlab.org/Okada/gitlabhq/uploads/629562e4313f89b795e81c3bb0f95893/restricted_visibility_settings.png)

## Allow admins to override

To allow admin users to override the restricted visibility levels, I had to remove the `visibility_level` validation from the `Project` class.  The model doesn't know about the `current_user`, which should determine whether the restrictions can be overridden.  We could use the creator in the validation, but that wouldn't work correctly for projects where a non-admin user is the creator and an admin tries to change the project to a restricted visibility level.

The `Project::UpdateService` and `Project::CreateService` classes already had code to determine whether the current user is allowed to use a given visibility level; now all visibility level validation is done in those classes.  Currently, when a non-admin tries to create or update a project using a restricted level, these classes silently set the visibility level to the global default (create) or the project's existing value (update).  I changed this behavior to be more like an Active Model validation, where using a restricted level causes the entire request to be rejected.

Project and personal snippets didn't have service classes, and restricted visibility levels weren't being enforced in the model or the controllers.  The UI disabled radio buttons for restricted levels, but that wouldn't be difficult to circumvent.  I created the `CreateSnippetService` and `UpdateSnippetService` classes to do the same restricted visibility check that the project classes do.  And since I was dealing with snippet visibility levels, I updated the API endpoints for project snippets to allow users to set and update the visibility level.

## TODO

* [x] Add more tests for restricted visibility functionality

cc @sytse @dzaporozhets

See merge request !1655
2015-03-16 17:49:46 +00:00
Dmitriy Zaporozhets bacb05c554 Small improvements to group/project member rows 2015-03-15 23:50:55 -07:00
Douwe Maan 3b1d5a1dff Prevent gitlab-shell character encoding issues by receiving its changes as raw data. 2015-03-15 16:52:22 +01:00
Douwe Maan e88d06c892 Update button class. 2015-03-15 13:56:32 +01:00
Douwe Maan 5ad35bbe02 Use same layout and interactivity for project members as group members. 2015-03-15 13:55:57 +01:00
Douwe Maan 84371de01f Move group leave action from dashboard/groups to groups/group_members. 2015-03-15 13:52:28 +01:00
Douwe Maan 224187ffb9 Move group members index from /members to /group_members. 2015-03-15 13:51:11 +01:00
Douwe Maan 75aff0f79c Move project members index from /team to /project_members 2015-03-15 13:51:11 +01:00
Douwe Maan e97cdb042d Remove old team scopes. 2015-03-15 13:50:38 +01:00
Douwe Maan bbdf23261c Use member instead of tm. 2015-03-15 13:50:38 +01:00
Douwe Maan 31fc73f0a9 Use project_member instead of team_member. 2015-03-15 13:50:38 +01:00
Douwe Maan 99f995755e Use group_member instead of users_group or membership. 2015-03-15 13:49:41 +01:00
Vinnie Okada d7f357a386 Use pre-wrap for diff code in discussion view 2015-03-14 12:30:36 -06:00
Vinnie Okada ad0ca0499a Merge branch 'master' into fix-restricted-visibility
Conflicts:
	db/schema.rb
2015-03-14 10:49:11 -06:00
Vinnie Okada 5710c1aaf8 Update snippet authorization
Allow authors and admins to update the visibility level of personal and
project snippets.
2015-03-14 10:30:48 -06:00
Dmitriy Zaporozhets 19e0dafbef Merge branch 'more-flatly' 2015-03-14 01:48:13 -07:00
Dmitriy Zaporozhets 9b445c6836 Return some merge widget styles and make it more compact 2015-03-14 01:47:19 -07:00
Dmitriy Zaporozhets 9c7faac040 Merge branch 'resetyle-import' into 'master'
Restyle import

Render import providers in one line and make it buttons

See merge request !1699
2015-03-14 08:17:08 +00:00
Dmitriy Zaporozhets f311e189d5 Improve compare switch button 2015-03-14 00:33:26 -07:00
Dmitriy Zaporozhets 30ca451fd4 Refactor buttons 2015-03-14 00:29:32 -07:00
Dmitriy Zaporozhets abf90611cb Improve import buttons on new project page 2015-03-14 00:13:15 -07:00
Dmitriy Zaporozhets dffa2fa9e9 Use sass variabled for backgroung and border colors 2015-03-13 23:40:46 -07:00
Dmitriy Zaporozhets 2da2720584 Improve css for file actions 2015-03-13 19:20:25 -07:00
Dmitriy Zaporozhets 309f588d56 Merge branch 'fix-encoding' into 'master'
Minor cleanup around UTF-8 encoding.

Minor cleanup to be merged after https://dev.gitlab.org/gitlab/gitlab_git/merge_requests/24 is merged in.

See merge request !1642
2015-03-13 16:50:53 +00:00
Dmitriy Zaporozhets b8f5e23f27 Merge branch 'tag-branch-hooks' into 'master'
Execute hooks and services when branch or tag is created or deleted through web interface.

Fixes #2095.

Split up into commits to make it easier to see why what was changed :)

See merge request !1692
2015-03-13 16:42:01 +00:00
Douwe Maan 12b779e70b Move tag deletion to service and execute hooks and services. 2015-03-13 16:07:08 +01:00
Douwe Maan 10421674af Ecevute hooks and services when branches are created/deleted through web. 2015-03-13 16:07:02 +01:00
Douwe Maan f2024b1e06 More consistent method naming. 2015-03-13 16:07:02 +01:00
Douwe Maan 84d28209b6 Use PushDataBuilder where applicable. 2015-03-13 16:06:56 +01:00
Douwe Maan 09791774a5 Use custom LDAP label in LDAP signin form. 2015-03-13 15:42:31 +01:00
Douwe Maan 4e49f21b14 Set push data object kind in PushDataBuilder. 2015-03-13 14:51:48 +01:00
Douwe Maan 7f4cffd88b Reuse blob object fetched by Gitlab::Git::Blame. 2015-03-13 13:49:27 +01:00
Douwe Maan f96dc6295a Everything from gitlab_git is already UTF-8. 2015-03-13 13:49:27 +01:00
Drew Blessing 606d24ff2d Merge branch 'irker-service-use-supported-events' into 'master'
Make Irker service check supported_events

63178a9509 added the supported_events check for services. Since f84b7eef3f was just added, we should adjust it accordingly.

See merge request !367
2015-03-13 00:41:07 +00:00
Dmitriy Zaporozhets ec02cdf205 Merge branch 'master' into mr-filter-by-title
Conflicts:
	app/controllers/projects/merge_requests_controller.rb
2015-03-12 16:29:03 -07:00
Dmitriy Zaporozhets fdfa79a79e Merge branch 'default-pagination' into 'master'
Use same constant for amount of items per page

See merge request !1689
2015-03-12 23:23:15 +00:00
Dmitriy Zaporozhets 80b2f3fb86 Implement merge requests search
It is same search like we have at issues page. It allows to quickly
filter merge requests based on title or desription. I copy-pasted some
js code from Issues.js. In future search (filtering) logic should be
refactoed into one class for merge requests and issues
2015-03-12 16:20:58 -07:00
Dmitriy Zaporozhets f0cbbd70bb Use same constant for amount of items per page 2015-03-12 15:37:00 -07:00
Dmitriy Zaporozhets 2fe69158f0 Merge branch 'group-icon-performance' into 'master'
Prevent database query each time we render group avatar

Fixes #2118

See merge request !1688
2015-03-12 22:28:47 +00:00
Marin Jankovski 1c3997a747 Merge branch 'replace_passwords_with_asterisk' into 'master'
Show asterisks instead of password in service edit form.

See merge request !1686
2015-03-12 22:27:46 +00:00
Dmitriy Zaporozhets 7ac62388a5 Prevent database query each time we render group avatar 2015-03-12 13:56:53 -07:00
Dmitriy Zaporozhets 0f144f36bc Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-03-12 11:19:03 -07:00
Dmitriy Zaporozhets 12ba855ffd Merge branch 'improve-import-page' into 'master'
Style improvements to import page

See merge request !1685
2015-03-12 18:18:05 +00:00
Douwe Maan d66148ef39 Merge branch 'fix_email_images' into 'master'
Fix email images

## Dependencies:
This MR Depends on gitlab-org/html-pipeline-gitlab!4 being **merged and published** to rubygems.org

## What does this MR do?
This MR fixes the broken images in emails that occured scince we introduced access control for all attachments in 7.8.
The access control lead to broken images, because the user usually isn't logged into gitlab when opening the email in his mail client.
The solution to fix this, is to replace all images that were uploaded to gitlab as attachemnts with inline images in emails.

I only added one test for images in notes, because all notes share the same view. If it works fine for a note on a commit, then it'll also work the same for notes on a MR or on issues.

@DouweM can you review this please?

Closes #1161

See merge request !373
2015-03-12 17:40:17 +00:00
Dmitriy Zaporozhets 1065f3d30b Merge branch 'github-org-repos' into 'master'
Fix missing GitHub organisation repositories on import page.

Private repositories belonging to organizations rather than users can't be imported because `client.repos(org.login)` was requesting `/users/:org_login/repos` (which only returns public org repo's), while we need `/orgs/:org_login/repos` (which includes both public and private). The `client.org_repos` method does this.

cc @marin This is a bug in 7.8.x, but I'm not sure if it needs a minor release now or if it can go in 7.9.

See merge request !1683
2015-03-12 17:13:25 +00:00
Marin Jankovski a1f5ae98e2 Show asterisks instead of password in service edit form. 2015-03-12 10:10:19 -07:00
Dmitriy Zaporozhets 59621e9034 Merge branch 'blue-theme' into 'master'
Add blue theme to GitLab

See merge request !1682
2015-03-12 17:09:55 +00:00
Dmitriy Zaporozhets dd78cd1ce4 Style improvements to import page 2015-03-12 10:04:09 -07:00
Marin Jankovski ec1c30ceec Merge branch 'hover_toggle_sidebar'
Conflicts:
	app/assets/stylesheets/generic/nav_sidebar.scss
2015-03-12 09:32:52 -07:00