gitlab-org--gitlab-foss/lib
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 Merge branch 'edit-on-fork' into 'master' 2015-12-24 12:24:57 +00:00
assets
backup Backup LFS objects same as any upload. 2015-11-19 10:43:45 +01:00
banzai Backport JIRA service 2015-12-18 14:19:48 -06:00
ci Use method that creates runners registration token 2015-12-23 11:45:17 +01:00
gitlab Merge branch 'fix/visibility-level-setting-in-forked-projects' into 'master' 2015-12-24 12:09:38 +00:00
omni_auth Fix signin with OmniAuth providers 2015-12-08 14:58:15 +01:00
rouge/formatters Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
support Fix spelling of "it's" to "its" where appropriate. 2015-12-24 15:28:12 +11:00
tasks Merge branch 'add_user_repo_integrity_rake_task' into 'master' 2015-12-15 18:36:28 +00:00
award_emoji.rb Emoji picker: better alias handling 2015-12-24 11:28:55 +02:00
banzai.rb Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00
disable_email_interceptor.rb Add email interceptor to prevent mail sending if email sending is disabled. 2014-10-27 13:05:50 +01:00
event_filter.rb Fix rubocop warnings in lib 2015-10-03 01:29:58 -05:00
extracts_path.rb Only render 404 page from /public 2015-10-13 20:12:34 +03:00
file_size_validator.rb Support configurable attachment size via Application Settings 2015-04-02 00:04:08 -07:00
file_streamer.rb Implement Build Artifacts 2015-11-10 12:51:50 +01:00
gitlab.rb Revert "Merge branch 'revert-satellites' into 'master' " 2015-08-11 14:33:31 +02:00
gt_one_coercion.rb
repository_cache.rb Store commit count in project table 2015-07-17 15:22:56 +02:00
static_model.rb
unfold_form.rb Gitlab Issue 707: Indent unfolded code 1 character 2015-07-22 09:58:17 -04:00
uploaded_file.rb Implement Build Artifacts 2015-11-10 12:51:50 +01:00
version_check.rb Replace host with real one 2015-05-11 18:21:45 +03:00