katello 4.7.2 → 4.8.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 (341) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +6 -4
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +15 -12
  4. data/app/controllers/katello/api/v2/capsule_content_controller.rb +0 -4
  5. data/app/controllers/katello/api/v2/content_export_incrementals_controller.rb +22 -81
  6. data/app/controllers/katello/api/v2/content_exports_controller.rb +11 -80
  7. data/app/controllers/katello/api/v2/content_imports_controller.rb +1 -0
  8. data/app/controllers/katello/api/v2/exports_controller.rb +130 -0
  9. data/app/controllers/katello/api/v2/host_subscriptions_controller.rb +7 -8
  10. data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +8 -4
  11. data/app/controllers/katello/api/v2/organizations_controller.rb +3 -0
  12. data/app/controllers/katello/api/v2/package_groups_controller.rb +0 -52
  13. data/app/controllers/katello/concerns/api/v2/bulk_hosts_extensions.rb +4 -6
  14. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -2
  15. data/app/controllers/katello/concerns/authorization/api/v2/content_views_controller.rb +4 -1
  16. data/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb +24 -0
  17. data/app/controllers/katello/concerns/hosts_controller_extensions.rb +3 -3
  18. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +55 -24
  19. data/app/helpers/katello/katello_urls_helper.rb +0 -15
  20. data/app/helpers/katello/sync_management_helper.rb +0 -4
  21. data/app/lib/actions/candlepin/environment/set_content.rb +7 -1
  22. data/app/lib/actions/candlepin/owner/destroy_imports.rb +1 -1
  23. data/app/lib/actions/katello/capsule_content/sync.rb +0 -4
  24. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +1 -2
  25. data/app/lib/actions/katello/content_view/publish.rb +6 -2
  26. data/app/lib/actions/katello/content_view/remove.rb +8 -2
  27. data/app/lib/actions/katello/content_view_version/destroy.rb +1 -1
  28. data/app/lib/actions/katello/environment/destroy.rb +8 -2
  29. data/app/lib/actions/katello/host/reassign.rb +4 -2
  30. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +0 -1
  31. data/app/lib/actions/katello/product/destroy.rb +2 -1
  32. data/app/lib/actions/katello/repository/filtered_index_content.rb +2 -10
  33. data/app/lib/actions/katello/repository/import_upload.rb +0 -1
  34. data/app/lib/actions/katello/repository/sync.rb +0 -1
  35. data/app/lib/actions/katello/repository/update.rb +5 -3
  36. data/app/lib/actions/katello/repository/upload_files.rb +0 -1
  37. data/app/lib/actions/pulp3/abstract.rb +0 -6
  38. data/app/lib/actions/pulp3/content_view/delete_repository_references.rb +1 -2
  39. data/app/lib/actions/pulp3/content_view_version/create_syncable_export_history.rb +4 -0
  40. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +1 -0
  41. data/app/lib/actions/pulp3/orchestration/content_view_version/export_repository.rb +7 -2
  42. data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +7 -2
  43. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -2
  44. data/app/lib/actions/pulp3/repository/save_distribution_references.rb +2 -2
  45. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  46. data/app/lib/katello/event_daemon/runner.rb +12 -9
  47. data/app/lib/katello/resources/candlepin/consumer.rb +6 -6
  48. data/app/lib/katello/resources/candlepin/owner.rb +1 -1
  49. data/app/lib/katello/resources/candlepin/upstream_consumer.rb +3 -4
  50. data/app/lib/katello/resources/candlepin.rb +4 -4
  51. data/app/lib/katello/util/errata.rb +12 -10
  52. data/app/lib/katello/util/search.rb +0 -1
  53. data/app/lib/katello/validators/content_view_environment_org_validator.rb +5 -2
  54. data/app/lib/katello/validators/content_view_environment_validator.rb +1 -2
  55. data/app/lib/katello/validators/generated_content_view_validator.rb +16 -0
  56. data/app/mailers/katello/errata_mailer.rb +4 -2
  57. data/app/models/katello/alternate_content_source.rb +5 -1
  58. data/app/models/katello/concerns/content_facet_host_extensions.rb +25 -14
  59. data/app/models/katello/concerns/host_managed_extensions.rb +17 -8
  60. data/app/models/katello/concerns/redhat_extensions.rb +16 -6
  61. data/app/models/katello/concerns/smart_proxy_extensions.rb +0 -12
  62. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -0
  63. data/app/models/katello/content_view.rb +22 -5
  64. data/app/models/katello/content_view_environment.rb +11 -2
  65. data/app/models/katello/content_view_environment_content_facet.rb +9 -0
  66. data/app/models/katello/content_view_version.rb +10 -5
  67. data/app/models/katello/erratum.rb +6 -1
  68. data/app/models/katello/glue/candlepin/pool.rb +6 -0
  69. data/app/models/katello/glue/candlepin/product.rb +7 -1
  70. data/app/models/katello/glue/candlepin/subscription.rb +5 -0
  71. data/app/models/katello/glue/provider.rb +26 -26
  72. data/app/models/katello/host/content_facet.rb +106 -18
  73. data/app/models/katello/host/info_provider.rb +25 -21
  74. data/app/models/katello/host/subscription_facet.rb +18 -14
  75. data/app/models/katello/kt_environment.rb +12 -7
  76. data/app/models/katello/package_group.rb +0 -12
  77. data/app/models/katello/pool.rb +4 -1
  78. data/app/models/katello/product.rb +11 -1
  79. data/app/models/katello/repository.rb +11 -11
  80. data/app/models/katello/root_repository.rb +5 -4
  81. data/app/models/katello/task_status.rb +0 -18
  82. data/app/services/katello/candlepin/consumer.rb +2 -2
  83. data/app/services/katello/host/package_profile_uploader.rb +1 -1
  84. data/app/services/katello/product_content_finder.rb +11 -8
  85. data/app/services/katello/pulp3/content_view_version/export.rb +8 -65
  86. data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +7 -0
  87. data/app/services/katello/pulp3/content_view_version/export_validator.rb +105 -0
  88. data/app/services/katello/pulp3/content_view_version/importable_products.rb +1 -1
  89. data/app/services/katello/pulp3/content_view_version/syncable_format_export.rb +7 -1
  90. data/app/services/katello/pulp3/erratum.rb +1 -0
  91. data/app/services/katello/pulp3/module_stream.rb +26 -11
  92. data/app/services/katello/pulp3/repository/yum.rb +2 -1
  93. data/app/services/katello/pulp3/smart_proxy_mirror_repository.rb +2 -1
  94. data/app/services/katello/registration_manager.rb +46 -26
  95. data/app/services/katello/repository_type.rb +3 -9
  96. data/app/services/katello/simple_package.rb +22 -0
  97. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -0
  98. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +1 -0
  99. data/app/views/katello/api/v2/content_facet/base.json.rabl +23 -2
  100. data/app/views/katello/api/v2/content_facet/show.json.rabl +11 -8
  101. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  102. data/app/views/katello/api/v2/hosts/base.json.rabl +22 -2
  103. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -2
  104. data/config/initializers/monkeys.rb +0 -2
  105. data/config/routes/api/registry.rb +8 -7
  106. data/config/routes/api/v2.rb +0 -2
  107. data/config/routes.rb +3 -0
  108. data/db/migrate/20200429153103_installed_package_bad_nvrea.rb +1 -1
  109. data/db/migrate/20220228173251_remove_drpm_from_ignorable_content.rb +7 -3
  110. data/db/migrate/20220419193414_content_settings_to_dsl_category.rb +1 -1
  111. data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +52 -0
  112. data/db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb +5 -0
  113. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  114. data/engines/bastion/app/assets/stylesheets/bastion/bastion.scss +4 -0
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/activation-key-details.controller.js +2 -4
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-errata-modal.controller.js +0 -1
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-details.controller.js +2 -4
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/content-hosts.html +2 -1
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +11 -3
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/details/views/host-collection-hosts-list.html +1 -1
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +8 -4
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/de.po +5485 -0
  123. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/es.po +5397 -0
  124. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/fr.po +5658 -0
  125. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ja.po +5284 -0
  126. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ka.po +5231 -0
  127. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/ko.po +5275 -0
  128. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/pt_BR.po +5389 -0
  129. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_CN.po +5212 -0
  130. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/locale/zh_TW.po +5145 -0
  131. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/translations.js +9 -0
  132. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/content-access-mode-banner.html +2 -2
  133. data/lib/katello/engine.rb +2 -1
  134. data/lib/katello/permission_creator.rb +2 -4
  135. data/lib/katello/permissions/registry_permissions.rb +5 -5
  136. data/lib/katello/plugin.rb +22 -14
  137. data/lib/katello/repository_types/README.md +136 -19
  138. data/lib/katello/repository_types/deb.rb +0 -1
  139. data/lib/katello/repository_types/docker.rb +0 -1
  140. data/lib/katello/repository_types/file.rb +0 -1
  141. data/lib/katello/repository_types/yum.rb +0 -4
  142. data/lib/katello/tasks/clean_candlepin_orphaned_products.rake +38 -0
  143. data/lib/katello/tasks/clean_orphaned_facets.rb +20 -0
  144. data/lib/katello/tasks/reimport.rake +1 -2
  145. data/lib/katello/tasks/repository.rake +1 -22
  146. data/lib/katello/tasks/reset.rake +1 -0
  147. data/lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake +29 -0
  148. data/lib/katello/version.rb +1 -1
  149. data/lib/katello.rb +0 -5
  150. data/locale/bn/katello.po +69 -27
  151. data/locale/cs/katello.po +69 -27
  152. data/locale/de/katello.po +78 -36
  153. data/locale/en/katello.po +69 -27
  154. data/locale/es/katello.po +70 -28
  155. data/locale/fr/katello.po +73 -31
  156. data/locale/gu/katello.po +69 -27
  157. data/locale/hi/katello.po +69 -27
  158. data/locale/it/katello.po +69 -27
  159. data/locale/ja/katello.po +73 -31
  160. data/locale/ka/katello.po +73 -31
  161. data/locale/katello.pot +335 -262
  162. data/locale/kn/katello.po +69 -27
  163. data/locale/ko/katello.po +69 -27
  164. data/locale/mr/katello.po +69 -27
  165. data/locale/or/katello.po +69 -27
  166. data/locale/pa/katello.po +69 -27
  167. data/locale/pt/katello.po +69 -27
  168. data/locale/pt_BR/katello.po +70 -28
  169. data/locale/ru/katello.po +70 -28
  170. data/locale/ta/katello.po +69 -27
  171. data/locale/te/katello.po +69 -27
  172. data/locale/zh_CN/katello.po +73 -31
  173. data/locale/zh_TW/katello.po +70 -28
  174. data/webpack/components/Content/ContentPage.js +51 -35
  175. data/webpack/components/Content/__tests__/ContentPage.test.js +2 -4
  176. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +22 -3
  177. data/webpack/components/RoutedTabs/index.js +6 -11
  178. data/webpack/components/Table/EmptyStateMessage.js +14 -11
  179. data/webpack/components/Table/MainTable.js +36 -15
  180. data/webpack/components/Table/TableWrapper.js +25 -25
  181. data/webpack/components/Table/__test__/emptyStateMessage.test.js +51 -0
  182. data/webpack/components/extensions/HostDetails/Cards/ErrataOverviewCard.js +5 -4
  183. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsModal.js +1 -1
  184. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsModal.test.js +1 -17
  185. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +18 -9
  186. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +1 -2
  187. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +1 -2
  188. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +1 -2
  189. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +47 -27
  190. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +1 -2
  191. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +2 -21
  192. data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +1 -28
  193. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +1 -10
  194. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +2 -19
  195. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +1 -17
  196. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +1 -15
  197. data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/ActivationKeys.test.js.snap +7 -0
  198. data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/Force.test.js.snap +2 -0
  199. data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/IgnoreSubmanErrors.test.js.snap +2 -0
  200. data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/LifeCycleEnvironment.test.js.snap +1 -0
  201. data/webpack/global_test_setup.js +1 -1
  202. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +12 -17
  203. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js +17 -3
  204. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +6 -0
  205. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +1 -0
  206. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +3 -10
  207. data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +1 -0
  208. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +3 -3
  209. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +1 -0
  210. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +12 -4
  211. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +7 -4
  212. data/webpack/scenes/AlternateContentSources/MainTable/__tests__/acsTable.test.js +4 -8
  213. data/webpack/scenes/AlternateContentSources/helpers.js +1 -1
  214. data/webpack/scenes/Content/Details/ContentRepositories.js +5 -4
  215. data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +1 -12
  216. data/webpack/scenes/Content/Table/ContentTable.js +2 -1
  217. data/webpack/scenes/Content/__tests__/contentTable.test.js +1 -14
  218. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +1 -25
  219. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +2 -1
  220. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +44 -31
  221. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +2 -0
  222. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +6 -1
  223. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +2 -1
  224. data/webpack/scenes/ContentViews/Details/Filters/CVDebFilterContent.js +2 -1
  225. data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +2 -2
  226. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +5 -3
  227. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +3 -1
  228. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +3 -1
  229. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -1
  230. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +2 -0
  231. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +2 -1
  232. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVDebMatchContentModal.js +1 -1
  233. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/CVRpmMatchContentModal.js +1 -1
  234. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentModal.test.js +35 -33
  235. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +48 -45
  236. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +58 -24
  237. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +64 -0
  238. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +36 -20
  239. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +40 -23
  240. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +0 -13
  241. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +0 -13
  242. data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +2 -1
  243. data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +1 -10
  244. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +2 -1
  245. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +1 -10
  246. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareConfig.js +21 -9
  247. data/webpack/scenes/ContentViews/Details/Versions/Compare/CVVersionCompareTable.js +4 -0
  248. data/webpack/scenes/ContentViews/Details/Versions/Compare/__tests__/CVVersionCompare.test.js +1 -32
  249. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +3 -1
  250. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +1 -15
  251. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedActivationKeys.js +1 -1
  252. data/webpack/scenes/ContentViews/Details/Versions/Delete/affectedHosts.js +1 -2
  253. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailConfig.js +31 -9
  254. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsTable.js +4 -0
  255. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +30 -14
  256. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +1 -1
  257. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +55 -120
  258. data/webpack/scenes/ContentViews/components/WizardHeader.js +1 -1
  259. data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +1 -1
  260. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +8 -1
  261. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +3 -9
  262. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +7 -1
  263. data/webpack/scenes/RedHatRepositories/components/Search.js +22 -16
  264. data/webpack/scenes/RedHatRepositories/index.scss +20 -1
  265. data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +12 -1
  266. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CdnTypeForm.js +1 -1
  267. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationTab/CustomCdnTypeForm.js +1 -1
  268. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +21 -19
  269. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +34 -1
  270. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +20 -7
  271. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.test.js +0 -1
  272. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/__snapshots__/SubscriptionsToolbar.test.js.snap +65 -15
  273. metadata +47 -113
  274. data/app/lib/actions/katello/pulp_selector.rb +0 -24
  275. data/app/lib/actions/katello/repository/correct_checksum.rb +0 -24
  276. data/app/lib/actions/katello/repository/destroy_package_group.rb +0 -26
  277. data/app/lib/actions/katello/repository/upload_package_group.rb +0 -24
  278. data/app/lib/actions/pulp/abstract.rb +0 -37
  279. data/app/lib/actions/pulp/abstract_async_task.rb +0 -154
  280. data/app/lib/actions/pulp/abstract_async_task_group.rb +0 -94
  281. data/app/lib/actions/pulp/consumer/sync_capsule.rb +0 -45
  282. data/app/lib/actions/pulp/consumer/unassociate_units.rb +0 -20
  283. data/app/lib/actions/pulp/expect_one_task.rb +0 -11
  284. data/app/lib/actions/pulp/orchestration/orphan_cleanup/remove_orphans.rb +0 -16
  285. data/app/lib/actions/pulp/orchestration/repository/copy_all_units.rb +0 -19
  286. data/app/lib/actions/pulp/orchestration/repository/delete.rb +0 -15
  287. data/app/lib/actions/pulp/orchestration/repository/refresh.rb +0 -14
  288. data/app/lib/actions/pulp/orchestration/repository/refresh_if_needed.rb +0 -13
  289. data/app/lib/actions/pulp/orchestration/repository/refresh_repos.rb +0 -19
  290. data/app/lib/actions/pulp/orchestration/repository/remove_units.rb +0 -14
  291. data/app/lib/actions/pulp/orchestration/repository/smart_proxy_sync.rb +0 -34
  292. data/app/lib/actions/pulp/orchestration/repository/sync.rb +0 -18
  293. data/app/lib/actions/pulp/orchestration/repository/upload_content.rb +0 -37
  294. data/app/lib/actions/pulp/orphan_cleanup/remove_orphans.rb +0 -15
  295. data/app/lib/actions/pulp/orphan_cleanup/remove_unneeded_repos.rb +0 -16
  296. data/app/lib/actions/pulp/repository/abstract_copy_content.rb +0 -45
  297. data/app/lib/actions/pulp/repository/abstract_remove_content.rb +0 -32
  298. data/app/lib/actions/pulp/repository/clear.rb +0 -18
  299. data/app/lib/actions/pulp/repository/copy_all_units.rb +0 -30
  300. data/app/lib/actions/pulp/repository/copy_units.rb +0 -25
  301. data/app/lib/actions/pulp/repository/create.rb +0 -28
  302. data/app/lib/actions/pulp/repository/create_in_plan.rb +0 -15
  303. data/app/lib/actions/pulp/repository/create_upload_request.rb +0 -20
  304. data/app/lib/actions/pulp/repository/delete_upload_request.rb +0 -19
  305. data/app/lib/actions/pulp/repository/destroy.rb +0 -28
  306. data/app/lib/actions/pulp/repository/distributor_publish.rb +0 -25
  307. data/app/lib/actions/pulp/repository/download.rb +0 -16
  308. data/app/lib/actions/pulp/repository/import_upload.rb +0 -19
  309. data/app/lib/actions/pulp/repository/presenters/abstract_sync_presenter.rb +0 -47
  310. data/app/lib/actions/pulp/repository/presenters/deb_presenter.rb +0 -95
  311. data/app/lib/actions/pulp/repository/presenters/docker_presenter.rb +0 -103
  312. data/app/lib/actions/pulp/repository/presenters/file_unit_presenter.rb +0 -42
  313. data/app/lib/actions/pulp/repository/presenters/yum_presenter.rb +0 -131
  314. data/app/lib/actions/pulp/repository/refresh.rb +0 -21
  315. data/app/lib/actions/pulp/repository/regenerate_applicability.rb +0 -21
  316. data/app/lib/actions/pulp/repository/remove_distribution.rb +0 -11
  317. data/app/lib/actions/pulp/repository/remove_units.rb +0 -44
  318. data/app/lib/actions/pulp/repository/sync.rb +0 -99
  319. data/app/lib/actions/pulp/repository/upload_file.rb +0 -28
  320. data/app/lib/actions/pulp/repository_group/create.rb +0 -31
  321. data/app/lib/actions/pulp/repository_group/delete.rb +0 -17
  322. data/app/lib/actions/pulp/repository_group/export.rb +0 -51
  323. data/app/lib/katello/util/package_clause_generator.rb +0 -77
  324. data/app/models/katello/glue/pulp/pulp_errors.rb +0 -9
  325. data/app/models/katello/glue/pulp/repo.rb +0 -353
  326. data/app/models/katello/pulp_sync_status.rb +0 -165
  327. data/app/models/katello/pulp_task_status.rb +0 -63
  328. data/app/services/katello/pulp/content.rb +0 -24
  329. data/app/services/katello/pulp/importer_comparison.rb +0 -28
  330. data/app/services/katello/pulp/repository/deb.rb +0 -61
  331. data/app/services/katello/pulp/repository/docker.rb +0 -82
  332. data/app/services/katello/pulp/repository/file.rb +0 -52
  333. data/app/services/katello/pulp/repository/yum.rb +0 -205
  334. data/app/services/katello/pulp/repository.rb +0 -327
  335. data/app/services/katello/pulp/server.rb +0 -35
  336. data/app/services/katello/pulp/simple_package.rb +0 -24
  337. data/app/services/katello/pulp/smart_proxy_repository.rb +0 -52
  338. data/lib/monkeys/fix_deb_optimized_sync.rb +0 -35
  339. data/lib/monkeys/fix_pulp_container_path.rb +0 -35
  340. data/locale/zanata.xml +0 -30
  341. data/webpack/scenes/ContentViews/Details/Filters/MatchContentModal/__tests__/CVRpmMatchContentSearch.fixtures.json +0 -33
@@ -55,6 +55,8 @@ export const TableType = PropTypes.shape({
55
55
  responseSelector: PropTypes.func,
56
56
  statusSelector: PropTypes.func,
57
57
  autocompleteEndpoint: PropTypes.string,
58
+ autocompleteQueryParams: PropTypes.shape({}),
59
+ bookmarkController: PropTypes.string,
58
60
  fetchItems: PropTypes.func,
59
61
  columnHeaders:
60
62
  PropTypes.arrayOf(PropTypes.shape({
@@ -72,6 +74,8 @@ export default ({ cvId, versionId }) => [
72
74
  responseSelector: state => selectCVVersions(state, cvId),
73
75
  statusSelector: state => selectCVVersionsStatus(state, cvId),
74
76
  autocompleteEndpoint: '',
77
+ autocompleteQueryParams: undefined,
78
+ bookmarkController: '',
75
79
  fetchItems: params => getContentViewVersions(
76
80
  cvId,
77
81
  { composite_version_id: versionId, ...params, content_view_id: undefined },
@@ -99,7 +103,9 @@ export default ({ cvId, versionId }) => [
99
103
  getCountKey: item => item?.repositories?.length,
100
104
  responseSelector: state => selectRepositories(state),
101
105
  statusSelector: state => selectRepositoriesStatus(state),
102
- autocompleteEndpoint: `/repositories/auto_complete_search?archived=true&content_view_version_id=${versionId}`,
106
+ autocompleteEndpoint: '/katello/api/v2/repositories',
107
+ autocompleteQueryParams: { archived: true, content_view_version_id: versionId },
108
+ bookmarkController: 'katello_content_view_repositories',
103
109
  fetchItems: params => getRepositories({
104
110
  content_view_version_id: versionId,
105
111
  archived: true,
@@ -137,7 +143,9 @@ export default ({ cvId, versionId }) => [
137
143
  getCountKey: item => item?.rpm_count,
138
144
  responseSelector: state => selectRPMPackages(state),
139
145
  statusSelector: state => selectRPMPackagesStatus(state),
140
- autocompleteEndpoint: `/packages/auto_complete_search?content_view_version_id=${versionId}`,
146
+ autocompleteEndpoint: '/katello/api/v2/packages',
147
+ autocompleteQueryParams: { content_view_version_id: versionId },
148
+ bookmarkController: 'katello_content_view_components',
141
149
  fetchItems: params => getRPMPackages({ content_view_version_id: versionId, ...params }),
142
150
  columnHeaders: [
143
151
  {
@@ -160,7 +168,9 @@ export default ({ cvId, versionId }) => [
160
168
  getCountKey: item => item?.package_group_count,
161
169
  responseSelector: state => selectRPMPackageGroups(state),
162
170
  statusSelector: state => selectRPMPackageGroupsStatus(state),
163
- autocompleteEndpoint: `/package_groups/auto_complete_search?content_view_version_id=${versionId}`,
171
+ autocompleteEndpoint: '/katello/api/v2/package_groups',
172
+ autocompleteQueryParams: { content_view_version_id: versionId },
173
+ bookmarkController: 'katello_content_view_components',
164
174
  fetchItems: params => getPackageGroups({ content_view_version_id: versionId, ...params }),
165
175
  columnHeaders: [
166
176
  { title: __('Name'), getProperty: item => item?.name },
@@ -174,7 +184,9 @@ export default ({ cvId, versionId }) => [
174
184
  getCountKey: item => item?.file_count,
175
185
  responseSelector: state => selectFiles(state),
176
186
  statusSelector: state => selectFilesStatus(state),
177
- autocompleteEndpoint: `/files/auto_complete_search?content_view_version_id=${versionId}`,
187
+ autocompleteEndpoint: '/katello/api/v2/files',
188
+ autocompleteQueryParams: { content_view_version_id: versionId },
189
+ bookmarkController: 'katello_content_view_components',
178
190
  fetchItems: params => getFiles({ content_view_version_id: versionId, ...params }),
179
191
  columnHeaders: [
180
192
  {
@@ -194,7 +206,9 @@ export default ({ cvId, versionId }) => [
194
206
  getCountKey: item => item?.erratum_count,
195
207
  responseSelector: state => selectErrata(state),
196
208
  statusSelector: state => selectErrataStatus(state),
197
- autocompleteEndpoint: `/errata/auto_complete_search?content_view_version_id=${versionId}`,
209
+ autocompleteEndpoint: '/katello/api/v2/errata',
210
+ autocompleteQueryParams: { content_view_version_id: versionId },
211
+ bookmarkController: 'katello_content_view_components',
198
212
  fetchItems: params => getErrata({ content_view_version_id: versionId, ...params }),
199
213
  columnHeaders: [
200
214
  {
@@ -249,7 +263,9 @@ export default ({ cvId, versionId }) => [
249
263
  getCountKey: item => item?.module_stream_count,
250
264
  responseSelector: state => selectModuleStreams(state),
251
265
  statusSelector: state => selectModuleStreamsStatus(state),
252
- autocompleteEndpoint: `/module_streams/auto_complete_search?content_view_version_id=${versionId}`,
266
+ autocompleteEndpoint: '/katello/api/v2/module_streams',
267
+ autocompleteQueryParams: { content_view_version_id: versionId },
268
+ bookmarkController: 'katello_content_view_components',
253
269
  fetchItems: params => getModuleStreams({ content_view_version_id: versionId, ...params }),
254
270
  columnHeaders: [
255
271
  {
@@ -272,7 +288,9 @@ export default ({ cvId, versionId }) => [
272
288
  getCountKey: item => item?.deb_count,
273
289
  responseSelector: state => selectDebPackages(state),
274
290
  statusSelector: state => selectDebPackagesStatus(state),
275
- autocompleteEndpoint: `/debs/auto_complete_search?content_view_version_id=${versionId}`,
291
+ autocompleteEndpoint: '/katello/api/v2/debs',
292
+ autocompleteQueryParams: { content_view_version_id: versionId },
293
+ bookmarkController: 'katello_content_view_components',
276
294
  fetchItems: params => getDebPackages({ content_view_version_id: versionId, ...params }),
277
295
  columnHeaders: [
278
296
  {
@@ -293,7 +311,9 @@ export default ({ cvId, versionId }) => [
293
311
  getCountKey: item => item?.docker_tag_count,
294
312
  responseSelector: state => selectDockerTags(state),
295
313
  statusSelector: state => selectDockerTagsStatus(state),
296
- autocompleteEndpoint: `/docker_tags/auto_complete_search?content_view_version_id=${versionId}`,
314
+ autocompleteEndpoint: '/katello/api/v2/docker_tags',
315
+ autocompleteQueryParams: { content_view_version_id: versionId },
316
+ bookmarkController: 'katello_content_view_components',
297
317
  fetchItems: params => getDockerTags({ content_view_version_id: versionId, ...params }),
298
318
  columnHeaders: [
299
319
  {
@@ -323,7 +343,9 @@ export default ({ cvId, versionId }) => [
323
343
  getCountKey: item => item[`${singularLabel}_count`],
324
344
  responseSelector: state => selectContent(pluralLabel, state),
325
345
  statusSelector: state => selectContentStatus(pluralLabel, state),
326
- autocompleteEndpoint: `/${pluralLabel}/auto_complete_search?content_view_version_id=${versionId}`,
346
+ autocompleteEndpoint: `/katello/api/v2/${pluralLabel}`,
347
+ autocompleteQueryParams: { content_view_version_id: versionId },
348
+ bookmarkController: 'katello_content_view_components',
327
349
  fetchItems: params =>
328
350
  getContent(pluralLabel, { content_view_version_id: versionId, ...params }),
329
351
  columnHeaders,
@@ -32,6 +32,8 @@ const ContentViewVersionDetailsTable = ({
32
32
  responseSelector,
33
33
  statusSelector,
34
34
  autocompleteEndpoint,
35
+ autocompleteQueryParams,
36
+ bookmarkController,
35
37
  fetchItems,
36
38
  columnHeaders,
37
39
  hideSearch,
@@ -77,6 +79,8 @@ const ContentViewVersionDetailsTable = ({
77
79
  updateSearchQuery,
78
80
  status,
79
81
  autocompleteEndpoint,
82
+ autocompleteQueryParams,
83
+ bookmarkController,
80
84
  hideSearch,
81
85
  }}
82
86
  ouiaId={`content-view-version-details-${kebabCase(route)}-table`}
@@ -2,11 +2,10 @@ import React from 'react';
2
2
  import { renderWithRedux, patientlyWaitFor } from 'react-testing-lib-wrapper';
3
3
  import { Route } from 'react-router-dom';
4
4
  import { head, last } from 'lodash';
5
- import { nockInstance, assertNockRequest, mockSetting, mockAutocomplete } from '../../../../../../test-utils/nockWrapper';
5
+ import { nockInstance, assertNockRequest, mockAutocomplete } from '../../../../../../test-utils/nockWrapper';
6
6
  import api from '../../../../../../services/api';
7
7
  import { cvVersionDetailsKey } from '../../../../ContentViewsConstants';
8
8
  import ContentViewVersionDetails from '../ContentViewVersionDetails';
9
- import { AUTOSEARCH_DELAY, AUTOSEARCH_WHILE_TYPING } from '../../../../../Settings/SettingsConstants';
10
9
  import ContentViewVersionDetailsData from './ContentViewVersionDetails.fixtures.json';
11
10
  import ContentViewVersionDetailsCounts from './ContentViewVersionDetailsCounts.fixtures.json';
12
11
  import cvDetailData from '../../../../__tests__/mockDetails.fixtures.json';
@@ -42,6 +41,28 @@ const renderOptions = {
42
41
  },
43
42
  };
44
43
 
44
+ const autocompleteQuery = name => ((name === 'Repositories') ? {
45
+ archived: true,
46
+ organization_id: 1,
47
+ content_view_version_id: 73,
48
+ search: '',
49
+ } : {
50
+ organization_id: 1,
51
+ content_view_version_id: 73,
52
+ search: '',
53
+ });
54
+
55
+ const queryParams = name => ((name === 'Repositories') ? {
56
+ archived: true,
57
+ content_view_version_id: 73,
58
+ per_page: 20,
59
+ page: 1,
60
+ } : {
61
+ content_view_version_id: 73,
62
+ per_page: 20,
63
+ page: 1,
64
+ });
65
+
45
66
  beforeEach(() => {
46
67
  envScope = nockInstance
47
68
  .get(environmentPathsPath)
@@ -90,7 +111,6 @@ test('Can show versions details - Components Tab', async (done) => {
90
111
  assertNockRequest(componentScope, done);
91
112
  });
92
113
 
93
-
94
114
  const testConfig = [
95
115
  {
96
116
  name: 'Repositories',
@@ -196,9 +216,11 @@ testConfig.forEach(({
196
216
  test(`Can show versions details - ${name} Tab`, async (done) => {
197
217
  const { version } = ContentViewVersionDetailsData;
198
218
 
199
- const autocompleteScope = mockAutocomplete(nockInstance, autoCompleteUrl);
200
- const searchDelayScope = mockSetting(nockInstance, AUTOSEARCH_DELAY);
201
- const autoSearchScope = mockSetting(nockInstance, AUTOSEARCH_WHILE_TYPING);
219
+ const autocompleteScope = mockAutocomplete(
220
+ nockInstance,
221
+ autoCompleteUrl,
222
+ autocompleteQuery(name),
223
+ );
202
224
 
203
225
  const scope = nockInstance
204
226
  .get(cvVersions)
@@ -207,7 +229,7 @@ testConfig.forEach(({
207
229
 
208
230
  const tabScope = nockInstance
209
231
  .get(dataUrl)
210
- .query(true)
232
+ .query(queryParams(name))
211
233
  .reply(200, data);
212
234
 
213
235
  const { getByText, queryByText } = renderWithRedux(
@@ -231,8 +253,6 @@ testConfig.forEach(({
231
253
  });
232
254
 
233
255
  assertNockRequest(autocompleteScope);
234
- assertNockRequest(searchDelayScope);
235
- assertNockRequest(autoSearchScope);
236
256
  assertNockRequest(scope);
237
257
  assertNockRequest(tabScope);
238
258
  assertNockRequest(scope, done);
@@ -247,9 +267,7 @@ test('Can change repository selector', async (done) => {
247
267
  } = testConfig[1]; // RPM Packages
248
268
 
249
269
  const { version } = ContentViewVersionDetailsData;
250
- const autocompleteScope = mockAutocomplete(nockInstance, autoCompleteUrl);
251
- const searchDelayScope = mockSetting(nockInstance, AUTOSEARCH_DELAY, 0);
252
- const autoSearchScope = mockSetting(nockInstance, AUTOSEARCH_WHILE_TYPING);
270
+ const autocompleteScope = mockAutocomplete(nockInstance, autoCompleteUrl, autocompleteQuery);
253
271
 
254
272
  const scope = nockInstance
255
273
  .get(cvVersions)
@@ -297,8 +315,6 @@ test('Can change repository selector', async (done) => {
297
315
  });
298
316
 
299
317
  assertNockRequest(autocompleteScope);
300
- assertNockRequest(searchDelayScope);
301
- assertNockRequest(autoSearchScope);
302
318
  assertNockRequest(scope);
303
319
  assertNockRequest(tabScope);
304
320
  assertNockRequest(scope, done);
@@ -162,7 +162,7 @@ const ContentViewTable = () => {
162
162
  bookmarkController="katello_content_views"
163
163
  variant={TableVariant.compact}
164
164
  status={status}
165
- autocompleteEndpoint="/content_views/auto_complete_search"
165
+ autocompleteEndpoint="/katello/api/v2/content_views"
166
166
  primaryActionButton={canCreate ? (
167
167
  <Button
168
168
  ouiaId="create-content-view"
@@ -6,7 +6,7 @@ import CONTENT_VIEWS_KEY from '../ContentViewsConstants';
6
6
  import ContentViewsPage from '../../ContentViews';
7
7
  import api from '../../../services/api';
8
8
  import {
9
- nockInstance, assertNockRequest, mockAutocomplete, mockSetting,
9
+ nockInstance, assertNockRequest, mockAutocomplete,
10
10
  } from '../../../test-utils/nockWrapper';
11
11
  import createBasicCVs from './basicContentViews.fixtures';
12
12
  import cvIndexData from './contentViewList.fixtures.json';
@@ -14,28 +14,23 @@ import cvIndexData from './contentViewList.fixtures.json';
14
14
  const cvIndexPath = api.getApiUrl('/content_views');
15
15
  const autocompleteUrl = '/content_views/auto_complete_search';
16
16
  const renderOptions = { apiNamespace: CONTENT_VIEWS_KEY };
17
+ const autocompleteQuery = {
18
+ organization_id: 1,
19
+ search: '',
20
+ };
17
21
 
18
22
  let firstCV;
19
- let searchDelayScope;
20
- let autoSearchScope;
21
- let scopeBookmark;
22
23
  beforeEach(() => {
23
24
  const { results } = cvIndexData;
24
25
  [firstCV] = results;
25
26
  });
26
27
 
27
28
  test('Can call API for CVs and show on screen on page load', async (done) => {
28
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
29
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
29
30
  const scope = nockInstance
30
31
  .get(cvIndexPath)
31
32
  .query(true)
32
33
  .reply(200, cvIndexData);
33
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
34
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
35
- scopeBookmark = nockInstance
36
- .get('/api/v2/bookmarks')
37
- .query(true)
38
- .reply(200, {});
39
34
 
40
35
  const { queryByText, queryAllByText } = renderWithRedux(<ContentViewsPage />, renderOptions);
41
36
 
@@ -49,25 +44,16 @@ test('Can call API for CVs and show on screen on page load', async (done) => {
49
44
  });
50
45
 
51
46
 
52
- assertNockRequest(scopeBookmark);
53
47
  assertNockRequest(autocompleteScope);
54
- assertNockRequest(searchDelayScope);
55
- assertNockRequest(autoSearchScope);
56
48
  assertNockRequest(scope, done);
57
49
  });
58
50
 
59
51
  test('Can show last task and link to it', async (done) => {
60
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
52
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
61
53
  const scope = nockInstance
62
54
  .get(cvIndexPath)
63
55
  .query(true)
64
56
  .reply(200, cvIndexData);
65
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
66
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
67
- scopeBookmark = nockInstance
68
- .get('/api/v2/bookmarks')
69
- .query(true)
70
- .reply(200, {});
71
57
 
72
58
  const { getByText, queryByText } = renderWithRedux(<ContentViewsPage />, renderOptions);
73
59
 
@@ -82,25 +68,16 @@ test('Can show last task and link to it', async (done) => {
82
68
  expect(queryByText('N/A')).toBeTruthy();
83
69
  });
84
70
 
85
- assertNockRequest(scopeBookmark);
86
71
  assertNockRequest(autocompleteScope);
87
- assertNockRequest(searchDelayScope);
88
- assertNockRequest(autoSearchScope);
89
72
  assertNockRequest(scope, done); // Pass jest callback to confirm test is done
90
73
  });
91
74
 
92
75
  test('Can show latest version and link to it', async (done) => {
93
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
76
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
94
77
  const scope = nockInstance
95
78
  .get(cvIndexPath)
96
79
  .query(true)
97
80
  .reply(200, cvIndexData);
98
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
99
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
100
- scopeBookmark = nockInstance
101
- .get('/api/v2/bookmarks')
102
- .query(true)
103
- .reply(200, {});
104
81
 
105
82
  const {
106
83
  getByText,
@@ -123,25 +100,16 @@ test('Can show latest version and link to it', async (done) => {
123
100
  expect(getByText('dev').closest('a'))
124
101
  .toHaveAttribute('href', '/lifecycle_environments/2');
125
102
  });
126
- assertNockRequest(scopeBookmark);
127
103
  assertNockRequest(autocompleteScope);
128
- assertNockRequest(searchDelayScope);
129
- assertNockRequest(autoSearchScope);
130
104
  assertNockRequest(scope, done); // Pass jest callback to confirm test is done
131
105
  });
132
106
 
133
107
  test('Can expand cv and show activation keys and hosts', async (done) => {
134
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
108
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
135
109
  const scope = nockInstance
136
110
  .get(cvIndexPath)
137
111
  .query(true)
138
112
  .reply(200, cvIndexData);
139
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
140
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
141
- scopeBookmark = nockInstance
142
- .get('/api/v2/bookmarks')
143
- .query(true)
144
- .reply(200, {});
145
113
 
146
114
  const {
147
115
  queryByLabelText,
@@ -171,9 +139,6 @@ test('Can expand cv and show activation keys and hosts', async (done) => {
171
139
  });
172
140
 
173
141
  assertNockRequest(autocompleteScope);
174
- assertNockRequest(searchDelayScope);
175
- assertNockRequest(autoSearchScope);
176
- assertNockRequest(scopeBookmark);
177
142
  assertNockRequest(scope, done); // Pass jest callback to confirm test is done
178
143
  });
179
144
 
@@ -215,25 +180,16 @@ test('Can handle unpublished Content Views', async (done) => {
215
180
  const { results } = cvIndexData;
216
181
  const unpublishedCVs = results.map(cv => ({ ...cv, last_published: null }));
217
182
  const unpublishedCVData = { ...cvIndexData, results: unpublishedCVs };
218
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
183
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
219
184
  const scope = nockInstance
220
185
  .get(cvIndexPath)
221
186
  .query(true)
222
187
  .reply(200, unpublishedCVData);
223
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
224
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
225
- scopeBookmark = nockInstance
226
- .get('/api/v2/bookmarks')
227
- .query(true)
228
- .reply(200, {});
229
188
 
230
189
  const { getAllByText } = renderWithRedux(<ContentViewsPage />, renderOptions);
231
190
 
232
191
  await patientlyWaitFor(() => expect(getAllByText(/not yet published/i).length).toBeGreaterThan(0));
233
192
  assertNockRequest(autocompleteScope);
234
- assertNockRequest(searchDelayScope);
235
- assertNockRequest(autoSearchScope);
236
- assertNockRequest(scopeBookmark);
237
193
  assertNockRequest(scope, done);
238
194
  });
239
195
 
@@ -242,13 +198,7 @@ test('Can handle pagination', async (done) => {
242
198
  const { results } = cvIndexLarge;
243
199
  const cvIndexFirstPage = { ...cvIndexLarge, ...{ results: results.slice(0, 20) } };
244
200
  const cvIndexSecondPage = { ...cvIndexLarge, page: 2, results: results.slice(20, 40) };
245
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
246
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
247
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
248
- scopeBookmark = nockInstance
249
- .get('/api/v2/bookmarks')
250
- .query(true)
251
- .reply(200, {});
201
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
252
202
 
253
203
  // Match first page API request
254
204
  const firstPageScope = nockInstance
@@ -283,39 +233,43 @@ test('Can handle pagination', async (done) => {
283
233
  expect(queryByText(results[41].name)).not.toBeInTheDocument();
284
234
  });
285
235
  assertNockRequest(autocompleteScope);
286
- assertNockRequest(autoSearchScope);
287
- assertNockRequest(searchDelayScope);
288
- assertNockRequest(scopeBookmark);
289
236
  assertNockRequest(firstPageScope);
290
237
  assertNockRequest(secondPageScope, done); // Only pass jest callback to the last API request
291
238
  });
292
239
 
293
240
  test('Can search for specific Content View', async (done) => {
294
241
  const cvname = 'composite one';
295
- const { results } = cvIndexData;
296
- const matchQuery = actualParams => actualParams?.search?.includes(cvname);
297
- const searchResults = {
298
- ...cvIndexData,
299
- ...{ total: 1, subtotal: 1, results: results.slice(-1) },
242
+ const matchQuery = {
243
+ organization_id: 1,
244
+ search: `name = ${firstCV.name}`,
300
245
  };
301
-
302
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
303
- const withSearchScope = mockAutocomplete(nockInstance, autocompleteUrl, matchQuery);
304
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
305
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
306
- scopeBookmark = nockInstance
307
- .get('/api/v2/bookmarks')
308
- .query(true)
309
- .reply(200, {});
246
+ const searchResults = [
247
+ {
248
+ completed: 'name = cv1',
249
+ part: 'and',
250
+ label: 'name = cv1 and',
251
+ category: 'Operators',
252
+ },
253
+ {
254
+ completed: 'name = cv1',
255
+ part: 'or',
256
+ label: 'name = cv1 or',
257
+ category: 'Operators',
258
+ },
259
+ ];
260
+
261
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
262
+ const withSearchScope = mockAutocomplete(
263
+ nockInstance,
264
+ autocompleteUrl,
265
+ matchQuery,
266
+ searchResults,
267
+ );
310
268
 
311
269
  const initialScope = nockInstance
312
270
  .get(cvIndexPath)
313
271
  .query(true)
314
272
  .reply(200, cvIndexData);
315
- const searchResultScope = nockInstance
316
- .get(cvIndexPath)
317
- .query(matchQuery)
318
- .reply(200, searchResults);
319
273
 
320
274
  const {
321
275
  getByLabelText,
@@ -325,71 +279,52 @@ test('Can search for specific Content View', async (done) => {
325
279
 
326
280
  await patientlyWaitFor(() => expect(getByText(firstCV.name)).toBeInTheDocument());
327
281
 
328
- const searchInput = getByLabelText(/text input for search/i);
282
+ const searchInput = getByLabelText('Search input');
329
283
  expect(searchInput).toBeInTheDocument();
330
- fireEvent.change(searchInput, { target: { value: `name = \"${cvname}\"` } });
284
+ searchInput.focus();
285
+ fireEvent.change(searchInput, { target: { value: `name = ${firstCV.name}` } });
331
286
 
332
287
  await patientlyWaitFor(() => {
333
- expect(getByText(cvname)).toBeInTheDocument();
334
- expect(queryByText(firstCV.name)).not.toBeInTheDocument();
288
+ expect(getByText(`name = ${firstCV.name} and`)).toBeInTheDocument();
289
+ expect(queryByText(`name = ${cvname} and`)).not.toBeInTheDocument();
335
290
  });
336
291
 
337
292
  assertNockRequest(autocompleteScope);
338
- assertNockRequest(searchDelayScope);
339
- assertNockRequest(autoSearchScope);
340
- assertNockRequest(scopeBookmark);
341
293
  assertNockRequest(initialScope);
342
- assertNockRequest(withSearchScope);
343
- assertNockRequest(searchResultScope, done);
294
+ assertNockRequest(withSearchScope, done);
344
295
  });
345
296
 
346
- test('No results message is shown for empty search', async (done) => {
297
+ test('Nothing is shown for empty search', async (done) => {
347
298
  const cvname = 'notanactualname';
348
299
  const query = `name = \"${cvname}\"`;
349
- const matchQuery = actualParams => actualParams?.search?.includes(cvname);
350
- const emptyResults = {
351
- total: 0,
352
- subtotal: 0,
353
- page: 1,
354
- per_page: 20,
300
+ const matchQuery = {
301
+ organization_id: 1,
355
302
  search: query,
356
- results: [],
357
- can_view: true,
358
- can_create: true,
359
303
  };
360
304
 
361
- const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
362
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
363
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
364
- scopeBookmark = nockInstance
365
- .get('/api/v2/bookmarks')
366
- .query(true)
367
- .reply(200, {});
305
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
368
306
  const withSearchScope = mockAutocomplete(nockInstance, autocompleteUrl, matchQuery);
369
307
  const initialScope = nockInstance
370
308
  .get(cvIndexPath)
371
309
  .query(true)
372
310
  .reply(200, cvIndexData);
373
- const searchResultScope = nockInstance
374
- .get(cvIndexPath)
375
- .query(matchQuery)
376
- .reply(200, emptyResults);
377
311
 
378
- const { getByLabelText, getByText } = renderWithRedux(<ContentViewsPage />, renderOptions);
312
+ const {
313
+ getByLabelText,
314
+ getByText,
315
+ queryByText,
316
+ } = renderWithRedux(<ContentViewsPage />, renderOptions);
379
317
 
380
318
  await patientlyWaitFor(() => expect(getByText(firstCV.name)).toBeInTheDocument());
381
319
 
382
- fireEvent.change(getByLabelText(/text input for search/i), { target: { value: query } });
320
+ getByLabelText('Search input').focus();
321
+ fireEvent.change(getByLabelText('Search input'), { target: { value: query } });
383
322
 
384
- await patientlyWaitFor(() => expect(getByText(/No matching content views found/i)).toBeInTheDocument());
323
+ await patientlyWaitFor(() => expect(queryByText(`${query} and`)).not.toBeInTheDocument());
385
324
 
386
325
  assertNockRequest(autocompleteScope);
387
- assertNockRequest(searchDelayScope);
388
- assertNockRequest(autoSearchScope);
389
- assertNockRequest(scopeBookmark);
390
326
  assertNockRequest(initialScope);
391
- assertNockRequest(withSearchScope);
392
- assertNockRequest(searchResultScope, done);
327
+ assertNockRequest(withSearchScope, done);
393
328
  });
394
329
 
395
330
  test('Displays Create Content View and opens modal with Form', async () => {
@@ -9,7 +9,7 @@ const WizardHeader = ({
9
9
  <Grid style={{ gridGap: '24px' }}>
10
10
  {title &&
11
11
  <TextContent>
12
- <Text component={TextVariants.h2}>{title}</Text>
12
+ <Text ouiaId="wizard-header-text" component={TextVariants.h2}>{title}</Text>
13
13
  </TextContent>}
14
14
  {description &&
15
15
  <TextContent>
@@ -70,7 +70,7 @@ const RelatedContentViewsModal = ({ cvName, cvId, relatedCVCount }) => {
70
70
  ouiaId="related-content-view-components-table"
71
71
  fetchItems={useCallback(params => getContentViewComponents(cvId, params, 'Added'), [cvId])}
72
72
  variant={TableVariant.compact}
73
- autocompleteEndpoint="/content_views/auto_complete_search"
73
+ autocompleteEndpoint="/katello/api/v2/content_views"
74
74
  emptyContentTitle={__('You currently don\'t have any related content views.')}
75
75
  emptySearchTitle={__('No matching content views found')}
76
76
  emptyContentBody={__('Related content views will appear here when created.')}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { renderWithRedux, patientlyWaitFor, fireEvent } from 'react-testing-lib-wrapper';
3
3
 
4
- import { nockInstance, assertNockRequest } from '../../../../test-utils/nockWrapper';
4
+ import { nockInstance, assertNockRequest, mockAutocomplete } from '../../../../test-utils/nockWrapper';
5
5
  import api from '../../../../services/api';
6
6
 
7
7
  import RelatedContentViewComponentsModal from '../RelatedContentViewComponentsModal';
@@ -16,6 +16,12 @@ test('Can call API and show Related Content Views Components Modal', async (done
16
16
  const relatedCvCount = 2;
17
17
  const cvName = 'italiano';
18
18
  const contentViewComponentsPath = api.getApiUrl(`/content_views/${cvId}/content_view_components/show_all`);
19
+ const autocompleteUrl = '/content_views/auto_complete_search';
20
+ const autocompleteQuery = {
21
+ organization_id: 1,
22
+ search: '',
23
+ };
24
+ const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
19
25
 
20
26
  const scope = nockInstance
21
27
  .get(contentViewComponentsPath)
@@ -32,6 +38,7 @@ test('Can call API and show Related Content Views Components Modal', async (done
32
38
  fireEvent.click(getByLabelText(`button_${cvId}`));
33
39
  await patientlyWaitFor(() => expect(getByText('Related content views')).toBeInTheDocument());
34
40
 
41
+ assertNockRequest(autocompleteScope);
35
42
  assertNockRequest(scope, done);
36
43
  });
37
44
 
@@ -32,14 +32,6 @@ class ModuleStreamsPage extends Component {
32
32
  this.props.getModuleStreams({ search });
33
33
  };
34
34
 
35
- getAutoCompleteParams = search => ({
36
- endpoint: '/module_streams/auto_complete_search',
37
- params: {
38
- organization_id: orgId(),
39
- search,
40
- },
41
- });
42
-
43
35
  updateSearchQuery = (searchQuery) => {
44
36
  this.setState({ searchQuery });
45
37
  };
@@ -52,7 +44,9 @@ class ModuleStreamsPage extends Component {
52
44
  content={moduleStreams}
53
45
  tableSchema={TableSchema}
54
46
  onSearch={this.onSearch}
55
- getAutoCompleteParams={this.getAutoCompleteParams}
47
+ autocompleteEndpoint="/katello/api/v2/module_streams"
48
+ autocompleteQueryParams={{ organization_id: orgId() }}
49
+ bookmarkController="katello_module_streams"
56
50
  updateSearchQuery={this.updateSearchQuery}
57
51
  initialInputValue={this.state.searchQuery}
58
52
  onPaginationChange={this.onPaginationChange}
@@ -2,8 +2,14 @@
2
2
 
3
3
  exports[`Module streams page should render and contain appropiate components 1`] = `
4
4
  <ContentPage
5
+ autocompleteEndpoint="/katello/api/v2/module_streams"
6
+ autocompleteQueryParams={
7
+ Object {
8
+ "organization_id": 1,
9
+ }
10
+ }
11
+ bookmarkController="katello_module_streams"
5
12
  content={Object {}}
6
- getAutoCompleteParams={[Function]}
7
13
  header="Module Streams"
8
14
  initialInputValue=""
9
15
  onPaginationChange={[Function]}