Skip to content

Commit 1294f76

Browse files
committed
Improve the way the beta is checked
1 parent fa7caf0 commit 1294f76

File tree

6 files changed

+235
-398
lines changed

6 files changed

+235
-398
lines changed

src/api/app/controllers/webui/package_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Webui::PackageController < Webui::WebuiController
1616
save_person save_group remove_role view_file
1717
buildresult rpmlint_result rpmlint_log rpmlint_summary files]
1818

19-
before_action :check_scmsync, only: %i[statistics requests]
20-
before_action :check_scmsync, only: %i[users], unless: -> { Flipper.enabled?(:scmsync, User.session) }
19+
before_action :check_scmsync, only: %i[statistics users requests], unless: -> { action_name == 'users' && Flipper.enabled?(:scmsync, User.session) }
2120

2221
before_action :set_package, only: %i[edit update show requests statistics revisions
2322
branch_diff_info rdiff remove

src/api/app/controllers/webui/webui_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ def set_package
101101
return if @package_name.blank?
102102

103103
begin
104-
@package = Package.get_by_project_and_name(@project.name, @package_name, follow_multibuild: true, follow_project_scmsync_links: true)
104+
options = { follow_multibuild: true }
105+
options[:follow_project_scmsync_links] = true if Flipper.enabled?(:scmsync, User.session)
106+
@package = Package.get_by_project_and_name(@project.name, @package_name, options)
105107
# why it's not found is of no concern
106108
rescue APIError
107109
raise Package::UnknownObjectError, "Package not found: #{@project.name}/#{@package_name}"

src/api/app/views/webui/package/_tabs.html.haml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
- if Flipper.enabled?(:request_show_redesign, User.session)
1111
= tab_link('RPM Lint', rpmlint_result_path(project, package), 'scrollable-tab-link')
1212
= tab_link('Revisions', package_view_revisions_path(project, package), 'scrollable-tab-link')
13-
- if Flipper.enabled?(:request_index, User.session)
14-
= tab_link('Requests', packages_requests_path(project,
15-
package,
16-
state: %w[new review]),
17-
'scrollable-tab-link', active: controller_name == 'bs_requests')
18-
- else
19-
= tab_link('Requests', package_requests_path(project, package), 'scrollable-tab-link')
13+
- unless package.readonly?
14+
- if Flipper.enabled?(:request_index, User.session)
15+
= tab_link('Requests', packages_requests_path(project,
16+
package,
17+
state: %w[new review]),
18+
'scrollable-tab-link', active: controller_name == 'bs_requests')
19+
- else
20+
= tab_link('Requests', package_requests_path(project, package), 'scrollable-tab-link')
2021
= tab_link('Users', package_users_path(project, package), 'scrollable-tab-link')
21-
= tab_link('Attributes', index_attribs_path(project, package), 'scrollable-tab-link')
22+
- unless package.readonly?
23+
= tab_link('Attributes', index_attribs_path(project, package), 'scrollable-tab-link')
2224
= tab_link('Meta', project_package_meta_path(project, package), 'scrollable-tab-link')

0 commit comments

Comments
 (0)