From 103a8048c432de026b5087a83b8c58cbd56f9c98 Mon Sep 17 00:00:00 2001 From: Jeremy Lenz Date: Fri, 2 Feb 2024 16:24:07 -0500 Subject: [PATCH 1/4] Fixes #37140 - update web UI angular and old React --- .../organizations_controller_extensions.rb | 18 +--- app/overrides/add_organization_attributes.rb | 18 ---- app/services/katello/organization_creator.rb | 4 +- .../organizations/_edit_override.html.erb | 11 --- .../_index_header_override.html.erb | 3 - .../_index_row_override.html.erb | 3 - .../organizations/_step_1_override.html.erb | 10 -- .../details/views/activation-key-details.html | 1 - .../content-access-mode-banner.directive.js | 22 ----- .../views/content-access-mode-banner.html | 10 -- ...ntent-access-mode-banner.directive.test.js | 26 ----- .../Organizations/OrganizationSelectors.js | 3 - .../Manifest/SimpleContentAccess.js | 96 ------------------- .../scenes/Subscriptions/Manifest/index.js | 5 +- .../scenes/Subscriptions/SubscriptionsPage.js | 26 +---- .../Subscriptions/SubscriptionsSelectors.js | 3 - .../__tests__/SubscriptionsSelectors.test.js | 3 - webpack/scenes/Subscriptions/index.js | 3 +- 18 files changed, 7 insertions(+), 258 deletions(-) delete mode 100644 app/views/overrides/organizations/_index_header_override.html.erb delete mode 100644 app/views/overrides/organizations/_index_row_override.html.erb delete mode 100644 app/views/overrides/organizations/_step_1_override.html.erb delete mode 100644 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/content-access-mode-banner.directive.js delete mode 100644 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html delete mode 100644 engines/bastion_katello/test/subscriptions/content-access-mode-banner.directive.test.js delete mode 100644 webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js diff --git a/app/controllers/katello/concerns/organizations_controller_extensions.rb b/app/controllers/katello/concerns/organizations_controller_extensions.rb index 3334f1b3fad..05b20313c14 100644 --- a/app/controllers/katello/concerns/organizations_controller_extensions.rb +++ b/app/controllers/katello/concerns/organizations_controller_extensions.rb @@ -24,9 +24,7 @@ def create if taxonomy_class == Organization begin @taxonomy = Organization.new(resource_params) - sca = ::Foreman::Cast.to_bool(params[:simple_content_access]) - ::Foreman::Deprecation.api_deprecation_warning(N_("Simple Content Access will be required for all organizations in Katello 4.12.")) - ::Katello::OrganizationCreator.new(@taxonomy, sca: sca).create! + ::Katello::OrganizationCreator.new(@taxonomy).create! @taxonomy.reload switch_taxonomy if @count_nil_hosts > 0 @@ -45,20 +43,6 @@ def create end end - def update - return if params[:simple_content_access].nil? - sca_param = ::Foreman::Cast.to_bool(params[:simple_content_access]) - ::Foreman::Deprecation.api_deprecation_warning("Simple Content Access will be required for all organizations in Katello 4.12.") - if sca_param && !@taxonomy.simple_content_access?(cached: false) - # user has requested SCA enable - sync_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:id]) - elsif !sca_param && @taxonomy.simple_content_access?(cached: false) - # user has requested SCA disable - sync_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:id]) - end - super - end - included do prepend Overrides end diff --git a/app/overrides/add_organization_attributes.rb b/app/overrides/add_organization_attributes.rb index 1880488ca33..d826d2f39b5 100644 --- a/app/overrides/add_organization_attributes.rb +++ b/app/overrides/add_organization_attributes.rb @@ -11,26 +11,8 @@ :text => '<% if taxonomy.is_a?(Location) %><%= render_original %><% end %>' ) -# Add organization attributes to org creation -Deface::Override.new(:virtual_path => "taxonomies/_step1", - :name => "add_organization_attributes_on_create", - :insert_after => 'erb[loud]:contains("text_f"):contains(":name")', - :partial => 'overrides/organizations/step_1_override') - # Add organization attributes to org edit Deface::Override.new(:virtual_path => "taxonomies/_form", :name => "add_organization_attributes_on_edit", :insert_after => 'erb[loud]:contains("text_f"):contains(":name")', :partial => 'overrides/organizations/edit_override') - -# Add Simple Content Access column to org table -Deface::Override.new(:virtual_path => "taxonomies/index", - :name => "add_sca_column_on_index", - :insert_before => 'table th:last-child', # make it the second-to-last column - :partial => 'overrides/organizations/index_header_override') - -# Add Simple Content Access cells to org table -Deface::Override.new(:virtual_path => "taxonomies/index", - :name => "add_sca_attributes_on_index", - :insert_before => 'tbody td:last-child', - :partial => 'overrides/organizations/index_row_override') diff --git a/app/services/katello/organization_creator.rb b/app/services/katello/organization_creator.rb index aacf46e9ca1..6b89fc9fd7e 100644 --- a/app/services/katello/organization_creator.rb +++ b/app/services/katello/organization_creator.rb @@ -27,9 +27,9 @@ def self.create_all_organizations! end end - def initialize(organization, sca: true) + def initialize(organization) @organization = organization - @content_access_mode = sca ? 'org_environment' : 'entitlement' + @content_access_mode = 'org_environment' end def seed! diff --git a/app/views/overrides/organizations/_edit_override.html.erb b/app/views/overrides/organizations/_edit_override.html.erb index 68c1e9dabdf..60435896459 100644 --- a/app/views/overrides/organizations/_edit_override.html.erb +++ b/app/views/overrides/organizations/_edit_override.html.erb @@ -11,15 +11,4 @@ :type => :button, :style => 'margin-top: 8px;', :class => 'btn btn-small', 'data-url' => "/katello/api/v2/organizations/#{@taxonomy.id}/download_debug_certificate" end %> - - <%= field(f, _('Simple Content Access')) do - tag1 = hidden_field_tag 'simple_content_access', '0' - tag2 = check_box_tag 'simple_content_access', '1', @taxonomy.simple_content_access?(cached: false) - tag1 + tag2 - end %> - - - <% end %> diff --git a/app/views/overrides/organizations/_index_header_override.html.erb b/app/views/overrides/organizations/_index_header_override.html.erb deleted file mode 100644 index e4dd18c7432..00000000000 --- a/app/views/overrides/organizations/_index_header_override.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% if controller_name == 'organizations' %> - <%= _("Simple Content Access") %> -<% end %> diff --git a/app/views/overrides/organizations/_index_row_override.html.erb b/app/views/overrides/organizations/_index_row_override.html.erb deleted file mode 100644 index 33f7b3f206f..00000000000 --- a/app/views/overrides/organizations/_index_row_override.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% if taxonomy.is_a?(Organization) %> - <%= checked_icon taxonomy.simple_content_access?(cached: false) %> -<% end %> diff --git a/app/views/overrides/organizations/_step_1_override.html.erb b/app/views/overrides/organizations/_step_1_override.html.erb deleted file mode 100644 index eb6e83843e1..00000000000 --- a/app/views/overrides/organizations/_step_1_override.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% if @taxonomy.is_a?(Organization) %> - - <%= text_f f, :label, :class => 'input-xlarge' %> - <%= field(f, _('Simple Content Access')) do - tag1 = hidden_field_tag 'simple_content_access', '0' - tag2 = check_box_tag 'simple_content_access', '1', true - tag1 + tag2 - end %> - -<% end %> \ No newline at end of file diff --git a/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html b/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html index 7161163e4b6..1373919bb6f 100644 --- a/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +++ b/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html @@ -31,7 +31,6 @@

{{ activationKey.name }}