gitlab-org--gitlab-foss/lib/api
Dmitriy Zaporozhets 76b7e24f85 Merge branch 'edit-on-fork' into 'master'
Automatically fork a project when not allowed to edit a file.

Fixes #3215.

To do:

- [ ] Add tests

-----

## "Edit" button on file in a project the user does NOT have write access to

![edit_file](/uploads/7602157420768aef483a6586bba2d164/edit_file.png)

## Clicking will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the edit page on the original project with a notice

![edit_notice](/uploads/94ed1319404370ff1e9c0d672fb41e03/edit_notice.png)

## The user cannot change the target branch and is informed that editing will start an MR

![edit_footer](/uploads/4da68d4795c7177e575b7c434d16eeae/edit_footer.png)

## Hitting "Commit changes" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.38.08](/uploads/d777a4db6f38a5a1be84031694465bc1/Screen_Shot_2015-12-17_at_23.38.08.png)

-----

## "Create file, "Upload file" and "New directory" buttons in a project the user does NOT have write access to

![new_directory](/uploads/72f556248f30d6652523bbb4be01b3e0/new_directory.png)

## Clicking any of these options will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the tree page on the original project with a notice

![new_directory_notice](/uploads/a1a3e11308ae0e8f0913fae6813a37ed/new_directory_notice.png)

## Clicking "New directory" again will show the modal. The user cannot change the target branch and is informed that editing will start an MR

![new_dir](/uploads/99ca8cbfb2f70603e352b3fdf67b6281/new_dir.png)

## Hitting "Create directory" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.39.19](/uploads/3713d0235abf831361b803a6198c5bc1/Screen_Shot_2015-12-17_at_23.39.19.png)

cc @dzaporozhets @skyruler

See merge request !2145
2015-12-24 12:24:57 +00:00
..
api.rb Reimplement Trigger API 2015-12-11 18:02:09 +01:00
api_guard.rb Rubocop: Style/CaseIndentation enabled 2015-02-02 21:26:40 -08:00
branches.rb Added the missing comma 2015-03-31 17:08:33 +01:00
commit_statuses.rb Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
commits.rb Order commit comments in API chronologically 2015-05-08 14:34:10 +02:00
deploy_keys.rb Fix failing tests due to updates on the return messages. 2015-01-07 11:39:20 +01:00
entities.rb Fix Rubocop complain. 2015-12-16 14:51:25 -05:00
files.rb Automatically fork a project when not allowed to edit a file. 2015-12-18 10:03:34 +01:00
group_members.rb Track who created a group or project member. 2015-04-14 12:06:42 +02:00
groups.rb Add API group projects endpoint. 2015-12-07 17:10:40 +01:00
helpers.rb Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
internal.rb Improve Git access error messages. 2015-05-13 09:41:55 +02:00
issues.rb Merge branch 'rename-abilities' into 'master' 2015-06-26 16:39:17 +00:00
keys.rb Add API method for get user by ID of an SSH key 2015-09-03 15:47:22 +03:00
labels.rb Fix failing tests due to updates on the return messages. 2015-01-07 11:39:20 +01:00
merge_requests.rb Merge branch 'master' into merge-if-green 2015-12-07 10:06:07 +01:00
milestones.rb Fix the test and add documentation for the "per-milestone issues API call" 2015-01-22 12:14:53 +01:00
namespaces.rb Make namespace API available to all users 2015-05-28 11:39:12 -07:00
notes.rb Show who last edited a comment if it wasn't the original author 2015-07-30 14:45:54 +02:00
project_hooks.rb Migrate CI::Services and CI::WebHooks to Services and WebHooks 2015-12-10 16:04:08 +01:00
project_members.rb Use project_member instead of team_member. 2015-03-15 13:50:38 +01:00
project_snippets.rb Rename abilities to correspond contoller/model action names 2015-06-26 15:55:56 +02:00
projects.rb Add project permissions to all project API endpoints 2015-12-22 10:58:23 -08:00
repositories.rb Move git tags API to separate file 2015-11-12 15:41:13 +01:00
services.rb Hide passwords to non-admin users in the services API 2015-10-12 15:24:00 +02:00
session.rb Add LDAP support to /api/session 2013-07-16 11:28:19 +03:00
settings.rb Add tests and improve logic 2015-07-06 16:47:19 +02:00
system_hooks.rb Added X-GitLab-Event header for web hooks 2015-05-08 16:49:03 +03:00
tags.rb Allow editing a release in API via PUT method 2015-11-21 22:34:53 +01:00
triggers.rb Fix triggers tests 2015-12-11 18:02:09 +01:00
users.rb Added ability to update or set the identity of an existing user, like the documentation said it was possible, but actually wasn't. 2015-09-22 16:26:59 -05:00