Commit 5703e873 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'ph/fileByFileDefaultEnabled' into 'master'

Enables diff file-by-file navigation by default

See merge request gitlab-org/gitlab!37090
parents a9196935 cae19af9
...@@ -84,7 +84,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -84,7 +84,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
@issuable_sidebar = serializer.represent(@merge_request, serializer: 'sidebar') @issuable_sidebar = serializer.represent(@merge_request, serializer: 'sidebar')
@current_user_data = UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json @current_user_data = UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json
@show_whitespace_default = current_user.nil? || current_user.show_whitespace_in_diffs @show_whitespace_default = current_user.nil? || current_user.show_whitespace_in_diffs
@file_by_file_default = Feature.enabled?(:view_diffs_file_by_file) && current_user&.view_diffs_file_by_file @file_by_file_default = Feature.enabled?(:view_diffs_file_by_file, default_enabled: true) && current_user&.view_diffs_file_by_file
@coverage_path = coverage_reports_project_merge_request_path(@project, @merge_request, format: :json) if @merge_request.has_coverage_reports? @coverage_path = coverage_reports_project_merge_request_path(@project, @merge_request, format: :json) if @merge_request.has_coverage_reports?
@endpoint_metadata_url = endpoint_metadata_url(@project, @merge_request) @endpoint_metadata_url = endpoint_metadata_url(@project, @merge_request)
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
= f.check_box :show_whitespace_in_diffs, class: 'form-check-input' = f.check_box :show_whitespace_in_diffs, class: 'form-check-input'
= f.label :show_whitespace_in_diffs, class: 'form-check-label' do = f.label :show_whitespace_in_diffs, class: 'form-check-label' do
= s_('Preferences|Show whitespace changes in diffs') = s_('Preferences|Show whitespace changes in diffs')
- if Feature.enabled?(:view_diffs_file_by_file) - if Feature.enabled?(:view_diffs_file_by_file, default_enabled: true)
.form-group.form-check .form-group.form-check
= f.check_box :view_diffs_file_by_file, class: 'form-check-input' = f.check_box :view_diffs_file_by_file, class: 'form-check-input'
= f.label :view_diffs_file_by_file, class: 'form-check-label' do = f.label :view_diffs_file_by_file, class: 'form-check-label' do
......
...@@ -67,9 +67,10 @@ list. ...@@ -67,9 +67,10 @@ list.
### File-by-file diff navigation ### File-by-file diff navigation
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/222790) in GitLab 13.2. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/222790) in GitLab 13.2.
> - It's deployed behind a feature flag, disabled by default. > - It's deployed behind a feature flag, enabled by default.
> - It's recommended for production use.
> - It's enabled on GitLab.com. > - It's enabled on GitLab.com.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-file-by-file-diff-navigation-core-only). > - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-file-by-file-diff-navigation-core-only).
For larger merge requests it might sometimes be useful to review single files at a time. To enable, For larger merge requests it might sometimes be useful to review single files at a time. To enable,
from your avatar on the top-right navbar, click **Settings**, and go to **Preferences** on the left from your avatar on the top-right navbar, click **Settings**, and go to **Preferences** on the left
...@@ -83,9 +84,9 @@ From there, when reviewing merge requests' **Changes** tab, you will see only on ...@@ -83,9 +84,9 @@ From there, when reviewing merge requests' **Changes** tab, you will see only on
#### Enable or disable file-by-file diff navigation **(CORE ONLY)** #### Enable or disable file-by-file diff navigation **(CORE ONLY)**
File-by-file diff navigation is under development but ready for production use. It is File-by-file diff navigation is under development but ready for production use. It is
deployed behind a feature flag that is **disabled by default**. deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md) [GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can enable it for your instance. can opt to disable it for your instance.
To enable it: To enable it:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment