katello 4.5.1 → 4.6.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 (440) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/rhsm/candlepin_dynflow_proxy_controller.rb +10 -0
  3. data/app/controllers/katello/api/v2/activation_keys_controller.rb +7 -0
  4. data/app/controllers/katello/api/v2/alternate_content_sources_controller.rb +52 -22
  5. data/app/controllers/katello/api/v2/content_uploads_controller.rb +2 -0
  6. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
  7. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/debs_controller.rb +42 -10
  9. data/app/controllers/katello/api/v2/host_collections_controller.rb +5 -1
  10. data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -0
  11. data/app/controllers/katello/api/v2/host_module_streams_controller.rb +9 -1
  12. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +8 -1
  13. data/app/controllers/katello/api/v2/organizations_controller.rb +3 -1
  14. data/app/controllers/katello/api/v2/simple_content_access_controller.rb +8 -0
  15. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +34 -11
  16. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +7 -16
  17. data/app/lib/actions/katello/alternate_content_source/alternate_content_source_common.rb +16 -0
  18. data/app/lib/actions/katello/alternate_content_source/create.rb +11 -5
  19. data/app/lib/actions/katello/alternate_content_source/destroy.rb +3 -4
  20. data/app/lib/actions/katello/alternate_content_source/refresh.rb +3 -5
  21. data/app/lib/actions/katello/alternate_content_source/update.rb +57 -13
  22. data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +2 -2
  23. data/app/lib/actions/katello/organization/manifest_refresh.rb +8 -4
  24. data/app/lib/actions/katello/organization/simple_content_access/toggle.rb +1 -9
  25. data/app/lib/actions/katello/repository/create.rb +9 -0
  26. data/app/lib/actions/katello/repository/destroy.rb +21 -0
  27. data/app/lib/actions/katello/repository/errata_mail.rb +3 -3
  28. data/app/lib/actions/katello/repository/refresh_repository.rb +3 -0
  29. data/app/lib/actions/katello/repository/update.rb +33 -0
  30. data/app/lib/actions/katello/repository/update_redhat_repository.rb +1 -1
  31. data/app/lib/actions/pulp3/alternate_content_source/create.rb +5 -4
  32. data/app/lib/actions/pulp3/alternate_content_source/create_remote.rb +5 -4
  33. data/app/lib/actions/pulp3/alternate_content_source/delete.rb +4 -4
  34. data/app/lib/actions/pulp3/alternate_content_source/delete_remote.rb +4 -4
  35. data/app/lib/actions/pulp3/alternate_content_source/refresh.rb +4 -4
  36. data/app/lib/actions/pulp3/alternate_content_source/update.rb +4 -4
  37. data/app/lib/actions/pulp3/alternate_content_source/update_remote.rb +5 -5
  38. data/app/lib/actions/pulp3/capsule_content/reclaim_space.rb +1 -0
  39. data/app/lib/actions/pulp3/orchestration/alternate_content_source/create.rb +3 -3
  40. data/app/lib/actions/pulp3/orchestration/alternate_content_source/delete.rb +6 -7
  41. data/app/lib/actions/pulp3/orchestration/alternate_content_source/refresh.rb +2 -2
  42. data/app/lib/actions/pulp3/orchestration/alternate_content_source/refresh_remote.rb +18 -0
  43. data/app/lib/actions/pulp3/orchestration/alternate_content_source/update.rb +3 -3
  44. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +1 -1
  45. data/app/lib/katello/concerns/base_template_scope_extensions.rb +1 -1
  46. data/app/lib/katello/errors.rb +1 -1
  47. data/app/lib/katello/resources/candlepin/owner.rb +9 -2
  48. data/app/lib/katello/validators/alternate_content_source_products_validator.rb +17 -0
  49. data/app/models/katello/alternate_content_source.rb +39 -8
  50. data/app/models/katello/alternate_content_source_product.rb +13 -0
  51. data/app/models/katello/concerns/host_managed_extensions.rb +12 -2
  52. data/app/models/katello/concerns/pulp_database_unit.rb +2 -2
  53. data/app/models/katello/concerns/smart_proxy_extensions.rb +5 -6
  54. data/app/models/katello/content_view.rb +4 -0
  55. data/app/models/katello/content_view_deb_filter.rb +51 -0
  56. data/app/models/katello/content_view_deb_filter_rule.rb +24 -0
  57. data/app/models/katello/content_view_filter.rb +10 -3
  58. data/app/models/katello/glue/candlepin/owner.rb +0 -1
  59. data/app/models/katello/installed_package.rb +1 -0
  60. data/app/models/katello/product.rb +3 -0
  61. data/app/models/katello/repository.rb +2 -0
  62. data/app/models/katello/smart_proxy_alternate_content_source.rb +6 -0
  63. data/app/services/cert/certs.rb +8 -16
  64. data/app/services/katello/content_unit_indexer.rb +2 -1
  65. data/app/services/katello/organization_creator.rb +4 -4
  66. data/app/services/katello/pulp/server.rb +2 -2
  67. data/app/services/katello/pulp3/alternate_content_source.rb +22 -4
  68. data/app/services/katello/pulp3/api/apt.rb +12 -0
  69. data/app/services/katello/pulp3/erratum.rb +1 -4
  70. data/app/services/katello/pulp3/repository/apt.rb +186 -2
  71. data/app/services/katello/pulp3/repository.rb +4 -3
  72. data/app/services/katello/pulp3/service_common.rb +1 -1
  73. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +1 -1
  74. data/app/views/foreman/smart_proxies/show.html.erb +3 -3
  75. data/app/views/katello/api/v2/alternate_content_sources/base.json.rabl +18 -3
  76. data/app/views/katello/api/v2/alternate_content_sources/show.json.rabl +20 -0
  77. data/app/views/katello/api/v2/ansible_collections/compare.json.rabl +10 -0
  78. data/app/views/katello/api/v2/content_view_filters/base.json.rabl +5 -0
  79. data/app/views/katello/api/v2/module_streams/compare.json.rabl +10 -0
  80. data/app/views/katello/api/v2/repository_sets/show.json.rabl +4 -0
  81. data/app/views/katello/layouts/foreman_with_bastion.html.erb +1 -1
  82. data/app/views/katello/layouts/react.html.erb +1 -1
  83. data/app/views/overrides/organizations/_edit_override.html.erb +5 -8
  84. data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
  85. data/app/views/overrides/organizations/_step_1_override.html.erb +5 -0
  86. data/ca/redhat-uep.pem +18 -23
  87. data/config/katello.yaml.example +0 -2
  88. data/config/routes/api/v2.rb +2 -0
  89. data/config/routes/overrides.rb +1 -0
  90. data/db/migrate/20201116161820_create_content_view_deb_filter_rules.rb +17 -0
  91. data/db/migrate/20220524132259_remove_last_refreshed_from_katello_alternate_content_sources.rb +5 -0
  92. data/db/migrate/20220601163911_add_vendor_to_katello_installed_packages.rb +5 -0
  93. data/db/migrate/20220610165621_add_repositories_and_products_to_acs.rb +23 -0
  94. data/db/seeds.d/102-organizations.rb +1 -1
  95. data/engines/bastion/app/views/bastion/layouts/application.html.erb +1 -1
  96. data/engines/bastion/app/views/bastion/layouts/application_ie.html.erb +1 -1
  97. data/engines/bastion/app/views/bastion/layouts/assets.html.erb +1 -1
  98. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js +2 -0
  99. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment.controller.js +2 -0
  100. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-content-views.html +1 -1
  101. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.controller.js +1 -0
  102. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/environments.html +3 -3
  103. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +4 -5
  104. data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -1
  105. data/lib/katello/engine.rb +1 -2
  106. data/lib/katello/permission_creator.rb +2 -2
  107. data/lib/katello/permissions/host_permissions.rb +1 -0
  108. data/lib/katello/plugin.rb +6 -12
  109. data/lib/katello/version.rb +1 -1
  110. data/locale/action_names.rb +49 -46
  111. data/locale/bn/katello.po +361 -53
  112. data/{webpack/scenes/AnsibleCollections/AnsibleCollectionsTables.scss → locale/bn/katello.po.time_stamp} +0 -0
  113. data/locale/cs/katello.po +361 -53
  114. data/locale/cs/katello.po.time_stamp +0 -0
  115. data/locale/de/katello.po +366 -58
  116. data/locale/de/katello.po.time_stamp +0 -0
  117. data/locale/en/katello.po +361 -53
  118. data/locale/en/katello.po.time_stamp +0 -0
  119. data/locale/es/katello.po +364 -56
  120. data/locale/es/katello.po.time_stamp +0 -0
  121. data/locale/fr/katello.po +376 -68
  122. data/locale/fr/katello.po.time_stamp +0 -0
  123. data/locale/gu/katello.po +361 -53
  124. data/locale/gu/katello.po.time_stamp +0 -0
  125. data/locale/hi/katello.po +361 -53
  126. data/locale/hi/katello.po.time_stamp +0 -0
  127. data/locale/it/katello.po +361 -53
  128. data/locale/it/katello.po.time_stamp +0 -0
  129. data/locale/ja/katello.po +374 -66
  130. data/locale/ja/katello.po.time_stamp +0 -0
  131. data/locale/katello.pot +1626 -1079
  132. data/locale/kn/katello.po +361 -53
  133. data/locale/kn/katello.po.time_stamp +0 -0
  134. data/locale/ko/katello.po +361 -53
  135. data/locale/ko/katello.po.time_stamp +0 -0
  136. data/locale/mr/katello.po +361 -53
  137. data/locale/mr/katello.po.time_stamp +0 -0
  138. data/locale/or/katello.po +361 -53
  139. data/locale/or/katello.po.time_stamp +0 -0
  140. data/locale/pa/katello.po +361 -53
  141. data/locale/pa/katello.po.time_stamp +0 -0
  142. data/locale/pt/katello.po +361 -53
  143. data/locale/pt/katello.po.time_stamp +0 -0
  144. data/locale/pt_BR/katello.po +364 -56
  145. data/locale/pt_BR/katello.po.time_stamp +0 -0
  146. data/locale/ru/katello.po +361 -53
  147. data/locale/ru/katello.po.time_stamp +0 -0
  148. data/locale/ta/katello.po +361 -53
  149. data/locale/ta/katello.po.time_stamp +0 -0
  150. data/locale/te/katello.po +361 -53
  151. data/locale/te/katello.po.time_stamp +0 -0
  152. data/locale/zh_CN/katello.po +374 -66
  153. data/locale/zh_CN/katello.po.time_stamp +0 -0
  154. data/locale/zh_TW/katello.po +361 -53
  155. data/locale/zh_TW/katello.po.time_stamp +0 -0
  156. data/package.json +0 -3
  157. data/webpack/components/EditableTextInput/EditableTextInput.js +3 -16
  158. data/webpack/components/EditableTextInput/PencilEditButton.js +33 -0
  159. data/webpack/components/Errata/index.js +18 -3
  160. data/webpack/components/Loading.js +1 -1
  161. data/webpack/components/RoutedTabs/index.js +1 -17
  162. data/webpack/components/Search/Search.js +0 -1
  163. data/webpack/components/Search/__tests__/search.test.js +1 -2
  164. data/webpack/components/SelectAllCheckbox/index.js +7 -4
  165. data/webpack/components/SelectableDropdown/SelectableDropdown.js +1 -0
  166. data/webpack/components/Table/EmptyStateMessage.js +77 -2
  167. data/webpack/components/Table/MainTable.js +46 -4
  168. data/webpack/components/Table/TableHooks.js +9 -6
  169. data/webpack/components/Table/TableWrapper.js +14 -8
  170. data/webpack/components/TypeAhead/TypeAhead.js +26 -11
  171. data/webpack/components/TypeAhead/pf3Search/TypeAheadItems.js +1 -1
  172. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +1 -0
  173. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +2 -1
  174. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +9 -4
  175. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js +37 -0
  176. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeCard.js +173 -0
  177. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeCard.scss +6 -0
  178. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeConstants.js +6 -0
  179. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeEditModal.js +301 -0
  180. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeSelectors.js +25 -0
  181. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/__tests__/SystemPurposeCard.test.js +108 -0
  182. data/webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/__tests__/SystemPurposeEditModal.test.js +161 -0
  183. data/webpack/components/extensions/HostDetails/Cards/__tests__/errataOverviewCard.test.js +12 -12
  184. data/webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js +100 -0
  185. data/webpack/components/extensions/HostDetails/DetailsTabCards/SystemPropertiesCardExtensions.js +26 -4
  186. data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +3 -1
  187. data/webpack/components/extensions/HostDetails/HostDetailsReducer.js +14 -0
  188. data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +8 -2
  189. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +8 -12
  190. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +23 -2
  191. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +5 -0
  192. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +57 -7
  193. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +2 -0
  194. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySets.fixtures.json +3 -0
  195. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +4 -1
  196. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -10
  197. data/webpack/components/extensions/HostDetails/hostDetailsHelpers.js +1 -1
  198. data/webpack/components/extensions/RegistrationCommands/index.js +49 -17
  199. data/webpack/containers/Application/config.js +5 -10
  200. data/webpack/global_index.js +19 -7
  201. data/webpack/global_test_setup.js +14 -2
  202. data/webpack/ouia_id_check.js +95 -0
  203. data/webpack/redux/actions/RedHatRepositories/helpers.js +2 -0
  204. data/webpack/redux/reducers/index.js +2 -4
  205. data/webpack/scenes/AlternateContentSources/ACSActions.js +36 -3
  206. data/webpack/scenes/AlternateContentSources/ACSConstants.js +3 -0
  207. data/webpack/scenes/AlternateContentSources/ACSSelectors.js +15 -6
  208. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +73 -42
  209. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js +26 -10
  210. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSProducts.js +44 -0
  211. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSReview.js +59 -45
  212. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +2 -1
  213. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +0 -1
  214. data/webpack/scenes/AlternateContentSources/Create/Steps/SelectSource.js +35 -19
  215. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +120 -13
  216. data/webpack/scenes/AlternateContentSources/Create/__tests__/products.fixtures.json +92 -0
  217. data/webpack/scenes/AlternateContentSources/Details/ACSExpandableDetails.js +459 -0
  218. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js +354 -0
  219. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +104 -0
  220. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js +120 -0
  221. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js +118 -0
  222. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +118 -0
  223. data/webpack/scenes/AlternateContentSources/Details/__tests__/ACSEdits.test.js +242 -0
  224. data/webpack/scenes/AlternateContentSources/Details/__tests__/ACSExpandableDetails.test.js +106 -0
  225. data/webpack/scenes/AlternateContentSources/Details/__tests__/acsDetails.fixtures.json +49 -0
  226. data/webpack/scenes/AlternateContentSources/Details/__tests__/acsProducts.fixtures.json +95 -0
  227. data/webpack/scenes/AlternateContentSources/Details/__tests__/simplifiedAcsDetails.fixtures.json +39 -0
  228. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +215 -87
  229. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.scss +3 -0
  230. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +1 -2
  231. data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -2
  232. data/webpack/scenes/ContentViews/ContentViewsConstants.js +15 -4
  233. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -2
  234. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -0
  235. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +1 -2
  236. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +113 -0
  237. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +89 -0
  238. data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +32 -9
  239. data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterAdd.test.js +13 -3
  240. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +39 -27
  241. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +236 -0
  242. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +1 -0
  243. data/webpack/scenes/ContentViews/Details/Filters/CVFilterDetailType.js +10 -0
  244. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -0
  245. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
  246. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +17 -4
  247. data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +1 -0
  248. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +34 -22
  249. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +97 -0
  250. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +1 -2
  251. data/webpack/scenes/ContentViews/Details/Filters/Rules/DebPackage/AddEditDebPackageRuleModal.js +128 -0
  252. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +56 -3
  253. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +62 -8
  254. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +1 -5
  255. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +1 -2
  256. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +32 -2
  257. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +1 -2
  258. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +1 -2
  259. data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyCVContainerImageFilterContent.fixtures.json +13 -0
  260. data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyCVPackageFilterRules.fixtures.json +13 -0
  261. data/webpack/scenes/ContentViews/Details/Filters/__tests__/emptyContentViewFilters.fixtures.json +13 -0
  262. data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -2
  263. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +5 -1
  264. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -2
  265. data/webpack/scenes/ContentViews/Details/Versions/BulkDelete/__tests__/BulkDeleteModal.test.js +3 -0
  266. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompare.js +143 -0
  267. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompare.scss +51 -0
  268. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +314 -0
  269. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareHeader.js +186 -0
  270. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +74 -0
  271. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/AnsibleCollectionsCompareAllContentData.fixtures.json +63 -0
  272. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +657 -0
  273. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionEmptyContentCompareData.fixtures.json +14 -0
  274. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/ContainerTagsCompareAllContentData.fixtures.json +95 -0
  275. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/DebPackagesCompareAllContentData.fixtures.json +87 -0
  276. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/ErrataCompareAllContentData.fixtures.json +319 -0
  277. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/ErrataCompareThreeContentTypesData.fixtures.json +131 -0
  278. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/FilesCompareAllContentData.fixtures.json +51 -0
  279. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/FilesCompareThreeContentTypesData.fixtures.json +48 -0
  280. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/ModuleStreamsCompareAllContentData.fixtures.json +239 -0
  281. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/PackageGroupsCompareAllContentData.fixtures.json +51 -0
  282. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/PythonPackagesCompareAllContentData.fixtures.json +315 -0
  283. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/RPMPackagesCompareAllContentData.fixtures.json +470 -0
  284. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/RPMPackagesCompareThreeContentTypesData.fixtures.json +475 -0
  285. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/contentViewDetails.fixtures.json +160 -0
  286. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/contentViewVersionOneDetials.fixtures.json +161 -0
  287. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/contentViewVersionThreeDetails.fixtures.json +154 -0
  288. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/contentViewVersionTwoDetails.fixtures.json +211 -0
  289. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/contentViewVersions.fixtures.json +1013 -0
  290. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/emptyStateCVVersionOneDetails.fixtures.json +145 -0
  291. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/emptyStateCVVersionTwoDetails.fixtures.json +145 -0
  292. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +102 -36
  293. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -2
  294. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +4 -2
  295. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +1 -2
  296. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js +1 -2
  297. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +113 -40
  298. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +96 -81
  299. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +1 -2
  300. data/webpack/scenes/ContentViews/__tests__/mockDetails.fixtures.json +7 -2
  301. data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +1 -1
  302. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +0 -30
  303. data/webpack/test-utils/nockWrapper.js +7 -0
  304. metadata +100 -145
  305. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +0 -34
  306. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +0 -751
  307. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-deletion.controller.js +0 -42
  308. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-activation-keys.controller.js +0 -81
  309. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-confirm.controller.js +0 -65
  310. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-content-hosts.controller.js +0 -82
  311. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion-environments.controller.js +0 -76
  312. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/content-view-version-deletion.controller.js +0 -160
  313. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/content-view-deletion.html +0 -58
  314. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-activation-keys.html +0 -94
  315. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-confirm.html +0 -76
  316. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-content-hosts.html +0 -88
  317. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/deletion/views/version-deletion-environments.html +0 -73
  318. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-component.factory.js +0 -32
  319. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-available-content-views.controller.js +0 -75
  320. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/content-view-composite-content-views-list.controller.js +0 -68
  321. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-available-content-views.html +0 -81
  322. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite-content-views-list.html +0 -81
  323. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/components/views/content-view-composite.html +0 -24
  324. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-deb-repositories.controller.js +0 -50
  325. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-docker-repositories.controller.js +0 -42
  326. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-file-repositories.controller.js +0 -50
  327. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-ostree-repositories.controller.js +0 -42
  328. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-available-repositories.controller.js +0 -45
  329. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-deb-repositories-list.controller.js +0 -48
  330. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +0 -100
  331. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-docker-repositories-list.controller.js +0 -49
  332. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-file-repositories-list.controller.js +0 -48
  333. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-ostree-repositories-list.controller.js +0 -49
  334. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-promotion.controller.js +0 -129
  335. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-publish.controller.js +0 -46
  336. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories-list.controller.js +0 -42
  337. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-repositories.service.js +0 -91
  338. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-versions.controller.js +0 -240
  339. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-errata-filter.controller.js +0 -115
  340. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-module-stream-filter.controller.js +0 -68
  341. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/available-package-group-filter.controller.js +0 -66
  342. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/date-type-errata-filter.controller.js +0 -77
  343. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/docker-tag-filter.controller.js +0 -137
  344. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/edit-filter.controller.js +0 -36
  345. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/errata-filter-list.controller.js +0 -78
  346. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/errata-filter.controller.js +0 -74
  347. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-content-type.filter.js +0 -21
  348. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-details.controller.js +0 -34
  349. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-helper.service.js +0 -30
  350. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-repositories.controller.js +0 -86
  351. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-rule-matching-package-modal.controller.js +0 -37
  352. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter-type.filter.js +0 -21
  353. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filter.factory.js +0 -66
  354. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/filters.controller.js +0 -85
  355. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/module-stream-list-filter.controller.js +0 -73
  356. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/new-filter.controller.js +0 -100
  357. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-filter.controller.js +0 -179
  358. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/package-group-list-filter.controller.js +0 -75
  359. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/rule.factory.js +0 -21
  360. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/date-type-errata-filter.html +0 -9
  361. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/date-type-errata.html +0 -75
  362. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/docker-filter.html +0 -28
  363. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/docker-tag-filter-details.html +0 -65
  364. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/edit-filter.html +0 -19
  365. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter-details.html +0 -63
  366. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/errata-filter.html +0 -50
  367. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-details.html +0 -9
  368. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-repositories.html +0 -121
  369. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filter-rule-matching-package-modal.html +0 -43
  370. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/filters.html +0 -85
  371. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter-details.html +0 -58
  372. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/module-stream-filter.html +0 -43
  373. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/new-filter.html +0 -62
  374. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter-details.html +0 -182
  375. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-filter.html +0 -28
  376. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-group-filter-details.html +0 -42
  377. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/package-group-filter.html +0 -43
  378. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/filters/views/partials/filter-repositories-count.html +0 -2
  379. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js +0 -47
  380. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.factory.js +0 -22
  381. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/views/content-view-history.html +0 -36
  382. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-copy.html +0 -20
  383. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-deb-repositories.html +0 -87
  384. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details-tasks.html +0 -4
  385. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +0 -144
  386. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-docker-repositories.html +0 -114
  387. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-file-repositories.html +0 -87
  388. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +0 -63
  389. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-ostree-repositories.html +0 -87
  390. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-promotion.html +0 -59
  391. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-publish.html +0 -58
  392. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-repositories.html +0 -116
  393. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -126
  394. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +0 -78
  395. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +0 -127
  396. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +0 -138
  397. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version.controller.js +0 -59
  398. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-apt.html +0 -25
  399. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-components.html +0 -19
  400. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-deb.html +0 -19
  401. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-details.html +0 -15
  402. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-docker.html +0 -23
  403. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-errata.html +0 -48
  404. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-file.html +0 -21
  405. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-module-streams.html +0 -8
  406. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-package-groups.html +0 -21
  407. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-packages.html +0 -27
  408. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-yum.html +0 -42
  409. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +0 -83
  410. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +0 -74
  411. data/webpack/components/Table/__test__/useBulkSelect.test.js +0 -99
  412. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js +0 -30
  413. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsConstants.js +0 -3
  414. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsPage.js +0 -80
  415. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsReducer.js +0 -39
  416. data/webpack/scenes/AnsibleCollections/AnsibleCollectionsTableSchema.js +0 -60
  417. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetails.js +0 -94
  418. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsActions.js +0 -23
  419. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsConstants.js +0 -3
  420. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionDetailsReducer.js +0 -30
  421. data/webpack/scenes/AnsibleCollections/Details/AnsibleCollectionsSchema.js +0 -35
  422. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailInfo.test.js +0 -16
  423. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.fixtures.js +0 -25
  424. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetails.test.js +0 -27
  425. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsActions.test.js +0 -41
  426. data/webpack/scenes/AnsibleCollections/Details/__tests__/AnsibleCollectionDetailsReducer.test.js +0 -33
  427. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailInfo.test.js.snap +0 -83
  428. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetails.test.js.snap +0 -190
  429. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsActions.test.js.snap +0 -58
  430. data/webpack/scenes/AnsibleCollections/Details/__tests__/__snapshots__/AnsibleCollectionDetailsReducer.test.js.snap +0 -50
  431. data/webpack/scenes/AnsibleCollections/Details/index.js +0 -17
  432. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionPage.test.js +0 -23
  433. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollections.fixtures.js +0 -52
  434. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsActions.test.js +0 -48
  435. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsReducer.test.js +0 -46
  436. data/webpack/scenes/AnsibleCollections/__tests__/AnsibleCollectionsTable.test.js +0 -25
  437. data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionPage.test.js.snap +0 -73
  438. data/webpack/scenes/AnsibleCollections/__tests__/__snapshots__/AnsibleCollectionsTable.test.js.snap +0 -81
  439. data/webpack/scenes/AnsibleCollections/index.js +0 -17
  440. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +0 -123
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 668ae7f77ea1cb1924c60b96931b249de9198b20caa055ee5142422ee5e72d44
4
- data.tar.gz: 746ebbe54eb3ad9f4208b344b4bb671143a21489e19a16720c2987a2ffa6719e
3
+ metadata.gz: ed8eb04c88654bdacc69fa01282d4122141a68430d8259cc6f0ec46dcae06367
4
+ data.tar.gz: 96bc2cd4a26684dae6a71884a3fd745469b30118e723613f2640b8017a1c6b50
5
5
  SHA512:
6
- metadata.gz: 41d0ed1bfd6b88b4414a79c3f8479b3a6ad2c170f055fb707434b7ba72b6e51c83d7582c03bef5bb6a297583a2553776cf324d945311c66442d8c54a40fe7e6a
7
- data.tar.gz: 35a1df76e4d090c8628d9c9d22fc623f12ab436fa229c6a55142e3fc53b3a82b6bd5e42e56d0e9282e9efa0fb6d925f378eedcc9c49cdb65335f146842dcbbae
6
+ metadata.gz: 99b345b1016334d1f7277f2eecb3f6ad8f21a90d45582a30367b49441891216b359fb118c61e2c59ec93fa4071b49e6a9c131175b7ba365613c2fb5acece0a4b
7
+ data.tar.gz: c9523e61da53201364bef634d3960bab1ff7120e648133b168da057bdd5d32c603c44f38e7395097fd2e3960f2451407a7f9444eb4a1382a28ab139452dc0033
@@ -59,6 +59,16 @@ module Katello
59
59
  @host = facet.host
60
60
  end
61
61
 
62
+ rescue_from RestClient::Exception do |e|
63
+ Rails.logger.error(pp_exception(e, with_backtrace: false))
64
+ Rails.logger.error(e.backtrace.detect { |line| line.match("katello.*controller") })
65
+ if request_from_katello_cli?
66
+ render :json => { :errors => [e.http_body] }, :status => e.http_code
67
+ else
68
+ render :plain => e.http_body, :status => e.http_code
69
+ end
70
+ end
71
+
62
72
  def authorize_client_or_user
63
73
  client_authorized? || authorize
64
74
  end
@@ -11,6 +11,7 @@ module Katello
11
11
  :content_override, :add_subscriptions, :remove_subscriptions,
12
12
  :subscriptions]
13
13
  before_action :verify_simple_content_access_disabled, :only => [:add_subscriptions]
14
+ before_action :validate_release_version, :only => [:create, :update]
14
15
 
15
16
  wrap_parameters :include => (ActivationKey.attribute_names + %w(host_collection_ids service_level auto_attach purpose_role purpose_usage purpose_addons content_view_environment))
16
17
 
@@ -337,5 +338,11 @@ module Katello
337
338
  fail HttpErrors::BadRequest, _("The specified organization is in Simple Content Access mode. Attaching subscriptions is disabled")
338
339
  end
339
340
  end
341
+
342
+ def validate_release_version
343
+ if params[:release_version].present? && !@organization.library.available_releases.include?(params[:release_version])
344
+ fail HttpErrors::BadRequest, _("Invalid release version: [%s]") % params[:release_version]
345
+ end
346
+ end
340
347
  end
341
348
  end
@@ -2,10 +2,12 @@ module Katello
2
2
  class Api::V2::AlternateContentSourcesController < Api::V2::ApiController
3
3
  include Katello::Concerns::FilteredAutoCompleteSearch
4
4
 
5
- acs_wrap_params = AlternateContentSource.attribute_names + [:smart_proxy_ids, :smart_proxy_names]
5
+ acs_wrap_params = AlternateContentSource.attribute_names + [:smart_proxy_ids, :smart_proxy_names, :product_ids]
6
6
  wrap_parameters :alternate_content_source, include: acs_wrap_params
7
7
 
8
8
  before_action :find_authorized_katello_resource, only: [:show, :update, :destroy, :refresh]
9
+ before_action :find_smart_proxies, only: :create
10
+ before_action :find_products, only: :create
9
11
 
10
12
  def_param_group :acs do
11
13
  param :name, String, desc: N_("Name of the alternate content source")
@@ -14,8 +16,6 @@ module Katello
14
16
  param :subpaths, Array, desc: N_('Path suffixes for finding alternate content'), required: false
15
17
  param :smart_proxy_ids, Array, desc: N_("Ids of smart proxies to associate"), required: false
16
18
  param :smart_proxy_names, Array, desc: N_("Names of smart proxies to associate"), required: false
17
- param :content_type, RepositoryTypeManager.defined_repository_types.keys & AlternateContentSource::CONTENT_TYPES, desc: N_("The content type for the Alternate Content Source"), required: false
18
- param :alternate_content_source_type, AlternateContentSource::ACS_TYPES, desc: N_("The Alternate Content Source type")
19
19
  param :upstream_username, String, desc: N_("Basic authentication username"), required: false
20
20
  param :upstream_password, String, desc: N_("Basic authentication password"), required: false
21
21
  param :ssl_ca_cert_id, :number, desc: N_("Identifier of the content credential containing the SSL CA Cert"), required: false
@@ -23,9 +23,10 @@ module Katello
23
23
  param :ssl_client_key_id, :number, desc: N_("Identifier of the content credential containing the SSL Client Key"), required: false
24
24
  param :http_proxy_id, :number, desc: N_("ID of a HTTP Proxy"), required: false
25
25
  param :verify_ssl, :bool, desc: N_("If SSL should be verified for the upstream URL"), required: false
26
+ param :product_ids, Array, desc: N_("IDs of products to copy repository information from into a Simplified Alternate Content Source. Products must include at least one repository of the chosen content type."), required: false
26
27
  end
27
28
 
28
- api :GET, "/alternate_content_sources", N_("List of alternate_content_sources")
29
+ api :GET, "/alternate_content_sources", N_("List alternate content sources.")
29
30
  param_group :search, Api::V2::ApiController
30
31
  add_scoped_search_description_for(AlternateContentSource)
31
32
  def index
@@ -33,9 +34,15 @@ module Katello
33
34
  format.csv do
34
35
  options[:csv] = true
35
36
  alternate_content_sources = scoped_search(index_relation, :name, :asc)
36
- csv_response(alternate_content_sources,
37
- [:id, :name, :description, :label, :base_url, :subpaths, :content_type, :alternate_content_source_type],
38
- ['Id', 'Name', 'Description', 'label', 'Base URL', 'Subpaths', 'Content Type', 'Alternate Content Source Type'])
37
+ if @acs.custom?
38
+ csv_response(alternate_content_sources,
39
+ [:id, :name, :description, :label, :base_url, :subpaths, :content_type, :alternate_content_source_type],
40
+ ['Id', 'Name', 'Description', 'label', 'Base URL', 'Subpaths', 'Content Type', 'Alternate Content Source Type'])
41
+ elsif @acs.simplified?
42
+ csv_response(alternate_content_sources,
43
+ [:id, :name, :description, :label, :content_type, :alternate_content_source_type, :products],
44
+ ['Id', 'Name', 'Description', 'label', 'Content Type', 'Alternate Content Source Type', 'Products'])
45
+ end
39
46
  end
40
47
  format.any do
41
48
  alternate_content_sources = scoped_search(index_relation, :name, :asc)
@@ -48,46 +55,56 @@ module Katello
48
55
  AlternateContentSource.readable.distinct
49
56
  end
50
57
 
51
- api :GET, '/alternate_content_sources/:id', N_('Show an alternate content source')
58
+ api :GET, '/alternate_content_sources/:id', N_('Show an alternate content source.')
52
59
  param :id, :number, :required => true, :desc => N_("Alternate content source ID")
53
60
  def show
54
61
  respond_for_show(:resource => @alternate_content_source)
55
62
  end
56
63
 
57
- api :POST, '/alternate_content_sources', N_('Create an ACS')
64
+ api :POST, '/alternate_content_sources', N_('Create an alternate content source to download content from during repository syncing. Note: alternate content sources are global and affect ALL sync actions on their smart proxies regardless of organization.')
65
+ param :content_type, RepositoryTypeManager.defined_repository_types.keys & AlternateContentSource::CONTENT_TYPES, desc: N_("The content type for the Alternate Content Source"), required: false
66
+ param :alternate_content_source_type, AlternateContentSource::ACS_TYPES, desc: N_("The Alternate Content Source type")
58
67
  param_group :acs
59
68
  def create
60
- find_smart_proxies
61
- @alternate_content_source = ::Katello::AlternateContentSource.new(acs_params.except(:smart_proxy_ids, :smart_proxy_names))
62
- sync_task(::Actions::Katello::AlternateContentSource::Create, @alternate_content_source, @smart_proxies)
69
+ @alternate_content_source = ::Katello::AlternateContentSource.new(acs_params.except(:smart_proxy_ids, :smart_proxy_names, :product_ids))
70
+ @alternate_content_source.verify_ssl = nil if @alternate_content_source.simplified?
71
+ sync_task(::Actions::Katello::AlternateContentSource::Create, @alternate_content_source, @smart_proxies, @products)
63
72
  @alternate_content_source.reload
64
73
  respond_for_create(resource: @alternate_content_source)
65
74
  end
66
75
 
67
- api :PUT, '/alternate_content_sources/:id', N_('Update an alternate content source')
76
+ api :PUT, '/alternate_content_sources/:id', N_('Update an alternate content source.')
68
77
  param_group :acs
69
78
  param :id, :number, :required => true, :desc => N_("Alternate content source ID")
70
79
  def update
71
- # If a user doesn't include smart proxies in the update call, don't accidentally remove all of them.
72
- if params[:smart_proxy_ids].nil?
80
+ # If a user doesn't include smart proxies or products in the update call, don't accidentally remove all of them.
81
+ if params[:smart_proxy_ids].nil? && params[:smart_proxy_names].nil?
73
82
  @smart_proxies = @alternate_content_source.smart_proxies
74
- elsif params[:smart_proxy_ids].empty?
83
+ elsif params[:smart_proxy_ids] == [] || params[:smart_proxy_names] == []
75
84
  @smart_proxies = []
76
85
  else
77
86
  find_smart_proxies
78
87
  end
79
- sync_task(::Actions::Katello::AlternateContentSource::Update, @alternate_content_source, @smart_proxies, acs_params.except(:smart_proxy_ids))
88
+
89
+ if params[:product_ids].nil?
90
+ @products = @alternate_content_source.products
91
+ elsif params[:product_ids] == []
92
+ @products = []
93
+ else
94
+ find_products
95
+ end
96
+ sync_task(::Actions::Katello::AlternateContentSource::Update, @alternate_content_source, @smart_proxies, @products, acs_params.except(:smart_proxy_ids, :smart_proxy_names, :product_ids))
80
97
  respond_for_show(:resource => @alternate_content_source)
81
98
  end
82
99
 
83
- api :DELETE, '/alternate_content_sources/:id', N_('Destroy an alternate content source')
100
+ api :DELETE, '/alternate_content_sources/:id', N_('Destroy an alternate content source.')
84
101
  param :id, :number, :required => true, :desc => N_("Alternate content source ID")
85
102
  def destroy
86
103
  sync_task(::Actions::Katello::AlternateContentSource::Destroy, @alternate_content_source)
87
104
  respond_for_destroy
88
105
  end
89
106
 
90
- api :POST, '/alternate_content_sources/:id/refresh', N_('Refresh an alternate content source')
107
+ api :POST, '/alternate_content_sources/:id/refresh', N_('Refresh an alternate content source. Refreshing, like repository syncing, is required before using an alternate content source.')
91
108
  param :id, :number, :required => true, :desc => N_("Alternate content source ID")
92
109
  def refresh
93
110
  task = async_task(::Actions::Katello::AlternateContentSource::Refresh, @alternate_content_source)
@@ -97,9 +114,9 @@ module Katello
97
114
  protected
98
115
 
99
116
  def acs_params
100
- keys = [:name, :label, :base_url, {subpaths: []}, {smart_proxy_ids: []}, {smart_proxy_names: []}, :content_type, :alternate_content_source_type,
101
- :upstream_username, :upstream_password, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id,
102
- :http_proxy_id, :verify_ssl]
117
+ keys = [:name, :label, :description, {smart_proxy_ids: []}, {smart_proxy_names: []}, :content_type, :alternate_content_source_type]
118
+ keys += [:base_url, {subpaths: []}, :upstream_username, :upstream_password, :ssl_ca_cert_id, :ssl_client_cert_id, :ssl_client_key_id, :http_proxy_id, :verify_ssl] if params[:action] == 'create' || @alternate_content_source&.custom?
119
+ keys += [{product_ids: []}] if params[:action] == 'create' || @alternate_content_source&.simplified?
103
120
  params.require(:alternate_content_source).permit(*keys).to_h.with_indifferent_access
104
121
  end
105
122
 
@@ -117,5 +134,18 @@ module Katello
117
134
  fail HttpErrors::NotFound, _("Couldn't find smart proxies with name '%s'") % missing_smart_proxies.to_sentence
118
135
  end
119
136
  end
137
+
138
+ def find_products
139
+ if params[:product_ids]
140
+ @products = ::Katello::Product.where(id: params[:product_ids])
141
+ else
142
+ @products = nil
143
+ end
144
+
145
+ if params[:product_ids] && @products.length < params[:product_ids].length
146
+ missing_products = params[:product_ids] - @products.pluck(:id)
147
+ fail HttpErrors::NotFound, _("Couldn't find products with id '%s'") % missing_products.to_sentence
148
+ end
149
+ end
120
150
  end
121
151
  end
@@ -2,6 +2,8 @@ module Katello
2
2
  class Api::V2::ContentUploadsController < Api::V2::ApiController
3
3
  before_action :find_repository
4
4
  skip_before_action :check_media_type, :only => [:update]
5
+ # https://github.com/rails/rails/issues/42278#issuecomment-918079123
6
+ skip_parameter_encoding :update
5
7
 
6
8
  include ::Foreman::Controller::FilterParameters
7
9
  filter_parameters :content
@@ -27,7 +27,7 @@ module Katello
27
27
  api :POST, "/content_view_filters/:content_view_filter_id/rules",
28
28
  N_("Create a filter rule. The parameters included should be based upon the filter type.")
29
29
  param :content_view_filter_id, :number, :desc => N_("filter identifier"), :required => true
30
- param :name, Array, of: [String], :desc => N_("package, package group, or docker tag names")
30
+ param :name, Array, of: [String], :desc => N_("deb, package, package group, or docker tag names")
31
31
  param :uuid, String, :desc => N_("package group: uuid")
32
32
  param :version, String, :desc => N_("package: version")
33
33
  param :architecture, String, :desc => N_("package: architecture")
@@ -34,7 +34,7 @@ module Katello
34
34
  api :post, "/content_view_filters", N_("create a filter for a content view")
35
35
  param :content_view_id, :number, :desc => N_("content view identifier"), :required => true
36
36
  param :name, String, :desc => N_("name of the filter"), :required => true
37
- param :type, String, :desc => N_("type of filter (e.g. rpm, package_group, erratum, erratum_id, erratum_date, docker, modulemd)"), :required => true
37
+ param :type, String, :desc => N_("type of filter (e.g. deb, rpm, package_group, erratum, erratum_id, erratum_date, docker, modulemd)"), :required => true
38
38
  param :original_packages, :bool, :desc => N_("add all packages without errata to the included/excluded list. " \
39
39
  "(package filter only)")
40
40
  param :original_module_streams, :bool, :desc => N_("add all module streams without errata to the included/excluded list. " \
@@ -7,23 +7,28 @@ module Katello
7
7
  apipie_concern_subst(:a_resource => N_("a deb package"), :resource => "deb packages")
8
8
  include Katello::Concerns::Api::V2::RepositoryContentController
9
9
 
10
- before_action :find_repositories, :only => [:auto_complete_name, :auto_complete_arch]
11
10
  before_action :find_hosts, :only => :index
11
+ before_action :find_repositories, :only => [:auto_complete_name, :auto_complete_arch]
12
12
 
13
- def auto_complete_name
13
+ def auto_complete(search)
14
14
  page_size = Katello::Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
15
15
  debs = Deb.in_repositories(@repositories)
16
- col = "#{Deb.table_name}.name"
17
- debs = debs.where("#{Deb.table_name}.name ILIKE ?", "#{params[:term]}%").select(col).group(col).order(col).limit(page_size)
16
+ col = ''
17
+ if search == 'name'
18
+ col = "#{Deb.table_name}.name"
19
+ elsif search == 'arch'
20
+ col = "#{Deb.table_name}.architecture"
21
+ end
22
+ debs = debs.where("#{col} ILIKE ?", "#{params[:term]}%").select(col).group(col).order(col).limit(page_size)
18
23
  render :json => debs.pluck(col)
19
24
  end
20
25
 
26
+ def auto_complete_name
27
+ auto_complete('name')
28
+ end
29
+
21
30
  def auto_complete_arch
22
- page_size = Katello::Concerns::FilteredAutoCompleteSearch::PAGE_SIZE
23
- debs = Deb.in_repositories(@repositories)
24
- col = "#{Deb.table_name}.architecture"
25
- debs = debs.where("#{col} ILIKE ?", "%#{params[:term]}%").select(col).group(col).order(col).limit(page_size)
26
- render :json => debs.pluck(col)
31
+ auto_complete('architecture')
27
32
  end
28
33
 
29
34
  api :GET, "/debs", N_("List deb packages")
@@ -39,14 +44,41 @@ module Katello
39
44
  param :host_id, :number, :desc => N_("Host id to list applicable deb packages for")
40
45
  param :packages_restrict_applicable, :boolean, :desc => N_("Return deb packages that are applicable to one or more hosts (defaults to true if host_id is specified)")
41
46
  param :packages_restrict_upgradable, :boolean, :desc => N_("Return deb packages that are upgradable on one or more hosts")
47
+ param :packages_restrict_latest, :boolean, :desc => N_("Return only the latest version of each package")
42
48
  param :available_for, String, :desc => N_("Return deb packages that can be added to the specified object. Only the value 'content_view_version' is supported.")
43
49
  param_group :search, ::Katello::Api::V2::ApiController
44
50
  def index
45
51
  super
46
52
  end
47
53
 
54
+ def final_custom_index_relation(collection)
55
+ # :packages_restrict_latest is intended to filter the result set after all
56
+ # other constraints have been applied, including the scoped_search
57
+ # constraints. If any constraints are applied after this, then a package
58
+ # will not be returned if its latest version does not match those
59
+ # constraints, even if an older version does match those constraints.
60
+ collection = Katello::Deb.latest(collection) if ::Foreman::Cast.to_bool(params[:packages_restrict_latest])
61
+ collection
62
+ end
63
+
64
+ def filter_by_content_view_filter(filter, collection)
65
+ filtered_debs = []
66
+ filter.deb_rules.each do |rule|
67
+ filtered_debs += filter.query_debs_from_collection(collection, rule).pluck(:id)
68
+ end
69
+
70
+ collection.where(id: filter.applicable_debs.pluck(:id) & filtered_debs)
71
+ end
72
+
73
+ def filter_by_content_view_filter_rule(rule, collection)
74
+ filter = rule.filter
75
+ filtered_debs = filter.query_debs_from_collection(collection, rule).pluck(:id)
76
+ collection.where(id: filter.applicable_debs.pluck(:id) & filtered_debs)
77
+ end
78
+
48
79
  def default_sort
49
- %w(name asc)
80
+ lambda { |query| query.default_sort }
81
+ # %w(name asc)
50
82
  end
51
83
 
52
84
  def available_for_content_view_version(version)
@@ -194,7 +194,11 @@ module Katello
194
194
 
195
195
  def host_collection_params_with_host_ids
196
196
  result = host_collection_params
197
- result[:max_hosts] = nil if params[:unlimited_hosts]
197
+ if params[:unlimited_hosts]
198
+ result[:max_hosts] = nil
199
+ elsif params[:max_hosts]
200
+ result[:unlimited_hosts] = false
201
+ end
198
202
  result
199
203
  end
200
204
 
@@ -104,6 +104,7 @@ module Katello
104
104
  relation = relation.where(:errata_type => TYPES_FROM_PARAMS[params[:type].to_sym])
105
105
  end
106
106
  if params[:severity].present?
107
+ params[:severity] = ['None', ''] if params[:severity] == 'None'
107
108
  relation = relation.where(:severity => params[:severity])
108
109
  end
109
110
  relation
@@ -22,7 +22,7 @@ module Katello
22
22
  def index_relation
23
23
  return HostAvailableModuleStream.upgradable([@host]) if params[:status] == HostAvailableModuleStream::UPGRADABLE
24
24
 
25
- rel = @host.host_available_module_streams
25
+ rel = @host.host_available_module_streams.where(available_module_stream_id: find_available_module_stream_ids)
26
26
  if params[:sort_by] == 'installed_profiles'
27
27
  rel = rel.order([:installed_profiles, :status])
28
28
  end
@@ -38,6 +38,14 @@ module Katello
38
38
 
39
39
  private
40
40
 
41
+ def find_available_module_stream_ids
42
+ items = @host.host_available_module_streams.includes(:available_module_stream).map(&:available_module_stream)
43
+ grouped = items.group_by { |item| [item.name, item.stream] }
44
+ grouped.values.map do |item|
45
+ item.first.id
46
+ end
47
+ end
48
+
41
49
  def find_host
42
50
  @host = resource_finder(::Host::Managed.authorized(:view_hosts, ::Host::Managed), params[:host_id])
43
51
  end
@@ -187,6 +187,13 @@ module Katello
187
187
  respond_for_index :collection => full_result_response(releases)
188
188
  end
189
189
 
190
+ api :GET, "/hosts/:host_id/subscriptions/enabled_repositories", N_("Show repositories enabled on the host that are known to Katello")
191
+ param :host_id, String, :desc => N_("id of host"), :required => true
192
+ def enabled_repositories
193
+ repositories = @host.content_facet.try(:bound_repositories) || []
194
+ respond_with_template_collection "index", 'repositories', :collection => full_result_response(repositories)
195
+ end
196
+
190
197
  private
191
198
 
192
199
  def fetch_product_content
@@ -216,7 +223,7 @@ module Katello
216
223
  def action_permission
217
224
  if ['add_subscriptions', 'destroy', 'remove_subscriptions', 'auto_attach', 'content_override'].include?(params[:action])
218
225
  :edit
219
- elsif ['index', 'events', 'product_content', 'available_release_versions'].include?(params[:action])
226
+ elsif ['index', 'events', 'product_content', 'available_release_versions', 'enabled_repositories'].include?(params[:action])
220
227
  :view
221
228
  else
222
229
  fail ::Foreman::Exception.new(N_("unknown permission for %s"), "#{params[:controller]}##{params[:action]}")
@@ -68,9 +68,11 @@ module Katello
68
68
  param :organization, Hash do
69
69
  param :label, String, :required => false
70
70
  end
71
+ param :simple_content_access, :bool, :desc => N_('Whether to turn on Simple Content Access for the organization.'), :required => false, :default => true
71
72
  def create
72
73
  @organization = Organization.new(resource_params)
73
- creator = ::Katello::OrganizationCreator.new(@organization)
74
+ sca = params.key?(:simple_content_access) ? ::Foreman::Cast.to_bool(params[:simple_content_access]) : true
75
+ creator = ::Katello::OrganizationCreator.new(@organization, sca: sca)
74
76
  creator.create!
75
77
  @organization.reload
76
78
  # @taxonomy instance variable is necessary for foreman side
@@ -15,6 +15,14 @@ module Katello
15
15
  render json: { simple_content_access_eligible: eligible }
16
16
  end
17
17
 
18
+ api :GET, "/organizations/:organization_id/simple_content_access/status",
19
+ N_("Check if the specified organization has Simple Content Access enabled")
20
+ param :organization_id, :number, :desc => N_("Organization ID"), :required => true
21
+ def status
22
+ status = @organization.simple_content_access?
23
+ render json: { simple_content_access: status }
24
+ end
25
+
18
26
  api :PUT, "/organizations/:organization_id/simple_content_access/enable",
19
27
  N_("Enable simple content access for a manifest")
20
28
  param :organization_id, :number, :desc => N_("Organization ID"), :required => true
@@ -30,6 +30,7 @@ module Katello
30
30
  param :ids, Array, :desc => N_("ids to filter content by")
31
31
  param :include_filter_ids, :bool, desc: N_("Includes associated content view filter ids in response")
32
32
  param_group :search, ::Katello::Api::V2::ApiController
33
+
33
34
  def index
34
35
  sort_by, sort_order, options = sort_options
35
36
  respond(:collection => scoped_search(index_relation, sort_by, sort_order, options))
@@ -40,6 +41,7 @@ module Katello
40
41
  param :repository_id, :number, :desc => N_("repository identifier")
41
42
  param :organization_id, :number, :desc => N_("organization identifier")
42
43
  param :id, String, :desc => N_(":a_resource identifier"), :required => true
44
+
43
45
  def show
44
46
  respond :resource => @resource
45
47
  end
@@ -47,10 +49,11 @@ module Katello
47
49
  api :GET, "/:resource_id/compare/", N_("List :resource")
48
50
  param :content_view_version_ids, Array, :desc => N_("content view versions to compare")
49
51
  param :repository_id, :number, :desc => N_("Library repository id to restrict comparisons to")
52
+ param :restrict_comparison, String, :desc => N_("Return same, different or all results")
53
+
50
54
  def compare
51
55
  fail _("No content_view_version_ids provided") if params[:content_view_version_ids].empty?
52
56
  @versions = ContentViewVersion.readable.where(:id => params[:content_view_version_ids])
53
-
54
57
  if @versions.count != params[:content_view_version_ids].uniq.length
55
58
  missing = params[:content_view_version_ids] - @versions.pluck(:id)
56
59
  fail HttpErrors::NotFound, _("Couldn't find content view versions '%s'") % missing.join(',')
@@ -63,9 +66,8 @@ module Katello
63
66
  else
64
67
  repos = Katello::Repository.where(:content_view_version_id => @versions.pluck(:id))
65
68
  repos = repos.where(:root_id => @repo.root_id) if @repo
66
- collection = filter_by_repos(repos, resource_class.all)
69
+ collection = filter_by_repos(repos, resource_class.all, @versions, params[:restrict_comparison])
67
70
  end
68
-
69
71
  collection = scoped_search(collection.distinct, sort_by, sort_order, options)
70
72
  collection[:results] = collection[:results].map { |item| ContentViewVersionComparePresenter.new(item, @versions, @repo) }
71
73
  respond_for_index(:collection => collection)
@@ -75,6 +77,7 @@ module Katello
75
77
  param :show_all_for, :bool,
76
78
  :desc => N_("Returns content that can be both added and is currently added to the object. The value 'content_view_filter' is supported")
77
79
  param :filterId, :integer, :desc => N_("Content View Filter id"), deprecated: true
80
+
78
81
  def index_relation
79
82
  if @version && params[:available_for] == "content_view_version" && self.respond_to?(:available_for_content_view_version)
80
83
  collection = self.available_for_content_view_version(@version)
@@ -125,8 +128,28 @@ module Katello
125
128
  repos
126
129
  end
127
130
 
128
- def filter_by_repos(repos, collection)
129
- collection.in_repositories(repos)
131
+ def filter_by_repos(repos, collection, content_view_versions = nil, compare = 'all')
132
+ collection = collection.in_repositories(repos)
133
+ case compare
134
+ when 'same'
135
+ compare_same(collection, content_view_versions)
136
+ when 'different'
137
+ collection_all_ids = collection&.pluck(:id)
138
+ collection_same_ids = compare_same(collection, content_view_versions)&.pluck(:id)
139
+ collection.where(id: collection_all_ids - collection_same_ids)
140
+ else
141
+ collection
142
+ end
143
+ end
144
+
145
+ def compare_same(collection, content_view_versions = nil)
146
+ cv_version_first = content_view_versions[0]
147
+ collection_ids = collection.in_repositories(Katello::Repository.where(:content_view_version_id => cv_version_first&.id))&.pluck(:id)
148
+ content_view_versions[1..-1].each do |version|
149
+ collection_version_ids = collection.in_repositories(Katello::Repository.where(:content_view_version_id => version&.id))&.pluck(:id)
150
+ collection_ids = collection_ids.intersection collection_version_ids
151
+ end
152
+ return collection.where(id: collection_ids)
130
153
  end
131
154
 
132
155
  def filter_by_content_view_version(version, collection)
@@ -145,12 +168,12 @@ module Katello
145
168
 
146
169
  if @resource.blank?
147
170
  fail HttpErrors::NotFound, _("Failed to find %{content} with id '%{id}'.") %
148
- {content: resource_name, id: params[:id]}
171
+ { content: resource_name, id: params[:id] }
149
172
  end
150
173
 
151
174
  if params[:repository_id] && !@resource.repositories.include?(@repo)
152
175
  fail HttpErrors::NotFound, _("Could not find %{content} with id '%{id}' in repository.") %
153
- {content: resource_name, id: params[:id]}
176
+ { content: resource_name, id: params[:id] }
154
177
  end
155
178
 
156
179
  if params[:organization_id] && !@resource.repositories.any? { |repo| repo.organization_id == params[:organization_id].to_i }
@@ -174,7 +197,7 @@ module Katello
174
197
  @environment = KTEnvironment.readable.find_by(:id => params[:environment_id])
175
198
  if @environment.nil?
176
199
  fail HttpErrors::NotFound, _("Could not find Lifecycle Environment with id '%{id}'.") %
177
- {id: params[:environment_id]}
200
+ { id: params[:environment_id] }
178
201
  end
179
202
  end
180
203
  end
@@ -196,7 +219,7 @@ module Katello
196
219
 
197
220
  unless @filter
198
221
  fail HttpErrors::NotFound, _("Couldn't find %{type} Filter with id %{id}") %
199
- {:type => resource_name, :id => params[:filter_id]}
222
+ { :type => resource_name, :id => params[:filter_id] }
200
223
  end
201
224
  end
202
225
  end
@@ -209,7 +232,7 @@ module Katello
209
232
 
210
233
  unless @filter_rule
211
234
  fail HttpErrors::NotFound, _("Couldn't find %{type} Filter with id %{id}") %
212
- {:type => resource_name, :id => filter_rule_id}
235
+ { :type => resource_name, :id => filter_rule_id }
213
236
  end
214
237
  end
215
238
  end
@@ -272,7 +295,7 @@ module Katello
272
295
  def check_repo_for_content_resource
273
296
  if params[:repository_id] && !@resource.send(repo_association).include?(@repo.pulp_id)
274
297
  fail HttpErrors::NotFound, _("Could not find %{content} with id '%{id}' in repository.") %
275
- {content: resource_name, id: params[:id]}
298
+ { content: resource_name, id: params[:id] }
276
299
  end
277
300
  end
278
301
 
@@ -6,12 +6,6 @@ module Katello
6
6
  include Foreman::Controller::Flash
7
7
 
8
8
  module Overrides
9
- def edit
10
- @can_toggle_sca = Katello::UpstreamConnectionChecker.new(@taxonomy).can_connect? &&
11
- (@taxonomy.upstream_consumer.simple_content_access_eligible? || @taxonomy.simple_content_access?)
12
- super
13
- end
14
-
15
9
  def destroy
16
10
  if @taxonomy.is_a?(Organization)
17
11
  begin
@@ -30,7 +24,8 @@ module Katello
30
24
  if taxonomy_class == Organization
31
25
  begin
32
26
  @taxonomy = Organization.new(resource_params)
33
- ::Katello::OrganizationCreator.new(@taxonomy).create!
27
+ sca = ::Foreman::Cast.to_bool(params[:simple_content_access])
28
+ ::Katello::OrganizationCreator.new(@taxonomy, sca: sca).create!
34
29
  @taxonomy.reload
35
30
  switch_taxonomy
36
31
  if @count_nil_hosts > 0
@@ -50,20 +45,16 @@ module Katello
50
45
  end
51
46
 
52
47
  def update
53
- super # we run super first here so that flash messages won't be in a confusing order
54
48
  return if params[:simple_content_access].nil?
55
49
  sca_param = ::Foreman::Cast.to_bool(params[:simple_content_access])
56
- if sca_param && !@taxonomy.simple_content_access?
50
+ if sca_param && !@taxonomy.simple_content_access?(cached: false)
57
51
  # user has requested SCA enable
58
- task = async_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:id])
59
- info "Enabling Simple Content Access for organization #{@taxonomy.name}.",
60
- link: { text: "View progress on the Tasks page", href: "/foreman_tasks/tasks/#{task&.id}" }
61
- elsif !sca_param && @taxonomy.simple_content_access?
52
+ sync_task(::Actions::Katello::Organization::SimpleContentAccess::Enable, params[:id])
53
+ elsif !sca_param && @taxonomy.simple_content_access?(cached: false)
62
54
  # user has requested SCA disable
63
- task = async_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:id])
64
- info "Disabling Simple Content Access for organization #{@taxonomy.name}.",
65
- link: { text: "View progress on the Tasks page", href: "/foreman_tasks/tasks/#{task&.id}" }
55
+ sync_task(::Actions::Katello::Organization::SimpleContentAccess::Disable, params[:id])
66
56
  end
57
+ super
67
58
  end
68
59
 
69
60
  included do
@@ -0,0 +1,16 @@
1
+ module Actions
2
+ module Katello
3
+ module AlternateContentSource
4
+ module AlternateContentSourceCommon
5
+ def create_simplified_acs(acs, smart_proxy)
6
+ acs.products.each do |product|
7
+ product.repositories.has_url.library.with_type(acs.content_type).each do |repo|
8
+ smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id, repository_id: repo.id)
9
+ plan_action(Pulp3::Orchestration::AlternateContentSource::Create, smart_proxy_acs)
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -2,15 +2,21 @@ module Actions
2
2
  module Katello
3
3
  module AlternateContentSource
4
4
  class Create < Actions::EntryAction
5
- def plan(acs, smart_proxies)
5
+ include Actions::Katello::AlternateContentSource::AlternateContentSourceCommon
6
+
7
+ def plan(acs, smart_proxies, products = nil)
6
8
  acs.save!
7
9
  action_subject(acs)
8
- smart_proxies = smart_proxies.uniq
10
+ acs.products << products if products.present?
11
+ smart_proxies = smart_proxies.present? ? smart_proxies.uniq : []
9
12
  concurrence do
10
13
  smart_proxies.each do |smart_proxy|
11
- ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id)
12
- plan_action(Pulp3::Orchestration::AlternateContentSource::Create,
13
- acs, smart_proxy)
14
+ if acs.custom?
15
+ smart_proxy_acs = ::Katello::SmartProxyAlternateContentSource.create(alternate_content_source_id: acs.id, smart_proxy_id: smart_proxy.id)
16
+ plan_action(Pulp3::Orchestration::AlternateContentSource::Create, smart_proxy_acs)
17
+ elsif acs.simplified?
18
+ create_simplified_acs(acs, smart_proxy)
19
+ end
14
20
  end
15
21
  end
16
22
  end