katello 4.12.0.rc1 → 4.12.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/content_views_controller.rb +1 -1
  3. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +13 -0
  4. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  5. data/app/lib/actions/katello/content_view/promote.rb +1 -1
  6. data/app/lib/actions/katello/content_view/publish.rb +1 -1
  7. data/app/lib/actions/katello/repository/sync.rb +1 -1
  8. data/app/models/katello/concerns/host_managed_extensions.rb +45 -18
  9. data/app/models/katello/concerns/hostgroup_extensions.rb +5 -0
  10. data/app/models/katello/content_view.rb +23 -41
  11. data/app/models/katello/installed_deb.rb +12 -0
  12. data/app/models/katello/repository.rb +4 -0
  13. data/app/views/katello/api/v2/content_views/base.json.rabl +0 -1
  14. data/app/views/katello/api/v2/content_views/show.json.rabl +1 -0
  15. data/app/views/katello/api/v2/hosts/base.json.rabl +2 -2
  16. data/app/views/overrides/activation_keys/_host_synced_content_select.html.erb +1 -1
  17. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-repository-sets.controller.js +3 -1
  18. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
  19. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +2 -2
  20. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-add-hosts.html +2 -2
  21. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +2 -2
  22. data/lib/katello/plugin.rb +1 -1
  23. data/lib/katello/version.rb +1 -1
  24. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsActions.js +2 -0
  25. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +2 -1
  26. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +34 -5
  27. metadata +6 -56
  28. data/locale/bn/katello.po.time_stamp +0 -0
  29. data/locale/bn/katello.pox +0 -0
  30. data/locale/bn_IN/katello.po.time_stamp +0 -0
  31. data/locale/ca/katello.po.time_stamp +0 -0
  32. data/locale/cs/katello.po.time_stamp +0 -0
  33. data/locale/cs_CZ/katello.po.time_stamp +0 -0
  34. data/locale/de/katello.po.time_stamp +0 -0
  35. data/locale/de_AT/katello.po.time_stamp +0 -0
  36. data/locale/de_DE/katello.po.time_stamp +0 -0
  37. data/locale/el/katello.po.time_stamp +0 -0
  38. data/locale/en/katello.po.time_stamp +0 -0
  39. data/locale/en_GB/katello.po.time_stamp +0 -0
  40. data/locale/en_US/katello.po.time_stamp +0 -0
  41. data/locale/es/katello.po.time_stamp +0 -0
  42. data/locale/et_EE/katello.po.time_stamp +0 -0
  43. data/locale/fr/katello.po.time_stamp +0 -0
  44. data/locale/gl/katello.po.time_stamp +0 -0
  45. data/locale/gu/katello.po.time_stamp +0 -0
  46. data/locale/he_IL/katello.po.time_stamp +0 -0
  47. data/locale/hi/katello.po.time_stamp +0 -0
  48. data/locale/id/katello.po.time_stamp +0 -0
  49. data/locale/it/katello.po.time_stamp +0 -0
  50. data/locale/ja/katello.po.time_stamp +0 -0
  51. data/locale/ka/katello.po.time_stamp +0 -0
  52. data/locale/kn/katello.po.time_stamp +0 -0
  53. data/locale/ko/katello.po.time_stamp +0 -0
  54. data/locale/messages.mo +0 -0
  55. data/locale/ml_IN/katello.po.time_stamp +0 -0
  56. data/locale/mr/katello.po.time_stamp +0 -0
  57. data/locale/nl_NL/katello.po.time_stamp +0 -0
  58. data/locale/or/katello.po.time_stamp +0 -0
  59. data/locale/pa/katello.po.time_stamp +0 -0
  60. data/locale/pl/katello.po.time_stamp +0 -0
  61. data/locale/pl_PL/katello.po.time_stamp +0 -0
  62. data/locale/pt/katello.po.time_stamp +0 -0
  63. data/locale/pt_BR/katello.po.time_stamp +0 -0
  64. data/locale/ro/katello.po.time_stamp +0 -0
  65. data/locale/ro_RO/katello.po.time_stamp +0 -0
  66. data/locale/ru/katello.po.time_stamp +0 -0
  67. data/locale/sl/katello.po.time_stamp +0 -0
  68. data/locale/sv_SE/katello.po.time_stamp +0 -0
  69. data/locale/ta/katello.po.time_stamp +0 -0
  70. data/locale/ta_IN/katello.po.time_stamp +0 -0
  71. data/locale/te/katello.po.time_stamp +0 -0
  72. data/locale/tr/katello.po.time_stamp +0 -0
  73. data/locale/vi/katello.po.time_stamp +0 -0
  74. data/locale/vi_VN/katello.po.time_stamp +0 -0
  75. data/locale/zh/katello.po.time_stamp +0 -0
  76. data/locale/zh_CN/katello.po.time_stamp +0 -0
  77. data/locale/zh_TW/katello.po.time_stamp +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c41dc19a0ba10ef3dbf69911a8af325d8b5c9cbb065bb57924c95f2753639d8
4
- data.tar.gz: b0066648b0eb1c7495a31aa4f660eeb8073d195af6b2c17702be6300df71c300
3
+ metadata.gz: 02c570b117f48fb7f4cd1f22029a90a2a1c06d6199bd852ffcde0f3bc1bded5f
4
+ data.tar.gz: b2cafdcecc7a845c5203bae40a5f5fa131c99c8aca15a6368e5fac2cfaf2f912
5
5
  SHA512:
6
- metadata.gz: 0cc59e4a038d2c3b19055ee1d551a6af6565136991883d8552ba58a4367aeae695dbd695fa65c6110dcde81b2181d20058930d17fa00a571de4846525cb23393
7
- data.tar.gz: c8aa6725b98c8b30719b0e310af312ddf4c1de4a348b4a63362f88fb08218d6f722e1bf0fe568451257f2683c31d021385dcef7ab80d16074f77938fdef83342
6
+ metadata.gz: 387496c576b5625d18fc6045902336675d128156e8cbb4701da7ed61f767032e8eea00bf80bed10ba51fd5b0fe5bbf96d388c66be7a806ad26167737546903c7
7
+ data.tar.gz: c358eba78d817d4f3e6c61543a1dc973b7878722cf2e522fba71db91f1097aae9b9181c63146093ca1fb670d5a166618a61092f95a84ab488051bc813c254f46
@@ -59,7 +59,7 @@ module Katello
59
59
  param_group :search, Api::V2::ApiController
60
60
  add_scoped_search_description_for(ContentView)
61
61
  def index
62
- content_view_includes = [:activation_keys, :content_view_versions,
62
+ content_view_includes = [:activation_keys, :content_view_versions, :content_view_components,
63
63
  :environments, :organization, :repositories]
64
64
  respond(:collection => scoped_search(index_relation.distinct, :name, :asc, :includes => content_view_includes))
65
65
  end
@@ -170,6 +170,7 @@ module Katello
170
170
  param :content_overrides_search, Hash, :desc => N_("Content override search parameters") do
171
171
  param_group :search, Api::V2::ApiController
172
172
  param :enabled, :bool, :desc => N_("Set true to override to enabled; Set false to override to disabled.'"), :required => false
173
+ param :limit_to_env, :bool, :desc => N_("Limit actions to content in the host's environment."), :required => false
173
174
  param :remove, :bool, :desc => N_("Set true to remove an override and reset it to 'default'"), :required => false
174
175
  end
175
176
  def content_override
@@ -232,10 +233,22 @@ module Katello
232
233
 
233
234
  def find_content_overrides
234
235
  if !params.dig(:content_overrides_search, :search).nil?
236
+
235
237
  content_labels = ::Katello::Content.joins(:product_contents)
236
238
  .where("#{Katello::ProductContent.table_name}.product_id": @host.organization.products.subscribable.enabled)
237
239
  .search_for(params[:content_overrides_search][:search])
238
240
  .pluck(:label)
241
+
242
+ if Foreman::Cast.to_bool(params.dig(:content_overrides_search, :limit_to_env))
243
+ env_content = ProductContentFinder.new(
244
+ :match_subscription => false,
245
+ :match_environment => true,
246
+ :consumable => @host.subscription_facet
247
+ ).product_content
248
+ env_content_labels = ::Katello::Content.find(env_content.pluck(:content_id)).pluck(:label)
249
+ content_labels &= env_content_labels
250
+ end
251
+
239
252
  @content_overrides = content_labels.map do |label|
240
253
  { content_label: label,
241
254
  value: Foreman::Cast.to_bool(params[:content_overrides_search][:enabled]),
@@ -52,7 +52,7 @@ module Actions
52
52
  notification = MailNotification[:proxy_sync_failure]
53
53
  proxy = SmartProxy.find(input.fetch(:smart_proxy, {})[:id])
54
54
  subjects = subjects(input[:options]).merge(smart_proxy: proxy)
55
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
55
+ notification.users.with_enabled_email.each do |user|
56
56
  notification.deliver(subjects.merge(user: user, task: task))
57
57
  end
58
58
  end
@@ -27,7 +27,7 @@ module Actions
27
27
  def notify_on_failure(_plan)
28
28
  notification = MailNotification[:content_view_promote_failure]
29
29
  view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
30
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
30
+ notification.users.with_enabled_email.each do |user|
31
31
  notification.deliver(user: user, content_view: view, task: task)
32
32
  end
33
33
  end
@@ -136,7 +136,7 @@ module Actions
136
136
  def notify_on_failure(_plan)
137
137
  notification = MailNotification[:content_view_publish_failure]
138
138
  view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
139
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
139
+ notification.users.with_enabled_email.each do |user|
140
140
  notification.deliver(user: user, content_view: view, task: task)
141
141
  end
142
142
  end
@@ -100,7 +100,7 @@ module Actions
100
100
  def notify_on_failure(_plan)
101
101
  notification = MailNotification[:repository_sync_failure]
102
102
  repo = ::Katello::Repository.find(input.fetch(:repository, {})[:id])
103
- notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
103
+ notification.users.with_enabled_email.each do |user|
104
104
  notification.deliver(user: user, repo: repo, task: task)
105
105
  end
106
106
  end
@@ -325,40 +325,67 @@ module Katello
325
325
  content_facet.update_repositories_by_paths(paths.compact)
326
326
  end
327
327
 
328
- def import_module_streams(module_streams)
329
- streams = {}
330
- module_streams.each do |module_stream|
331
- stream = AvailableModuleStream.create_or_find_by!(name: module_stream["name"],
332
- context: module_stream["context"],
333
- stream: module_stream["stream"])
334
- streams[stream.id] = module_stream
328
+ def available_module_stream_id_from(name:, stream:, context:)
329
+ @indexed_available_module_streams ||= Katello::AvailableModuleStream.all.index_by do |available_module_stream|
330
+ "#{available_module_stream.name}-#{available_module_stream.stream}-#{available_module_stream.context}"
335
331
  end
336
- sync_available_module_stream_associations(streams)
332
+ @indexed_available_module_streams["#{name}-#{stream}-#{context}"]&.id
333
+ end
334
+
335
+ def import_module_streams(module_streams)
336
+ # module_streams looks like this
337
+ # {"name"=>"389-ds", "stream"=>"1.4", "version"=>"8030020201203210520", "context"=>"e114a9e7", "arch"=>"x86_64", "profiles"=>[], "installed_profiles"=>[], "status"=>"default", "active"=>false}
338
+ streams = module_streams.map do |module_stream|
339
+ {
340
+ name: module_stream["name"],
341
+ stream: module_stream["stream"],
342
+ context: module_stream["context"]
343
+ }
344
+ end
345
+ if streams.any?
346
+ AvailableModuleStream.insert_all(
347
+ streams,
348
+ unique_by: %w[name stream context],
349
+ returning: %w[id name stream context]
350
+ )
351
+ end
352
+ indexed_module_streams = module_streams.index_by do |module_stream|
353
+ available_module_stream_id_from(
354
+ name: module_stream["name"],
355
+ stream: module_stream["stream"],
356
+ context: module_stream["context"]
357
+ )
358
+ end
359
+ sync_available_module_stream_associations(indexed_module_streams)
337
360
  end
338
361
 
339
362
  def sync_available_module_stream_associations(new_available_module_streams)
340
- upgradable_streams = self.host_available_module_streams.where(:available_module_stream_id => new_available_module_streams.keys)
363
+ new_associated_ids = new_available_module_streams.keys.compact
364
+ upgradable_streams = self.host_available_module_streams.where(:available_module_stream_id => new_associated_ids)
341
365
  old_associated_ids = self.available_module_stream_ids
342
- delete_ids = old_associated_ids - new_available_module_streams.keys
366
+ delete_ids = old_associated_ids - new_associated_ids
343
367
 
344
368
  if delete_ids.any?
345
369
  self.host_available_module_streams.where(:available_module_stream_id => delete_ids).delete_all
346
370
  end
347
371
 
348
- new_ids = new_available_module_streams.keys - old_associated_ids
349
- new_ids.each do |new_id|
372
+ new_ids = new_associated_ids - old_associated_ids
373
+
374
+ hams_to_create = new_ids.map do |new_id|
350
375
  module_stream = new_available_module_streams[new_id]
351
376
  status = module_stream["status"]
352
377
  # Set status to "unknown" only if the active field is in use and set to false and the module is enabled
353
378
  if enabled_module_stream_inactive?(module_stream)
354
379
  status = "unknown"
355
380
  end
356
- self.host_available_module_streams.create!(host_id: self.id,
357
- available_module_stream_id: new_id,
358
- installed_profiles: module_stream["installed_profiles"],
359
- status: status)
360
- end
361
-
381
+ {
382
+ host_id: self.id,
383
+ available_module_stream_id: new_id,
384
+ installed_profiles: module_stream["installed_profiles"],
385
+ status: status
386
+ }
387
+ end
388
+ HostAvailableModuleStream.insert_all(hams_to_create) if hams_to_create.any?
362
389
  upgradable_streams.each do |hams|
363
390
  module_stream = new_available_module_streams[hams.available_module_stream_id]
364
391
  shared_keys = hams.attributes.keys & module_stream.keys
@@ -56,6 +56,11 @@ module Katello
56
56
  Katello::KTEnvironment.find_by(:id => inherited_lifecycle_environment_id)
57
57
  end
58
58
 
59
+ def kickstart_repository
60
+ return super if ancestry.nil? || self.kickstart_repository_id.present?
61
+ Katello::Repository.find_by(:id => inherited_kickstart_repository_id)
62
+ end
63
+
59
64
  # instead of calling nested_attribute_for(:content_source_id) in Foreman, define the methods explictedly
60
65
  def content_source
61
66
  return super if ancestry.nil? || self.content_source_id.present?
@@ -770,45 +770,6 @@ module Katello
770
770
  content_views
771
771
  end
772
772
 
773
- def audited_cv_repositories_since_last_publish
774
- audited_repositories = self.audits.filter do |a|
775
- !a.audited_changes["repository_ids"].nil?
776
- end
777
- if latest_version_object
778
- audited_repositories.filter! { |a| a.created_at > latest_version_object.created_at }
779
- end
780
- audited_repositories
781
- end
782
-
783
- def audited_cv_repository_changed
784
- audited_repositories_changes = Audit.where(auditable_id: repositories, auditable_type: "Katello::Repository").filter do |a|
785
- a.audited_changes["publication_href"].present? || a.audited_changes["version_href"].present?
786
- end
787
- if latest_version_object
788
- audited_repositories_changes = audited_repositories_changes.filter { |a| a.created_at > latest_version_object.created_at }
789
- end
790
- audited_repositories_changes
791
- end
792
-
793
- def audited_cv_filters_changed
794
- audited_filters = Audit.where(auditable_type: "Katello::ContentViewFilter",
795
- associated_id: id,
796
- associated_type: "Katello::ContentView")
797
- if latest_version_object
798
- audited_filters = audited_filters.filter { |a| a.created_at > latest_version_object.created_at }
799
- end
800
- audited_filters
801
- end
802
-
803
- def audited_cv_filter_rules_changed
804
- audited_filter_rules = Audit.where(associated_id: id,
805
- associated_type: "Katello::ContentView").where("auditable_type LIKE '%FilterRule%'")
806
- if latest_version_object
807
- audited_filter_rules = audited_filter_rules.filter { |a| a.created_at > latest_version_object.created_at }
808
- end
809
- audited_filter_rules
810
- end
811
-
812
773
  def composite_cv_components_changed?
813
774
  return true unless latest_version_object
814
775
  published_component_version_ids = latest_version_object.components.pluck(:id) || []
@@ -874,8 +835,29 @@ module Katello
874
835
  end
875
836
 
876
837
  def audited_changes_present?
877
- audited_cv_repositories_since_last_publish.present? || audited_cv_repository_changed.present? ||
878
- audited_cv_filters_changed.present? || audited_cv_filter_rules_changed.present?
838
+ latest_version_created_at = latest_version_object.created_at
839
+ cv_repository_ids = repositories.pluck(:id)
840
+
841
+ audited_changes_like = ->(param) {
842
+ Arel.sql("#{Audit.table_name}.audited_changes ilike '%#{param}%'")
843
+ }
844
+
845
+ table = Audit.arel_table
846
+ repository_condition = table[:auditable_id].eq(id).and(audited_changes_like.call("repository_ids"))
847
+
848
+ cv_repository_condition = table[:auditable_id].in(cv_repository_ids)
849
+ .and(table[:auditable_type].eq('Katello::Repository'))
850
+ .and(Arel.sql("(#{audited_changes_like.call("publication_href")} OR #{audited_changes_like.call("version_href")})"))
851
+
852
+ content_view_filter_condition = table[:auditable_type].eq('Katello::ContentViewFilter').and(table[:associated_id].eq(id))
853
+
854
+ filter_rule_condition = table[:associated_id].eq(id).and(table[:auditable_type].matches('%FilterRule%'))
855
+
856
+ base_query = table[:created_at].gt(latest_version_created_at)
857
+
858
+ final_query = base_query.and(repository_condition.or(cv_repository_condition).or(content_view_filter_condition).or(filter_rule_condition))
859
+
860
+ Audit.where(final_query).exists?
879
861
  end
880
862
 
881
863
  def dependency_solving_changed?
@@ -1,5 +1,17 @@
1
1
  module Katello
2
2
  class InstalledDeb < Katello::Model
3
+ apipie :class, desc: "A class representing #{model_name.human} object" do
4
+ name 'Installed Deb'
5
+ refs 'InstalledDeb'
6
+ sections only: %w[all additional]
7
+ property :name, String, desc: 'Returns name of the package'
8
+ property :version, String, desc: 'Returns package version'
9
+ property :architecture, String, desc: 'Returns package architecture'
10
+ end
11
+ class Jail < Safemode::Jail
12
+ allow :name, :version, :architecture
13
+ end
14
+
3
15
  has_many :host_installed_debs, :class_name => "Katello::HostInstalledDeb", :dependent => :destroy, :inverse_of => :installed_deb
4
16
  has_many :hosts, :through => :host_installed_debs, :class_name => "::Host"
5
17
 
@@ -250,6 +250,10 @@ module Katello
250
250
  self.pulp_id = SecureRandom.uuid if self.pulp_id.length > PULP_ID_MAX_LENGTH
251
251
  end
252
252
 
253
+ def self.attribute_name
254
+ :name
255
+ end
256
+
253
257
  def set_container_repository_name
254
258
  self.container_repository_name = Repository.safe_render_container_name(self)
255
259
  end
@@ -12,7 +12,6 @@ attributes :import_only
12
12
  attributes :generated_for
13
13
  attributes :related_cv_count
14
14
  attributes :related_composite_cvs
15
- attributes :needs_publish? => :needs_publish
16
15
  attributes :filtered? => :filtered
17
16
 
18
17
  node :next_version do |content_view|
@@ -3,6 +3,7 @@ object @resource
3
3
  extends "katello/api/v2/content_views/base"
4
4
 
5
5
  attributes :content_host_count
6
+ attributes :needs_publish? => :needs_publish
6
7
 
7
8
  node :errors do
8
9
  unless @resource.valid?
@@ -6,11 +6,11 @@ object @resource
6
6
  attributes :id, :name, :description
7
7
 
8
8
  node :operatingsystem_family do |resource|
9
- resource.operatingsystem.family
9
+ resource.operatingsystem&.family
10
10
  end
11
11
 
12
12
  node :operatingsystem_major do |resource|
13
- resource.operatingsystem.major
13
+ resource.operatingsystem&.major
14
14
  end
15
15
 
16
16
  if @facet
@@ -3,7 +3,7 @@
3
3
  kickstart_repo_id = kickstart_repository_id(@host, :selected_host_group => @host&.hostgroup)
4
4
  kickstart_options = kickstart_repository_options(@host, :selected_host_group => @host&.hostgroup)
5
5
  elsif using_hostgroups_page?
6
- kickstart_repo_id = kickstart_repository_id(@host, :selected_host_group => @host&.hostgroup)
6
+ kickstart_repo_id = kickstart_repository_id(@hostgroup, :selected_host_group => @host&.hostgroup)
7
7
  kickstart_options = kickstart_repository_options(@hostgroup)
8
8
  else
9
9
  kickstart_repo_id = kickstart_repository_id(@host, :selected_host_group => @hostgroup)
@@ -39,7 +39,7 @@ angular.module('Bastion.activation-keys').controller('ActivationKeyRepositorySet
39
39
 
40
40
  $scope.contentAccessModes = {
41
41
  contentAccessModeAll: $scope.simpleContentAccessEnabled,
42
- contentAccessModeEnv: false
42
+ contentAccessModeEnv: true
43
43
  };
44
44
 
45
45
  $scope.selectRepositoryType = function () {
@@ -56,6 +56,8 @@ angular.module('Bastion.activation-keys').controller('ActivationKeyRepositorySet
56
56
  $scope.nutupane.refresh();
57
57
  };
58
58
 
59
+ $scope.toggleFilters();
60
+
59
61
  success = function () {
60
62
  $scope.table.working = false;
61
63
  Notification.setSuccessMessage(translate('Repository Sets settings saved successfully.'));
@@ -29,8 +29,8 @@
29
29
  ng-controller="ContentHostStatusController">
30
30
  <td bst-table-cell>
31
31
  <span ng-switch="newHostDetailsUI">
32
- <a ng-switch-when="true" ng-href="/new/hosts/{{host.name}}">{{ host.name }}</a>
33
- <a ng-switch-when="false" ui-sref="content-host.info({hostId: host.id})">{{ host.name }}</a>
32
+ <a ng-switch-when="true" ng-href="/new/hosts/{{host.name}}">{{ host.display_name }}</a>
33
+ <a ng-switch-when="false" ui-sref="content-host.info({hostId: host.id})">{{ host.display_name }}</a>
34
34
  </span>
35
35
  </td>
36
36
  <td bst-table-cell>{{ host.content_facet_attributes.lifecycle_environment.name }}</td>
@@ -63,8 +63,8 @@
63
63
  ng-controller="ContentHostStatusController">
64
64
  <td bst-table-cell>
65
65
  <span ng-switch="newHostDetailsUI">
66
- <a ng-switch-when="true" ng-href="/new/hosts/{{contentHost.name}}/content">{{ contentHost.name }}</a>
67
- <a ng-switch-when="false" ui-sref="content-host.info({hostId: contentHost.id})">{{ contentHost.name }}</a>
66
+ <a ng-switch-when="true" ng-href="/new/hosts/{{contentHost.name}}/content">{{ contentHost.display_name }}</a>
67
+ <a ng-switch-when="false" ui-sref="content-host.info({hostId: contentHost.id})">{{ contentHost.display_name }}</a>
68
68
  </span>
69
69
  </td>
70
70
  <td bst-table-cell>{{ contentHost.operatingsystem_name }}</td>
@@ -40,8 +40,8 @@
40
40
  </td>
41
41
  <td bst-table-cell >
42
42
  <span ng-switch="newHostDetailsUI">
43
- <a ng-switch-when="true" ng-href="/new/hosts/{{host.name}}">{{ host.name }}</a>
44
- <a ng-switch-when="false" ui-sref="content-host.info({hostId: host.id})">{{ host.name }}</a>
43
+ <a ng-switch-when="true" ng-href="/new/hosts/{{host.name}}">{{ host.display_name }}</a>
44
+ <a ng-switch-when="false" ui-sref="content-host.info({hostId: host.id})">{{ host.display_name }}</a>
45
45
  </span>
46
46
  </td>
47
47
  <td bst-table-cell >{{ host.content_facet_attributes.lifecycle_environment.name}}</td>
@@ -40,8 +40,8 @@
40
40
  </td>
41
41
  <td bst-table-cell >
42
42
  <span ng-switch="newHostDetailsUI">
43
- <a ng-switch-when="true" ng-href="/new/hosts/{{host.name}}">{{ host.name }}</a>
44
- <a ng-switch-when="false" ui-sref="content-host.info({hostId: host.id})">{{ host.name }}</a>
43
+ <a ng-switch-when="true" ng-href="/new/hosts/{{host.name}}">{{ host.display_name }}</a>
44
+ <a ng-switch-when="false" ui-sref="content-host.info({hostId: host.id})">{{ host.display_name }}</a>
45
45
  </span>
46
46
  </td>
47
47
  <td bst-table-cell >{{ host.content_facet_attributes.lifecycle_environment.name}}</td>
@@ -4,7 +4,7 @@ require 'katello/host_status_manager'
4
4
  # rubocop:disable Metrics/BlockLength
5
5
 
6
6
  Foreman::Plugin.register :katello do
7
- requires_foreman '>= 3.7'
7
+ requires_foreman '>= 3.11'
8
8
  register_gettext
9
9
 
10
10
  sub_menu :top_menu, :content_menu, :caption => N_('Content'),
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "4.12.0.rc1".freeze
2
+ VERSION = "4.12.0.rc2".freeze
3
3
  end
@@ -24,6 +24,7 @@ export const setContentOverrides = ({
24
24
  hostId,
25
25
  search,
26
26
  enabled,
27
+ limit_to_env: limitToEnv,
27
28
  remove = false,
28
29
  updateResults,
29
30
  singular,
@@ -35,6 +36,7 @@ export const setContentOverrides = ({
35
36
  content_overrides_search: {
36
37
  search,
37
38
  enabled,
39
+ limit_to_env: limitToEnv,
38
40
  remove,
39
41
  },
40
42
  },
@@ -203,7 +203,7 @@ const RepositorySetsTab = () => {
203
203
 
204
204
  const toggleGroupStates = ['noLimit', 'limitToEnvironment'];
205
205
  const [SHOW_ALL, LIMIT_TO_ENVIRONMENT] = toggleGroupStates;
206
- const defaultToggleGroupState = nonLibraryHost ? LIMIT_TO_ENVIRONMENT : SHOW_ALL;
206
+ const defaultToggleGroupState = LIMIT_TO_ENVIRONMENT;
207
207
  const unfilteredToggleGroupState = SHOW_ALL;
208
208
  const [toggleGroupState, setToggleGroupState] =
209
209
  useState(show ?? defaultToggleGroupState);
@@ -369,6 +369,7 @@ const RepositorySetsTab = () => {
369
369
  hostId,
370
370
  search,
371
371
  enabled,
372
+ limit_to_env: toggleGroupState === LIMIT_TO_ENVIRONMENT,
372
373
  remove,
373
374
  updateResults: resp => updateResults(resp),
374
375
  singular: singular || selectedCount === 1,
@@ -61,10 +61,6 @@ const limitToEnvQuery = {
61
61
  sort_by: 'name',
62
62
  sort_order: 'asc',
63
63
  };
64
- const showAllQuery = {
65
- ...limitToEnvQuery,
66
- content_access_mode_env: false,
67
- };
68
64
 
69
65
  let firstRepoSet;
70
66
  let secondRepoSet;
@@ -191,7 +187,7 @@ test('Toggle Group does not show if it\'s the library environment and default co
191
187
  // return errata data results when we look for errata
192
188
  const scope = nockInstance
193
189
  .get(hostRepositorySets)
194
- .query(showAllQuery)
190
+ .query(limitToEnvQuery)
195
191
  .reply(200, mockRepoSetData);
196
192
 
197
193
  const {
@@ -371,6 +367,39 @@ test('Can override in bulk', async (done) => {
371
367
  assertNockRequest(scope);
372
368
  assertNockRequest(contentOverrideScope, done); // Pass jest callback to confirm test is done});
373
369
  });
370
+ test('Can override in bulk when limited to environment', async (done) => {
371
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
372
+ const scope = nockInstance
373
+ .get(hostRepositorySets)
374
+ .query(limitToEnvQuery)
375
+ .reply(200, mockRepoSetData);
376
+ const contentOverrideScope = nockInstance
377
+ .put(contentOverride, {
378
+ content_overrides_search:
379
+ {
380
+ search: '',
381
+ limit_to_env: true,
382
+ remove: true,
383
+ },
384
+ })
385
+ .reply(200, mockContentOverride);
386
+
387
+ const {
388
+ getByText, getByLabelText, queryByText,
389
+ } = renderWithRedux(<RepositorySetsTab />, renderOptions());
390
+
391
+ await patientlyWaitFor(() => expect(getByText(firstRepoSet.contentUrl)).toBeInTheDocument());
392
+ getByLabelText('Select all').click();
393
+ const actionMenu = getByLabelText('bulk_actions');
394
+ actionMenu.click();
395
+ const resetToDefault = queryByText('Reset to default');
396
+ expect(resetToDefault).toBeInTheDocument();
397
+ resetToDefault.click();
398
+
399
+ assertNockRequest(autocompleteScope);
400
+ assertNockRequest(scope);
401
+ assertNockRequest(contentOverrideScope, done);
402
+ });
374
403
 
375
404
  test('Can filter by status', async (done) => {
376
405
  const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.0.rc1
4
+ version: 4.12.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -4353,152 +4353,102 @@ files:
4353
4353
  - locale/action_names.rb
4354
4354
  - locale/bn/LC_MESSAGES/katello.mo
4355
4355
  - locale/bn/katello.po
4356
- - locale/bn/katello.po.time_stamp
4357
- - locale/bn/katello.pox
4358
4356
  - locale/bn_IN/LC_MESSAGES/katello.mo
4359
4357
  - locale/bn_IN/katello.po
4360
- - locale/bn_IN/katello.po.time_stamp
4361
4358
  - locale/ca/LC_MESSAGES/katello.mo
4362
4359
  - locale/ca/katello.po
4363
- - locale/ca/katello.po.time_stamp
4364
4360
  - locale/cs/LC_MESSAGES/katello.mo
4365
4361
  - locale/cs/katello.po
4366
- - locale/cs/katello.po.time_stamp
4367
4362
  - locale/cs_CZ/LC_MESSAGES/katello.mo
4368
4363
  - locale/cs_CZ/katello.po
4369
- - locale/cs_CZ/katello.po.time_stamp
4370
4364
  - locale/de/LC_MESSAGES/katello.mo
4371
4365
  - locale/de/katello.po
4372
- - locale/de/katello.po.time_stamp
4373
4366
  - locale/de_AT/LC_MESSAGES/katello.mo
4374
4367
  - locale/de_AT/katello.po
4375
- - locale/de_AT/katello.po.time_stamp
4376
4368
  - locale/de_DE/LC_MESSAGES/katello.mo
4377
4369
  - locale/de_DE/katello.po
4378
- - locale/de_DE/katello.po.time_stamp
4379
4370
  - locale/el/LC_MESSAGES/katello.mo
4380
4371
  - locale/el/katello.po
4381
- - locale/el/katello.po.time_stamp
4382
4372
  - locale/en/LC_MESSAGES/katello.mo
4383
4373
  - locale/en/katello.po
4384
- - locale/en/katello.po.time_stamp
4385
4374
  - locale/en_GB/LC_MESSAGES/katello.mo
4386
4375
  - locale/en_GB/katello.po
4387
- - locale/en_GB/katello.po.time_stamp
4388
4376
  - locale/en_US/LC_MESSAGES/katello.mo
4389
4377
  - locale/en_US/katello.po
4390
- - locale/en_US/katello.po.time_stamp
4391
4378
  - locale/es/LC_MESSAGES/katello.mo
4392
4379
  - locale/es/katello.po
4393
- - locale/es/katello.po.time_stamp
4394
4380
  - locale/et_EE/LC_MESSAGES/katello.mo
4395
4381
  - locale/et_EE/katello.po
4396
- - locale/et_EE/katello.po.time_stamp
4397
4382
  - locale/fr/LC_MESSAGES/katello.mo
4398
4383
  - locale/fr/katello.po
4399
- - locale/fr/katello.po.time_stamp
4400
4384
  - locale/gl/LC_MESSAGES/katello.mo
4401
4385
  - locale/gl/katello.po
4402
- - locale/gl/katello.po.time_stamp
4403
4386
  - locale/gu/LC_MESSAGES/katello.mo
4404
4387
  - locale/gu/katello.po
4405
- - locale/gu/katello.po.time_stamp
4406
4388
  - locale/he_IL/LC_MESSAGES/katello.mo
4407
4389
  - locale/he_IL/katello.po
4408
- - locale/he_IL/katello.po.time_stamp
4409
4390
  - locale/hi/LC_MESSAGES/katello.mo
4410
4391
  - locale/hi/katello.po
4411
- - locale/hi/katello.po.time_stamp
4412
4392
  - locale/id/LC_MESSAGES/katello.mo
4413
4393
  - locale/id/katello.po
4414
- - locale/id/katello.po.time_stamp
4415
4394
  - locale/it/LC_MESSAGES/katello.mo
4416
4395
  - locale/it/katello.po
4417
- - locale/it/katello.po.time_stamp
4418
4396
  - locale/ja/LC_MESSAGES/katello.mo
4419
4397
  - locale/ja/katello.po
4420
- - locale/ja/katello.po.time_stamp
4421
4398
  - locale/ka/LC_MESSAGES/katello.mo
4422
4399
  - locale/ka/katello.po
4423
- - locale/ka/katello.po.time_stamp
4424
4400
  - locale/katello.pot
4425
4401
  - locale/kn/LC_MESSAGES/katello.mo
4426
4402
  - locale/kn/katello.po
4427
- - locale/kn/katello.po.time_stamp
4428
4403
  - locale/ko/LC_MESSAGES/katello.mo
4429
4404
  - locale/ko/katello.po
4430
- - locale/ko/katello.po.time_stamp
4431
- - locale/messages.mo
4432
4405
  - locale/ml_IN/LC_MESSAGES/katello.mo
4433
4406
  - locale/ml_IN/katello.po
4434
- - locale/ml_IN/katello.po.time_stamp
4435
4407
  - locale/mr/LC_MESSAGES/katello.mo
4436
4408
  - locale/mr/katello.po
4437
- - locale/mr/katello.po.time_stamp
4438
4409
  - locale/nl_NL/LC_MESSAGES/katello.mo
4439
4410
  - locale/nl_NL/katello.po
4440
- - locale/nl_NL/katello.po.time_stamp
4441
4411
  - locale/or/LC_MESSAGES/katello.mo
4442
4412
  - locale/or/katello.po
4443
- - locale/or/katello.po.time_stamp
4444
4413
  - locale/pa/LC_MESSAGES/katello.mo
4445
4414
  - locale/pa/katello.po
4446
- - locale/pa/katello.po.time_stamp
4447
4415
  - locale/pl/LC_MESSAGES/katello.mo
4448
4416
  - locale/pl/katello.po
4449
- - locale/pl/katello.po.time_stamp
4450
4417
  - locale/pl_PL/LC_MESSAGES/katello.mo
4451
4418
  - locale/pl_PL/katello.po
4452
- - locale/pl_PL/katello.po.time_stamp
4453
4419
  - locale/pt/LC_MESSAGES/katello.mo
4454
4420
  - locale/pt/katello.po
4455
- - locale/pt/katello.po.time_stamp
4456
4421
  - locale/pt_BR/LC_MESSAGES/katello.mo
4457
4422
  - locale/pt_BR/katello.po
4458
- - locale/pt_BR/katello.po.time_stamp
4459
4423
  - locale/ro/LC_MESSAGES/katello.mo
4460
4424
  - locale/ro/katello.po
4461
- - locale/ro/katello.po.time_stamp
4462
4425
  - locale/ro_RO/LC_MESSAGES/katello.mo
4463
4426
  - locale/ro_RO/katello.po
4464
- - locale/ro_RO/katello.po.time_stamp
4465
4427
  - locale/ru/LC_MESSAGES/katello.mo
4466
4428
  - locale/ru/katello.po
4467
- - locale/ru/katello.po.time_stamp
4468
4429
  - locale/sl/LC_MESSAGES/katello.mo
4469
4430
  - locale/sl/katello.po
4470
- - locale/sl/katello.po.time_stamp
4471
4431
  - locale/sv_SE/LC_MESSAGES/katello.mo
4472
4432
  - locale/sv_SE/katello.po
4473
- - locale/sv_SE/katello.po.time_stamp
4474
4433
  - locale/ta/LC_MESSAGES/katello.mo
4475
4434
  - locale/ta/katello.po
4476
- - locale/ta/katello.po.time_stamp
4477
4435
  - locale/ta_IN/LC_MESSAGES/katello.mo
4478
4436
  - locale/ta_IN/katello.po
4479
- - locale/ta_IN/katello.po.time_stamp
4480
4437
  - locale/te/LC_MESSAGES/katello.mo
4481
4438
  - locale/te/katello.po
4482
- - locale/te/katello.po.time_stamp
4483
4439
  - locale/tr/LC_MESSAGES/katello.mo
4484
4440
  - locale/tr/katello.po
4485
- - locale/tr/katello.po.time_stamp
4486
4441
  - locale/update-i18n
4487
4442
  - locale/vi/LC_MESSAGES/katello.mo
4488
4443
  - locale/vi/katello.po
4489
- - locale/vi/katello.po.time_stamp
4490
4444
  - locale/vi_VN/LC_MESSAGES/katello.mo
4491
4445
  - locale/vi_VN/katello.po
4492
- - locale/vi_VN/katello.po.time_stamp
4493
4446
  - locale/zh/LC_MESSAGES/katello.mo
4494
4447
  - locale/zh/katello.po
4495
- - locale/zh/katello.po.time_stamp
4496
4448
  - locale/zh_CN/LC_MESSAGES/katello.mo
4497
4449
  - locale/zh_CN/katello.po
4498
- - locale/zh_CN/katello.po.time_stamp
4499
4450
  - locale/zh_TW/LC_MESSAGES/katello.mo
4500
4451
  - locale/zh_TW/katello.po
4501
- - locale/zh_TW/katello.po.time_stamp
4502
4452
  - package.json
4503
4453
  - vendor/assets/images/katello/add2.png
4504
4454
  - vendor/assets/images/katello/addhost.png
@@ -5434,7 +5384,7 @@ homepage: http://www.katello.org
5434
5384
  licenses:
5435
5385
  - GPL-2.0
5436
5386
  metadata: {}
5437
- post_install_message:
5387
+ post_install_message:
5438
5388
  rdoc_options: []
5439
5389
  require_paths:
5440
5390
  - lib
@@ -5452,8 +5402,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
5452
5402
  - !ruby/object:Gem::Version
5453
5403
  version: 1.3.1
5454
5404
  requirements: []
5455
- rubygems_version: 3.1.6
5456
- signing_key:
5405
+ rubygems_version: 3.4.10
5406
+ signing_key:
5457
5407
  specification_version: 4
5458
5408
  summary: Content and Subscription Management plugin for Foreman
5459
5409
  test_files: []
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/locale/messages.mo DELETED
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes