gitlab-org--gitlab-foss/app/services
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
..
ci Run builds from projects with enabled CI 2015-12-11 18:03:48 +01:00
files Automatically fork a project when not allowed to edit a file. 2015-12-18 10:03:34 +01:00
issues Backport JIRA service 2015-12-18 14:19:48 -06:00
merge_requests Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
milestones Move global milestone specs 2015-11-16 14:38:34 +01:00
notes Move note emoji-award implementation to note model (feature envy) 2015-12-03 13:38:59 +01:00
oauth2
projects Merge branch 'master' into fix/visibility-level-setting-in-forked-projects 2015-12-21 13:27:34 +01:00
search
archive_repository_service.rb Clear archive cache asynchronously 2015-10-20 16:53:37 +02:00
audit_event_service.rb
base_service.rb Move level_name resolving to Gitlan::VisibilityLevel 2015-11-03 17:23:19 +01:00
compare_service.rb Add ignore white space option in merge request diff 2015-11-13 16:53:53 +09:00
create_branch_service.rb Merge branch 'edit-on-fork' into 'master' 2015-12-24 12:24:57 +00:00
create_commit_builds_service.rb Don't create CI status for refs that doesn't have .gitlab-ci.yml, even if the builds are enabled 2015-12-17 16:33:47 +01:00
create_release_service.rb Allow editing a release in API via PUT method 2015-11-21 22:34:53 +01:00
create_snippet_service.rb
create_tag_service.rb API: Return 404 if the tag for a release does not exist 2015-11-21 18:08:45 +01:00
delete_branch_service.rb Run custom Git hooks when creating or deleting branches through the UI. #1156 2015-12-03 09:39:15 -05:00
delete_tag_service.rb Refactor release code a bit 2015-11-09 15:30:50 +01:00
delete_user_service.rb
destroy_group_service.rb
event_create_service.rb
git_hooks_service.rb Raise the exception from #execute instead of #run_hook. #1156 #3069 2015-12-03 09:39:15 -05:00
git_push_service.rb Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
git_tag_push_service.rb Remove ci_ prefix from all ci related things 2015-12-11 18:02:09 +01:00
gravatar_service.rb Add support for HiDPI displays in gravatar service 2015-09-26 20:53:16 +02:00
issuable_base_service.rb Refactor creation of system notes for Issue/MR labels. #2296 2015-11-20 10:36:12 -05:00
notification_service.rb Fixed duplicated issue note email notifications. 2015-12-06 01:20:42 +02:00
system_hooks_service.rb Split complex method SystemHooksService#build_event_data 2015-11-13 00:12:18 +01:00
system_note_service.rb Backport JIRA service 2015-12-18 14:19:48 -06:00
test_hook_service.rb
update_release_service.rb Allow editing a release in API via PUT method 2015-11-21 22:34:53 +01:00
update_snippet_service.rb