Skip to content

Linking to edit file directly

username-removed-892863 requested to merge 28899-linking-to-edit-file into master

What does this MR do?

  • When visiting a blob edit link NLI, /group/project/edit/master/some-file.txt, we now redirect to sign in and return to back to
    • If able to edit directly, edit blob page
    • If unable to edit directly, blob show page with suggestion to fork the project in order to edit

EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1546

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

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

Todo

  • When unable to edit directly and needing to fork, update normal "Edit" button to toggle the .js-file-fork-suggestion-section
  • Add tests
    • From NLI, visit blob edit, sign in with user who can edit directly, expect edit page
    • From NLI, visit blob edit, sign in with user who can edit on a branch, expect edit page
    • From NLI, visit blob edit, sign in with user who can't edit, expect show page with suggestion to fork
    • From NLI, visit blob edit, sign in with user who can't edit but already has a fork, expect edit page
  • When user needs to fork, just redirect to blob show page without the fork/cancel combo, see https://gitlab.com/gitlab-org/gitlab-ce/issues/28899#note_26395325

What are the relevant issue numbers?

Closes #28899 (closed)

Merge request reports