katello 3.16.0 → 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 (328) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/katello/katello.scss +3 -7
  3. data/app/controllers/katello/api/v2/activation_keys_controller.rb +8 -0
  4. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +10 -4
  5. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +10 -0
  6. data/app/controllers/katello/api/v2/repositories_controller.rb +4 -1
  7. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +16 -0
  8. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -4
  9. data/app/controllers/katello/concerns/api/v2/hostgroups_controller_extensions.rb +1 -1
  10. data/app/helpers/katello/concerns/dashboard_helper_extensions.rb +10 -0
  11. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +6 -7
  12. data/app/lib/actions/candlepin/product/content_add.rb +2 -1
  13. data/app/lib/actions/candlepin/product/content_update_enablement.rb +18 -0
  14. data/app/lib/actions/katello/capsule_content/sync.rb +2 -1
  15. data/app/lib/actions/katello/organization/simple_content_access/disable.rb +17 -0
  16. data/app/lib/actions/katello/organization/simple_content_access/enable.rb +17 -0
  17. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +36 -0
  18. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +13 -0
  19. data/app/lib/actions/katello/product/content_create.rb +3 -3
  20. data/app/lib/actions/katello/repository/content_update.rb +41 -0
  21. data/app/lib/actions/katello/repository/export.rb +1 -1
  22. data/app/lib/actions/katello/repository/update.rb +4 -20
  23. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +1 -0
  24. data/app/lib/actions/pulp3/capsule_content/refresh_content_guard.rb +17 -0
  25. data/app/lib/actions/pulp3/{ContentGuard → content_guard}/refresh.rb +0 -0
  26. data/app/lib/katello/concerns/base_template_scope_extensions.rb +4 -0
  27. data/app/lib/katello/resources/candlepin/product.rb +11 -0
  28. data/app/lib/katello/util/cdn_var_substitutor.rb +1 -0
  29. data/app/lib/katello/validators/hostgroup_kickstart_repository_validator.rb +11 -11
  30. data/app/models/katello/activation_key.rb +1 -1
  31. data/app/models/katello/concerns/content_facet_host_extensions.rb +7 -0
  32. data/app/models/katello/concerns/host_managed_extensions.rb +39 -0
  33. data/app/models/katello/concerns/hostgroup_extensions.rb +46 -24
  34. data/app/models/katello/concerns/smart_proxy_extensions.rb +2 -5
  35. data/app/models/katello/concerns/widget_extensions.rb +23 -0
  36. data/app/models/katello/content_view.rb +9 -1
  37. data/app/models/katello/content_view_version.rb +7 -0
  38. data/app/models/katello/erratum.rb +13 -0
  39. data/app/models/katello/erratum_cve.rb +8 -0
  40. data/app/models/katello/host/content_facet.rb +18 -0
  41. data/app/models/katello/host_collection.rb +6 -0
  42. data/app/models/katello/hostgroup/content_facet.rb +18 -0
  43. data/app/models/katello/installed_package.rb +8 -0
  44. data/app/models/katello/kt_environment.rb +9 -1
  45. data/app/models/katello/model.rb +16 -0
  46. data/app/models/katello/ping.rb +1 -3
  47. data/app/models/katello/pool.rb +17 -0
  48. data/app/models/katello/product.rb +6 -0
  49. data/app/models/katello/purpose_addons_status.rb +1 -0
  50. data/app/models/katello/purpose_role_status.rb +1 -0
  51. data/app/models/katello/purpose_sla_status.rb +1 -0
  52. data/app/models/katello/purpose_usage_status.rb +1 -0
  53. data/app/models/katello/repository.rb +3 -1
  54. data/app/models/katello/root_repository.rb +23 -11
  55. data/app/models/katello/subscription_status.rb +1 -1
  56. data/app/models/katello/trace_status.rb +1 -1
  57. data/app/models/setting/content.rb +5 -1
  58. data/app/services/katello/event_daemon.rb +7 -8
  59. data/app/services/katello/host_status_manager.rb +13 -0
  60. data/app/services/katello/pulp3/repository_mirror.rb +7 -2
  61. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
  62. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  63. data/config/routes/api/v2.rb +2 -0
  64. data/db/migrate/20141222151001_add_host_content_view_environment.rb +1 -1
  65. data/db/migrate/20180904122343_create_hostgroup_content_facet.katello.rb +16 -0
  66. data/db/migrate/20200514092553_move_katello_fields_from_hostgroups.katello.rb +53 -0
  67. data/db/migrate/20200610112009_remove_audits_of_root_repo_with_content_id.rb +9 -0
  68. data/db/migrate/20200701150946_add_auto_enabled_to_root_repository.rb +5 -0
  69. data/db/seeds.d/75-job_templates.rb +2 -2
  70. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +3 -1
  71. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-associations.controller.js +5 -2
  72. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +4 -2
  73. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-add-subscriptions.html +1 -1
  74. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-associations-content-hosts.html +2 -2
  75. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-details.html +1 -1
  76. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +4 -1
  77. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-packages-modal.controller.js +4 -1
  78. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -0
  79. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-environment-modal.html +7 -1
  80. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +1 -0
  81. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -0
  82. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +4 -2
  83. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.routes.js +1 -1
  84. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details-info.controller.js +7 -1
  85. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +4 -2
  86. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-add-subscriptions.html +1 -1
  87. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-details.html +1 -0
  88. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-info.html +14 -6
  89. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/views/content-host-subscriptions-list.html +1 -1
  90. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +6 -6
  91. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +5 -2
  92. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +1 -1
  93. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +45 -4
  94. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +1 -1
  95. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +1 -1
  96. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1 -1
  97. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +1 -1
  98. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +1 -1
  99. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +1 -1
  100. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +1 -1
  101. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +1 -1
  102. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +1 -1
  103. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +1 -1
  104. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +10 -0
  105. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +1 -1
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +14 -2
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  108. data/lib/katello/engine.rb +6 -5
  109. data/lib/katello/permission_creator.rb +1 -1
  110. data/lib/katello/plugin.rb +20 -17
  111. data/lib/katello/tasks/reports.rake +0 -12
  112. data/lib/katello/tasks/test.rake +15 -0
  113. data/lib/katello/version.rb +1 -1
  114. data/locale/action_names.rb +48 -48
  115. data/locale/bn/katello.po +137 -14
  116. data/locale/cs/katello.po +137 -14
  117. data/locale/de/katello.po +138 -15
  118. data/locale/en/katello.po +137 -14
  119. data/locale/es/katello.po +138 -15
  120. data/locale/fr/katello.po +138 -15
  121. data/locale/gu/katello.po +137 -14
  122. data/locale/hi/katello.po +137 -14
  123. data/locale/it/katello.po +138 -15
  124. data/locale/ja/katello.po +138 -15
  125. data/locale/katello.pot +969 -769
  126. data/locale/kn/katello.po +137 -14
  127. data/locale/ko/katello.po +138 -15
  128. data/locale/mr/katello.po +137 -14
  129. data/locale/or/katello.po +137 -14
  130. data/locale/pa/katello.po +137 -14
  131. data/locale/pt/katello.po +137 -14
  132. data/locale/pt_BR/katello.po +138 -15
  133. data/locale/ru/katello.po +138 -15
  134. data/locale/ta/katello.po +137 -14
  135. data/locale/te/katello.po +137 -14
  136. data/locale/zh_CN/katello.po +138 -15
  137. data/locale/zh_TW/katello.po +138 -15
  138. data/package.json +8 -25
  139. data/webpack/__mocks__/foremanReact/Root/Context/ForemanContext.js +3 -0
  140. data/webpack/components/ActionableDetail.js +63 -0
  141. data/webpack/components/Content/ContentTable.js +2 -2
  142. data/webpack/components/Content/Details/ContentDetailRepositoryTableSchema.js +1 -1
  143. data/webpack/components/Content/Details/ContentDetails.js +1 -1
  144. data/webpack/components/Content/__tests__/ContentTable.test.js +2 -2
  145. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +1 -1
  146. data/webpack/components/EditableSwitch.js +30 -0
  147. data/webpack/components/EditableTextInput/EditableTextInput.js +120 -0
  148. data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +52 -0
  149. data/webpack/components/EditableTextInput/editableTextInput.scss +14 -0
  150. data/webpack/components/EditableTextInput/index.js +3 -0
  151. data/webpack/{scenes/ContentViews/components → components}/Loading.js +8 -5
  152. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.js +0 -0
  153. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.scss +0 -0
  154. data/webpack/{move_to_pf → components}/LoadingState/LoadingState.test.js +0 -0
  155. data/webpack/{move_to_pf → components}/LoadingState/__snapshots__/LoadingState.test.js.snap +0 -0
  156. data/webpack/{move_to_pf → components}/LoadingState/index.js +0 -0
  157. data/webpack/components/MultiSelect/index.js +1 -1
  158. data/webpack/{move_to_pf → components}/OptionTooltip/OptionTooltip.scss +0 -0
  159. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/OptionTooltip.test.js +0 -0
  160. data/webpack/{move_to_pf → components}/OptionTooltip/__tests__/__snapshots__/OptionTooltip.test.js.snap +0 -0
  161. data/webpack/{move_to_pf → components}/OptionTooltip/index.js +0 -0
  162. data/webpack/components/Search/Search.js +124 -0
  163. data/webpack/components/Search/Search.test.js +2 -1
  164. data/webpack/components/Search/__snapshots__/Search.test.js.snap +2 -0
  165. data/webpack/components/Search/__tests__/search.test.js +124 -0
  166. data/webpack/components/Search/index.js +11 -87
  167. data/webpack/{move_to_pf → components}/Select/Select.js +0 -0
  168. data/webpack/components/SelectOrg/SetOrganization.js +2 -2
  169. data/webpack/components/TabWrapper/TabWrapper.js +26 -0
  170. data/webpack/components/TabWrapper/index.js +3 -0
  171. data/webpack/components/TabbedView/TabbedView.js +38 -0
  172. data/webpack/components/TabbedView/TabbedView.scss +3 -0
  173. data/webpack/components/TabbedView/index.js +3 -0
  174. data/webpack/components/Table/EmptyStateMessage.js +61 -0
  175. data/webpack/{scenes/ContentViews/Table/TableWrapper.js → components/Table/MainTable.js} +23 -12
  176. data/webpack/components/Table/TableWrapper.js +94 -0
  177. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.js +0 -0
  178. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.scss +0 -0
  179. data/webpack/{move_to_pf → components}/TooltipButton/TooltipButton.test.js +0 -0
  180. data/webpack/{move_to_pf → components}/TooltipButton/__snapshots__/TooltipButton.test.js.snap +0 -0
  181. data/webpack/{move_to_pf → components}/TooltipButton/index.js +0 -0
  182. data/webpack/components/TypeAhead/TypeAhead.js +109 -0
  183. data/webpack/{move_to_pf → components}/TypeAhead/TypeAhead.scss +0 -0
  184. data/webpack/components/TypeAhead/helpers/commonPropTypes.js +35 -0
  185. data/webpack/components/TypeAhead/helpers/helpers.js +32 -0
  186. data/webpack/components/TypeAhead/index.js +3 -0
  187. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadInput.js +3 -6
  188. data/webpack/{move_to_pf/TypeAhead → components/TypeAhead/pf3Search}/TypeAheadItems.js +3 -7
  189. data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +52 -0
  190. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +44 -0
  191. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +11 -0
  192. data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +57 -0
  193. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +66 -0
  194. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.scss +5 -0
  195. data/webpack/components/extensions/about/__tests__/SystemStatuses.test.js +1 -1
  196. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.js +0 -0
  197. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/CollapseSubscriptionGroupButton.test.js +0 -0
  198. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.js +0 -0
  199. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/Table.test.js +0 -0
  200. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.js +0 -0
  201. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBody.test.js +0 -0
  202. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.js +0 -0
  203. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableBodyMessage.test.js +0 -0
  204. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableFixtures.js +0 -0
  205. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.js +0 -0
  206. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionCell.test.js +0 -0
  207. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.js +0 -0
  208. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/TableSelectionHeaderCell.test.js +0 -0
  209. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +0 -0
  210. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/Table.test.js.snap +0 -0
  211. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBody.test.js.snap +0 -0
  212. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableBodyMessage.test.js.snap +0 -0
  213. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionCell.test.js.snap +0 -0
  214. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +0 -0
  215. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/components/index.js +0 -0
  216. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/EntitlementsInlineEditFormatter.js +1 -1
  217. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/EntitlementsInlineEditFormatter.test.js +0 -0
  218. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +0 -0
  219. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/cellFormatter.js +0 -0
  220. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/collapseableAndSelectionCellFormatter.js +0 -0
  221. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/ellipsisCellFormatter.js +0 -0
  222. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/headerFormatter.js +0 -0
  223. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/index.js +0 -0
  224. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionCellFormatter.js +0 -0
  225. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/formatters/selectionHeaderCellFormatter.js +0 -0
  226. data/webpack/{move_to_foreman/components/common/table → components/pf3Table}/index.js +0 -0
  227. data/webpack/{move_to_pf → components}/react-bootstrap-select/index.js +0 -0
  228. data/webpack/containers/Application/config.js +5 -0
  229. data/webpack/containers/Application/overrides.scss +5 -0
  230. data/webpack/global_test_setup.js +3 -1
  231. data/webpack/redux/OrganizationProducts/OrganizationProductsActions.js +1 -1
  232. data/webpack/redux/OrganizationProducts/__tests__/OrganizationProductsActions.test.js +2 -2
  233. data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
  234. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +1 -1
  235. data/webpack/redux/reducers/index.js +2 -0
  236. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +1 -1
  237. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +1 -1
  238. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +1 -1
  239. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +2 -2
  240. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +1 -1
  241. data/webpack/scenes/ContentViews/ContentViewSelectors.js +1 -2
  242. data/webpack/scenes/ContentViews/ContentViewsActions.js +4 -4
  243. data/webpack/scenes/ContentViews/ContentViewsConstants.js +4 -1
  244. data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -6
  245. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +44 -0
  246. data/webpack/scenes/ContentViews/Details/ContentViewDetailReducer.js +23 -0
  247. data/webpack/scenes/ContentViews/{details → Details}/ContentViewDetailSelectors.js +3 -0
  248. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +70 -0
  249. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +116 -0
  250. data/webpack/scenes/ContentViews/{details → Details}/DetailsContainer.js +8 -4
  251. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +101 -0
  252. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetails.fixtures.json +106 -0
  253. data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +8 -0
  254. data/webpack/scenes/ContentViews/Details/index.js +7 -0
  255. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +51 -36
  256. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +47 -44
  257. data/webpack/scenes/ContentViews/__tests__/basicContentViews.fixtures.js +31 -0
  258. data/webpack/scenes/ContentViews/__tests__/contentViewList.fixtures.json +2 -1
  259. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +173 -23
  260. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +26 -0
  261. data/webpack/scenes/ContentViews/components/{contentViewName.scss → contentViewIcon.scss} +0 -0
  262. data/webpack/scenes/ModuleStreams/Details/ModuleStreamDetailsActions.js +1 -1
  263. data/webpack/scenes/ModuleStreams/Details/Profiles/TableSchema.js +1 -1
  264. data/webpack/scenes/ModuleStreams/Details/__tests__/ModuleStreamDetailsActions.test.js +2 -2
  265. data/webpack/scenes/ModuleStreams/ModuleStreamsActions.js +1 -1
  266. data/webpack/scenes/ModuleStreams/ModuleStreamsTableSchema.js +1 -1
  267. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamsTable.test.js +1 -1
  268. data/webpack/scenes/Organizations/OrganizationSelectors.js +14 -0
  269. data/webpack/scenes/Products/ProductActions.js +1 -1
  270. data/webpack/scenes/RedHatRepositories/RedHatRepositoriesPage.js +1 -1
  271. data/webpack/scenes/Settings/SettingsConstants.js +3 -0
  272. data/webpack/scenes/Settings/SettingsReducer.js +33 -0
  273. data/webpack/scenes/Settings/SettingsSelectors.js +4 -0
  274. data/webpack/scenes/Settings/index.js +2 -1
  275. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +1 -1
  276. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +1 -1
  277. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +59 -73
  278. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.scss +15 -0
  279. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +43 -1
  280. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +8 -0
  281. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +1 -1
  282. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +78 -0
  283. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +2 -0
  284. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +56 -1
  285. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +114 -0
  286. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -6
  287. data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +36 -0
  288. data/webpack/scenes/Subscriptions/Manifest/index.js +3 -1
  289. data/webpack/scenes/Subscriptions/SubscriptionActions.js +1 -1
  290. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +4 -0
  291. data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +0 -3
  292. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +38 -11
  293. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +30 -18
  294. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -3
  295. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +1 -1
  296. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +2 -2
  297. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +1 -1
  298. data/webpack/scenes/Subscriptions/__tests__/SubscriptionHelpers.test.js +0 -11
  299. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +2 -2
  300. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +4 -4
  301. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +26 -1
  302. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +2 -2
  303. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +27 -21
  304. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +6 -2
  305. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
  306. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionTypeFormatter.test.js.snap +3 -3
  307. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +1 -1
  308. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +28 -3
  309. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +5 -10
  310. data/webpack/scenes/Subscriptions/index.js +6 -2
  311. data/webpack/test-utils/nockWrapper.js +39 -5
  312. data/webpack/test-utils/react-testing-lib-wrapper.js +35 -9
  313. data/webpack/{move_to_foreman/common → utils}/helpers.js +12 -8
  314. data/webpack/utils/useEventListener.js +37 -0
  315. metadata +144 -74
  316. data/vendor/assets/stylesheets/katello/jquery.loadmask.css.scss +0 -40
  317. data/vendor/assets/stylesheets/katello/ui.spinner.css.scss +0 -3
  318. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
  319. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalSelectors.js +0 -2
  320. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -4
  321. data/webpack/__mocks__/foremanReact/components/Settings/SettingsActions.js +0 -4
  322. data/webpack/__mocks__/foremanReact/components/Settings/SettingsConstants.js +0 -2
  323. data/webpack/move_to_pf/TypeAhead/TypeAhead.js +0 -138
  324. data/webpack/move_to_pf/TypeAhead/helpers.js +0 -5
  325. data/webpack/scenes/ContentViews/components/ContentViewName.js +0 -33
  326. data/webpack/scenes/ContentViews/components/EmptyStateMessage.js +0 -43
  327. data/webpack/scenes/ContentViews/details/ContentViewDetailActions.js +0 -12
  328. data/webpack/scenes/ContentViews/expansions/RepositoriesExpansion.js +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c1b5ae508e6d13abb97dd4fa5dcb3a869b5a8ee2f6a2a2e574bcde16faa1c41
4
- data.tar.gz: e5dc1c88a336020bf333e9f781eac5790b588139bd8d813433bea739ee7077ca
3
+ metadata.gz: bf008f8880960ad2a6cf9b615c0e0801fb38cce104e67001f4d17178cca43ab7
4
+ data.tar.gz: d2cda17cc4664479ac34f7abd33c08f14ef81f038abb0cfe3d43c9542624c48b
5
5
  SHA512:
6
- metadata.gz: c6e0279e68e389701bcf84815bd401fe64375259da0ff533e4ae53fbf51f99b93837be754c0fb8d2d0457e6a8d299e4527c26d5c51fb4e81870f78592bbd46bf
7
- data.tar.gz: 2296caf477bbb72d78f187e53a493b9e4c8657119424939063a8a6c6c40435d5e9bda70490351101207694cf9511a59de939397c53c623f11a2f30eba564ff91
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
  }
@@ -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")
@@ -10,9 +10,11 @@ module Katello
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
@@ -295,6 +301,10 @@ module Katello
295
301
  find_bulk_hosts(:destroy_hosts, params)
296
302
  end
297
303
 
304
+ def validate_organization
305
+ fail HttpErrors::BadRequest, _("Organization ID is required") if @organization.blank?
306
+ end
307
+
298
308
  def validate_host_collection_membership_limit
299
309
  max_hosts_exceeded = []
300
310
  host_ids = @hosts.map(&:id)
@@ -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
@@ -327,6 +328,7 @@ module Katello
327
328
  api :PUT, "/repositories/:id", N_("Update a repository")
328
329
  param :id, :number, :required => true, :desc => N_("repository ID")
329
330
  param :name, String, :required => false
331
+ param :description, String, :desc => N_("description of the repository"), :required => false
330
332
  param_group :repo
331
333
  def update
332
334
  repo_params = repository_params
@@ -463,7 +465,7 @@ module Katello
463
465
 
464
466
  def repository_params
465
467
  keys = [:download_policy, :mirror_on_sync, :arch, :verify_ssl_on_sync, :upstream_password, :upstream_username,
466
- :ostree_upstream_sync_depth, :ostree_upstream_sync_policy,
468
+ :ostree_upstream_sync_depth, :ostree_upstream_sync_policy, :auto_enabled,
467
469
  :deb_releases, :deb_components, :deb_architectures, :description, :http_proxy_policy, :http_proxy_id,
468
470
  {:ignorable_content => []}
469
471
  ]
@@ -514,6 +516,7 @@ module Katello
514
516
  root.ansible_collection_requirements = repo_params[:ansible_collection_requirements] if root.ansible_collection?
515
517
  root.http_proxy_policy = repo_params[:http_proxy_policy] if repo_params.key?(:http_proxy_policy)
516
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)
517
520
 
518
521
  if root.ostree?
519
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
 
@@ -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
@@ -32,7 +32,7 @@ module Actions
32
32
 
33
33
  smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
34
34
  repositories = smart_proxy_helper.repos_available_to_capsule(environment, content_view, repository)
35
- smart_proxy.ping_pulp3 if repositories.any? { |repo| smart_proxy.pulp3_support?(repo) }
35
+
36
36
  smart_proxy.ping_pulp if repositories.any? { |repo| !smart_proxy.pulp3_support?(repo) }
37
37
 
38
38
  refresh_options = options.merge(content_view: content_view,
@@ -40,6 +40,7 @@ module Actions
40
40
  repository: repository)
41
41
  sequence do
42
42
  plan_action(Actions::Pulp::Orchestration::Repository::RefreshRepos, smart_proxy, refresh_options)
43
+ plan_action(Actions::Pulp3::CapsuleContent::RefreshContentGuard, smart_proxy) if repositories.any? { |repo| smart_proxy.pulp3_support?(repo) }
43
44
  plan_action(Actions::Pulp3::Orchestration::Repository::RefreshRepos, smart_proxy, refresh_options) if smart_proxy.pulp3_enabled?
44
45
  plan_action(SyncCapsule, smart_proxy, refresh_options)
45
46
  end
@@ -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
@@ -0,0 +1,36 @@
1
+ module Actions
2
+ module Katello
3
+ module Organization
4
+ module SimpleContentAccess
5
+ class Toggle < Actions::AbstractAsyncTask
6
+ middleware.use Actions::Middleware::PropagateCandlepinErrors
7
+
8
+ SIMPLE_CONTENT_ACCESS_DISABLED_VALUE = "entitlement".freeze
9
+ SIMPLE_CONTENT_ACCESS_ENABLED_VALUE = "org_environment".freeze
10
+
11
+ attr_reader :organization
12
+
13
+ def plan(organization_id)
14
+ @organization = ::Organization.find(organization_id)
15
+
16
+ ::Katello::Resources::Candlepin::UpstreamConsumer.update(
17
+ "#{consumer['apiUrl']}#{consumer['uuid']}",
18
+ consumer['idCert']['cert'],
19
+ consumer['idCert']['key'],
20
+ nil,
21
+ {contentAccessMode: content_access_mode_value}
22
+ )
23
+
24
+ plan_action(::Actions::Katello::Organization::ManifestRefresh, organization)
25
+ end
26
+
27
+ private
28
+
29
+ def consumer
30
+ @consumer ||= ::Katello::Resources::Candlepin::UpstreamCandlepinResource.upstream_consumer
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -13,6 +13,19 @@ module Actions
13
13
  Actions::Pulp3::Orchestration::OrphanCleanup::RemoveOrphans,
14
14
  proxy)
15
15
  end
16
+ plan_self
17
+ end
18
+ end
19
+
20
+ def run
21
+ models = []
22
+ ::Katello::RepositoryTypeManager.repository_types.each_value do |repo_type|
23
+ indexable_types = repo_type.content_types_to_index
24
+ models += indexable_types&.map(&:model_class)
25
+ models.select! { |model| model.many_repository_associations }
26
+ end
27
+ models.each do |model|
28
+ model.joins("left join katello_#{model.repository_association} on #{model.table_name}.id = katello_#{model.repository_association}.#{model.unit_id_field}").where("katello_#{model.repository_association}.#{model.unit_id_field} IS NULL").destroy_all
16
29
  end
17
30
  end
18
31
  end