katello 4.3.0.rc1 → 4.3.0.rc4

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 (299) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/api_controller.rb +4 -0
  3. data/app/controllers/katello/api/v2/capsule_content_controller.rb +11 -3
  4. data/app/controllers/katello/api/v2/content_uploads_controller.rb +1 -1
  5. data/app/controllers/katello/api/v2/generic_content_units_controller.rb +10 -4
  6. data/app/controllers/katello/api/v2/host_errata_controller.rb +5 -0
  7. data/app/controllers/katello/api/v2/host_packages_controller.rb +2 -0
  8. data/app/controllers/katello/api/v2/host_tracer_controller.rb +4 -0
  9. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +8 -0
  10. data/app/controllers/katello/api/v2/repositories_controller.rb +35 -3
  11. data/app/controllers/katello/api/v2/repository_sets_controller.rb +2 -2
  12. data/app/controllers/katello/api/v2/root_controller.rb +10 -19
  13. data/app/controllers/katello/concerns/api/v2/bulk_extensions.rb +3 -13
  14. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +1 -9
  15. data/app/controllers/katello/remote_execution_controller.rb +1 -1
  16. data/app/lib/actions/katello/capsule_content/refresh_repos.rb +1 -1
  17. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +7 -5
  18. data/app/lib/actions/katello/repository/destroy.rb +3 -3
  19. data/app/lib/actions/katello/repository/import_upload.rb +12 -2
  20. data/app/lib/actions/pulp/repository/sync.rb +0 -2
  21. data/app/lib/actions/pulp3/abstract_async_task.rb +16 -4
  22. data/app/lib/actions/pulp3/capsule_content/generate_metadata.rb +5 -4
  23. data/app/lib/actions/pulp3/capsule_content/reclaim_space.rb +25 -0
  24. data/app/lib/actions/pulp3/orchestration/repository/import_repository_upload.rb +36 -0
  25. data/app/lib/actions/pulp3/orchestration/repository/import_upload.rb +1 -1
  26. data/app/lib/actions/pulp3/repository/commit_upload.rb +3 -1
  27. data/app/lib/actions/pulp3/repository/import_upload.rb +4 -2
  28. data/app/lib/actions/pulp3/repository/reclaim_space.rb +25 -0
  29. data/app/lib/actions/pulp3/repository/save_artifact.rb +12 -8
  30. data/app/lib/katello/resources/cdn.rb +10 -1
  31. data/app/lib/katello/resources/registry.rb +1 -1
  32. data/app/models/katello/concerns/host_managed_extensions.rb +7 -4
  33. data/app/models/katello/concerns/smart_proxy_extensions.rb +21 -9
  34. data/app/models/katello/content_view_version.rb +1 -6
  35. data/app/models/katello/glue/pulp/repo.rb +1 -2
  36. data/app/models/katello/host_tracer.rb +2 -0
  37. data/app/models/katello/pulp3/repository_reference.rb +7 -0
  38. data/app/models/katello/repository.rb +2 -30
  39. data/app/models/katello/root_repository.rb +3 -44
  40. data/app/models/setting/content.rb +2 -8
  41. data/app/presenters/katello/host_package_presenter.rb +21 -0
  42. data/app/services/katello/bulk_items_helper.rb +35 -0
  43. data/app/services/katello/pulp3/api/core.rb +16 -2
  44. data/app/services/katello/pulp3/content.rb +4 -2
  45. data/app/services/katello/pulp3/pulp_content_unit.rb +9 -3
  46. data/app/services/katello/pulp3/repository.rb +9 -4
  47. data/app/services/katello/pulp3/repository_mirror.rb +1 -1
  48. data/app/services/katello/repository_type.rb +2 -1
  49. data/app/services/katello/smart_proxy_helper.rb +10 -1
  50. data/app/views/foreman/job_templates/change_content_source.erb +42 -0
  51. data/app/views/foreman/job_templates/install_errata.erb +8 -6
  52. data/app/views/foreman/job_templates/resolve_traces.erb +4 -5
  53. data/app/views/foreman/job_templates/resolve_traces_-_katello_ansible_default.erb +3 -5
  54. data/app/views/foreman/smart_proxies/_content_sync.html.erb +17 -4
  55. data/app/views/foreman/smart_proxies/_reclaim_space.html.erb +12 -0
  56. data/app/views/foreman/smart_proxies/show.html.erb +4 -2
  57. data/app/views/katello/api/v2/capsule_content/sync_status.json.rabl +6 -0
  58. data/app/views/katello/api/v2/{organizations/cdn_configuration.rabl → cdn_configurations/show.json.rabl} +4 -0
  59. data/app/views/katello/api/v2/content_facet/show.json.rabl +8 -0
  60. data/app/views/katello/api/v2/content_view_filters/show.json.rabl +0 -1
  61. data/app/views/katello/api/v2/content_views/base.json.rabl +1 -1
  62. data/app/views/katello/api/v2/host_packages/base.json.rabl +2 -0
  63. data/app/views/katello/api/v2/organizations/show.json.rabl +1 -1
  64. data/app/views/katello/api/v2/repositories/show.json.rabl +0 -3
  65. data/config/routes/api/v2.rb +5 -10
  66. data/db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb +2 -0
  67. data/db/migrate/20211115215210_drop_ostree_branches.rb +13 -0
  68. data/db/migrate/20211129200124_remove_dependency_solving_algorithm_setting.rb +5 -0
  69. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion-katello-bootstrap.js +1 -2
  70. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.js +3 -3
  71. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +21 -1
  72. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.factory.js +2 -1
  73. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/sync-state.service.js +2 -0
  74. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +0 -10
  75. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-versions.html +0 -3
  76. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +0 -10
  77. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-versions.module.js +0 -1
  78. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version.html +0 -7
  79. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/content.service.js +0 -5
  80. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.module.js +0 -1
  81. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.routes.js +0 -11
  82. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/fenced-pages.service.js +1 -2
  83. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +14 -2
  84. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -4
  85. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +0 -10
  86. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-reclaim-space-modal.controller.js +36 -0
  87. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +16 -2
  88. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details-reclaim-space-modal.html +18 -0
  89. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +13 -0
  90. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +1 -1
  91. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/new-repository.controller.js +3 -6
  92. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +4 -1
  93. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/os-versions.service.js +1 -0
  94. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/product-repositories-reclaim-space-modal.controller.js +35 -0
  95. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repositories.routes.js +0 -9
  96. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/repository.factory.js +3 -1
  97. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories-reclaim-space-modal.html +18 -0
  98. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +7 -8
  99. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.controller.js +35 -0
  100. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.factory.js +18 -0
  101. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.module.js +14 -0
  102. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/pulp-primary/pulp-primary.routes.js +16 -0
  103. data/engines/bastion_katello/lib/bastion_katello/engine.rb +0 -1
  104. data/lib/katello/permission_creator.rb +3 -4
  105. data/lib/katello/plugin.rb +4 -10
  106. data/lib/katello/repository_types/ostree.rb +3 -1
  107. data/lib/katello/tasks/reset.rake +2 -2
  108. data/lib/katello/tasks/upgrades/4.3/fix_url_auth.rake +25 -0
  109. data/lib/katello/version.rb +1 -1
  110. data/package.json +1 -0
  111. data/webpack/components/AddedStatusLabel.js +2 -1
  112. data/webpack/components/EditableTextInput/EditableTextInput.js +76 -17
  113. data/webpack/components/EditableTextInput/__tests__/editableTextInput.test.js +82 -0
  114. data/webpack/components/EditableTextInput/editableTextInput.scss +4 -0
  115. data/webpack/components/Packages/index.js +63 -0
  116. data/webpack/components/RoutedTabs/index.js +3 -1
  117. data/webpack/components/Search/Search.js +7 -1
  118. data/webpack/components/SelectAllCheckbox/index.js +2 -2
  119. data/webpack/components/Table/EmptyStateMessage.js +4 -2
  120. data/webpack/components/Table/MainTable.scss +7 -1
  121. data/webpack/components/Table/TableHooks.js +10 -19
  122. data/webpack/components/Table/TableWrapper.js +3 -3
  123. data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +3 -3
  124. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard.js +24 -30
  125. data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +1 -0
  126. data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +16 -0
  127. data/webpack/components/extensions/HostDetails/HostErrata/HostErrataConstants.js +2 -0
  128. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesActions.js +11 -0
  129. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesConstants.js +2 -0
  130. data/webpack/components/extensions/HostDetails/HostPackages/HostPackagesSelectors.js +16 -0
  131. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
  132. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +1 -0
  133. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab.js +119 -25
  134. data/webpack/components/extensions/HostDetails/Tabs/HostTracesConstants.js +1 -0
  135. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.js +127 -0
  136. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab.scss +11 -0
  137. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +30 -4
  138. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionConstants.js +1 -0
  139. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsActions.js +73 -0
  140. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsConstants.js +2 -0
  141. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsSelectors.js +16 -0
  142. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +347 -0
  143. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.scss +7 -0
  144. data/webpack/components/extensions/HostDetails/Tabs/TracesTab.js +38 -31
  145. data/webpack/components/extensions/HostDetails/Tabs/__tests__/bookmarks.fixtures.json +12 -0
  146. data/webpack/components/extensions/HostDetails/Tabs/__tests__/contentOverrides.fixtures.json +227 -0
  147. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +423 -2
  148. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packages.fixtures.json +28 -0
  149. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +91 -0
  150. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySets.fixtures.json +120 -0
  151. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +307 -0
  152. data/webpack/components/extensions/HostDetails/Tabs/__tests__/resolveErrata.fixtures.json +35 -0
  153. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +55 -9
  154. data/webpack/components/extensions/HostDetails/Tabs/customizedRexUrlHelpers.js +28 -14
  155. data/webpack/containers/Application/overrides.scss +31 -9
  156. data/webpack/global_index.js +11 -4
  157. data/webpack/redux/reducers/RedHatRepositories/enabled.fixtures.js +0 -2
  158. data/webpack/scenes/Content/ContentConfig.js +23 -7
  159. data/webpack/scenes/Content/Details/__tests__/contentDetail.test.js +2 -0
  160. data/webpack/scenes/ContentCredentials/ContentCredentialActions.js +18 -0
  161. data/webpack/scenes/ContentCredentials/ContentCredentialConstants.js +2 -0
  162. data/webpack/scenes/ContentCredentials/ContentCredentialSelectors.js +12 -0
  163. data/webpack/scenes/ContentCredentials/__tests__/contentCredentials.fixtures.js +73 -0
  164. data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +8 -12
  165. data/webpack/scenes/ContentViews/Copy/CopyContentViewModal.js +1 -1
  166. data/webpack/scenes/ContentViews/Copy/__tests__/copyContentView.test.js +1 -1
  167. data/webpack/scenes/ContentViews/Create/ContentViewFormComponents.js +3 -3
  168. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +7 -2
  169. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.scss +7 -0
  170. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +9 -9
  171. data/webpack/scenes/ContentViews/Delete/ContentViewDeleteWizard.js +6 -6
  172. data/webpack/scenes/ContentViews/Delete/Steps/CVDeleteEnvironmentsSelection.js +39 -37
  173. data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionFinish.js +10 -4
  174. data/webpack/scenes/ContentViews/Delete/Steps/CVDeletionReview.js +35 -33
  175. data/webpack/scenes/ContentViews/Delete/__tests__/contentViewDelete.test.js +12 -7
  176. data/webpack/scenes/ContentViews/Delete/__tests__/cvVersionsData.fixtures.json +2 -6
  177. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentEnvironments.js +13 -14
  178. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +36 -31
  179. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +8 -8
  180. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +108 -41
  181. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +3 -2
  182. data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +2 -2
  183. data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterCreateResult.fixtures.json +1 -2
  184. data/webpack/scenes/ContentViews/Details/Filters/AffectedRepositories/AffectedRepositoryTable.js +1 -4
  185. data/webpack/scenes/ContentViews/Details/Filters/CVContainerImageFilterContent.js +6 -6
  186. data/webpack/scenes/ContentViews/Details/Filters/CVErrataDateFilterContent.js +11 -5
  187. data/webpack/scenes/ContentViews/Details/Filters/CVErrataIDFilterContent.js +6 -9
  188. data/webpack/scenes/ContentViews/Details/Filters/CVModuleStreamFilterContent.js +5 -8
  189. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +40 -43
  190. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +2 -2
  191. data/webpack/scenes/ContentViews/Details/Filters/ContentType.js +4 -4
  192. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetailsHeader.js +6 -8
  193. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +6 -1
  194. data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +1 -1
  195. data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +16 -22
  196. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +8 -8
  197. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +3 -5
  198. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewErrataByDateDetails.fixtures.json +1 -8
  199. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetail.fixtures.json +1 -2
  200. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilterDetails.test.js +5 -9
  201. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvAllRepos.fixtures.json +0 -2
  202. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataDateFilterContent.test.js +1 -9
  203. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErrataIDFilter.test.js +2 -4
  204. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvErratumFilterDetails.fixtures.json +1 -2
  205. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailModuleAffectedRepos.fixtures.json +1 -8
  206. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvFilterDetailWithAffectedRepos.fixtures.json +1 -8
  207. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilter.test.js +2 -4
  208. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvModuleStreamFilterDetails.fixtures.json +1 -2
  209. data/webpack/scenes/ContentViews/Details/Filters/__tests__/cvPackageFilterDetail.fixtures.json +1 -3
  210. data/webpack/scenes/ContentViews/Details/Promote/ContentViewVersionPromote.js +61 -32
  211. data/webpack/scenes/ContentViews/Details/Repositories/ContentCounts.js +6 -1
  212. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +5 -8
  213. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +55 -9
  214. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +2 -0
  215. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.fixtures.json +0 -2
  216. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionContent.js +48 -29
  217. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionEnvironments.js +2 -2
  218. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.js +9 -7
  219. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersionErrata.scss +5 -2
  220. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +38 -9
  221. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveCVVersionWizard.js +4 -1
  222. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVEnvironmentSelectionForm.js +59 -53
  223. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionDeleteFinish.js +14 -3
  224. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js +24 -17
  225. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/cvVersionRemove.test.js +3 -3
  226. data/webpack/scenes/ContentViews/Details/Versions/Delete/__tests__/versionsResponseData.fixtures.json +1 -4
  227. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetails.js +4 -2
  228. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionDetailsHeader.js +134 -32
  229. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/ContentViewVersionRepositoryCell.js +8 -3
  230. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionComponent.fixtures.json +1 -4
  231. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.fixtures.json +1 -2
  232. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetails.test.js +21 -1
  233. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsCounts.fixtures.json +1 -2
  234. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionDetailsEmpty.test.js +22 -1
  235. data/webpack/scenes/ContentViews/Details/Versions/VersionDetails/__tests__/ContentViewVersionRepositories.fixtures.json +1 -18
  236. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.fixtures.json +5 -5
  237. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +2 -0
  238. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +1 -3
  239. data/webpack/scenes/ContentViews/Details/contentViewInfo.scss +0 -4
  240. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +66 -53
  241. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +40 -28
  242. data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +3 -3
  243. data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +14 -14
  244. data/webpack/scenes/ContentViews/Publish/cvPublishForm.scss +6 -0
  245. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +53 -12
  246. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +12 -6
  247. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +6 -6
  248. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +12 -7
  249. data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +2 -2
  250. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +26 -27
  251. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.scss +18 -6
  252. data/webpack/scenes/ContentViews/components/WizardHeader.js +44 -0
  253. data/webpack/scenes/ContentViews/components/contentViewIcon.scss +13 -2
  254. data/webpack/scenes/Organizations/OrganizationActions.js +22 -24
  255. data/webpack/scenes/Organizations/OrganizationConstants.js +1 -3
  256. data/webpack/scenes/Organizations/OrganizationReducer.js +0 -7
  257. data/webpack/scenes/Organizations/OrganizationSelectors.js +16 -0
  258. data/webpack/scenes/Organizations/__tests__/OrganizationActions.test.js +1 -21
  259. data/webpack/scenes/Organizations/__tests__/OrganizationReducer.test.js +0 -20
  260. data/webpack/scenes/Organizations/__tests__/organizations.fixtures.js +34 -23
  261. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationForm.js +185 -0
  262. data/webpack/scenes/Subscriptions/Manifest/CdnConfigurationForm.scss +3 -0
  263. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +112 -146
  264. data/webpack/scenes/Subscriptions/Manifest/__tests__/CdnConfigurationForm.test.js +114 -0
  265. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +121 -31
  266. data/webpack/scenes/Subscriptions/Manifest/index.js +14 -3
  267. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsActions.test.js.snap +1 -0
  268. data/webpack/scenes/Tasks/TaskActions.js +4 -3
  269. data/webpack/scenes/Tasks/__tests__/__snapshots__/TaskActions.test.js.snap +1 -0
  270. data/webpack/utils/helpers.js +2 -2
  271. metadata +62 -43
  272. data/app/controllers/katello/api/v2/ostree_branches_controller.rb +0 -16
  273. data/app/lib/actions/pulp/repository/presenters/ostree_presenter.rb +0 -91
  274. data/app/models/katello/ostree_branch.rb +0 -12
  275. data/app/models/katello/repository_ostree_branch.rb +0 -7
  276. data/app/services/katello/pulp/ostree_branch.rb +0 -14
  277. data/app/services/katello/pulp/repository/ostree.rb +0 -48
  278. data/app/views/katello/api/v2/ostree_branches/compare.json.rabl +0 -10
  279. data/app/views/katello/api/v2/ostree_branches/index.json.rabl +0 -7
  280. data/app/views/katello/api/v2/ostree_branches/show.json.rabl +0 -5
  281. data/app/views/katello/api/v2/root/resource_list.json.rabl +0 -3
  282. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +0 -26
  283. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +0 -27
  284. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch-repositories.controller.js +0 -77
  285. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/ostree-branch.controller.js +0 -31
  286. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +0 -15
  287. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-repositories.html +0 -72
  288. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch.html +0 -30
  289. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branch.factory.js +0 -27
  290. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.controller.js +0 -67
  291. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.module.js +0 -15
  292. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/ostree-branches.routes.js +0 -50
  293. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/views/ostree-branches.html +0 -40
  294. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -40
  295. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/ostree-upstream-sync-policy.service.js +0 -26
  296. data/webpack/components/extensions/HostDetails/Tabs/SubscriptionTab.js +0 -12
  297. data/webpack/scenes/Content/Details/ContentCounts.js +0 -42
  298. data/webpack/scenes/Subscriptions/Manifest/__tests__/SimpleContentAccess.test.js +0 -108
  299. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +0 -158
@@ -1,80 +1,93 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { translate as __ } from 'foremanReact/common/I18n';
4
- import { Alert, Switch, Flex, FlexItem, TextContent, Text, TextVariants, Form, FormGroup, TextArea } from '@patternfly/react-core';
4
+ import {
5
+ Alert, Switch, TextContent, Text,
6
+ TextVariants, Form, FormGroup, TextArea, AlertActionCloseButton,
7
+ } from '@patternfly/react-core';
5
8
  import { EnterpriseIcon, RegistryIcon } from '@patternfly/react-icons';
6
9
  import EnvironmentPaths from '../components/EnvironmentPaths/EnvironmentPaths';
7
10
  import ComponentEnvironments from '../Details/ComponentContentViews/ComponentEnvironments';
8
11
  import './cvPublishForm.scss';
12
+ import WizardHeader from '../components/WizardHeader';
9
13
 
10
14
  const CVPublishForm = ({
11
15
  description,
12
16
  setDescription,
13
- details,
17
+ details: {
18
+ name, composite, next_version: nextVersion,
19
+ },
14
20
  userCheckedItems,
15
21
  setUserCheckedItems,
16
22
  promote,
17
23
  setPromote,
18
24
  forcePromote,
19
25
  }) => {
20
- const {
21
- name, composite, next_version: nextVersion,
22
- } = details;
26
+ const [alertDismissed, setAlertDismissed] = useState(false);
23
27
 
28
+ const checkPromote = (checked) => {
29
+ if (!checked) {
30
+ setUserCheckedItems([]);
31
+ }
32
+ setPromote(checked);
33
+ };
24
34
  return (
25
35
  <>
26
- <>
27
- <TextContent>
28
- <Text style={{ marginBottom: '1em' }} component={TextVariants.h1}>{__('Publish')}</Text>
29
- </TextContent>
30
- <Flex flex={{ default: 'inlineFlex' }}>
31
- <FlexItem>{__('A new version of ')}<b>{composite ? <RegistryIcon /> : <EnterpriseIcon />} {name}</b>
36
+ <WizardHeader
37
+ title={__('Publish')}
38
+ description={
39
+ <>{__('A new version of ')}<b>{composite ? <RegistryIcon /> : <EnterpriseIcon />} {name}</b>
32
40
  {__(' will be created and automatically promoted to the ' +
33
- 'Library environment. You can promote to other environments as well. ')}
34
- </FlexItem>
35
- </Flex>
36
- <TextContent>
37
- <Text style={{ marginTop: '1em', marginBottom: '1em' }} component={TextVariants.h3}>{__('Publish new version - ')}{nextVersion || '1.0'}</Text>
38
- </TextContent>
39
- <Form>
40
- <FormGroup label="Description" fieldId="description">
41
- <TextArea
42
- isRequired
43
- type="text"
44
- id="description"
45
- aria-label="input_description"
46
- name="description"
47
- value={description}
48
- onChange={value => setDescription(value)}
49
- />
50
- </FormGroup>
51
- <FormGroup label="Promote" fieldId="promote" style={{ marginBottom: '2em', outlineStyle: 'none' }}>
52
- <Switch
53
- id="promote-switch"
54
- aria-label="promote-switch"
55
- isChecked={promote}
56
- onChange={checked => setPromote(checked)}
57
- />
58
- </FormGroup>
59
- </Form>
60
- </>
61
- <>
62
- {forcePromote.length > 0 && (
63
- <Alert variant="info" isInline title="Force Promotion">
64
- <p>{__('Selected environments are out of the environment order. ' +
65
- 'The recommended practice is to promote to the next environment in the path.')}
66
- </p>
67
- <ComponentEnvironments environments={forcePromote} />
68
- </Alert>
69
- )
70
- }
71
- {promote &&
41
+ 'Library environment. You can promote to other environments as well. ')
42
+ }
43
+ </>}
44
+ />
45
+ <TextContent>
46
+ <Text component={TextVariants.h3}>{__('Publish new version - ')}{nextVersion || '1.0'}</Text>
47
+ </TextContent>
48
+ <Form>
49
+ <FormGroup label={__('Description')} fieldId="description">
50
+ <TextArea
51
+ isRequired
52
+ type="text"
53
+ id="description"
54
+ aria-label="input_description"
55
+ name="description"
56
+ value={description}
57
+ onChange={setDescription}
58
+ />
59
+ </FormGroup>
60
+ <FormGroup label={__('Promote')} fieldId="promote">
61
+ <Switch
62
+ id="promote-switch"
63
+ aria-label="promote-switch"
64
+ isChecked={promote}
65
+ onChange={checkPromote}
66
+ />
67
+ </FormGroup>
68
+ </Form>
69
+ {!alertDismissed && promote && forcePromote.length > 0 && (
70
+ <Alert
71
+ variant="info"
72
+ isInline
73
+ title={__('Force promotion')}
74
+ actionClose={<AlertActionCloseButton onClose={() => setAlertDismissed(true)} />}
75
+ >
76
+ <TextContent>
77
+ {forcePromote.length > 1 ? __('Selected environments ') : __('Selected environment ')}
78
+ <ComponentEnvironments environments={forcePromote} />
79
+ {forcePromote.length > 1 ?
80
+ __(' are out of the environment path order. The recommended practice is to promote to the next environment in the path.') :
81
+ __(' is out of the environment path order. The recommended practice is to promote to the next environment in the path.')
82
+ }
83
+ </TextContent>
84
+ </Alert>)}
85
+ {promote &&
72
86
  <EnvironmentPaths
73
87
  userCheckedItems={userCheckedItems}
74
88
  setUserCheckedItems={setUserCheckedItems}
75
89
  />
76
- }
77
- </>
90
+ }
78
91
  </>
79
92
  );
80
93
  };
@@ -1,16 +1,23 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { useSelector } from 'react-redux';
3
3
  import PropTypes from 'prop-types';
4
- import { TableComposable, Thead, Tbody, Tr, Th, Td } from '@patternfly/react-table';
4
+ import {
5
+ TableComposable, Thead, Tbody, Tr, Th,
6
+ Td,
7
+ } from '@patternfly/react-table';
8
+ import { EnterpriseIcon, RegistryIcon } from '@patternfly/react-icons';
5
9
  import { translate as __ } from 'foremanReact/common/I18n';
6
10
  import { STATUS } from 'foremanReact/constants';
7
11
  import ContentViewIcon from '../components/ContentViewIcon';
8
12
  import InactiveText from '../components/InactiveText';
9
13
  import ComponentEnvironments from '../Details/ComponentContentViews/ComponentEnvironments';
10
14
  import { selectEnvironmentPaths, selectEnvironmentPathsStatus } from '../components/EnvironmentPaths/EnvironmentPathSelectors';
15
+ import WizardHeader from '../components/WizardHeader';
11
16
 
12
17
  const CVPublishReview = ({
13
- details,
18
+ details: {
19
+ name, composite, next_version: nextVersion,
20
+ },
14
21
  userCheckedItems,
15
22
  }) => {
16
23
  const environmentPathResponse = useSelector(selectEnvironmentPaths);
@@ -26,33 +33,38 @@ const CVPublishReview = ({
26
33
  return [];
27
34
  }, [environmentPathResponse, environmentPathLoading, userCheckedItems]);
28
35
 
29
- const {
30
- name, composite, next_version: nextVersion,
31
- } = details;
32
-
33
36
  return (
34
- <TableComposable aria-label="Review Table">
35
- <Thead>
36
- <Tr>
37
- <Th>{__('Content view')}</Th>
38
- <Th>{__('Version')}</Th>
39
- <Th>{__('Environments')}</Th>
40
- </Tr>
41
- </Thead>
42
- <Tbody>
43
- <Tr>
44
- <Td>
45
- <><ContentViewIcon composite={composite} description={name} /><InactiveText text={__('Newly published')} /></>
46
- </Td>
47
- <Td>
48
- {__('Version')} {nextVersion}
49
- </Td>
50
- <Td>
51
- <ComponentEnvironments environments={promotedToEnvironments} />
52
- </Td>
53
- </Tr>
54
- </Tbody>
55
- </TableComposable>
37
+ <>
38
+ <WizardHeader
39
+ title={__('Review details')}
40
+ description={
41
+ <>
42
+ {__('Review your currently selected changes for ')}<b>{composite ? <RegistryIcon /> : <EnterpriseIcon />} {name}.</b>
43
+ </>}
44
+ />
45
+ <TableComposable aria-label="Review Table">
46
+ <Thead>
47
+ <Tr>
48
+ <Th>{__('Content view name')}</Th>
49
+ <Th>{__('Version')}</Th>
50
+ <Th>{__('Environments')}</Th>
51
+ </Tr>
52
+ </Thead>
53
+ <Tbody>
54
+ <Tr>
55
+ <Td>
56
+ <><ContentViewIcon composite={composite} description={name} /><InactiveText text={__('Newly published')} /></>
57
+ </Td>
58
+ <Td>
59
+ {__('Version')} {nextVersion}
60
+ </Td>
61
+ <Td>
62
+ <ComponentEnvironments environments={promotedToEnvironments} />
63
+ </Td>
64
+ </Tr>
65
+ </Tbody>
66
+ </TableComposable>
67
+ </>
56
68
  );
57
69
  };
58
70
 
@@ -33,7 +33,7 @@ const PublishContentViewWizard = ({
33
33
  const steps = [
34
34
  {
35
35
  id: 1,
36
- name: 'Publish',
36
+ name: __('Publish'),
37
37
  component: <CVPublishForm
38
38
  description={description}
39
39
  setDescription={setDescription}
@@ -47,11 +47,11 @@ const PublishContentViewWizard = ({
47
47
  />,
48
48
  },
49
49
  {
50
- id: 2, name: 'Review', component: <CVPublishReview details={details} userCheckedItems={userCheckedItems} show={show} />, nextButtonText: 'Finish',
50
+ id: 2, name: __('Review details'), component: <CVPublishReview details={details} userCheckedItems={userCheckedItems} show={show} />, nextButtonText: 'Finish',
51
51
  },
52
52
  {
53
53
  id: 3,
54
- name: 'Finish',
54
+ name: __('Finish'),
55
55
  component: <CVPublishFinish
56
56
  description={description}
57
57
  setDescription={setDescription}
@@ -23,9 +23,9 @@ test('Can call API and show Wizard', async (done) => {
23
23
  const { getByText } = renderWithRedux(<PublishContentViewWizard
24
24
  details={cvDetailData}
25
25
  show
26
- setIsOpen={() => {}}
26
+ setIsOpen={() => { }}
27
27
  currentStep={1}
28
- setCurrentStep={() => {}}
28
+ setCurrentStep={() => { }}
29
29
  />);
30
30
 
31
31
  await patientlyWaitFor(() => expect(getByText('Publish new version - 6.0')).toBeInTheDocument());
@@ -44,9 +44,9 @@ test('Can show Wizard and show environment paths', async (done) => {
44
44
  const { getByText, getByLabelText } = renderWithRedux(<PublishContentViewWizard
45
45
  details={cvDetailData}
46
46
  show
47
- setIsOpen={() => {}}
47
+ setIsOpen={() => { }}
48
48
  currentStep={1}
49
- setCurrentStep={() => {}}
49
+ setCurrentStep={() => { }}
50
50
  />);
51
51
 
52
52
  await patientlyWaitFor(() => expect(getByText('Publish new version - 6.0')).toBeInTheDocument());
@@ -75,9 +75,9 @@ test('Can show and hide force promotion alert', async (done) => {
75
75
  } = renderWithRedux(<PublishContentViewWizard
76
76
  details={cvDetailData}
77
77
  show
78
- setIsOpen={() => {}}
78
+ setIsOpen={() => { }}
79
79
  currentStep={1}
80
- setCurrentStep={() => {}}
80
+ setCurrentStep={() => { }}
81
81
  />);
82
82
 
83
83
  await patientlyWaitFor(() => expect(getByText('Publish new version - 6.0')).toBeInTheDocument());
@@ -95,24 +95,24 @@ test('Can show and hide force promotion alert', async (done) => {
95
95
 
96
96
  // check outOfOrderEnv
97
97
  fireEvent.click(getByLabelText(outOfOrderEnv));
98
- expect(getByText('Force Promotion')).toBeInTheDocument();
98
+ expect(getByText('Force promotion')).toBeInTheDocument();
99
99
  expect(getAllByText(outOfOrderEnv)[0].closest('a'))
100
100
  .toHaveAttribute('href', '/lifecycle_environments/5');
101
101
 
102
102
  // check outOfOrder env in 2nd path
103
103
  fireEvent.click(getByLabelText(outOfOrderEnv2));
104
- expect(getByText('Force Promotion')).toBeInTheDocument();
104
+ expect(getByText('Force promotion')).toBeInTheDocument();
105
105
  expect(getAllByText(outOfOrderEnv2)[0].closest('a'))
106
106
  .toHaveAttribute('href', '/lifecycle_environments/7');
107
107
 
108
108
  // uncheck outOfOrderEnv
109
109
  fireEvent.click(getByLabelText(outOfOrderEnv));
110
110
  fireEvent.click(getByLabelText(outOfOrderEnv2));
111
- expect(queryByText('Force Promotion')).not.toBeInTheDocument();
111
+ expect(queryByText('Force promotion')).not.toBeInTheDocument();
112
112
 
113
113
  // Check inOrderEnv
114
114
  fireEvent.click(getByLabelText(inOrderEnv));
115
- expect(queryByText('Force Promotion')).not.toBeInTheDocument();
115
+ expect(queryByText('Force promotion')).not.toBeInTheDocument();
116
116
 
117
117
  useSelectorMock.mockClear();
118
118
  assertNockRequest(scope, done);
@@ -128,9 +128,9 @@ test('Can show Wizard form and move to review', async (done) => {
128
128
  const { getByText } = renderWithRedux(<PublishContentViewWizard
129
129
  details={cvDetailData}
130
130
  show
131
- setIsOpen={() => {}}
131
+ setIsOpen={() => { }}
132
132
  currentStep={1}
133
- setCurrentStep={() => {}}
133
+ setCurrentStep={() => { }}
134
134
  />);
135
135
  const useSelectorMock = jest.spyOn(reactRedux, 'useSelector');
136
136
  useSelectorMock.mockReturnValue(environmentPathsData);
@@ -164,9 +164,9 @@ test('Can move to Finish step and publish CV', async (done) => {
164
164
  const { getByText } = renderWithRedux(<PublishContentViewWizard
165
165
  details={cvDetailData}
166
166
  show
167
- setIsOpen={() => {}}
167
+ setIsOpen={() => { }}
168
168
  currentStep={1}
169
- setCurrentStep={() => {}}
169
+ setCurrentStep={() => { }}
170
170
  />);
171
171
  const useSelectorMock = jest.spyOn(reactRedux, 'useSelector');
172
172
  useSelectorMock.mockReturnValue(environmentPathsData);
@@ -1,3 +1,9 @@
1
1
  .pf-c-switch {
2
2
  --pf-c-switch__input--focus__toggle--OutlineWidth: 0;
3
+ }
4
+
5
+ .pf-c-wizard__main-body {
6
+ display: flex;
7
+ grid-gap: 16px;
8
+ flex-direction: column;
3
9
  }
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useCallback } from 'react';
2
2
  import useDeepCompareEffect from 'use-deep-compare-effect';
3
3
  import { useSelector, useDispatch } from 'react-redux';
4
- import { omit } from 'lodash';
4
+ import { omit, upperCase } from 'lodash';
5
5
  import { translate as __ } from 'foremanReact/common/I18n';
6
6
  import { STATUS } from 'foremanReact/constants';
7
7
  import { Button } from '@patternfly/react-core';
@@ -24,6 +24,7 @@ const ContentViewTable = () => {
24
24
  const status = useSelector(selectContentViewStatus);
25
25
  const error = useSelector(selectContentViewError);
26
26
  const [table, setTable] = useState({ rows: [], columns: [] });
27
+ const [sortBy, setSortBy] = useState({});
27
28
  const [rowMappingIds, setRowMappingIds] = useState([]);
28
29
  const [searchQuery, updateSearchQuery] = useState('');
29
30
  const loadingResponse = status === STATUS.PENDING;
@@ -104,12 +105,16 @@ const ContentViewTable = () => {
104
105
  setRowMappingIds(newRowMappingIds);
105
106
  setCvTableStatus(tableStatus());
106
107
  }
108
+ return () => {
109
+ // This sets the loading state so that the table doesn't flicker on return
110
+ setCvTableStatus(STATUS.PENDING);
111
+ };
107
112
  },
108
113
  [response, status, loadingResponse, setTable, setRowMappingIds,
109
114
  setCvResults, setCvTableStatus, setCurrentStep, cvResults, rowMappingIds],
110
115
  );
111
116
 
112
- const onCollapse = (event, rowId, isOpen) => {
117
+ const onCollapse = (_event, rowId, isOpen) => {
113
118
  let rows;
114
119
  if (rowId === -1) {
115
120
  rows = table.rows.map(row => ({ ...row, isOpen }));
@@ -159,11 +164,45 @@ const ContentViewTable = () => {
159
164
  ];
160
165
  };
161
166
 
162
- const additionalListeners = new Array(isPublishModalOpen);
167
+ const indexToSortVariable = (key) => {
168
+ switch (key) {
169
+ case 2:
170
+ return 'name';
171
+ default:
172
+ return undefined;
173
+ }
174
+ };
175
+
176
+ const onSort = (_event, index, direction) => {
177
+ setCvTableStatus(STATUS.PENDING);
178
+ setSortBy({ index, direction });
179
+ };
180
+
181
+ const { index: sortByIndex, direction } = sortBy;
182
+ const fetchItems = useCallback(
183
+ params =>
184
+ getContentViews({
185
+ ...params,
186
+ ...sortByIndex ? {
187
+ sort_by: indexToSortVariable(sortByIndex),
188
+ sort_order: upperCase(direction),
189
+ } : {},
190
+ }),
191
+ [sortByIndex, direction],
192
+ );
193
+
163
194
  const emptyContentTitle = __("You currently don't have any Content Views.");
164
195
  const emptyContentBody = __('A content view can be added by using the "Create content view" button above.');
165
196
  const emptySearchTitle = __('No matching content views found');
166
197
  const emptySearchBody = __('Try changing your search settings.');
198
+ const {
199
+ id,
200
+ latestVersionId,
201
+ latestVersionName,
202
+ latestVersionEnvironments,
203
+ environments,
204
+ versions,
205
+ } = actionableCvDetails;
167
206
 
168
207
  const { rows, columns } = table;
169
208
  return (
@@ -179,12 +218,14 @@ const ContentViewTable = () => {
179
218
  actionResolver,
180
219
  searchQuery,
181
220
  updateSearchQuery,
182
- additionalListeners,
221
+ fetchItems,
183
222
  }}
223
+ additionalListeners={[isPublishModalOpen, sortByIndex, direction]}
224
+ sortBy={sortBy}
225
+ onSort={onSort}
184
226
  bookmarkController="katello_content_views"
185
227
  variant={TableVariant.compact}
186
228
  status={cvTableStatus}
187
- fetchItems={useCallback(getContentViews, [])}
188
229
  onCollapse={onCollapse}
189
230
  canSelectAll={false}
190
231
  cells={columns}
@@ -210,17 +251,17 @@ const ContentViewTable = () => {
210
251
  }
211
252
  {isPromoteModalOpen &&
212
253
  <ContentViewVersionPromote
213
- cvId={actionableCvDetails.id}
214
- versionIdToPromote={actionableCvDetails.latestVersionId}
215
- versionNameToPromote={actionableCvDetails.latestVersionName}
216
- versionEnvironments={actionableCvDetails.latestVersionEnvironments}
254
+ cvId={id && Number(id)}
255
+ versionIdToPromote={latestVersionId}
256
+ versionNameToPromote={latestVersionName}
257
+ versionEnvironments={latestVersionEnvironments}
217
258
  setIsOpen={setIsPromoteModalOpen}
218
259
  />
219
260
  }
220
261
  {isDeleteModalOpen && <ContentViewDeleteWizard
221
- cvId={actionableCvDetails.id}
222
- cvEnvironments={actionableCvDetails.environments}
223
- cvVersions={actionableCvDetails.versions}
262
+ cvId={id && Number(id)}
263
+ cvEnvironments={environments}
264
+ cvVersions={versions}
224
265
  show={isDeleteModalOpen}
225
266
  setIsOpen={setIsDeleteModalOpen}
226
267
  currentStep={currentStep}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { fitContent, expandable } from '@patternfly/react-table';
2
+ import { fitContent, expandable, sortable } from '@patternfly/react-table';
3
3
  import { Link } from 'react-router-dom';
4
4
  import { urlBuilder } from 'foremanReact/common/urlHelpers';
5
5
  import { translate as __ } from 'foremanReact/common/I18n';
@@ -12,7 +12,13 @@ import LastSync from '../Details/Repositories/LastSync';
12
12
 
13
13
  export const buildColumns = () => [
14
14
  { title: __('Type'), cellFormatters: [expandable], transforms: [fitContent] },
15
- __('Name'), __('Last published'), __('Last task'), __('Latest version'),
15
+ {
16
+ title: __('Name'),
17
+ transforms: [sortable],
18
+ },
19
+ __('Last published'),
20
+ __('Last task'),
21
+ __('Latest version'),
16
22
  ];
17
23
 
18
24
  const buildRow = (contentView) => {
@@ -22,12 +28,12 @@ const buildRow = (contentView) => {
22
28
  latest_version_environments: latestVersionEnvironments, last_task: lastTask,
23
29
  } = contentView;
24
30
  /* eslint-enable max-len */
25
- const { last_sync_words: lastSyncWords } = lastTask || {};
31
+ const { last_sync_words: lastSyncWords, started_at: startedAt } = lastTask || {};
26
32
  const row = [
27
33
  { title: <ContentViewIcon composite={composite ? true : undefined} /> },
28
34
  { title: <Link to={`${urlBuilder('content_views', '')}${id}`}>{name}</Link> },
29
35
  { title: lastPublished ? <LongDateTime date={lastPublished} showRelativeTimeTooltip /> : <InactiveText text={__('Not yet published')} /> },
30
- { title: <LastSync lastSync={lastTask} lastSyncWords={lastSyncWords} emptyMessage="N/A" /> },
36
+ { title: <LastSync startedAt={startedAt} lastSync={lastTask} lastSyncWords={lastSyncWords} emptyMessage="N/A" /> },
31
37
  {
32
38
  title: latestVersion ? <ContentViewVersionCell {...{
33
39
  id, latestVersion, latestVersionId, latestVersionEnvironments,
@@ -87,8 +93,8 @@ const buildExpandableRows = (contentViews) => {
87
93
  cvName={name}
88
94
  cvComposite={composite}
89
95
  {...{
90
- activationKeys, hosts, relatedCVCount, relatedCompositeCVs,
91
- }}
96
+ activationKeys, hosts, relatedCVCount, relatedCompositeCVs,
97
+ }}
92
98
  />,
93
99
  props: {
94
100
  colSpan: 2,
@@ -355,9 +355,9 @@ test('Displays Create Content View and opens modal with Form', async () => {
355
355
  expect(queryByText('Label')).not.toBeInTheDocument();
356
356
  expect(queryByText('Composite content view')).not.toBeInTheDocument();
357
357
  expect(queryByText('Component content view')).not.toBeInTheDocument();
358
- expect(queryByText('Solve Dependencies')).not.toBeInTheDocument();
359
- expect(queryByText('Auto Publish')).not.toBeInTheDocument();
360
- expect(queryByText('Import Only')).not.toBeInTheDocument();
358
+ expect(queryByText('Solve dependencies')).not.toBeInTheDocument();
359
+ expect(queryByText('Auto publish')).not.toBeInTheDocument();
360
+ expect(queryByText('Import only')).not.toBeInTheDocument();
361
361
 
362
362
  getByLabelText('create_content_view').click();
363
363
 
@@ -366,9 +366,9 @@ test('Displays Create Content View and opens modal with Form', async () => {
366
366
  expect(getByText('Label')).toBeInTheDocument();
367
367
  expect(getByText('Composite content view')).toBeInTheDocument();
368
368
  expect(getByText('Component content view')).toBeInTheDocument();
369
- expect(getByText('Solve Dependencies')).toBeInTheDocument();
370
- expect(queryByText('Auto Publish')).not.toBeInTheDocument();
371
- expect(getByText('Import Only')).toBeInTheDocument();
369
+ expect(getByText('Solve dependencies')).toBeInTheDocument();
370
+ expect(queryByText('Auto publish')).not.toBeInTheDocument();
371
+ expect(getByText('Import only')).toBeInTheDocument();
372
372
  });
373
373
 
374
374
  /* eslint-enable no-useless-escape */
@@ -1,18 +1,21 @@
1
1
  import React from 'react';
2
+ import { translate as __ } from 'foremanReact/common/I18n';
2
3
  import PropTypes from 'prop-types';
3
4
  import { EnterpriseIcon, RegistryIcon } from '@patternfly/react-icons';
4
5
  import './contentViewIcon.scss';
5
6
 
6
- const ContentViewIcon = ({ composite, count, description }) => {
7
+ const ContentViewIcon = ({
8
+ composite, count, description, style,
9
+ }) => {
7
10
  const props = {
8
- title: composite ? 'composite' : 'component',
9
- className: 'svg-icon-centered',
11
+ title: composite ? __('Composite') : __('Component'),
12
+ className: composite ? 'svg-icon-composite' : 'svg-icon-component',
10
13
  };
11
14
  return (
12
- <div aria-label="content_view_icon" className="svg-centered-container">
13
- {count}
14
- {composite ? <RegistryIcon {...props} /> : <EnterpriseIcon {...props} />}
15
- {description}
15
+ <div aria-label="content_view_icon" className="svg-centered-container" style={style}>
16
+ {count && <span className="composite-component-count">{count}</span>}
17
+ {composite ? <RegistryIcon size="md" {...props} /> : <EnterpriseIcon size="sm" {...props} />}
18
+ <span>{description}</span>
16
19
  </div>
17
20
  );
18
21
  };
@@ -21,12 +24,14 @@ ContentViewIcon.propTypes = {
21
24
  composite: PropTypes.bool,
22
25
  count: PropTypes.node,
23
26
  description: PropTypes.node,
27
+ style: PropTypes.shape({}),
24
28
  };
25
29
 
26
30
  ContentViewIcon.defaultProps = {
27
31
  composite: false,
28
32
  count: null,
29
33
  description: null,
34
+ style: {},
30
35
  };
31
36
 
32
37
  export default ContentViewIcon;
@@ -18,7 +18,7 @@ const ContentViewsCounter = () => {
18
18
  <b>
19
19
  <Flex>
20
20
  <FlexItem spacer={{ default: 'spacerXs' }}>
21
- <ContentViewIcon composite={false} description={__('Component content views')} count={component || <InProgressIcon />} />
21
+ <ContentViewIcon composite={false} description={__('Component content views')} count={(component || component === 0) ? component : <InProgressIcon />} />
22
22
  </FlexItem>
23
23
  <FlexItem>
24
24
  <Tooltip
@@ -37,7 +37,7 @@ const ContentViewsCounter = () => {
37
37
  <b>
38
38
  <Flex>
39
39
  <FlexItem spacer={{ default: 'spacerXs' }}>
40
- <ContentViewIcon composite description={__('Composite content views')} count={composite || <InProgressIcon />} />
40
+ <ContentViewIcon composite description={__('Composite content views')} count={(composite || composite === 0) ? composite : <InProgressIcon />} />
41
41
  </FlexItem>
42
42
  <FlexItem>
43
43
  <Tooltip