katello 3.16.2 → 3.17.0.rc1

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 (381) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/katello/katello.scss +3 -7
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +8 -0
  5. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +10 -4
  6. data/app/controllers/katello/api/v2/host_tracer_controller.rb +33 -8
  7. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +11 -11
  8. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +0 -15
  9. data/app/controllers/katello/api/v2/repositories_controller.rb +5 -11
  10. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +16 -0
  11. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -4
  12. data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +1 -1
  13. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +5 -11
  14. data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +10 -0
  15. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +6 -7
  16. data/app/lib/actions/candlepin/product/content_add.rb +2 -1
  17. data/app/lib/actions/candlepin/product/content_update_enablement.rb +18 -0
  18. data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +2 -6
  19. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
  20. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  21. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -17
  22. data/app/lib/actions/katello/content_view_version/incremental_update.rb +2 -3
  23. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +17 -0
  24. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +17 -0
  25. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +36 -0
  26. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +13 -0
  27. data/app/lib/actions/katello/product/content_create.rb +3 -3
  28. data/app/lib/actions/katello/product/destroy.rb +4 -25
  29. data/app/lib/actions/katello/repository/content_update.rb +41 -0
  30. data/app/lib/actions/katello/repository/destroy.rb +1 -5
  31. data/app/lib/actions/katello/repository/export.rb +1 -1
  32. data/app/lib/actions/katello/repository/multi_clone_contents.rb +15 -13
  33. data/app/lib/actions/katello/repository/sync.rb +25 -35
  34. data/app/lib/actions/katello/repository/update.rb +19 -30
  35. data/app/lib/actions/katello/repository/update_cv_repo_cert_guard.rb +17 -0
  36. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +1 -0
  37. data/app/lib/actions/pulp/orchestration/repository/sync.rb +1 -2
  38. data/app/lib/actions/pulp/repository/sync.rb +1 -2
  39. data/app/lib/actions/pulp3/abstract_async_task.rb +0 -1
  40. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -3
  41. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
  42. data/app/lib/actions/pulp3/orchestration/repository/copy_all_units.rb +2 -1
  43. data/app/lib/actions/pulp3/orchestration/repository/sync.rb +1 -3
  44. data/app/lib/actions/pulp3/repository/copy_content.rb +1 -0
  45. data/app/lib/actions/pulp3/repository/delete.rb +1 -1
  46. data/app/lib/actions/pulp3/repository/multi_copy_content.rb +1 -1
  47. data/app/lib/actions/pulp3/repository/save_version.rb +16 -20
  48. data/app/lib/actions/pulp3/repository/sync.rb +1 -1
  49. data/app/lib/actions/pulp3/repository/update_cv_repository_cert_guard.rb +2 -6
  50. data/app/lib/actions/pulp3/repository/upload_file.rb +1 -1
  51. data/app/lib/katello/resources/candlepin/product.rb +11 -0
  52. data/app/lib/katello/resources/cdn.rb +2 -3
  53. data/app/lib/katello/util/cdn_var_substitutor.rb +7 -9
  54. data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +11 -11
  55. data/app/models/katello/activation_key.rb +1 -1
  56. data/app/models/katello/concerns/content_facet_host_extensions.rb +7 -0
  57. data/app/models/katello/concerns/host_managed_extensions.rb +39 -0
  58. data/app/models/katello/concerns/hostgroup_extensions.rb +46 -24
  59. data/app/models/katello/concerns/smart_proxy_extensions.rb +5 -19
  60. data/app/models/katello/concerns/widget_extensions.rb +23 -0
  61. data/app/models/katello/content_view.rb +9 -1
  62. data/app/models/katello/content_view_package_filter.rb +1 -1
  63. data/app/models/katello/content_view_version.rb +7 -0
  64. data/app/models/katello/erratum.rb +13 -0
  65. data/app/models/katello/erratum_cve.rb +8 -0
  66. data/app/models/katello/glue/pulp/repo.rb +1 -1
  67. data/app/models/katello/host/content_facet.rb +18 -1
  68. data/app/models/katello/host_collection.rb +6 -0
  69. data/app/models/katello/hostgroup/content_facet.rb +18 -0
  70. data/app/models/katello/installed_package.rb +8 -0
  71. data/app/models/katello/kt_environment.rb +9 -1
  72. data/app/models/katello/model.rb +16 -0
  73. data/app/models/katello/pool.rb +17 -0
  74. data/app/models/katello/product.rb +6 -0
  75. data/app/models/katello/purpose_addons_status.rb +1 -0
  76. data/app/models/katello/purpose_role_status.rb +1 -0
  77. data/app/models/katello/purpose_sla_status.rb +1 -0
  78. data/app/models/katello/purpose_usage_status.rb +1 -0
  79. data/app/models/katello/repository.rb +3 -6
  80. data/app/models/katello/root_repository.rb +24 -16
  81. data/app/models/katello/subscription_status.rb +1 -1
  82. data/app/models/katello/trace_status.rb +1 -1
  83. data/app/models/setting/content.rb +6 -2
  84. data/app/services/cert/certs.rb +2 -10
  85. data/app/services/katello/event_daemon.rb +7 -8
  86. data/app/services/katello/host_status_manager.rb +13 -0
  87. data/app/services/katello/pulp3/migration.rb +1 -1
  88. data/app/services/katello/pulp3/repository/yum.rb +6 -72
  89. data/app/services/katello/pulp3/repository.rb +11 -10
  90. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +1 -1
  91. data/app/services/katello/pulp3/task.rb +3 -3
  92. data/app/services/katello/pulp3/task_group.rb +0 -6
  93. data/app/services/katello/smart_proxy_helper.rb +16 -13
  94. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
  95. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  96. data/config/routes/api/rhsm.rb +0 -1
  97. data/config/routes/api/v2.rb +8 -2
  98. data/config/routes/overrides.rb +0 -4
  99. data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
  100. data/db/migrate/20180904122343_create_hostgroup_content_facet.katello.rb +16 -0
  101. data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +53 -0
  102. data/db/migrate/20200610112009_remove_audits_of_root_repo_with_content_id.rb +9 -0
  103. data/db/migrate/20200701150946_add_auto_enabled_to_root_repository.rb +5 -0
  104. data/db/seeds.d/75-job_templates.rb +2 -2
  105. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +3 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +5 -2
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +4 -2
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +1 -1
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +1 -1
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +4 -1
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +4 -1
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -0
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-traces-modal.controller.js +4 -3
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +7 -1
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +1 -0
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -0
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +1 -1
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +7 -1
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +4 -2
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +1 -1
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -0
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +14 -6
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +1 -1
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +6 -6
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +5 -2
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +1 -1
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +1 -2
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-traces-resolve.factory.js +18 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +45 -4
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +1 -1
  133. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +1 -1
  134. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1 -1
  135. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +1 -1
  136. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +1 -1
  137. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +1 -1
  138. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +1 -1
  139. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +1 -1
  140. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +1 -1
  141. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +1 -1
  142. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/product-bulk-action.factory.js +0 -1
  143. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +0 -6
  144. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -7
  145. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +11 -1
  146. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +1 -1
  147. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +16 -4
  148. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +0 -1
  149. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +0 -15
  150. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/views/products.html +0 -6
  151. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  152. data/lib/katello/engine.rb +6 -5
  153. data/lib/katello/permission_creator.rb +3 -3
  154. data/lib/katello/permissions/host_permissions.rb +0 -1
  155. data/lib/katello/plugin.rb +20 -16
  156. data/lib/katello/tasks/pulp3_post_migration_check.rake +1 -2
  157. data/lib/katello/tasks/reimport.rake +1 -1
  158. data/lib/katello/tasks/reports.rake +0 -12
  159. data/lib/katello/tasks/test.rake +15 -0
  160. data/lib/katello/version.rb +1 -1
  161. data/locale/action_names.rb +48 -48
  162. data/locale/bn/katello.po +137 -14
  163. data/locale/cs/katello.po +137 -14
  164. data/locale/de/katello.po +138 -15
  165. data/locale/en/katello.po +137 -14
  166. data/locale/es/katello.po +138 -15
  167. data/locale/fr/katello.po +138 -15
  168. data/locale/gu/katello.po +137 -14
  169. data/locale/hi/katello.po +137 -14
  170. data/locale/it/katello.po +138 -15
  171. data/locale/ja/katello.po +138 -15
  172. data/locale/katello.pot +969 -769
  173. data/locale/kn/katello.po +137 -14
  174. data/locale/ko/katello.po +138 -15
  175. data/locale/mr/katello.po +137 -14
  176. data/locale/or/katello.po +137 -14
  177. data/locale/pa/katello.po +137 -14
  178. data/locale/pt/katello.po +137 -14
  179. data/locale/pt_BR/katello.po +138 -15
  180. data/locale/ru/katello.po +138 -15
  181. data/locale/ta/katello.po +137 -14
  182. data/locale/te/katello.po +137 -14
  183. data/locale/zh_CN/katello.po +138 -15
  184. data/locale/zh_TW/katello.po +138 -15
  185. data/package.json +8 -25
  186. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +3 -0
  187. data/webpack/components/ActionableDetail.js +63 -0
  188. data/webpack/components/Content/ContentTable.js +2 -2
  189. data/webpack/components/Content/Details/ContentDetailRepositoryTableSchema.js +1 -1
  190. data/webpack/components/Content/Details/ContentDetails.js +1 -1
  191. data/webpack/components/Content/__tests__/ContentTable.test.js +2 -2
  192. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +1 -1
  193. data/webpack/components/EditableSwitch.js +30 -0
  194. data/webpack/components/EditableTextInput/EditableTextInput.js +120 -0
  195. data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +52 -0
  196. data/webpack/components/EditableTextInput/editableTextInput.scss +14 -0
  197. data/webpack/components/EditableTextInput/index.js +3 -0
  198. data/webpack/{scenes/ContentViews/components → components}/Loading.js +8 -5
  199. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.js +0 -0
  200. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.scss +0 -0
  201. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.test.js +0 -0
  202. data/webpack/{move_to_pf → components}/LoadingState/__snapshots__/LoadingState.test.js.snap +0 -0
  203. data/webpack/{move_to_pf → components}/LoadingState/index.js +0 -0
  204. data/webpack/components/MultiSelect/index.js +1 -1
  205. data/webpack/{move_to_pf → components}/OptionTooltip/OptionTooltip.scss +0 -0
  206. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/OptionTooltip.test.js +0 -0
  207. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +0 -0
  208. data/webpack/{move_to_pf → components}/OptionTooltip/index.js +0 -0
  209. data/webpack/components/Search/Search.js +124 -0
  210. data/webpack/components/Search/Search.test.js +2 -1
  211. data/webpack/components/Search/__snapshots__/Search.test.js.snap +2 -0
  212. data/webpack/components/Search/__tests__/search.test.js +124 -0
  213. data/webpack/components/Search/index.js +11 -87
  214. data/webpack/{move_to_pf → components}/Select/Select.js +0 -0
  215. data/webpack/components/SelectOrg/SetOrganization.js +2 -2
  216. data/webpack/components/TabWrapper/TabWrapper.js +26 -0
  217. data/webpack/components/TabWrapper/index.js +3 -0
  218. data/webpack/components/TabbedView/TabbedView.js +38 -0
  219. data/webpack/components/TabbedView/TabbedView.scss +3 -0
  220. data/webpack/components/TabbedView/index.js +3 -0
  221. data/webpack/components/Table/EmptyStateMessage.js +61 -0
  222. data/webpack/{scenes/ContentViews/Table/TableWrapper.js → components/Table/MainTable.js} +23 -12
  223. data/webpack/components/Table/TableWrapper.js +94 -0
  224. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.js +0 -0
  225. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.scss +0 -0
  226. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.test.js +0 -0
  227. data/webpack/{move_to_pf → components}/TooltipButton/__snapshots__/TooltipButton.test.js.snap +0 -0
  228. data/webpack/{move_to_pf → components}/TooltipButton/index.js +0 -0
  229. data/webpack/components/TypeAhead/TypeAhead.js +109 -0
  230. data/webpack/{move_to_pf → components}/TypeAhead/TypeAhead.scss +0 -0
  231. data/webpack/components/TypeAhead/helpers/commonPropTypes.js +35 -0
  232. data/webpack/components/TypeAhead/helpers/helpers.js +32 -0
  233. data/webpack/components/TypeAhead/index.js +3 -0
  234. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadInput.js +3 -6
  235. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadItems.js +3 -7
  236. data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +52 -0
  237. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +44 -0
  238. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +11 -0
  239. data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +57 -0
  240. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +66 -0
  241. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.scss +5 -0
  242. data/webpack/components/extensions/about/__tests__/SystemStatuses.test.js +1 -1
  243. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.js +0 -0
  244. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.test.js +0 -0
  245. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.js +0 -0
  246. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.test.js +0 -0
  247. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.js +0 -0
  248. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.test.js +0 -0
  249. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.js +0 -0
  250. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.test.js +0 -0
  251. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableFixtures.js +0 -0
  252. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.js +0 -0
  253. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.test.js +0 -0
  254. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.js +0 -0
  255. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.test.js +0 -0
  256. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +0 -0
  257. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/Table.test.js.snap +0 -0
  258. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBody.test.js.snap +0 -0
  259. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBodyMessage.test.js.snap +0 -0
  260. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionCell.test.js.snap +0 -0
  261. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +0 -0
  262. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/index.js +0 -0
  263. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/EntitlementsInlineEditFormatter.js +1 -1
  264. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/EntitlementsInlineEditFormatter.test.js +0 -0
  265. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +0 -0
  266. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/cellFormatter.js +0 -0
  267. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/collapseableAndSelectionCellFormatter.js +0 -0
  268. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/ellipsisCellFormatter.js +0 -0
  269. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/headerFormatter.js +0 -0
  270. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/index.js +0 -0
  271. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionCellFormatter.js +0 -0
  272. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionHeaderCellFormatter.js +0 -0
  273. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/index.js +0 -0
  274. data/webpack/{move_to_pf → components}/react-bootstrap-select/index.js +0 -0
  275. data/webpack/containers/Application/config.js +5 -0
  276. data/webpack/containers/Application/overrides.scss +5 -0
  277. data/webpack/global_test_setup.js +3 -1
  278. data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +1 -1
  279. data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsActions.test.js +2 -2
  280. data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
  281. data/webpack/redux/actions/RedHatRepositories/helpers.js +1 -1
  282. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +1 -1
  283. data/webpack/redux/reducers/index.js +2 -0
  284. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +1 -1
  285. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +1 -1
  286. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +1 -1
  287. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +2 -2
  288. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +1 -1
  289. data/webpack/scenes/ContentViews/ContentViewSelectors.js +1 -2
  290. data/webpack/scenes/ContentViews/ContentViewsActions.js +4 -4
  291. data/webpack/scenes/ContentViews/ContentViewsConstants.js +4 -1
  292. data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -6
  293. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +44 -0
  294. data/webpack/scenes/ContentViews/Details/ContentViewDetailReducer.js +23 -0
  295. data/webpack/scenes/ContentViews/{details → Details}/ContentViewDetailSelectors.js +3 -0
  296. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +70 -0
  297. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +116 -0
  298. data/webpack/scenes/ContentViews/{details → Details}/DetailsContainer.js +8 -4
  299. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +101 -0
  300. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetails.fixtures.json +106 -0
  301. data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +8 -0
  302. data/webpack/scenes/ContentViews/Details/index.js +7 -0
  303. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +51 -36
  304. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +47 -44
  305. data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +31 -0
  306. data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +2 -1
  307. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +173 -23
  308. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +26 -0
  309. data/webpack/scenes/ContentViews/components/{contentViewName.scss → contentViewIcon.scss} +0 -0
  310. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +1 -1
  311. data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +1 -1
  312. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +2 -2
  313. data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +1 -1
  314. data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +1 -1
  315. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +1 -1
  316. data/webpack/scenes/Organizations/OrganizationSelectors.js +14 -0
  317. data/webpack/scenes/Products/ProductActions.js +1 -1
  318. data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +1 -1
  319. data/webpack/scenes/Settings/SettingsConstants.js +3 -0
  320. data/webpack/scenes/Settings/SettingsReducer.js +33 -0
  321. data/webpack/scenes/Settings/SettingsSelectors.js +4 -0
  322. data/webpack/scenes/Settings/index.js +2 -1
  323. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
  324. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +1 -1
  325. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +59 -73
  326. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.scss +15 -0
  327. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +43 -1
  328. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +8 -0
  329. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -1
  330. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +78 -0
  331. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +2 -0
  332. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +56 -1
  333. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +114 -0
  334. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -6
  335. data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +36 -0
  336. data/webpack/scenes/Subscriptions/Manifest/index.js +3 -1
  337. data/webpack/scenes/Subscriptions/SubscriptionActions.js +1 -1
  338. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +4 -0
  339. data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +0 -3
  340. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +38 -11
  341. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +30 -18
  342. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
  343. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +1 -1
  344. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +2 -2
  345. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -1
  346. data/webpack/scenes/Subscriptions/__tests__/SubscriptionHelpers.test.js +0 -11
  347. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
  348. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +4 -4
  349. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +26 -1
  350. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +2 -2
  351. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +27 -21
  352. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +6 -2
  353. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
  354. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +3 -3
  355. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +1 -1
  356. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -3
  357. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +5 -10
  358. data/webpack/scenes/Subscriptions/index.js +6 -2
  359. data/webpack/test-utils/nockWrapper.js +39 -5
  360. data/webpack/test-utils/react-testing-lib-wrapper.js +35 -9
  361. data/webpack/{move_to_foreman/common → utils}/helpers.js +12 -8
  362. data/webpack/utils/useEventListener.js +37 -0
  363. metadata +143 -83
  364. data/app/lib/actions/katello/repository/verify_checksum.rb +0 -28
  365. data/app/lib/actions/pulp3/orchestration/repository/trigger_update_repo_cert_guard.rb +0 -22
  366. data/app/lib/actions/pulp3/repository/presenters/repair_presenter.rb +0 -85
  367. data/app/lib/actions/pulp3/repository/repair.rb +0 -29
  368. data/app/services/katello/host_trace_manager.rb +0 -38
  369. data/vendor/assets/stylesheets/katello/jquery.loadmask.css.scss +0 -40
  370. data/vendor/assets/stylesheets/katello/ui.spinner.css.scss +0 -3
  371. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
  372. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalSelectors.js +0 -2
  373. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -4
  374. data/webpack/__mocks__/foremanReact/components/Settings/SettingsActions.js +0 -4
  375. data/webpack/__mocks__/foremanReact/components/Settings/SettingsConstants.js +0 -2
  376. data/webpack/move_to_pf/TypeAhead/TypeAhead.js +0 -138
  377. data/webpack/move_to_pf/TypeAhead/helpers.js +0 -5
  378. data/webpack/scenes/ContentViews/components/ContentViewName.js +0 -33
  379. data/webpack/scenes/ContentViews/components/EmptyStateMessage.js +0 -43
  380. data/webpack/scenes/ContentViews/details/ContentViewDetailActions.js +0 -12
  381. data/webpack/scenes/ContentViews/expansions/RepositoriesExpansion.js +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e3320c3167ac19ebd8119f1d4e58f0dcc141a4a18e4bccc98f1a4965e09262d
4
- data.tar.gz: a9d5092691dca107610bfae636df54566cc07bf9fdf724d4c2e96312c3fdca9b
3
+ metadata.gz: bf008f8880960ad2a6cf9b615c0e0801fb38cce104e67001f4d17178cca43ab7
4
+ data.tar.gz: d2cda17cc4664479ac34f7abd33c08f14ef81f038abb0cfe3d43c9542624c48b
5
5
  SHA512:
6
- metadata.gz: 263362175e3deffd8bb979fd7464447b66524ccf5156a2a9836ae92b8ccd615b443202e3072309cc8d2d870ff899ddb4256887a5385c0fe860eb903b4b6a7066
7
- data.tar.gz: af6e7d83da1cb8ac22dd279156e076cc42e605fb4f5b968d9e027f19903c3a819ebec6c8149f4a2f16ef43a9b3d5d34bb7ed4359c9b6b86e041ce0180c486a6a
6
+ metadata.gz: 27f052edff77986139ef6a82d0cd318c95b90a601a9f42178038896589c1042b1e18d030320173ae2c5a21ac75bfe09b13e7376525574f7dbff9d33b4867b8fa
7
+ data.tar.gz: 22f05c56710ee8951e1d15d30e5b2d471ab07f17287c51c01b7958e751442197fe89b8d262eb89584e612bba939aad7e8d7ddd407d55937d31a04d00e1df8e10
@@ -1,10 +1,3 @@
1
- /**
2
- * = require "katello/jquery.loadmask.css"
3
- * = require "katello/jquery-ui-1.8.11.custom.css"
4
- * = require "katello/jquery.treeTable.css"
5
- * = require "katello/ui.spinner.css"
6
- */
7
-
8
1
  @import "katello/overrides";
9
2
  @import "katello/katello_base";
10
3
  @import "katello/look";
@@ -18,6 +11,9 @@
18
11
  @import "katello/generic";
19
12
  @import "katello/notifications";
20
13
 
14
+ @import "katello/jquery.treeTable";
15
+ @import "katello/jquery-ui-1.8.11.custom.css";
16
+
21
17
  body {
22
18
  background-color: white;
23
19
  }
@@ -480,7 +480,7 @@ module Katello
480
480
  else
481
481
  User.consumer? || ::User.current.can?(:view_organizations, self)
482
482
  end
483
- when "rhsm_proxy_owner_servicelevels_path", "rhsm_proxy_owner_system_purpose_path"
483
+ when "rhsm_proxy_owner_servicelevels_path"
484
484
  (User.consumer? || ::User.current.can?(:view_organizations, self))
485
485
  when "rhsm_proxy_consumer_accessible_content_path", "rhsm_proxy_consumer_certificates_path",
486
486
  "rhsm_proxy_consumer_releases_path", "rhsm_proxy_certificate_serials_path",
@@ -1,4 +1,5 @@
1
1
  module Katello
2
+ # rubocop:disable Metrics/ClassLength
2
3
  class Api::V2::ActivationKeysController < Api::V2::ApiController
3
4
  include Katello::Concerns::FilteredAutoCompleteSearch
4
5
  include Katello::Concerns::Api::V2::ContentOverridesController
@@ -11,6 +12,7 @@ module Katello
11
12
  :content_override, :add_subscriptions, :remove_subscriptions,
12
13
  :subscriptions]
13
14
  before_action :authorize
15
+ before_action :verify_simple_content_access_disabled, :only => [:add_subscriptions]
14
16
 
15
17
  wrap_parameters :include => (ActivationKey.attribute_names + %w(host_collection_ids service_level auto_attach purpose_role purpose_usage purpose_addons content_view_environment))
16
18
 
@@ -348,5 +350,11 @@ module Katello
348
350
 
349
351
  key_params
350
352
  end
353
+
354
+ def verify_simple_content_access_disabled
355
+ if @activation_key.organization.simple_content_access?
356
+ fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
357
+ end
358
+ end
351
359
  end
352
360
  end
@@ -39,7 +39,9 @@ module Katello
39
39
  respond_for_index :collection => @collection
40
40
  end
41
41
 
42
- def index_response
42
+ def index_response(reload_host = false)
43
+ # Host needs to be reloaded because of lazy accessor
44
+ @host.reload if reload_host
43
45
  entitlements = @host.subscription_facet.candlepin_consumer.entitlements
44
46
  subscriptions = entitlements.map { |entitlement| ::Katello::HostSubscriptionPresenter.new(entitlement) }
45
47
  full_result_response(subscriptions)
@@ -53,7 +55,7 @@ module Katello
53
55
  end
54
56
 
55
57
  sync_task(::Actions::Katello::Host::AutoAttachSubscriptions, @host)
56
- respond_for_index(:collection => index_response, :template => "index")
58
+ respond_for_index(:collection => index_response(true), :template => "index")
57
59
  end
58
60
 
59
61
  api :DELETE, "/hosts/:host_id/subscriptions/", N_("Unregister the host as a subscription consumer")
@@ -124,7 +126,7 @@ module Katello
124
126
  end
125
127
 
126
128
  sync_task(::Actions::Katello::Host::RemoveSubscriptions, @host, pool_id_quantities.values)
127
- respond_for_index(:collection => index_response, :template => "index")
129
+ respond_for_index(:collection => index_response(true), :template => "index")
128
130
  end
129
131
 
130
132
  api :PUT, "/hosts/:host_id/subscriptions/add_subscriptions", N_("Add a subscription to a host")
@@ -134,12 +136,16 @@ module Katello
134
136
  param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
135
137
  end
136
138
  def add_subscriptions
139
+ if @host.organization.simple_content_access?
140
+ fail ::Katello::HttpErrors::BadRequest, _("This host's organization is in Simple Content Access mode. Attaching subscriptions is disabled.")
141
+ end
142
+
137
143
  pools_with_quantities = params.require(:subscriptions).map do |sub_params|
138
144
  PoolWithQuantities.new(Pool.with_identifier(sub_params['id']), sub_params['quantity'].to_i)
139
145
  end
140
146
 
141
147
  sync_task(::Actions::Katello::Host::AttachSubscriptions, @host, pools_with_quantities)
142
- respond_for_index(:collection => index_response, :template => "index")
148
+ respond_for_index(:collection => index_response(true), :template => "index")
143
149
  end
144
150
 
145
151
  api :PUT, "/hosts/:host_id/subscriptions/content_override", N_("Set content overrides for the host")
@@ -1,6 +1,6 @@
1
1
  module Katello
2
2
  class Api::V2::HostTracerController < Api::V2::ApiController
3
- before_action :find_host
3
+ before_action :find_host, :only => :index
4
4
 
5
5
  resource_description do
6
6
  api_version 'v2'
@@ -14,18 +14,43 @@ module Katello
14
14
  respond_for_index(:collection => collection)
15
15
  end
16
16
 
17
- api :PUT, "/hosts/:host_id/traces/resolve", N_("Resolve Traces")
18
- param :host_id, :number, :required => true, :desc => N_("ID of the host")
17
+ api :PUT, "/traces/resolve", N_("Resolve Traces")
19
18
  param :trace_ids, Array, :required => true, :desc => N_("Array of Trace IDs")
20
19
  def resolve
21
- traces = @host.host_traces.resolvable.where(id: params[:trace_ids])
22
- fail HttpErrors::BadRequest, _("The requested traces were not found for this host") if traces.empty?
20
+ traces = Katello::HostTracer.resolvable.where(id: params[:trace_ids])
21
+
22
+ traces.each do |trace|
23
+ if trace.reboot_required?
24
+ trace.helper = 'reboot'
25
+ end
26
+ end
27
+
28
+ traces_by_host_id = traces.group_by(&:host_id)
29
+ traces_by_helper = traces.group_by(&:helper)
30
+
31
+ composers = []
32
+
33
+ if traces_by_host_id.size < traces_by_helper.size
34
+ traces_by_host_id.each do |host_id, trace|
35
+ needed_traces = trace.map(&:helper).join(',')
36
+ joined_helpers = { :helper => needed_traces }
37
+ composers << JobInvocationComposer.for_feature(:katello_service_restart, [host_id], joined_helpers)
38
+ end
39
+ else
40
+ traces_by_helper.each do |helper, trace|
41
+ helpers = { :helper => helper }
42
+ composers << JobInvocationComposer.for_feature(:katello_service_restart, trace.map(&:host_id), helpers)
43
+ end
44
+ end
23
45
 
24
- result = Katello::HostTraceManager.resolve_traces(traces)
46
+ job_invocations = []
25
47
 
26
- task = ForemanTasks::Task.find(result.first.task_id)
48
+ composers.each do |composer|
49
+ composer.trigger
50
+ job_invocations << composer.job_invocation
51
+ end
27
52
 
28
- respond_for_async(resource: task)
53
+ render json: job_invocations
29
54
  end
30
55
 
31
56
  protected
@@ -6,13 +6,15 @@ module Katello
6
6
  before_action :find_host_collections, :only => [:bulk_add_host_collections, :bulk_remove_host_collections]
7
7
  before_action :find_environment, :only => [:environment_content_view]
8
8
  before_action :find_content_view, :only => [:environment_content_view]
9
- before_action :find_editable_hosts, :except => [:destroy_hosts, :applicable_errata, :installable_errata, :resolve_traces]
9
+ before_action :find_editable_hosts, :except => [:destroy_hosts, :applicable_errata, :installable_errata]
10
10
  before_action :find_deletable_hosts, :only => [:destroy_hosts]
11
11
  before_action :find_readable_hosts, :only => [:applicable_errata, :installable_errata, :available_incremental_updates]
12
12
  before_action :find_errata, :only => [:available_incremental_updates]
13
+ before_action :find_organization, :only => [:add_subscriptions]
13
14
  before_action :deprecate_katello_agent, :only => [:install_content, :update_content, :remove_content]
14
15
 
15
16
  before_action :validate_content_action, :only => [:install_content, :update_content, :remove_content]
17
+ before_action :validate_organization, :only => [:add_subscriptions]
16
18
 
17
19
  # disable *_count fields on erratum rabl, since they perform N+1 queries
18
20
  before_action :disable_erratum_hosts_count
@@ -173,6 +175,10 @@ module Katello
173
175
  param :quantity, :number, :desc => N_("Quantity of this subscriptions to add"), :required => true
174
176
  end
175
177
  def add_subscriptions
178
+ if @organization.simple_content_access?
179
+ fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
180
+ end
181
+
176
182
  pools_with_quantities = params.require(:subscriptions).map do |sub_params|
177
183
  PoolWithQuantities.new(Pool.find(sub_params['id']), sub_params['quantity'])
178
184
  end
@@ -230,16 +236,6 @@ module Katello
230
236
  respond_for_index(:collection => collection, :template => '../../../api/v2/host_tracer/index')
231
237
  end
232
238
 
233
- api :PUT, "/hosts/bulk/resolve_traces", N_("Resolve traces for one or more hosts")
234
- param_group :bulk_params
235
- param :trace_ids, Array, :required => true, :desc => N_("Array of Trace IDs")
236
- def resolve_traces
237
- traces = Katello::HostTracer.resolvable.where(id: params[:trace_ids])
238
- result = Katello::HostTraceManager.resolve_traces(traces)
239
-
240
- render json: result
241
- end
242
-
243
239
  api :POST, "/hosts/bulk/available_incremental_updates", N_("Given a set of hosts and errata, lists the content view versions" \
244
240
  " and environments that need updating.")
245
241
  param_group :bulk_params
@@ -305,6 +301,10 @@ module Katello
305
301
  find_bulk_hosts(:destroy_hosts, params)
306
302
  end
307
303
 
304
+ def validate_organization
305
+ fail HttpErrors::BadRequest, _("Organization ID is required") if @organization.blank?
306
+ end
307
+
308
308
  def validate_host_collection_membership_limit
309
309
  max_hosts_exceeded = []
310
310
  host_ids = @hosts.map(&:id)
@@ -50,21 +50,6 @@ module Katello
50
50
  respond_for_async :resource => task
51
51
  end
52
52
 
53
- api :PUT, "/products/bulk/verify_checksum", N_("Verify checksum for one or more products")
54
- param :ids, Array, :desc => N_("List of product ids"), :required => true
55
- def verify_checksum_products
56
- repairable_products = @products.syncable
57
- repairable_roots = RootRepository.where(:product_id => repairable_products).
58
- where(:content_type => ::Katello::Repository::YUM_TYPE).has_url.select { |r| r.library_instance }.uniq
59
-
60
- repairable_repositories = Katello::Repository.where(:root_id => repairable_roots)
61
- task = async_task(::Actions::BulkAction,
62
- ::Actions::Katello::Repository::VerifyChecksum,
63
- repairable_repositories)
64
-
65
- respond_for_async :resource => task
66
- end
67
-
68
53
  api :PUT, "/products/bulk/http_proxy", N_("Update the HTTP proxy configuration on the repositories of one or more products.")
69
54
  param :ids, Array, :desc => N_("List of product ids"), :required => true
70
55
  param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policy for HTTP proxy for content sync")
@@ -15,7 +15,7 @@ module Katello
15
15
  before_action :find_organization_from_product, :only => [:create]
16
16
  before_action :find_repository, :only => [:show, :update, :destroy, :sync, :export,
17
17
  :remove_content, :upload_content, :republish,
18
- :import_uploads, :gpg_key_content, :verify_checksum]
18
+ :import_uploads, :gpg_key_content]
19
19
  before_action :find_content, :only => :remove_content
20
20
  before_action :find_organization_from_repo, :only => [:update]
21
21
  before_action :error_on_rh_product, :only => [:create]
@@ -57,6 +57,7 @@ module Katello
57
57
  param :ansible_collection_requirements, String, :desc => N_("Contents of requirement yaml file to sync from URL")
58
58
  param :http_proxy_policy, ::Katello::RootRepository::HTTP_PROXY_POLICIES, :desc => N_("policies for HTTP proxy for content sync")
59
59
  param :http_proxy_id, :number, :desc => N_("ID of a HTTP Proxy")
60
+ param :auto_enabled, :bool, :desc => N_("if true, the repositories will be automatically enabled on a registered host subscribed to this product. Default: true")
60
61
  end
61
62
 
62
63
  def_param_group :repo_create do
@@ -294,15 +295,6 @@ module Katello
294
295
  raise HttpErrors::BadRequest, e.message
295
296
  end
296
297
 
297
- api :POST, "/repositories/:id/verify_checksum", N_("Verify checksum of repository contents")
298
- param :id, :number, :required => true, :desc => N_("repository ID")
299
- def verify_checksum
300
- task = async_task(::Actions::Katello::Repository::VerifyChecksum, @repository)
301
- respond_for_async :resource => task
302
- rescue Errors::InvalidActionOptionError => e
303
- raise HttpErrors::BadRequest, e.message
304
- end
305
-
306
298
  api :POST, "/repositories/:id/export", N_("Export a repository")
307
299
  param :id, :number, :desc => N_("Repository identifier"), :required => true
308
300
  param :export_to_iso, :bool, :desc => N_("Export to ISO format"), :required => false
@@ -336,6 +328,7 @@ module Katello
336
328
  api :PUT, "/repositories/:id", N_("Update a repository")
337
329
  param :id, :number, :required => true, :desc => N_("repository ID")
338
330
  param :name, String, :required => false
331
+ param :description, String, :desc => N_("description of the repository"), :required => false
339
332
  param_group :repo
340
333
  def update
341
334
  repo_params = repository_params
@@ -472,7 +465,7 @@ module Katello
472
465
 
473
466
  def repository_params
474
467
  keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username,
475
- :ostree_upstream_sync_depth, :ostree_upstream_sync_policy,
468
+ :ostree_upstream_sync_depth, :ostree_upstream_sync_policy, :auto_enabled,
476
469
  :deb_releases, :deb_components, :deb_architectures, :description, :http_proxy_policy, :http_proxy_id,
477
470
  {:ignorable_content => []}
478
471
  ]
@@ -523,6 +516,7 @@ module Katello
523
516
  root.ansible_collection_requirements = repo_params[:ansible_collection_requirements] if root.ansible_collection?
524
517
  root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
525
518
  root.http_proxy_id = repo_params[:http_proxy_id] if repo_params.key?(:http_proxy_id)
519
+ root.auto_enabled = repo_params[:auto_enabled] if repo_params.key?(:auto_enabled)
526
520
 
527
521
  if root.ostree?
528
522
  root.ostree_upstream_sync_policy = repo_params[:ostree_upstream_sync_policy]
@@ -77,6 +77,22 @@ module Katello
77
77
  render json: { status: 'OK' }
78
78
  end
79
79
 
80
+ api :PUT, "/organizations/:organization_id/simple_content_access/enable",
81
+ N_("Enable simple content access for a manifest")
82
+ param :organization_id, :number, :desc => N_("Organization ID"), :required => true
83
+ def enable_simple_content_access
84
+ task = async_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:organization_id])
85
+ respond_for_async :resource => task
86
+ end
87
+
88
+ api :PUT, "/organizations/:organization_id/simple_content_access/disable",
89
+ N_("Disable simple content access for a manifest")
90
+ param :organization_id, :number, :desc => N_("Organization ID"), :required => true
91
+ def disable_simple_content_access
92
+ task = async_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:organization_id])
93
+ respond_for_async :resource => task
94
+ end
95
+
80
96
  private
81
97
 
82
98
  def update_params
@@ -5,19 +5,19 @@ module Katello
5
5
 
6
6
  def find_bulk_hosts(permission, bulk_params, restrict_to = nil)
7
7
  #works on a structure of param_group bulk_params and transforms it into a list of systems
8
- organization = find_organization
8
+ find_organization
9
9
  bulk_params[:included] ||= {}
10
10
  bulk_params[:excluded] ||= {}
11
11
  @hosts = []
12
12
 
13
13
  unless bulk_params[:included][:ids].blank?
14
14
  @hosts = ::Host::Managed.authorized(permission).where(:id => bulk_params[:included][:ids])
15
- @hosts = @hosts.where(:organization_id => organization.id) if organization
15
+ @hosts = @hosts.where(:organization_id => @organization.id) if @organization
16
16
  end
17
17
 
18
18
  if bulk_params[:included][:search]
19
19
  search_hosts = ::Host::Managed.authorized(permission)
20
- search_hosts = search_hosts.where(:organization_id => organization_id) if params[:organization_id]
20
+ search_hosts = search_hosts.where(:organization_id => @organization.id) if @organization
21
21
  search_hosts = search_hosts.search_for(bulk_params[:included][:search])
22
22
  if @hosts.any?
23
23
  @hosts = ::Host.where(id: @hosts).or(::Host.where(id: search_hosts))
@@ -38,7 +38,7 @@ module Katello
38
38
  end
39
39
 
40
40
  def find_organization
41
- Organization.find_by_id(params[:organization_id])
41
+ @organization ||= Organization.find_by_id(params[:organization_id])
42
42
  end
43
43
  end
44
44
  end
@@ -20,7 +20,7 @@ module Katello
20
20
  include ApiPieExtensions
21
21
 
22
22
  def create
23
- @hostgroup = Hostgroup.new(hostgroup_params)
23
+ @hostgroup = ::Hostgroup.new(hostgroup_params)
24
24
  process_response @hostgroup.save
25
25
  end
26
26
 
@@ -19,17 +19,11 @@ module Katello
19
19
  prepend Overrides
20
20
 
21
21
  def update_multiple_taxonomies(type)
22
- if type == :organization
23
- new_org_id = params.dig(type, 'id')
24
-
25
- if new_org_id
26
- registered_host = @hosts.where.not(organization_id: new_org_id).joins(:subscription_facet).first
27
- if registered_host
28
- error _("Unregister host %s before assigning an organization") % registered_host.name
29
- redirect_back_or_to hosts_path
30
- return
31
- end
32
- end
22
+ registered_host = @hosts.detect { |host| host.subscription_facet }
23
+ unless registered_host.nil?
24
+ error _("Unregister host %s before assigning an organization") % registered_host.name
25
+ redirect_back_or_to hosts_path
26
+ return
33
27
  end
34
28
 
35
29
  super
@@ -28,6 +28,16 @@ module Katello
28
28
  def unsubscribed_hypervisor_count
29
29
  host_query.search_for("subscription_status = unsubscribed_hypervisor").size
30
30
  end
31
+
32
+ def removed_widgets
33
+ widgets = super
34
+
35
+ if Organization.current&.simple_content_access?
36
+ widgets.reject! { |widget| ::Widget.singleton_class::SUBSCRIPTION_TEMPLATES.include? widget[:template] }
37
+ end
38
+
39
+ widgets
40
+ end
31
41
  end
32
42
  end
33
43
  end
@@ -15,7 +15,7 @@ module Katello
15
15
  end
16
16
 
17
17
  def organizations(host)
18
- if host.is_a?(Hostgroup)
18
+ if host.is_a?(::Hostgroup)
19
19
  host.organizations
20
20
  else
21
21
  host.organization ? [host.organization] : []
@@ -29,8 +29,7 @@ module Katello
29
29
 
30
30
  def host_hostgroup_kickstart_repository_id(host)
31
31
  return if host.blank?
32
- return host.kickstart_repository_id if host.is_a?(Hostgroup)
33
- host.content_facet.kickstart_repository_id if host.try(:content_facet).present?
32
+ host.content_facet&.kickstart_repository_id
34
33
  end
35
34
 
36
35
  def kickstart_repository_id(host, options = {})
@@ -78,13 +77,13 @@ module Katello
78
77
 
79
78
  def accessible_lifecycle_environments(org, host)
80
79
  selected = host.lifecycle_environment
81
- envs = org.kt_environments.readable
80
+ envs = org.kt_environments.readable.order(:name)
82
81
  envs |= [selected] if selected.present? && org == selected.organization
83
82
  envs
84
83
  end
85
84
 
86
85
  def accessible_content_proxies(obj)
87
- list = accessible_resource_records(:smart_proxy).with_content.to_a
86
+ list = accessible_resource_records(:smart_proxy).with_content.order(:name).to_a
88
87
  current = obj.content_source
89
88
  list |= [current] if current.present?
90
89
  list
@@ -159,7 +158,7 @@ module Katello
159
158
 
160
159
  views = []
161
160
  if lifecycle_environment
162
- views = Katello::ContentView.in_environment(lifecycle_environment).readable
161
+ views = Katello::ContentView.in_environment(lifecycle_environment).readable.order(:name)
163
162
  views |= [content_view] if content_view.present? && content_view.in_environment?(lifecycle_environment)
164
163
  elsif content_view
165
164
  views = [content_view]
@@ -205,7 +204,7 @@ module Katello
205
204
 
206
205
  return [] unless new_host.operatingsystem.is_a?(Redhat)
207
206
 
208
- if (host.is_a? Hostgroup)
207
+ if (host.is_a? ::Hostgroup)
209
208
  new_host.content_facet = ::Katello::Host::ContentFacet.new(:lifecycle_environment_id => host.inherited_lifecycle_environment_id,
210
209
  :content_view_id => host.inherited_content_view_id,
211
210
  :content_source_id => host.inherited_content_source_id)
@@ -6,11 +6,12 @@ module Actions
6
6
  param :product_id
7
7
  param :content_id
8
8
  param :owner
9
+ param :enabled
9
10
  end
10
11
 
11
12
  def run
12
13
  output[:response] = ::Katello::Resources::Candlepin::Product.
13
- add_content(input[:owner], input[:product_id], input[:content_id], true)
14
+ add_content(input[:owner], input[:product_id], input[:content_id], input[:enabled])
14
15
  end
15
16
  end
16
17
  end
@@ -0,0 +1,18 @@
1
+ module Actions
2
+ module Candlepin
3
+ module Product
4
+ class ContentUpdateEnablement < Candlepin::Abstract
5
+ input_format do
6
+ param :content_enablements
7
+ param :owner
8
+ param :product_id
9
+ end
10
+
11
+ def run
12
+ output[:response] = ::Katello::Resources::Candlepin::Product.
13
+ update_enabled(input[:owner], input[:product_id], input[:content_enablements])
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -9,12 +9,8 @@ module Actions
9
9
 
10
10
  def run
11
11
  input[:host_ids].each do |host_id|
12
- content_facet = ::Katello::Host::ContentFacet.find_by_host_id(host_id)
13
- if content_facet.present?
14
- content_facet.calculate_and_import_applicability
15
- else
16
- Rails.logger.warn(_("Content Facet for host with id %s is non-existent. Skipping applicability calculation.") % host_id)
17
- end
12
+ content_facet = ::Host.find(host_id).content_facet
13
+ content_facet.calculate_and_import_applicability
18
14
  end
19
15
  end
20
16
 
@@ -37,7 +37,7 @@ module Actions
37
37
  current_repos_on_capsule = smart_proxy_service.current_repositories(environment, content_view)
38
38
  current_repos_on_capsule_ids = current_repos_on_capsule.pluck(:id)
39
39
 
40
- list_of_repos_to_sync = smart_proxy_helper.combined_repos_available_to_capsule(environment, content_view, repository)
40
+ list_of_repos_to_sync = smart_proxy_helper.repos_available_to_capsule(environment, content_view, repository)
41
41
  list_of_repos_to_sync.each do |repo|
42
42
  if repo.is_a?(Katello::ContentViewPuppetEnvironment)
43
43
  repo = repo.nonpersisted_repository
@@ -31,7 +31,7 @@ module Actions
31
31
  fail _("Action not allowed for the default smart proxy.") if smart_proxy.pulp_master?
32
32
 
33
33
  smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
34
- repositories = smart_proxy_helper.combined_repos_available_to_capsule(environment, content_view, repository)
34
+ repositories = smart_proxy_helper.repos_available_to_capsule(environment, content_view, repository)
35
35
 
36
36
  smart_proxy.ping_pulp if repositories.any? { |repo| !smart_proxy.pulp3_support?(repo) }
37
37
 
@@ -10,12 +10,11 @@ module Actions
10
10
  repository = options[:repository]
11
11
  skip_metadata_check = options.fetch(:skip_metadata_check, false)
12
12
 
13
+ smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
13
14
  sequence do
14
- repos = repos_to_sync(smart_proxy, environment, content_view, repository)
15
-
16
- repos.in_groups_of(Setting[:foreman_proxy_content_batch_size], false) do |repo_batch|
15
+ smart_proxy_helper.repos_available_to_capsule(environment, content_view, repository).in_groups_of(Setting[:foreman_proxy_content_batch_size], false) do |repos|
17
16
  concurrence do
18
- repo_batch.each do |repo|
17
+ repos.each do |repo|
19
18
  plan_pulp_action([Actions::Pulp::Orchestration::Repository::SmartProxySync,
20
19
  Actions::Pulp3::CapsuleContent::Sync],
21
20
  repo, smart_proxy,
@@ -34,19 +33,6 @@ module Actions
34
33
  end
35
34
  end
36
35
 
37
- def repos_to_sync(smart_proxy, environment, content_view, repository)
38
- smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
39
- smart_proxy_helper.lifecycle_environment_check(environment, repository)
40
-
41
- if repository
42
- [repository]
43
- else
44
- repositories = smart_proxy_helper.repositories_available_to_capsule(environment, content_view).by_rpm_count
45
- puppet_envs = smart_proxy_helper.puppet_environments_available_to_capsule(environment, content_view)
46
- repositories + puppet_envs
47
- end
48
- end
49
-
50
36
  def resource_locks
51
37
  :link
52
38
  end
@@ -266,9 +266,8 @@ module Actions
266
266
  history.status = ::Katello::ContentViewHistory::SUCCESSFUL
267
267
  history.save!
268
268
 
269
- cvv_yum_repos = version.repositories.yum_type
270
- unless cvv_yum_repos.empty? || SmartProxy.pulp_master.pulp3_support?(cvv_yum_repos.first)
271
- cvv_yum_repos.each do |repo|
269
+ unless SmartProxy.pulp_master.pulp3_support?(version.repositories.first)
270
+ version.repositories.each do |repo|
272
271
  SmartProxy.pulp_master.pulp_api.extensions.send(:module_default).
273
272
  copy(repo.library_instance.pulp_id,
274
273
  repo.pulp_id)
@@ -0,0 +1,17 @@
1
+ module Actions
2
+ module Katello
3
+ module Organization
4
+ module SimpleContentAccess
5
+ class Disable < Toggle
6
+ def content_access_mode_value
7
+ SIMPLE_CONTENT_ACCESS_DISABLED_VALUE
8
+ end
9
+
10
+ def humanized_name
11
+ N_("Disable Simple Content Access")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module Actions
2
+ module Katello
3
+ module Organization
4
+ module SimpleContentAccess
5
+ class Enable < Toggle
6
+ def content_access_mode_value
7
+ SIMPLE_CONTENT_ACCESS_ENABLED_VALUE
8
+ end
9
+
10
+ def humanized_name
11
+ N_("Enable Simple Content Access")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end