Commit Graph
1850 Commits
Author SHA1 Message Date
Dmitriy Zaporozhets d63371ad78 Update controller filters
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 16:44:21 +02:00
Dmitriy Zaporozhets 342d553709 Rename abilities to correspond contoller/model action names
write_ was renamed to create_
modify_  was renamed to update_

So now in update action we have next code

def create
  can?(current_user, :create_issue, @issue)
end

def update
  can?(current_user, :update_issue, @issue)
end

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 15:55:56 +02:00
Dmitriy Zaporozhets a3f64b195e Improve performance for merge_request#show page
* store @participants in variable
* store result of subscribed? call into variable

In total it reduce amount of SQL queries for merge_request with 10
comments/participants twice.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-24 12:56:10 +02:00
Dmitriy Zaporozhets a5f23435f7 Improve performance for issue#show page
* store @participants in variable
* store result of subscribed? call into variable

In total it reduce amount of SQL queries for issue with 10 comments/participants twice.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-24 12:49:34 +02:00
Dmitriy Zaporozhets 94f130cbfc Merge branch 'admin-edit-identities' into 'master'
Admin can see, edit and remove user identities

Related to #1415 and https://dev.gitlab.org/gitlab/gitlabhq/issues/2224

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

See merge request !843
2015-06-23 14:24:16 +00:00
Stan Hu e80d7a804f Fix error when deleting a user who has projects
Closes #1856
Closes https://github.com/gitlabhq/gitlabhq/issues/9394
2015-06-23 04:39:49 -07:00
Dmitriy Zaporozhets 1beb0dbe56 Fix admin identities code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-23 10:26:50 +02:00
Dmitriy Zaporozhets d7553d3630 Address review comments
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-22 18:01:52 +02:00
Dmitriy Zaporozhets 73e003013f Merge branch 'master' into admin-edit-identities
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/views/admin/users/show.html.haml
2015-06-22 18:00:11 +02:00
Dmitriy Zaporozhets cc04c5b828 Refactor admin user page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-22 17:12:20 +02:00
Dmitriy Zaporozhets d3978e0b27 Merge branch 'remove_unused_except' into 'master'
projects doesn't seem to be a valid action in this controller

Hi,

This is just a tiny change. Let me know if I'm doing it wrong...

Eaden

See merge request !696
2015-06-22 13:20:14 +00:00
Dmitriy Zaporozhets 29b6d465a7 Merge branch 'rs-dev-issue-2355' into 'master'
MergeRequest#show performance improvements

This is a first pass on improving the performance of the `MergeRequests#show` page. Notable changes:

- The "Commits" tab is loaded lazily, so the initial page load should be much faster for MRs with many commits.
- Relative timestamps via `timeago` are only initialized once per load instead of `O(n^2)`. This greatly improves frontend rendering times for a large number of commits.
- Refactored `User.find_for_commit` to use a single ARel-generated SQL query instead of the old method which resulted in one query, and could result in up to three.

See merge request !838
2015-06-22 09:48:49 +00:00
Robert Speicher b6318297fc Use User#two_factor_enabled instead of otp_required_for_login 2015-06-19 15:14:37 -04:00
Dmitriy Zaporozhets d059c69db7 Move identities list to own controller action
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-19 15:29:53 +02:00
Dmitriy Zaporozhets 270b7ce810 Add ability for admin to edit user identity
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-19 15:29:53 +02:00
Dmitriy Zaporozhets 228da2dd28 Admin can see and remove user identities
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-19 15:29:52 +02:00
Douwe Maan 0e615a4863 Merge branch 'fix-labels-permisssion-check' into 'master'
Fix 403 Access Denied error messages when accessing Labels section in a project

This would occur if the project's issues or merge requests features were disabled. The change in 9bcd36396b caused `can?(current_user, :read_merge_request, project)` to be false if the merge request feature were disabled, so `authorize_labels!` needs to be changed accordingly.

Closes #1813

See merge request !836
2015-06-18 11:43:32 +00:00
Stan Hu 07efb17e10 Fix 403 Access Denied error messages when accessing Labels section in a project that has MRs disabled but issues enabled
Closes #1813
2015-06-18 03:15:05 -07:00
Robert Speicher bc027c5183 Load the Merge Request > Commits tab lazily 2015-06-17 16:59:51 -04:00
Dmitriy Zaporozhets de5c9b795d Merge branch 'rs-dev-issue-2373' into 'master'
Prefix 2FA issuer with the GitLab host (e.g., 'dev.gitlab.org')

https://dev.gitlab.org/gitlab/gitlabhq/issues/2373

See merge request !821
2015-06-17 09:00:57 +00:00
Robert Speicher ad049a8e52 Prefix 2FA issuer with the GitLab host (e.g., 'dev.gitlab.org') 2015-06-16 13:08:29 -04:00
Stan Hu a7932fe2fd Support commenting on a diff in side-by-side view
Closes https://github.com/gitlabhq/gitlabhq/issues/9283
2015-06-16 06:11:59 -07:00
Robert Speicher 8ae13c7a51 Refactor RootController 2015-06-13 17:59:13 -04:00
Robert Speicher 1562f017b6 Spec the failure cases for PreferencesController#update 2015-06-13 17:59:12 -04:00
Robert Speicher 94d3c1433d Add RootController
This controller is now the target for `root_url`. It sub-classes
DashboardController so we can render the old default without a redirect
if the user hasn't customized their dashboard location.
2015-06-13 17:59:11 -04:00
Robert Speicher 2bc4fd2d04 Add dashboard attribute to User model 2015-06-13 17:59:11 -04:00
Robert Speicher 1044dfbfd2 Remove js handler from Profiles#update
It was only used for the appearance live updating, which is now handled
by Profiles::Preferences#update
2015-06-13 17:58:16 -04:00
Robert Speicher 0c0c31ff34 Move the "Design" templates and logic to Preferences 2015-06-13 17:58:16 -04:00
Robert Speicher 821fc4b034 Add Profiles::PreferencesController 2015-06-13 17:58:15 -04:00
Douwe Maan 9ea8dcb5e2 Merge branch 'feature-session-expire-seconds-ui' into 'master'
Add session expiration delay configuration through UI application

Setting is accessible by the administrator through the UI and defaults to 1 week (the current setting)

Answers the following suggestions:

  * http://feedback.gitlab.com/forums/176466-general/suggestions/6210719-make-session-length-configurable
  * http://feedback.gitlab.com/forums/176466-general/suggestions/6730512-automatic-logout-after-a-time-being-idle

See merge request !774
2015-06-12 13:50:40 +00:00
Dmitriy Zaporozhets 21a62bb995 Merge branch 'refactor-mr-widget' into 'master'
Refactor accept merge request widget

* make each case a simple view
* separate  merge request JS from merge request accept widget JS

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

See merge request !799
2015-06-12 08:22:13 +00:00
Dmitriy Zaporozhets c69ca9912e Merge pull request #9371 from zenati/patch-2
An `in_namespace` scope is already present
2015-06-11 23:09:41 +02:00
Dmitriy Zaporozhets 946b4ceda3 Improve variables in mr widget
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 18:45:12 +02:00
Dmitriy Zaporozhets 8893ac4ba4 Fix rubocop
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 18:35:43 +02:00
Dmitriy Zaporozhets 00600a592b Extract merge request widget JS to separate class
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 18:27:03 +02:00
Dmitriy Zaporozhets d2d8037b1a Refactor merge request widget step 2
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 15:14:50 +02:00
themaze75andEric Maziade 1d080f5745 session_expire_seconds => session_expire_delay
delay is in seconds
more legible code in session_store
Added `GitLab restart required` help block to session_expire_delay
2015-06-10 22:10:00 -04:00
Dmitriy Zaporozhets 269c2d2efc Merge branch 'move_project_members_link' into 'master'
Move Project Members link from Settings to main menu.

Addresses #2278.

See merge request !1846
2015-06-09 18:23:35 +00:00
Nicolas ebe4963871 Move Project Members link from Settings to main menu.
Addresses #2278.
2015-06-09 14:45:38 +02:00
zenati b0de6e9ae2 An in_namespace scope is already present 2015-06-09 13:42:01 +02:00
Dmitriy Zaporozhets 6267a6b999 Merge branch 'ldap-remember-me' into 'master'
Add "Remember me" checkbox to LDAP signin form.

Addresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2127.

See merge request !772
2015-06-09 10:52:30 +00:00
Dmitriy Zaporozhets 87f9c475db Merge branch 'refactor-web-editor' into 'master'
Refactor web editor

* fix problem with editing non-master branch
* before commit make sure branch exists
* dont allow user change file in one branch and commit to another existing branch
* remove a lot of code duplication
* remove outdated statellite errors

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

Fixes #1761

See merge request !773
2015-06-05 16:14:34 +00:00
Eric Maziade 84a414fe53 Add session expiration delay configuration through UI application
settings
2015-06-05 11:50:37 -04:00
Dmitriy Zaporozhets dfccb06dda Refactor web editor
* fix problem with editing non-master branch
* before commit make sure branch exists
* dont allow user change file in one branch and commit to another existing branch
* remove a lot of code duplication
* remove outdated statellite errors

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-05 15:01:38 +02:00
Douwe Maan 44458f3ca2 Add "Remember me" checkbox to LDAP signin form. 2015-06-05 14:37:01 +02:00
Douwe Maan 4ae67fcaef Show warning when a comment will add 10 or more people to the discussion. 2015-06-05 12:07:13 +02:00
Robert Speicher 6e5473f930 Remove show actions from Admin and Project DeployKeys 2015-06-03 18:03:04 -04:00
Dmitriy Zaporozhets 7bab4817f7 Merge branch 'repo-remove' into fix-group-remove
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/projects_spec.rb
2015-06-03 15:15:46 +02:00
Dmitriy Zaporozhets 61cfd1d273 Wrap group removal into service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 14:07:20 +02:00
Dmitriy Zaporozhets 97ff86e07c Move repository when project is removed
Ths commit does next:

* When we remove project we move repository to path+deleted.git
* Then we schedule removal of path+deleted with sidekiq
* If repository move failed we abort project removal

This should help us with NFS issue when project get removed but
repository stayed. The full explanation of problem is below:

* rm -rf project.git
* rm -rf removes project.git/objects/foo
* NFS server renames foo to foo.nfsXXXX because some NFS client (think
* Unicorn) still has the file open
* rm -rf exits, but project.git/objects/foo.nfsXXX still exists
* Unicorn closes the file, the NFS client closes the file (foo), and the
* NFS server removes foo.nfsXXX
* the directory project.git/objects/ still exists => problem

So now we move repository and even if repository removal failed

Repository directory is moved so no bugs with project removed but
repository directory taken. User still able to create new project with
same name. From administrator perspective you can easily find stalled
repositories by searching `*+deleted.git`

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 13:05:43 +02:00