211 Commits
Author SHA1 Message Date
Douwe MaanandMarin Jankovski 1b23122f99 Merge branch 'fix-admin-service-template-config' into 'master'
Include missing events and fix save functionality in admin service template settings form

### What does this MR do?

This MR includes missing settings left out in the Admin -> Service Templates page and fixes the inability to save certain settings.

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

No.

### Why was this MR needed?

Because the service template form was broken and untested.

### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?

#1275

Before:

![Screen_Shot_2015-03-23_at_5.53.19_AM](https://gitlab.com/stanhu/gitlab-ce/uploads/e1bff75f30a3b6ecb174d3e25c722b7e/Screen_Shot_2015-03-23_at_5.53.19_AM.png)

After:

![Screen_Shot_2015-03-23_at_5.53.13_AM](https://gitlab.com/stanhu/gitlab-ce/uploads/8fada00128a3d0951b3230fefa64be92/Screen_Shot_2015-03-23_at_5.53.13_AM.png)

See merge request !427
2015-03-24 12:54:24 -07:00
Vinnie Okada 2e672c39a0 Fix restricted visibility bugs
Check for nil values in the restricted_visibility_level validation
method, and set the restricted visibility request parameter to `[]` when
it's missing from the request.
2015-03-16 13:59:50 -06: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
Douwe Maan 31fc73f0a9 Use project_member instead of team_member. 2015-03-15 13:50:38 +01:00
Vinnie Okada ad0ca0499a Merge branch 'master' into fix-restricted-visibility
Conflicts:
	db/schema.rb
2015-03-14 10:49:11 -06:00
Dmitriy Zaporozhets f0cbbd70bb Use same constant for amount of items per page 2015-03-12 15:37:00 -07:00
Dmitriy Zaporozhets dd24c3d4b9 Improve user block/unblock UI in admin area 2015-03-09 13:02:06 -07:00
Vinnie Okada cacac147de Move restricted visibility settings to the UI
Add checkboxes to the application settings page for restricted
visibility levels, and remove those settings from gitlab.yml.
2015-03-07 13:11:08 -07:00
Douwe Maan 85af3e82bf Add option to disable code diffs to EmailOnPush.
See #1950
2015-02-25 14:29:49 +01:00
Douwe Maan e0c186c357 Add option to send EmailsOnPush from committer email if domain matches.
See #1809.
2015-02-25 14:20:35 +01:00
Vinnie Okada 9e9ce95d62 Merge branch 'master' into rails-4.1.9
Conflicts:
	app/views/dashboard/_project.html.haml
	app/views/events/event/_common.html.haml
	app/views/explore/projects/_project.html.haml
	app/views/groups/_projects.html.haml
	app/views/projects/_home_panel.html.haml
	app/views/projects/_issues_nav.html.haml
	app/views/projects/issues/_discussion.html.haml
	app/views/projects/issues/_issues.html.haml
	app/views/projects/issues/show.html.haml
	app/views/projects/merge_requests/_discussion.html.haml
	app/views/projects/merge_requests/_show.html.haml
	app/views/projects/milestones/index.html.haml
	app/views/projects/notes/_edit_form.html.haml
	app/views/shared/_issuable_filter.html.haml
2015-02-19 20:53:05 -07:00
Dmitriy Zaporozhets 2ad00f5294 Merge branch 'tweet-new-project'
Conflicts:
	db/schema.rb
2015-02-15 19:03:10 -08:00
Vinnie Okada 76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07:00
Douwe Maan 25e44d0530 Allow users that signed up via OAuth to set their password in order to use Git over HTTP(S). 2015-02-13 14:44:42 +01:00
Douwe Maan ce08f919bf Add link to share via twitter to "created project" event. 2015-02-13 12:07:59 +01:00
Marin Jankovski e8271226b1 Use the service_name. 2015-02-12 10:57:08 -08:00
Marin Jankovski 9f33898f7a All services can have templates. 2015-02-12 09:19:55 -08:00
Marin Jankovski 6b4ddf2cc1 Add admin services templates. 2015-02-11 17:55:33 -08:00
Dmitriy Zaporozhets 3cd036e315 Merge branch 'notification_email'
Conflicts:
	db/schema.rb
2015-02-07 18:42:34 -08:00
Douwe Maan 9dbd7e5aec Allow notification email to be set separately from primary email.
Closes #1932.
2015-02-07 23:19:17 +01:00
Dmitriy Zaporozhets bbca6a0abd Refactor sorting in project 2015-02-05 19:15:05 -08:00
Dmitriy Zaporozhets 62ed1c537e Explicitly define ordering in models using default_scope 2015-02-05 14:20:55 -08:00
Marco Wessel aad6ceaef9 Allow configuring protection of the default branch upon first push 2015-01-25 17:09:10 +01:00
Dmitriy Zaporozhets 7d5d5e53b1 Merge branch 'doorkeeper_applications_scafold' 2015-01-17 16:17:45 -08:00
Dmitriy Zaporozhets a81081aa72 Small improvements to CI 2015-01-17 16:17:34 -08:00
Valery Sizov 20028523b5 Application admin scaffold 2015-01-17 15:40:09 -08:00
Dmitriy Zaporozhets 41d7be3ce1 Allow to specify home page for non logged-in users 2015-01-16 16:01:15 -08:00
Dmitriy Zaporozhets d0a50985ec Create ApplicationSettings if does not exist in runtime 2015-01-08 11:26:16 -08:00
Dmitriy Zaporozhets 57a65ede77 Improve application settings and write tests 2015-01-08 09:53:35 -08:00
Dmitriy Zaporozhets 8589b4e137 Init ApplicationSettings resource with defaults from config file 2015-01-08 00:22:50 -08:00
Marin Jankovski 607ea7c6e5 Share the key table between admin and profile resources. 2014-12-30 11:01:30 +01:00
Marin Jankovski 82829ed49e Move user key manipulation in admin section to a separate controller. 2014-12-30 10:15:11 +01:00
Marin Jankovski 492f3a4779 Add user key actions to admins. 2014-12-29 17:07:23 +01:00
Dmitriy Zaporozhets 52a8e5c01a Set group name from path in admin controller
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-22 13:55:32 +02:00
Dmitriy Zaporozhets f4178f9601 Merge pull request #8005 from cirosantilli/settings-to-gitlab-config
Use Gitlab.config instead of Settings everywhere
2014-10-27 19:18:48 +02:00
Ciro Santilli 2c98584a9c Remove unused admin/projects#repository method
Already defined on the ApplicationController base class.
2014-10-21 10:56:11 +02:00
Dmitriy Zaporozhets 5ce9f89c7b Merge pull request #8102 from cirosantilli/use-memoized-project
Use @project on controllers, don't call method
2014-10-21 11:41:03 +03:00
Ciro Santilli 9e1b97ad99 Use @project on controllers, don't call method
Also memoize the method to ensure that other methods in
ApplicationController that rely on it can call it efficiently.
2014-10-19 23:36:23 +02:00
Ciro Santilli 6a73b76c5f Remove param[:project_id] at admin controller
The route never passes that parameter to the helpers.
2014-10-19 23:02:19 +02:00
Ciro Santilli 39c66c822e Use Gitlab.config instead of Settings everywhere 2014-10-15 23:01:31 +02:00
Valery Sizov 4e0da2325b Admin: user sorting 2014-10-13 16:07:57 +03:00
Dmitriy Zaporozhets c69b8e0459 Huge replace of old users_project and users_group references
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-14 19:32:51 +03:00
Dmitriy Zaporozhets c29857ac00 Merge branch 'new_user_password_set' into 'master'
Admin created user should get password reset link instead of mailed temporary password

Fixes #1405

See merge request !973
2014-07-23 16:44:07 +00:00
Dmitriy Zaporozhets de582ab375 Fix user params when edit from admin area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-16 15:12:33 +03:00
Marin Jankovski 44b8198334 Do not set password expiry. 2014-07-15 14:30:05 +02:00
Marin Jankovski 56398ea161 Do not sent a generated password via email for admin created user. 2014-07-15 13:25:11 +02:00
Dmitriy Zaporozhets 8fee5a0572 Make app works with strong params
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 23:24:17 +03:00
Dmitriy Zaporozhets 2acde87e0d Project hook, milestone, snippet strong params
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 18:51:11 +03:00
Dmitriy Zaporozhets 8f60b5b4fc Group and Event strong_params
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 16:57:10 +03:00
Dmitriy Zaporozhets 98ba075c32 User model to strong params. Comment other attr_accessible to let tests run
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 15:11:45 +03:00