katello 3.17.0 → 3.18.0

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 (272) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +38 -21
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +3 -1
  4. data/app/controllers/katello/api/v2/activation_keys_controller.rb +10 -15
  5. data/app/controllers/katello/api/v2/capsule_content_controller.rb +2 -2
  6. data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -8
  7. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +98 -0
  8. data/app/controllers/katello/api/v2/content_exports_controller.rb +84 -0
  9. data/app/controllers/katello/api/v2/content_imports_controller.rb +59 -0
  10. data/app/controllers/katello/api/v2/content_view_components_controller.rb +31 -14
  11. data/app/controllers/katello/api/v2/content_view_filters_controller.rb +17 -8
  12. data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -0
  13. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +65 -71
  14. data/app/controllers/katello/api/v2/content_views_controller.rb +37 -26
  15. data/app/controllers/katello/api/v2/environments_controller.rb +8 -8
  16. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +5 -5
  17. data/app/controllers/katello/api/v2/host_collections_controller.rb +19 -16
  18. data/app/controllers/katello/api/v2/host_debs_controller.rb +1 -0
  19. data/app/controllers/katello/api/v2/host_errata_controller.rb +2 -2
  20. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +35 -6
  21. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -1
  22. data/app/controllers/katello/api/v2/products_controller.rb +9 -9
  23. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +1 -1
  24. data/app/controllers/katello/api/v2/repositories_controller.rb +10 -5
  25. data/app/controllers/katello/api/v2/repository_sets_controller.rb +24 -14
  26. data/app/controllers/katello/api/v2/subscriptions_controller.rb +1 -1
  27. data/app/controllers/katello/api/v2/sync_plans_controller.rb +8 -9
  28. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +9 -2
  29. data/app/controllers/katello/concerns/api/v2/authorization.rb +19 -5
  30. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +22 -18
  31. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +21 -0
  32. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +1 -1
  33. data/app/controllers/katello/concerns/organizations_controller_extensions.rb +2 -1
  34. data/app/controllers/katello/concerns/registration_controller_extensions.rb +16 -0
  35. data/app/helpers/katello/katello_urls_helper.rb +5 -2
  36. data/app/lib/actions/candlepin/product/content_create.rb +2 -0
  37. data/app/lib/actions/candlepin/product/content_update.rb +2 -0
  38. data/app/lib/actions/helpers/smart_proxy_sync_history_helper.rb +24 -0
  39. data/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +6 -2
  40. data/app/lib/actions/katello/capsule_content/sync.rb +1 -1
  41. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +16 -7
  42. data/app/lib/actions/katello/content_view/promote_to_environment.rb +1 -1
  43. data/app/lib/actions/katello/content_view/publish.rb +9 -9
  44. data/app/lib/actions/katello/content_view_version/import.rb +8 -13
  45. data/app/lib/actions/katello/content_view_version/import_library.rb +17 -0
  46. data/app/lib/actions/katello/content_view_version/incremental_update.rb +18 -3
  47. data/app/lib/actions/katello/host/hypervisors_update.rb +18 -0
  48. data/app/lib/actions/katello/host/update_system_purpose.rb +31 -0
  49. data/app/lib/actions/katello/host/upload_package_profile.rb +3 -1
  50. data/app/lib/actions/katello/host/upload_profiles.rb +8 -6
  51. data/app/lib/actions/katello/organization/manifest_delete.rb +0 -1
  52. data/app/lib/actions/katello/organization/manifest_import.rb +0 -1
  53. data/app/lib/actions/katello/organization/manifest_refresh.rb +0 -1
  54. data/app/lib/actions/katello/product/content_create.rb +7 -6
  55. data/app/lib/actions/katello/repository/filtered_index_content.rb +10 -1
  56. data/app/lib/actions/katello/repository/import_upload.rb +4 -1
  57. data/app/lib/actions/katello/repository/remove_content.rb +1 -1
  58. data/app/lib/actions/katello/repository/sync.rb +3 -1
  59. data/app/lib/actions/katello/repository/update.rb +5 -1
  60. data/app/lib/actions/katello/repository/upload_files.rb +1 -0
  61. data/app/lib/actions/middleware/record_smart_proxy_sync_history.rb +15 -0
  62. data/app/lib/actions/pulp/consumer/sync_capsule.rb +4 -2
  63. data/app/lib/actions/pulp/repository/distributor_publish.rb +1 -1
  64. data/app/lib/actions/pulp3/capsule_content/sync.rb +1 -0
  65. data/app/lib/actions/pulp3/content_migration.rb +10 -0
  66. data/app/lib/actions/pulp3/content_migration_presenter.rb +59 -0
  67. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -1
  68. data/app/lib/actions/pulp3/content_view_version/create_importer.rb +7 -3
  69. data/app/lib/actions/pulp3/content_view_version/export.rb +7 -1
  70. data/app/lib/actions/pulp3/content_view_version/import.rb +7 -3
  71. data/app/lib/actions/pulp3/import_migration.rb +6 -1
  72. data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +2 -1
  73. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +38 -14
  74. data/app/lib/actions/pulp3/orchestration/content_view_version/export_library.rb +60 -0
  75. data/app/lib/actions/pulp3/orchestration/content_view_version/import.rb +16 -10
  76. data/app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb +4 -1
  77. data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +16 -3
  78. data/app/lib/actions/pulp3/repository/commit_upload.rb +2 -1
  79. data/app/lib/actions/pulp3/repository/copy_content.rb +1 -1
  80. data/app/lib/actions/pulp3/repository/delete.rb +1 -1
  81. data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
  82. data/app/lib/actions/pulp3/repository/save_version.rb +1 -1
  83. data/app/lib/actions/pulp3/repository/upload_tag.rb +18 -0
  84. data/app/lib/katello/resources/candlepin/consumer.rb +2 -2
  85. data/app/lib/katello/resources/candlepin/owner.rb +5 -0
  86. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +6 -0
  87. data/app/lib/katello/resources/registry.rb +3 -3
  88. data/app/models/katello/authorization/activation_key.rb +4 -0
  89. data/app/models/katello/authorization/content_view.rb +13 -0
  90. data/app/models/katello/authorization/content_view_component.rb +15 -0
  91. data/app/models/katello/authorization/content_view_filter.rb +15 -0
  92. data/app/models/katello/authorization/content_view_version.rb +25 -2
  93. data/app/models/katello/authorization/content_view_version_export_history.rb +1 -1
  94. data/app/models/katello/authorization/gpg_key.rb +12 -4
  95. data/app/models/katello/authorization/lifecycle_environment.rb +8 -0
  96. data/app/models/katello/authorization/organization.rb +8 -0
  97. data/app/models/katello/authorization/sync_plan.rb +16 -0
  98. data/app/models/katello/concerns/operatingsystem_extensions.rb +2 -0
  99. data/app/models/katello/concerns/organization_extensions.rb +4 -5
  100. data/app/models/katello/concerns/smart_proxy_extensions.rb +6 -4
  101. data/app/models/katello/content_migration_progress.rb +4 -0
  102. data/app/models/katello/content_view.rb +30 -4
  103. data/app/models/katello/content_view_component.rb +2 -0
  104. data/app/models/katello/content_view_filter.rb +5 -0
  105. data/app/models/katello/content_view_history.rb +2 -1
  106. data/app/models/katello/content_view_package_filter.rb +1 -1
  107. data/app/models/katello/content_view_puppet_module.rb +8 -0
  108. data/app/models/katello/content_view_repository.rb +13 -1
  109. data/app/models/katello/content_view_version_export_history.rb +8 -1
  110. data/app/models/katello/glue/candlepin/pool.rb +9 -14
  111. data/app/models/katello/glue/pulp/repo.rb +8 -0
  112. data/app/models/katello/gpg_key.rb +1 -1
  113. data/app/models/katello/ping.rb +8 -3
  114. data/app/models/katello/repository.rb +33 -0
  115. data/app/models/katello/root_repository.rb +26 -1
  116. data/app/models/katello/smart_proxy_sync_history.rb +8 -0
  117. data/app/services/katello/candlepin/event_handler.rb +2 -0
  118. data/app/services/katello/candlepin/message_handler.rb +34 -0
  119. data/app/services/katello/candlepin/upstream_consumer.rb +28 -0
  120. data/app/services/katello/host_status_manager.rb +9 -0
  121. data/app/services/katello/pulp3/api/apt.rb +57 -0
  122. data/app/services/katello/pulp3/api/core.rb +8 -0
  123. data/app/services/katello/pulp3/api/docker.rb +4 -0
  124. data/app/services/katello/pulp3/content_view_version/export.rb +125 -8
  125. data/app/services/katello/pulp3/content_view_version/import.rb +39 -34
  126. data/app/services/katello/pulp3/content_view_version/import_export_common.rb +6 -16
  127. data/app/services/katello/pulp3/content_view_version/import_validator.rb +114 -0
  128. data/app/services/katello/pulp3/deb.rb +38 -0
  129. data/app/services/katello/pulp3/docker_manifest.rb +1 -0
  130. data/app/services/katello/pulp3/docker_tag.rb +1 -0
  131. data/app/services/katello/pulp3/migration.rb +51 -10
  132. data/app/services/katello/pulp3/pulp_content_unit.rb +5 -0
  133. data/app/services/katello/pulp3/repository.rb +10 -4
  134. data/app/services/katello/pulp3/repository/ansible_collection.rb +9 -0
  135. data/app/services/katello/pulp3/repository/apt.rb +63 -0
  136. data/app/services/katello/pulp3/repository/docker.rb +9 -0
  137. data/app/services/katello/pulp3/repository/yum.rb +14 -9
  138. data/app/services/katello/pulp3/repository_mirror.rb +9 -4
  139. data/app/services/katello/pulp3/task.rb +4 -0
  140. data/app/services/katello/pulp3/task_group.rb +4 -0
  141. data/app/services/katello/repository_type.rb +2 -1
  142. data/app/services/katello/smart_proxy_helper.rb +9 -0
  143. data/app/views/dashboard/_subscription_widget.html.erb +0 -5
  144. data/app/views/foreman/hosts/_registration.html.erb +12 -0
  145. data/app/views/katello/api/v2/content_view_version_export_histories/show.json.rabl +1 -1
  146. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -0
  147. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  148. data/app/views/katello/layouts/react.html.erb +3 -2
  149. data/app/views/overrides/activation_keys/_host_tab_pane.html.erb +1 -5
  150. data/app/views/overrides/organizations/_index_row_override.html.erb +1 -1
  151. data/config/routes/api/v2.rb +24 -2
  152. data/config/routes/overrides.rb +1 -0
  153. data/db/migrate/20200929200357_create_katello_smart_proxy_sync_history.rb +13 -0
  154. data/db/migrate/20201008204114_add_os_versions_to_katello_root_repositories.rb +5 -0
  155. data/db/migrate/20201012172713_remove_gpg_key_perms.rb +23 -0
  156. data/db/migrate/20201012192035_add_metadata_to_katello_content_view_version_export_history.rb +5 -0
  157. data/db/migrate/20201021150008_add_import_only_to_katello_content_view.rb +5 -0
  158. data/db/migrate/20201119211133_pulp3_migration_progress.rb +9 -0
  159. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  160. data/engines/bastion/app/assets/javascripts/bastion/components/notification.service.js +1 -1
  161. data/engines/bastion/app/assets/javascripts/bastion/components/nutupane.factory.js +8 -13
  162. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-system-purpose-modal.controller.js +112 -0
  163. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-system-purpose-modal.html +78 -0
  164. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-modal-helper.service.js +11 -0
  165. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-hosts.controller.js +5 -0
  166. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-debs-installed.controller.js +2 -42
  167. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +4 -0
  168. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.controller.js +6 -2
  169. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details.controller.js +12 -0
  170. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +7 -7
  171. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-info.html +7 -1
  172. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/content-view-new.controller.js +17 -3
  173. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/new/views/content-view-new.html +16 -2
  174. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/views/content-views.html +5 -0
  175. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/host-collection-details.controller.js +4 -0
  176. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-info.html +6 -0
  177. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host-bulk-action.factory.js +2 -1
  178. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +92 -19
  179. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +17 -20
  180. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +17 -24
  181. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +1292 -1170
  182. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/it.po +17 -20
  183. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +858 -807
  184. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +18 -19
  185. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +17 -24
  186. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ru.po +17 -18
  187. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +986 -971
  188. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +19 -20
  189. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -9
  190. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +6 -7
  191. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +168 -155
  192. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +17 -2
  193. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +125 -113
  194. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +15 -3
  195. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +46 -0
  196. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository-types.service.js +8 -1
  197. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +1 -1
  198. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-details.html +1 -1
  199. data/lib/katello/engine.rb +2 -0
  200. data/lib/katello/permission_creator.rb +98 -69
  201. data/lib/katello/permissions/host_permissions.rb +1 -0
  202. data/lib/katello/plugin.rb +10 -2
  203. data/lib/katello/repository_types/deb.rb +9 -1
  204. data/lib/katello/tasks/pulp3_migration.rake +17 -3
  205. data/lib/katello/tasks/pulp3_migration_abort.rake +22 -0
  206. data/lib/katello/tasks/pulp3_migration_stats.rake +41 -0
  207. data/lib/katello/tasks/receptor/extract_orgs.rake +1 -1
  208. data/lib/katello/tasks/reset.rake +2 -1
  209. data/lib/katello/tasks/upgrades/3.18/add_cvv_export_history_metadata.rb +18 -0
  210. data/lib/katello/version.rb +1 -1
  211. data/locale/action_names.rb +51 -44
  212. data/locale/bn/katello.po +279 -55
  213. data/locale/cs/katello.po +278 -51
  214. data/locale/de/katello.po +279 -52
  215. data/locale/en/katello.po +278 -49
  216. data/locale/es/katello.po +279 -51
  217. data/locale/fr/katello.po +279 -51
  218. data/locale/gu/katello.po +279 -55
  219. data/locale/hi/katello.po +279 -55
  220. data/locale/it/katello.po +279 -51
  221. data/locale/ja/katello.po +279 -52
  222. data/locale/katello.pot +1379 -971
  223. data/locale/kn/katello.po +279 -55
  224. data/locale/ko/katello.po +279 -51
  225. data/locale/mr/katello.po +279 -55
  226. data/locale/or/katello.po +279 -55
  227. data/locale/pa/katello.po +279 -55
  228. data/locale/pt/katello.po +278 -52
  229. data/locale/pt_BR/katello.po +279 -51
  230. data/locale/ru/katello.po +279 -51
  231. data/locale/ta/katello.po +279 -55
  232. data/locale/te/katello.po +279 -55
  233. data/locale/zh_CN/katello.po +279 -51
  234. data/locale/zh_TW/katello.po +279 -52
  235. data/webpack/components/ActionableDetail.js +2 -1
  236. data/webpack/components/Search/Search.js +1 -1
  237. data/webpack/components/Table/MainTable.js +6 -2
  238. data/webpack/components/Table/TableWrapper.js +46 -9
  239. data/webpack/scenes/ContentViews/ContentViewSelectors.js +7 -3
  240. data/webpack/scenes/ContentViews/ContentViewsConstants.js +8 -0
  241. data/webpack/scenes/ContentViews/ContentViewsPage.js +2 -9
  242. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +25 -3
  243. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +14 -4
  244. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -1
  245. data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +56 -0
  246. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +169 -0
  247. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +47 -0
  248. data/webpack/scenes/ContentViews/Details/Repositories/RepoAddedStatus.js +17 -0
  249. data/webpack/scenes/ContentViews/Details/Repositories/RepoIcon.js +23 -0
  250. data/webpack/scenes/ContentViews/Details/Repositories/SelectableDropdown.js +49 -0
  251. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +154 -0
  252. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +131 -0
  253. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
  254. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +4 -1
  255. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +2 -2
  256. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +29 -19
  257. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +17 -0
  258. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +4 -0
  259. data/webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js +19 -2
  260. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +9 -1
  261. data/webpack/scenes/Subscriptions/Manifest/index.js +2 -1
  262. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -1
  263. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +3 -0
  264. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +8 -2
  265. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  266. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +3 -0
  267. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +6 -0
  268. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsSelectors.test.js.snap +6 -0
  269. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +1 -13
  270. data/webpack/test-utils/react-testing-lib-wrapper.js +3 -0
  271. metadata +74 -13
  272. data/webpack/__mocks__/foremanReact/components/common/Fill/GlobalFill.js +0 -3
@@ -21,6 +21,15 @@ module Katello
21
21
  end
22
22
  end
23
23
 
24
+ def clear_smart_proxy_sync_histories(repo_list = [])
25
+ if repo_list.empty?
26
+ @smart_proxy.smart_proxy_sync_histories.delete_all
27
+ return
28
+ end
29
+ repo_ids = repo_list.map(&:id)
30
+ @smart_proxy.smart_proxy_sync_histories.where("repository_id IN (?)", repo_ids).delete_all
31
+ end
32
+
24
33
  def combined_repos_available_to_capsule(environment = nil, content_view = nil, repository = nil)
25
34
  lifecycle_environment_check(environment, repository)
26
35
  if repository
@@ -4,11 +4,6 @@
4
4
 
5
5
  <% if Organization.current.blank? %>
6
6
  <p class="ca"><%= _("Please select an organization to view subscription status.") %></p>
7
- <% elsif Organization.current.simple_content_access?%>
8
- <div class="bastion alert alert-info">
9
- <span translate>This organization has Simple Content Access enabled. Hosts can consume from all repositories in their Content View regardless of subscription status.
10
- </span>
11
- </div>
12
7
  <% else %>
13
8
  <% total_count = total_host_count() %>
14
9
  <% partial_consumer_count = partial_consumer_count() %>
@@ -0,0 +1,12 @@
1
+ <div class='form-group'>
2
+ <label class='col-md-2 control-label'>
3
+ <%= _('Activation Key(s)') %>
4
+ <% help = _('Activation key(s) for Subscription Manager. Required for CentOS and Red Hat Enterprise Linux. Multiple keys add separated by comma, example: key1,key2,key3.') %>
5
+ <a rel="popover" data-content="<%= help %>" data-trigger="focus" data-container="body" data-html="true" tabindex="-1">
6
+ <span class="pficon pficon-info "></span>
7
+ </a>
8
+ </label>
9
+ <div class='col-md-4'>
10
+ <%= text_field_tag 'activation_key', params[:activation_key], class: 'form-control' %>
11
+ </div>
12
+ </div>
@@ -1,6 +1,6 @@
1
1
  object @resource
2
2
 
3
- attributes :destination_server, :path, :id
3
+ attributes :destination_server, :path, :id, :metadata
4
4
 
5
5
  node :content_view_version do |h|
6
6
  h.content_view_version.name
@@ -9,6 +9,7 @@ attributes :version_count
9
9
  attributes :latest_version
10
10
  attributes :auto_publish
11
11
  attributes :solve_dependencies
12
+ attributes :import_only
12
13
 
13
14
  node :next_version do |content_view|
14
15
  content_view.next_version.to_f.to_s
@@ -7,7 +7,7 @@ attributes :relative_path, :container_repository_name, :full_path, :library_inst
7
7
  attributes :version_href, :remote_href, :publication_href
8
8
 
9
9
  glue(@object.root) do
10
- attributes :content_type, :url, :arch, :content_id
10
+ attributes :content_type, :url, :arch, :os_versions, :content_id
11
11
  attributes :major, :minor
12
12
 
13
13
  child :product do |_product|
@@ -10,7 +10,8 @@
10
10
  <%= notifications %>
11
11
  <div id="organization-id" data-id="<%= Organization.current.id if Organization.current %>" ></div>
12
12
  <div id="user-id" data-id="<%= User.current.id if User.current %>" ></div>
13
- <div id="reactRoot"></div>
14
- <%= mount_react_component('katello', '#reactRoot') %>
13
+ <div id="reactRoot">
14
+ <%= react_component('katello') %>
15
+ </div>
15
16
  <% end %>
16
17
  <%= render file: "layouts/base" %>
@@ -9,13 +9,9 @@
9
9
 
10
10
  <%= field(f, _("Activation Keys"),
11
11
  :help_inline => _("The value will be available in templates as @host.params['#{kt_ak_label}']")) do
12
- tag.div id: :kt_activation_keys
12
+ react_component('TypeAheadSelect', { id: 'kt_activation_keys', multiple: true, allowNew: true })
13
13
  end %>
14
14
 
15
- <%= mount_react_component('TypeAheadSelect', '#kt_activation_keys',
16
- {id: 'kt_activation_keys', multiple: true, allowNew: true}.to_json,
17
- { flatten_data: true }) %>
18
-
19
15
  <div class="alert alert-info">
20
16
  <p><b><%= _('Subscriptions information based on selected activation keys:') %></b></p>
21
17
  <ul id="ak-subscriptions-info"></ul>
@@ -1,3 +1,3 @@
1
1
  <% if taxonomy.is_a?(Organization) %>
2
- <td><%= taxonomy.simple_content_access? ? _("Enabled") : _("Disabled") %></td>
2
+ <td><%= checked_icon taxonomy.simple_content_access? %></td>
3
3
  <% end %>
@@ -113,6 +113,22 @@ Katello::Engine.routes.draw do
113
113
  end
114
114
  end
115
115
 
116
+ api_resources :content_exports, :only => [] do
117
+ collection do
118
+ post :version
119
+ post :library
120
+ get :index
121
+ get :api_status
122
+ end
123
+ end
124
+
125
+ api_resources :content_export_incrementals, :only => [] do
126
+ collection do
127
+ post :version
128
+ post :library
129
+ end
130
+ end
131
+
116
132
  api_resources :content_view_versions, :except => [:create] do
117
133
  member do
118
134
  post :promote
@@ -121,10 +137,15 @@ Katello::Engine.routes.draw do
121
137
  get :available_errata, :controller => :errata
122
138
  end
123
139
  collection do
124
- get :export_histories
125
140
  get :auto_complete_search
126
141
  post :incremental_update
127
- post :import
142
+ end
143
+ end
144
+
145
+ api_resources :content_imports, :only => [] do
146
+ collection do
147
+ post :version
148
+ post :library
128
149
  end
129
150
  end
130
151
 
@@ -357,6 +378,7 @@ Katello::Engine.routes.draw do
357
378
  get :ping
358
379
  match '/simple_content_access/enable', :to => 'upstream_subscriptions#enable_simple_content_access', :via => :put
359
380
  match '/simple_content_access/disable', :to => 'upstream_subscriptions#disable_simple_content_access', :via => :put
381
+ match '/simple_content_access/eligible', :to => 'upstream_subscriptions#simple_content_access_eligible', :via => :get
360
382
  end
361
383
  end
362
384
  end
@@ -78,6 +78,7 @@ Foreman::Application.routes.draw do
78
78
  match '/bulk/release_version' => 'hosts_bulk_actions#release_version', :via => :put
79
79
  match '/bulk/traces' => 'hosts_bulk_actions#traces', :via => :post
80
80
  match '/bulk/resolve_traces' => 'hosts_bulk_actions#resolve_traces', :via => :put
81
+ match '/bulk/system_purpose' => 'hosts_bulk_actions#system_purpose', :via => :put
81
82
  match '/bulk/available_incremental_updates' => 'hosts_bulk_actions#available_incremental_updates', :via => :post
82
83
  match '/bulk/module_streams' => 'hosts_bulk_actions#module_streams', :via => :post
83
84
  match '/subscriptions/' => 'host_subscriptions#create', :via => :post
@@ -0,0 +1,13 @@
1
+ class CreateKatelloSmartProxySyncHistory < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :katello_smart_proxy_sync_history do |t|
4
+ t.references :smart_proxy, :null => false
5
+ t.references :repository, :null => false
6
+ t.datetime :started_at
7
+ t.datetime :finished_at
8
+ end
9
+ add_index "katello_smart_proxy_sync_history", ["smart_proxy_id"], :name => "index_spsh_smart_proxy_id"
10
+ add_index "katello_smart_proxy_sync_history", ["repository_id"], :name => "index_spsh_repository_id"
11
+ add_index "katello_smart_proxy_sync_history", [:smart_proxy_id, :repository_id], :unique => true, :name => 'index_spsh_smart_proxy_repository_unique'
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ class AddOsVersionsToKatelloRootRepositories < ActiveRecord::Migration[6.0]
2
+ def change
3
+ add_column :katello_root_repositories, :os_versions, :text
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ class RemoveGpgKeyPerms < ActiveRecord::Migration[6.0]
2
+ def permission_map
3
+ {
4
+ Permission.find_by(name: :view_gpg_keys) => Permission.find_by(name: :view_content_credentials),
5
+ Permission.find_by(name: :edit_gpg_keys) => Permission.find_by(name: :edit_content_credentials),
6
+ Permission.find_by(name: :destroy_gpg_keys) => Permission.find_by(name: :destroy_content_credentials),
7
+ Permission.find_by(name: :create_gpg_keys) => Permission.find_by(name: :create_content_credentials)
8
+ }
9
+ end
10
+
11
+ def up
12
+ perms = permission_map
13
+ perms.each do |old_perm, new_perm|
14
+ Filtering.where(permission_id: old_perm.id).update_all(:permission_id => new_perm.id) if old_perm
15
+ end
16
+ names = perms.keys.compact.map(&:name)
17
+ Permission.where(:name => names).destroy_all if names.any?
18
+ end
19
+
20
+ def down
21
+ fail ActiveRecord::IrreversibleMigration
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ class AddMetadataToKatelloContentViewVersionExportHistory < ActiveRecord::Migration[6.0]
2
+ def change
3
+ add_column :katello_content_view_version_export_histories, :metadata, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddImportOnlyToKatelloContentView < ActiveRecord::Migration[6.0]
2
+ def change
3
+ add_column :katello_content_views, :import_only, :boolean, :default => false, :null => false
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class Pulp3MigrationProgress < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :katello_content_migration_progresses do |t|
4
+ t.string :progress_message
5
+ t.boolean :canceled, null: false, default: false
6
+ t.string :task_id, null: false, index: {name: 'katello_content_migration_progress_task_id', unique: true }
7
+ end
8
+ end
9
+ end
@@ -13,6 +13,7 @@ UpgradeTask.define_tasks(:katello) do
13
13
  {:name => 'katello:upgrades:3.13:republish_deb_metadata'},
14
14
  {:name => 'katello:upgrades:3.15:set_sub_facet_dmi_uuid'},
15
15
  {:name => 'katello:upgrades:3.15:reindex_rpm_modular'},
16
- {:name => 'katello:upgrades:3.16:update_applicable_el8_hosts'}
16
+ {:name => 'katello:upgrades:3.16:update_applicable_el8_hosts'},
17
+ {:name => 'katello:upgrades:3.18:add_cvv_export_history_metadata'}
17
18
  ]
18
19
  end
@@ -32,6 +32,6 @@ angular.module('Bastion.components').service("Notification", ['$interpolate', 'f
32
32
  };
33
33
 
34
34
  this.setErrorMessage = function (message, context) {
35
- foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'danger'});
35
+ foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'error'});
36
36
  };
37
37
  }]);
@@ -97,7 +97,6 @@ angular.module('Bastion.components').factory('Nutupane',
97
97
  self.load = function () {
98
98
  var deferred = $q.defer(),
99
99
  responsePage,
100
- resourceCall,
101
100
  table = self.table,
102
101
  existingTable = TableCache.getTable(getTableName());
103
102
 
@@ -115,11 +114,7 @@ angular.module('Bastion.components').factory('Nutupane',
115
114
  params.search = table.searchTerm || "";
116
115
  params.search = self.searchTransform(params.search);
117
116
 
118
- resourceCall = resource[table.action](params, function (response) {
119
- if (response.error) {
120
- Notification.setErrorMessage(response.error);
121
- }
122
-
117
+ resource[table.action](params).$promise.then(function (response) {
123
118
  angular.forEach(response.results, function (row) {
124
119
  row.selected = table.allResultsSelected;
125
120
  });
@@ -155,14 +150,14 @@ angular.module('Bastion.components').factory('Nutupane',
155
150
  table.working = false;
156
151
  table.refreshing = false;
157
152
  table.initialLoad = false;
158
- });
153
+ }).catch(function(response) {
154
+ table.working = false;
155
+ table.refreshing = false;
159
156
 
160
- if (resourceCall && resourceCall.$promise && resourceCall.$promise.catch) {
161
- resourceCall.$promise.catch(function () {
162
- table.working = false;
163
- table.refreshing = false;
164
- });
165
- }
157
+ if (response && response.data && response.data.error && response.data.error.message) {
158
+ Notification.setErrorMessage(response.data.error.message);
159
+ }
160
+ });
166
161
 
167
162
  return deferred.promise;
168
163
  };
@@ -0,0 +1,112 @@
1
+ /**
2
+ * @ngdoc object
3
+ * @name Bastion.content-hosts.controller:ContentHostsBulkSystemPurposeModalController
4
+ *
5
+ * @requires $scope
6
+ * @requires $uibModalInstance
7
+ * @requires HostBulkAction
8
+ * @requires Organization
9
+ * @requires CurrentOrganization
10
+ * @requires Notification
11
+ * @requires hostIds
12
+ *
13
+ * @description
14
+ * A controller for providing bulk action functionality for setting system purpose values
15
+ */
16
+ angular.module('Bastion.content-hosts').controller('ContentHostsBulkSystemPurposeModalController',
17
+ ['$scope', '$uibModalInstance', 'HostBulkAction', 'Organization', 'CurrentOrganization', 'Notification', 'hostIds',
18
+ function ($scope, $uibModalInstance, HostBulkAction, Organization, CurrentOrganization, Notification, hostIds) {
19
+
20
+ $scope.organization = Organization.get({id: CurrentOrganization});
21
+
22
+ $scope.purposeAddonsList = function () {
23
+ var defaultOptions = ['No Change', 'None (Clear)'];
24
+ if ($scope.organization.system_purposes && $scope.organization.system_purposes.addons) {
25
+ return defaultOptions.concat($scope.organization.system_purposes.addons);
26
+ }
27
+ return [];
28
+ };
29
+
30
+ $scope.defaultUsages = ['No change', 'None (Clear)', 'Production', 'Development/Test', 'Disaster Recovery'];
31
+ $scope.defaultRoles = ['No change', 'None (Clear)', 'Red Hat Enterprise Linux Server', 'Red Hat Enterprise Linux Workstation', 'Red Hat Enterprise Linux Compute Node'];
32
+ $scope.defaultServiceLevels = ['No change', 'None (Clear)', 'Self-Support', 'Standard', 'Premium'];
33
+
34
+ $scope.hostCount = hostIds.included.ids.length;
35
+
36
+ $scope.selectedUsages = $scope.defaultUsages[0];
37
+ $scope.selectedRoles = $scope.defaultRoles[0];
38
+ $scope.selectedServiceLevels = $scope.defaultServiceLevels[0];
39
+
40
+ $scope.selected = {
41
+ addons: undefined
42
+ };
43
+
44
+ $scope.selectedItemToParam = function (item) {
45
+ var mapping = {
46
+ "None (Clear)": "",
47
+ "No change": null,
48
+ "": []
49
+ };
50
+ if (Array.isArray(item)) {
51
+ return $scope.selectedAddonsToParam(item);
52
+ }
53
+ if (mapping.hasOwnProperty(item)) {
54
+ return mapping[item];
55
+ }
56
+ return item;
57
+ };
58
+
59
+ $scope.selectedAddonsToParam = function (addons) {
60
+ var intentOptions = ['No Change', 'None (Clear)'];
61
+
62
+ var userIntent = intentOptions.filter(function(val) {
63
+ return addons.indexOf(val) !== -1;
64
+ });
65
+
66
+ if (userIntent.length === 0) {
67
+ return addons;
68
+ }
69
+
70
+ if (userIntent.includes('No Change')) {
71
+ return null;
72
+ }
73
+
74
+ if (userIntent.includes('None (Clear)') && addons.length === 1) {
75
+ return [];
76
+ } if (userIntent.includes('None (Clear)') && addons.length > 1) {
77
+ addons.shift();
78
+ return addons;
79
+ }
80
+ };
81
+
82
+ function actionParams() {
83
+ var params = hostIds;
84
+
85
+ params['purpose_usage'] = $scope.selectedItemToParam($scope.selectedUsages);
86
+ params['purpose_role'] = $scope.selectedItemToParam($scope.selectedRoles);
87
+ params['purpose_addons'] = $scope.selectedItemToParam($scope.selectedAddons);
88
+ params['service_level'] = $scope.selectedItemToParam($scope.selectedServiceLevels);
89
+
90
+ return params;
91
+ }
92
+
93
+ $scope.performAction = function () {
94
+ HostBulkAction.systemPurpose(actionParams(), function (task) {
95
+ $scope.ok();
96
+ $scope.transitionTo('content-hosts.bulk-task', {taskId: task.id});
97
+ }, function (response) {
98
+ angular.forEach(response.data.errors, function (error) {
99
+ Notification.setErrorMessage(error);
100
+ });
101
+ });
102
+ };
103
+
104
+ $scope.ok = function () {
105
+ $uibModalInstance.close();
106
+ };
107
+
108
+ $scope.cancel = function () {
109
+ $uibModalInstance.dismiss('cancel');
110
+ };
111
+ }]
112
+ );
@@ -0,0 +1,78 @@
1
+ <div data-extend-template="components/views/bst-modal.html">
2
+ <h4 data-block="modal-header" translate>Content Host System Purpose</h4>
3
+
4
+ <div data-block="modal-body">
5
+ <h4 translate>Assign System Purpose:</h4>
6
+
7
+ <div class="row">
8
+ <div class="col-sm-12">
9
+ <div bst-global-notification></div>
10
+ </div>
11
+ </div>
12
+
13
+ <form name="contentHostContentForm" class="form" ng-hide="content.workingMode">
14
+ <div>
15
+ <label translate>Service Level:</label>
16
+
17
+ <select type="select"
18
+ ng-options="item for item in defaultServiceLevels"
19
+ ng-model="selectedServiceLevels">
20
+ </select>
21
+ <br /><br />
22
+
23
+ <label translate>Usage Type:</label>
24
+
25
+ <select type="select"
26
+ ng-options="item for item in defaultUsages"
27
+ ng-model="selectedRoles">
28
+ </select>
29
+ <br /><br />
30
+
31
+ <label translate>Role:</label>
32
+
33
+ <select type="select"
34
+ ng-options="item for item in defaultRoles"
35
+ ng-model="selectedUsages">
36
+ </select>
37
+ <br /><br />
38
+
39
+ <label ng-hide="!purposeAddonsList().length" translate>Add ons:</label>
40
+ <div class="help-block" style="text-align:left;">
41
+ <p translate>ctrl-click or shift-click to select multiple Add ons</p>
42
+ </div>
43
+
44
+ <select multiple ng-multiple="true"
45
+ ng-hide="!purposeAddonsList().length"
46
+ ng-options="item for item in purposeAddonsList()"
47
+ ng-model="selectedAddons">
48
+ </select>
49
+ <br /><br />
50
+
51
+ </div>
52
+
53
+ <div bst-alert="info" ng-show="showConfirm">
54
+ <span translate>
55
+ Set System Purpose values on {{ hostCount }} selected content hosts?
56
+ </span>
57
+ <div>
58
+ <br />
59
+ <button type="button" class="btn btn-primary" ng-click="showConfirm = false; performAction()" translate>Assign</button>
60
+ </div>
61
+ </div>
62
+
63
+ <button class="btn btn-primary"
64
+ type="button"
65
+ ng-hide="showConfirm"
66
+ ng-click="showConfirm = true;">
67
+ <span translate>Assign</span>
68
+ </button>
69
+
70
+ </form>
71
+ </div>
72
+
73
+ <div data-block="modal-footer">
74
+ <button type="button" class="btn btn-default" ng-click="cancel()" translate>
75
+ Cancel
76
+ </button>
77
+ </div>
78
+ </div>