katello 4.1.4 → 4.2.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 (240) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +2 -2
  3. data/app/controllers/katello/api/v2/content_credentials_controller.rb +3 -3
  4. data/app/controllers/katello/api/v2/content_uploads_controller.rb +3 -1
  5. data/app/controllers/katello/api/v2/content_view_components_controller.rb +33 -1
  6. data/app/controllers/katello/api/v2/content_views_controller.rb +12 -0
  7. data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/products_bulk_actions_controller.rb +1 -2
  9. data/app/controllers/katello/api/v2/products_controller.rb +4 -4
  10. data/app/controllers/katello/api/v2/repositories_bulk_actions_controller.rb +3 -11
  11. data/app/controllers/katello/api/v2/repositories_controller.rb +68 -47
  12. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +0 -28
  13. data/app/controllers/katello/concerns/api/v2/registration_commands_controller_extensions.rb +26 -5
  14. data/app/controllers/katello/concerns/api/v2/registration_controller_extensions.rb +26 -1
  15. data/app/lib/actions/candlepin/environment/destroy.rb +2 -0
  16. data/app/lib/actions/katello/agent_action.rb +2 -2
  17. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +3 -2
  18. data/app/lib/actions/katello/{gpg_key → content_credential}/update.rb +1 -1
  19. data/app/lib/actions/katello/content_view/publish.rb +6 -1
  20. data/app/lib/actions/katello/content_view_version/create_repos.rb +1 -1
  21. data/app/lib/actions/katello/content_view_version/incremental_update.rb +0 -47
  22. data/app/lib/actions/katello/orphan_cleanup/remove_orphans.rb +1 -1
  23. data/app/lib/actions/katello/repository/clone_contents.rb +1 -7
  24. data/app/lib/actions/katello/repository/clone_to_environment.rb +1 -7
  25. data/app/lib/actions/katello/repository/create.rb +4 -8
  26. data/app/lib/actions/katello/repository/create_root.rb +1 -1
  27. data/app/lib/actions/katello/repository/destroy.rb +1 -3
  28. data/app/lib/actions/katello/repository/import_upload.rb +3 -2
  29. data/app/lib/actions/katello/repository/instance_update.rb +1 -1
  30. data/app/lib/actions/katello/repository/metadata_generate.rb +2 -8
  31. data/app/lib/actions/katello/repository/multi_clone_contents.rb +0 -1
  32. data/app/lib/actions/katello/repository/refresh_repository.rb +1 -4
  33. data/app/lib/actions/katello/repository/remove_content.rb +6 -4
  34. data/app/lib/actions/katello/repository/sync.rb +5 -25
  35. data/app/lib/actions/katello/repository/update.rb +1 -2
  36. data/app/lib/actions/katello/repository/update_http_proxy_details.rb +2 -5
  37. data/app/lib/actions/katello/repository/update_redhat_repository.rb +1 -1
  38. data/app/lib/actions/katello/repository/upload_files.rb +8 -3
  39. data/app/lib/actions/katello/repository/upload_package_group.rb +2 -11
  40. data/app/lib/actions/katello/repository/verify_checksum.rb +0 -1
  41. data/app/lib/actions/katello/repository_set/enable_repository.rb +1 -1
  42. data/app/lib/actions/pulp3/orchestration/repository/create.rb +2 -2
  43. data/app/lib/actions/pulp3/repository/create.rb +3 -4
  44. data/app/lib/actions/pulp3/repository/create_remote.rb +1 -6
  45. data/app/lib/actions/pulp3/repository/repair.rb +4 -0
  46. data/app/lib/katello/errors.rb +1 -0
  47. data/app/lib/katello/http_resource.rb +26 -73
  48. data/app/lib/katello/qpid/connection.rb +1 -3
  49. data/app/lib/katello/resources/candlepin/consumer.rb +1 -1
  50. data/app/lib/katello/resources/candlepin/environment.rb +2 -0
  51. data/app/lib/katello/resources/registry.rb +7 -20
  52. data/app/lib/katello/util/http_proxy.rb +0 -3
  53. data/app/lib/katello/validators/gpg_key_content_validator.rb +1 -1
  54. data/app/models/katello/authorization/{gpg_key.rb → content_credential.rb} +1 -1
  55. data/app/models/katello/authorization/product.rb +0 -4
  56. data/app/models/katello/concerns/host_managed_extensions.rb +2 -16
  57. data/app/models/katello/concerns/organization_extensions.rb +1 -1
  58. data/app/models/katello/concerns/pulp_database_unit.rb +13 -5
  59. data/app/models/katello/concerns/smart_proxy_extensions.rb +45 -41
  60. data/app/models/katello/{gpg_key.rb → content_credential.rb} +4 -4
  61. data/app/models/katello/content_view.rb +6 -1
  62. data/app/models/katello/generic_content_unit.rb +16 -0
  63. data/app/models/katello/glue/pulp/repos.rb +9 -25
  64. data/app/models/katello/kt_environment.rb +1 -1
  65. data/app/models/katello/product.rb +4 -4
  66. data/app/models/katello/repository.rb +13 -7
  67. data/app/models/katello/repository_generic_content_unit.rb +7 -0
  68. data/app/models/katello/root_repository.rb +38 -7
  69. data/app/models/setting/content.rb +5 -0
  70. data/app/services/cert/certs.rb +16 -8
  71. data/app/services/katello/applicability/applicable_content_helper.rb +1 -2
  72. data/app/services/katello/candlepin/consumer.rb +6 -0
  73. data/app/services/katello/component_view_presenter.rb +27 -0
  74. data/app/services/katello/pulp/repository.rb +1 -1
  75. data/app/services/katello/pulp/server.rb +2 -2
  76. data/app/services/katello/pulp3/api/core.rb +4 -0
  77. data/app/services/katello/pulp3/api/generic.rb +68 -0
  78. data/app/services/katello/pulp3/generic_content_unit.rb +29 -0
  79. data/app/services/katello/pulp3/pulp_content_unit.rb +5 -1
  80. data/app/services/katello/pulp3/repository/generic.rb +94 -0
  81. data/app/services/katello/pulp3/repository/yum.rb +4 -5
  82. data/app/services/katello/pulp3/repository.rb +27 -12
  83. data/app/services/katello/pulp3/repository_mirror.rb +2 -2
  84. data/app/services/katello/pulp3/smart_proxy_repository.rb +4 -4
  85. data/app/services/katello/registration_manager.rb +18 -7
  86. data/app/services/katello/repository_type.rb +59 -1
  87. data/app/services/katello/repository_type_manager.rb +116 -24
  88. data/app/views/katello/api/v2/content_views/base.json.rabl +4 -4
  89. data/app/views/katello/api/v2/repositories/show.json.rabl +1 -0
  90. data/app/views/smart_proxies/plugins/_pulpcore.html.erb +2 -5
  91. data/app/views/smart_proxies/pulp_status.html.erb +0 -7
  92. data/config/katello.yaml.example +0 -21
  93. data/config/routes/api/v2.rb +2 -1
  94. data/db/functions/deb_version_cmp_v01.sql +200 -0
  95. data/db/migrate/20171110082124_add_ssl_certs_to_products_and_repos.rb +5 -1
  96. data/db/migrate/20200402130013_add_repsoitory_docker_meta_tag_f_key.rb +3 -1
  97. data/db/migrate/20210624221630_katello_generic_content.rb +22 -0
  98. data/db/migrate/20210625095042_add_retain_package_versions_count.rb +9 -0
  99. data/db/migrate/20210628182553_add_generic_remote_options_to_root_repository.rb +5 -0
  100. data/db/migrate/20210714140440_remove_repo_export_permission.rb +5 -0
  101. data/db/migrate/20210721163730_change_gpg_keys_to_content_credentials.rb +8 -0
  102. data/db/migrate/20210728130748_create_function_deb_version_cmp.rb +12 -0
  103. data/db/seeds.d/111-upgrade_tasks.rb +1 -2
  104. data/engines/bastion/app/views/bastion/layouts/assets.html.erb +1 -1
  105. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +7 -5
  106. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-errata-modal.html +4 -1
  107. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/views/content-view-details.html +1 -1
  108. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/apply-errata.controller.js +1 -1
  109. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/views/apply-errata-confirm.html +2 -1
  110. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/i18n/bastion_katello.pot +25 -33
  111. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/views/products-bulk-advanced-sync-modal.html +1 -1
  112. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/product-repositories.controller.js +1 -6
  113. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +10 -2
  114. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.filter.js +9 -0
  115. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details.controller.js +0 -2
  116. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-advanced-sync-options.html +1 -25
  117. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-details.html +1 -1
  118. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +31 -13
  119. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +11 -3
  120. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/views/product-repositories.html +0 -6
  121. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/aggregate-task.factory.js +3 -3
  122. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js +1 -1
  123. data/lib/katello/engine.rb +2 -4
  124. data/lib/katello/permission_creator.rb +6 -12
  125. data/lib/katello/plugin.rb +76 -80
  126. data/lib/katello/repository_types/python.rb +37 -0
  127. data/lib/katello/tasks/reimport.rake +0 -9
  128. data/lib/katello/tasks/repository.rake +3 -4
  129. data/lib/katello/version.rb +1 -1
  130. data/locale/action_names.rb +28 -29
  131. data/locale/bn/katello.po +699 -221
  132. data/locale/cs/katello.po +167 -59
  133. data/locale/de/katello.po +585 -352
  134. data/locale/en/katello.po +167 -59
  135. data/locale/es/katello.po +1388 -1189
  136. data/locale/fr/katello.po +1740 -1494
  137. data/locale/gu/katello.po +896 -416
  138. data/locale/hi/katello.po +892 -415
  139. data/locale/it/katello.po +371 -170
  140. data/locale/ja/katello.po +1657 -1439
  141. data/locale/katello.pot +933 -736
  142. data/locale/kn/katello.po +894 -416
  143. data/locale/ko/katello.po +515 -317
  144. data/locale/mr/katello.po +857 -415
  145. data/locale/or/katello.po +894 -416
  146. data/locale/pa/katello.po +874 -411
  147. data/locale/pt/katello.po +347 -154
  148. data/locale/pt_BR/katello.po +1398 -1215
  149. data/locale/ru/katello.po +671 -463
  150. data/locale/ta/katello.po +697 -221
  151. data/locale/te/katello.po +891 -415
  152. data/locale/zh_CN/katello.po +2029 -1845
  153. data/locale/zh_TW/katello.po +735 -407
  154. data/package.json +3 -1
  155. data/webpack/components/EditableTextInput/EditableTextInput.js +3 -3
  156. data/webpack/components/RoutedTabs/RoutedTabs.js +7 -8
  157. data/webpack/components/Table/TableWrapper.js +19 -11
  158. data/webpack/components/Table/helpers.js +1 -1
  159. data/webpack/components/extensions/HostDetails/Tabs/ContentTab.js +42 -0
  160. data/webpack/components/extensions/HostDetails/Tabs/SubscriptionTab.js +12 -0
  161. data/webpack/components/extensions/RegistrationCommands/__tests__/__snapshots__/ActivationKeys.test.js.snap +4 -0
  162. data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +1 -1
  163. data/webpack/components/extensions/RegistrationCommands/index.js +1 -2
  164. data/webpack/components/pf3Table/formatters/selectionHeaderCellFormatter.js +2 -1
  165. data/webpack/fills_index.js +4 -1
  166. data/webpack/redux/actions/RedHatRepositories/helpers.js +2 -4
  167. data/webpack/redux/reducers/RedHatRepositories/enabled.js +4 -1
  168. data/webpack/scenes/ContentViews/ContentViewsActions.js +16 -1
  169. data/webpack/scenes/ContentViews/ContentViewsConstants.js +15 -0
  170. data/webpack/scenes/ContentViews/ContentViewsPage.js +12 -22
  171. data/webpack/scenes/ContentViews/Copy/CopyContentViewForm.js +4 -3
  172. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +25 -14
  173. data/webpack/scenes/ContentViews/Create/CreateContentViewModal.js +4 -2
  174. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +153 -0
  175. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentVersion.js +21 -10
  176. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ContentViewComponents.js +157 -19
  177. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.fixtures.json +100 -108
  178. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +140 -16
  179. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/publishedContentViewDetails.fixtures.json +367 -0
  180. data/webpack/scenes/ContentViews/Details/ContentViewDetailActions.js +59 -6
  181. data/webpack/scenes/ContentViews/Details/ContentViewDetailSelectors.js +43 -0
  182. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +44 -13
  183. data/webpack/scenes/ContentViews/Details/Filters/Add/CVFilterAddModal.js +161 -0
  184. data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterAdd.test.js +54 -0
  185. data/webpack/scenes/ContentViews/Details/Filters/Add/__tests__/cvFilterCreateResult.fixtures.json +124 -0
  186. data/webpack/scenes/ContentViews/Details/Filters/CVPackageGroupFilterContent.js +8 -6
  187. data/webpack/scenes/ContentViews/Details/Filters/CVRpmFilterContent.js +7 -6
  188. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilterDetails.js +4 -3
  189. data/webpack/scenes/ContentViews/Details/Filters/ContentViewFilters.js +71 -12
  190. data/webpack/scenes/ContentViews/Details/Filters/__tests__/contentViewFilters.test.js +77 -0
  191. data/webpack/scenes/ContentViews/Details/Histories/ContentViewHistories.js +13 -12
  192. data/webpack/scenes/ContentViews/Details/Histories/__tests__/contentViewHistory.test.js +2 -2
  193. data/webpack/scenes/ContentViews/Details/Repositories/ContentViewRepositories.js +17 -14
  194. data/webpack/scenes/ContentViews/Details/Repositories/LastSync.js +3 -3
  195. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewAddRemove.test.js +2 -2
  196. data/webpack/scenes/ContentViews/Details/Repositories/__tests__/contentViewDetailRepos.test.js +6 -2
  197. data/webpack/scenes/ContentViews/Details/Versions/ContentViewVersions.js +61 -20
  198. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewTaskInProgressResponse.fixtures.json +71 -0
  199. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewTaskResponse.fixtures.json +75 -0
  200. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +86 -1
  201. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersionsWithTask.fixtures.json +713 -0
  202. data/webpack/scenes/ContentViews/Details/__tests__/contentViewDetail.test.js +3 -0
  203. data/webpack/scenes/ContentViews/Publish/CVPublishFinish.js +184 -0
  204. data/webpack/scenes/ContentViews/Publish/CVPublishForm.js +104 -0
  205. data/webpack/scenes/ContentViews/Publish/CVPublishReview.js +71 -0
  206. data/webpack/scenes/ContentViews/Publish/ContentViewPublishSelectors.js +17 -0
  207. data/webpack/scenes/ContentViews/Publish/PublishContentViewWizard.js +145 -0
  208. data/webpack/scenes/ContentViews/Publish/__tests__/environmentPaths.fixtures.json +352 -0
  209. data/webpack/scenes/ContentViews/Publish/__tests__/publishContentView.test.js +184 -0
  210. data/webpack/scenes/ContentViews/Publish/__tests__/publishResponse.fixture.json +69 -0
  211. data/webpack/scenes/ContentViews/Publish/cvPublishForm.scss +3 -0
  212. data/webpack/scenes/ContentViews/Table/ContentViewsTable.js +75 -48
  213. data/webpack/scenes/ContentViews/Table/tableDataGenerator.js +15 -2
  214. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +6 -10
  215. data/webpack/scenes/ContentViews/components/EnvironmentLabels.js +22 -10
  216. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathActions.js +12 -0
  217. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathConstants.js +2 -0
  218. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathSelectors.js +16 -0
  219. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +72 -0
  220. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.scss +8 -0
  221. data/webpack/scenes/ContentViews/components/TaskPresenter/TaskPresenter.js +85 -0
  222. data/webpack/scenes/SmartProxy/SmartProxyContentTable.js +9 -8
  223. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +4 -25
  224. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +0 -3
  225. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +3 -3
  226. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +4 -2
  227. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +24 -0
  228. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +4 -1
  229. data/webpack/scenes/Subscriptions/index.js +1 -4
  230. metadata +74 -39
  231. data/app/lib/actions/candlepin/environment/create.rb +0 -21
  232. data/app/lib/actions/foreman/environment/destroy.rb +0 -23
  233. data/app/lib/actions/katello/content_view/environment_create.rb +0 -21
  234. data/app/lib/actions/katello/repository/export.rb +0 -85
  235. data/app/lib/actions/katello/repository/purge_empty_content.rb +0 -16
  236. data/app/lib/actions/katello/repository/upload_errata.rb +0 -38
  237. data/app/lib/katello/util/proxy_uri.rb +0 -64
  238. data/app/models/katello/rhsm_fact_importer.rb +0 -20
  239. data/app/models/katello/rhsm_fact_name.rb +0 -17
  240. data/app/models/katello/rhsm_fact_parser.rb +0 -120
@@ -0,0 +1,367 @@
1
+ {
2
+ "content_host_count": 0,
3
+ "composite": false,
4
+ "component_ids": [],
5
+ "default": false,
6
+ "version_count": 33,
7
+ "latest_version": "33.0",
8
+ "latest_version_id": 85,
9
+ "auto_publish": false,
10
+ "solve_dependencies": false,
11
+ "import_only": false,
12
+ "repository_ids": [],
13
+ "id": 13,
14
+ "name": "10",
15
+ "label": "10",
16
+ "description": "",
17
+ "organization_id": 1,
18
+ "organization": {
19
+ "name": "Default Organization",
20
+ "label": "Default_Organization",
21
+ "id": 1
22
+ },
23
+ "created_at": "2021-06-21 03:52:16 -1000",
24
+ "updated_at": "2021-06-22 11:03:15 -1000",
25
+ "last_task": {
26
+ "id": "861e56ab-e582-46ff-a56f-4db0a66f6cd3",
27
+ "result": "success",
28
+ "last_sync_words": "14 days"
29
+ },
30
+ "latest_version_environments": [
31
+ {
32
+ "id": 1,
33
+ "name": "Library",
34
+ "label": "Library"
35
+ },
36
+ {
37
+ "id": 5,
38
+ "name": "dev1",
39
+ "label": "dev1"
40
+ },
41
+ {
42
+ "id": 6,
43
+ "name": "test1",
44
+ "label": "test1"
45
+ },
46
+ {
47
+ "id": 7,
48
+ "name": "prod1",
49
+ "label": "prod1"
50
+ },
51
+ {
52
+ "id": 9,
53
+ "name": "dev2",
54
+ "label": "dev2"
55
+ }
56
+ ],
57
+ "environments": [
58
+ {
59
+ "id": 1,
60
+ "name": "Library",
61
+ "label": "Library",
62
+ "permissions": {
63
+ "readable": true
64
+ }
65
+ },
66
+ {
67
+ "id": 5,
68
+ "name": "dev1",
69
+ "label": "dev1",
70
+ "permissions": {
71
+ "readable": true
72
+ }
73
+ },
74
+ {
75
+ "id": 6,
76
+ "name": "test1",
77
+ "label": "test1",
78
+ "permissions": {
79
+ "readable": true
80
+ }
81
+ },
82
+ {
83
+ "id": 7,
84
+ "name": "prod1",
85
+ "label": "prod1",
86
+ "permissions": {
87
+ "readable": true
88
+ }
89
+ },
90
+ {
91
+ "id": 8,
92
+ "name": "test2",
93
+ "label": "test2",
94
+ "permissions": {
95
+ "readable": true
96
+ }
97
+ },
98
+ {
99
+ "id": 9,
100
+ "name": "dev2",
101
+ "label": "dev2",
102
+ "permissions": {
103
+ "readable": true
104
+ }
105
+ },
106
+ {
107
+ "id": 10,
108
+ "name": "qa2",
109
+ "label": "qa2",
110
+ "permissions": {
111
+ "readable": true
112
+ }
113
+ },
114
+ {
115
+ "id": 11,
116
+ "name": "prod2",
117
+ "label": "prod2",
118
+ "permissions": {
119
+ "readable": true
120
+ }
121
+ },
122
+ {
123
+ "id": 12,
124
+ "name": "dev3",
125
+ "label": "dev3",
126
+ "permissions": {
127
+ "readable": true
128
+ }
129
+ },
130
+ {
131
+ "id": 13,
132
+ "name": "test3",
133
+ "label": "test3",
134
+ "permissions": {
135
+ "readable": true
136
+ }
137
+ }
138
+ ],
139
+ "repositories": [],
140
+ "versions": [
141
+ {
142
+ "id": 52,
143
+ "version": "1.0",
144
+ "published": "2021-06-22 06:07:43 -1000",
145
+ "environment_ids": []
146
+ },
147
+ {
148
+ "id": 53,
149
+ "version": "2.0",
150
+ "published": "2021-06-22 06:09:02 -1000",
151
+ "environment_ids": []
152
+ },
153
+ {
154
+ "id": 54,
155
+ "version": "3.0",
156
+ "published": "2021-06-22 06:09:33 -1000",
157
+ "environment_ids": []
158
+ },
159
+ {
160
+ "id": 55,
161
+ "version": "4.0",
162
+ "published": "2021-06-22 06:29:29 -1000",
163
+ "environment_ids": []
164
+ },
165
+ {
166
+ "id": 56,
167
+ "version": "5.0",
168
+ "published": "2021-06-22 06:29:56 -1000",
169
+ "environment_ids": []
170
+ },
171
+ {
172
+ "id": 57,
173
+ "version": "6.0",
174
+ "published": "2021-06-22 06:30:29 -1000",
175
+ "environment_ids": []
176
+ },
177
+ {
178
+ "id": 58,
179
+ "version": "7.0",
180
+ "published": "2021-06-22 06:32:10 -1000",
181
+ "environment_ids": []
182
+ },
183
+ {
184
+ "id": 59,
185
+ "version": "8.0",
186
+ "published": "2021-06-22 06:38:01 -1000",
187
+ "environment_ids": []
188
+ },
189
+ {
190
+ "id": 60,
191
+ "version": "9.0",
192
+ "published": "2021-06-22 06:41:03 -1000",
193
+ "environment_ids": []
194
+ },
195
+ {
196
+ "id": 61,
197
+ "version": "10.0",
198
+ "published": "2021-06-22 06:53:06 -1000",
199
+ "environment_ids": []
200
+ },
201
+ {
202
+ "id": 62,
203
+ "version": "11.0",
204
+ "published": "2021-06-22 06:55:03 -1000",
205
+ "environment_ids": []
206
+ },
207
+ {
208
+ "id": 63,
209
+ "version": "12.0",
210
+ "published": "2021-06-22 06:57:47 -1000",
211
+ "environment_ids": []
212
+ },
213
+ {
214
+ "id": 64,
215
+ "version": "13.0",
216
+ "published": "2021-06-22 06:58:13 -1000",
217
+ "environment_ids": []
218
+ },
219
+ {
220
+ "id": 65,
221
+ "version": "14.0",
222
+ "published": "2021-06-22 06:58:44 -1000",
223
+ "environment_ids": []
224
+ },
225
+ {
226
+ "id": 66,
227
+ "version": "15.0",
228
+ "published": "2021-06-22 07:00:51 -1000",
229
+ "environment_ids": []
230
+ },
231
+ {
232
+ "id": 67,
233
+ "version": "16.0",
234
+ "published": "2021-06-22 07:02:35 -1000",
235
+ "environment_ids": []
236
+ },
237
+ {
238
+ "id": 68,
239
+ "version": "17.0",
240
+ "published": "2021-06-22 07:03:15 -1000",
241
+ "environment_ids": []
242
+ },
243
+ {
244
+ "id": 69,
245
+ "version": "18.0",
246
+ "published": "2021-06-22 07:12:38 -1000",
247
+ "environment_ids": []
248
+ },
249
+ {
250
+ "id": 70,
251
+ "version": "19.0",
252
+ "published": "2021-06-22 07:38:55 -1000",
253
+ "environment_ids": []
254
+ },
255
+ {
256
+ "id": 71,
257
+ "version": "20.0",
258
+ "published": "2021-06-22 07:39:27 -1000",
259
+ "environment_ids": []
260
+ },
261
+ {
262
+ "id": 72,
263
+ "version": "21.0",
264
+ "published": "2021-06-22 08:09:53 -1000",
265
+ "environment_ids": []
266
+ },
267
+ {
268
+ "id": 73,
269
+ "version": "22.0",
270
+ "published": "2021-06-22 08:10:23 -1000",
271
+ "environment_ids": []
272
+ },
273
+ {
274
+ "id": 74,
275
+ "version": "23.0",
276
+ "published": "2021-06-22 09:24:48 -1000",
277
+ "environment_ids": []
278
+ },
279
+ {
280
+ "id": 75,
281
+ "version": "24.0",
282
+ "published": "2021-06-22 09:28:09 -1000",
283
+ "environment_ids": []
284
+ },
285
+ {
286
+ "id": 76,
287
+ "version": "25.0",
288
+ "published": "2021-06-22 09:31:50 -1000",
289
+ "environment_ids": []
290
+ },
291
+ {
292
+ "id": 77,
293
+ "version": "26.0",
294
+ "published": "2021-06-22 09:33:03 -1000",
295
+ "environment_ids": []
296
+ },
297
+ {
298
+ "id": 78,
299
+ "version": "27.0",
300
+ "published": "2021-06-22 09:34:31 -1000",
301
+ "environment_ids": []
302
+ },
303
+ {
304
+ "id": 79,
305
+ "version": "28.0",
306
+ "published": "2021-06-22 09:35:00 -1000",
307
+ "environment_ids": []
308
+ },
309
+ {
310
+ "id": 80,
311
+ "version": "29.0",
312
+ "published": "2021-06-22 09:35:18 -1000",
313
+ "environment_ids": []
314
+ },
315
+ {
316
+ "id": 81,
317
+ "version": "30.0",
318
+ "published": "2021-06-22 10:55:48 -1000",
319
+ "environment_ids": []
320
+ },
321
+ {
322
+ "id": 83,
323
+ "version": "31.0",
324
+ "published": "2021-06-22 10:58:09 -1000",
325
+ "environment_ids": []
326
+ },
327
+ {
328
+ "id": 84,
329
+ "version": "32.0",
330
+ "published": "2021-06-22 10:58:37 -1000",
331
+ "environment_ids": [
332
+ 8,
333
+ 10,
334
+ 11,
335
+ 12,
336
+ 13
337
+ ]
338
+ },
339
+ {
340
+ "id": 85,
341
+ "version": "33.0",
342
+ "published": "2021-06-22 11:03:15 -1000",
343
+ "environment_ids": [
344
+ 1,
345
+ 5,
346
+ 6,
347
+ 7,
348
+ 9
349
+ ]
350
+ }
351
+ ],
352
+ "components": [],
353
+ "content_view_components": [],
354
+ "activation_keys": [],
355
+ "hosts": [],
356
+ "next_version": "34.0",
357
+ "last_published": "2021-06-22 11:03:15 -1000",
358
+ "permissions": {
359
+ "view_content_views": true,
360
+ "edit_content_views": true,
361
+ "destroy_content_views": true,
362
+ "publish_content_views": true,
363
+ "promote_or_remove_content_views": true
364
+ },
365
+ "duplicate_repositories_to_publish": [],
366
+ "errors": null
367
+ }
@@ -1,10 +1,13 @@
1
- import { API_OPERATIONS, get, put } from 'foremanReact/redux/API';
1
+ import { API_OPERATIONS, APIActions, get, put, post } from 'foremanReact/redux/API';
2
2
  import { addToast } from 'foremanReact/redux/actions/toasts';
3
3
  import { translate as __ } from 'foremanReact/common/I18n';
4
4
  import {
5
5
  UPDATE_CONTENT_VIEW,
6
6
  UPDATE_CONTENT_VIEW_FAILURE,
7
7
  UPDATE_CONTENT_VIEW_SUCCESS,
8
+ CREATE_CONTENT_VIEW_FILTER_KEY,
9
+ DELETE_CONTENT_VIEW_FILTER_KEY,
10
+ DELETE_CONTENT_VIEW_FILTERS_KEY,
8
11
  NOT_ADDED,
9
12
  ALL_STATUSES,
10
13
  REPOSITORY_TYPES,
@@ -17,6 +20,10 @@ import {
17
20
  cvFilterRulesKey,
18
21
  cvDetailsComponentKey,
19
22
  cvDetailsVersionKey,
23
+ cvAddComponentKey,
24
+ cvRemoveComponentKey,
25
+ addComponentSuccessMessage,
26
+ removeComponentSuccessMessage,
20
27
  } from '../ContentViewsConstants';
21
28
  import api from '../../../services/api';
22
29
  import { getResponseErrorMsgs, apiError } from '../../../utils/helpers';
@@ -33,11 +40,11 @@ const cvUpdateSuccess = (response, dispatch) => {
33
40
  dispatch(getContentViewDetails(id));
34
41
  return dispatch(addToast({
35
42
  type: 'success',
36
- message: __(' Content view updated.'),
43
+ message: __(' Content view updated'),
37
44
  }));
38
45
  };
39
46
 
40
- export const updateContentView = (cvId, params) => async dispatch => dispatch(put({
47
+ export const updateContentView = (cvId, params) => dispatch => dispatch(put({
41
48
  type: API_OPERATIONS.PUT,
42
49
  key: cvDetailsKey(cvId),
43
50
  url: api.getApiUrl(`/content_views/${cvId}`),
@@ -51,6 +58,33 @@ export const updateContentView = (cvId, params) => async dispatch => dispatch(pu
51
58
  },
52
59
  }));
53
60
 
61
+ export const addComponent = params => put({
62
+ type: API_OPERATIONS.PUT,
63
+ key: cvAddComponentKey(params.compositeContentViewId),
64
+ url: api.getApiUrl(`/content_views/${params.compositeContentViewId}/content_view_components/${params.components.id ? params.components.id : 'add'}`),
65
+ params: params.components.id ? params.components : params,
66
+ successToast: () => addComponentSuccessMessage(params.components.id),
67
+ errorToast: error => __(`Something went wrong while adding component! ${getResponseErrorMsgs(error.response)}`),
68
+ });
69
+
70
+ export const removeComponent = params => put({
71
+ type: API_OPERATIONS.PUT,
72
+ key: cvRemoveComponentKey(params.compositeContentViewId),
73
+ url: api.getApiUrl(`/content_views/${params.compositeContentViewId}/content_view_components/remove`),
74
+ params,
75
+ successToast: () => removeComponentSuccessMessage(params.component_ids.length),
76
+ errorToast: error => __(`Something went wrong while removing component! ${getResponseErrorMsgs(error.response)}`),
77
+ });
78
+
79
+ export const createContentViewFilter = (cvId, params) => post({
80
+ type: API_OPERATIONS.POST,
81
+ key: CREATE_CONTENT_VIEW_FILTER_KEY,
82
+ url: api.getApiUrl(`/content_view_filters?content_view_id=${cvId}`),
83
+ params,
84
+ successToast: () => __('Filter created'),
85
+ errorToast: error => __(`Something went wrong while creating the filter! ${getResponseErrorMsgs(error.response)}`),
86
+ });
87
+
54
88
  export const getContentViewRepositories = (cvId, params, status) => {
55
89
  const apiParams = { ...params };
56
90
  let apiUrl = `/content_views/${cvId}/repositories`;
@@ -83,6 +117,25 @@ export const getContentViewFilters = (cvId, params) => get({
83
117
  url: api.getApiUrl('/content_view_filters'),
84
118
  });
85
119
 
120
+ export const deleteContentViewFilters = (cvId, ids, handleSuccess) => put({
121
+ type: API_OPERATIONS.PUT,
122
+ key: DELETE_CONTENT_VIEW_FILTERS_KEY,
123
+ url: api.getApiUrl(`/content_views/${cvId}/remove_filters`),
124
+ params: { filter_ids: ids },
125
+ handleSuccess,
126
+ successToast: () => __('Filters successfully deleted'),
127
+ errorToast: error => __(`Something went wrong while deleting filters! ${getResponseErrorMsgs(error.response)}`),
128
+ });
129
+
130
+ export const deleteContentViewFilter = (filterId, handleSuccess) => APIActions.delete({
131
+ type: API_OPERATIONS.DELETE,
132
+ key: DELETE_CONTENT_VIEW_FILTER_KEY,
133
+ url: api.getApiUrl(`/content_view_filters/${filterId}`),
134
+ handleSuccess,
135
+ successToast: () => __('Filter successfully deleted'),
136
+ errorToast: error => __(`Something went wrong while deleting this filter! ${getResponseErrorMsgs(error.response)}`),
137
+ });
138
+
86
139
  export const getCVFilterDetails = (cvId, filterId, params) => get({
87
140
  key: cvFilterDetailsKey(cvId, filterId),
88
141
  params: { contentViewId: cvId, ...params },
@@ -117,9 +170,9 @@ export const getCVFilterRules = (filterId, params) => get({
117
170
  url: api.getApiUrl(`/content_view_filters/${filterId}/rules`),
118
171
  });
119
172
 
120
- export const getContentViewComponents = (cvId, params) => {
121
- const apiParams = { ...params };
122
- const apiUrl = `/content_views/${cvId}/content_view_components`;
173
+ export const getContentViewComponents = (cvId, params, statusSelected) => {
174
+ const apiParams = { ...params, status: statusSelected };
175
+ const apiUrl = `/content_views/${cvId}/content_view_components/show_all`;
123
176
  return get({
124
177
  key: cvDetailsComponentKey(cvId),
125
178
  params: apiParams,
@@ -15,7 +15,11 @@ import {
15
15
  cvDetailsVersionKey,
16
16
  REPOSITORY_TYPES,
17
17
  cvDetailsComponentKey,
18
+ cvAddComponentKey,
19
+ cvRemoveComponentKey,
20
+ CREATE_CONTENT_VIEW_FILTER_KEY,
18
21
  } from '../ContentViewsConstants';
22
+ import { pollTaskKey } from '../../Tasks/helpers';
19
23
 
20
24
  export const selectCVDetails = (state, cvId) =>
21
25
  selectAPIResponse(state, cvDetailsKey(cvId)) || {};
@@ -101,4 +105,43 @@ export const selectCVVersionsStatus = (state, cvId) =>
101
105
  export const selectCVVersionsError = (state, cvId) =>
102
106
  selectAPIError(state, cvDetailsVersionKey(cvId));
103
107
 
108
+ export const selectPublishTaskPoll = (state, cvVersionPublishKey) =>
109
+ selectAPIResponse(state, pollTaskKey(cvVersionPublishKey)) || {};
110
+
111
+ export const selectPublishTaskPollStatus = (state, cvVersionPublishKey) =>
112
+ selectAPIStatus(state, pollTaskKey(cvVersionPublishKey)) || STATUS.PENDING;
113
+
114
+ export const selectTaskPoll = (state, key) =>
115
+ selectAPIResponse(state, pollTaskKey(key)) || {};
116
+
117
+ export const selectTaskPollStatus = (state, key) =>
118
+ selectAPIStatus(state, pollTaskKey(key)) || STATUS.PENDING;
119
+
120
+ export const selectCVComponentAdd = (state, cvId) =>
121
+ selectAPIResponse(state, cvAddComponentKey(cvId));
122
+
123
+ export const selectCVComponentAddStatus = (state, cvId) =>
124
+ selectAPIStatus(state, cvAddComponentKey(cvId)) || STATUS.PENDING;
125
+
126
+ export const selectCVComponentAddError = (state, cvId) =>
127
+ selectAPIError(state, cvAddComponentKey(cvId));
128
+
129
+ export const selectCVComponentRemove = (state, cvId) =>
130
+ selectAPIResponse(state, cvRemoveComponentKey(cvId));
131
+
132
+ export const selectCVComponentRemoveStatus = (state, cvId) =>
133
+ selectAPIStatus(state, cvRemoveComponentKey(cvId)) || STATUS.PENDING;
134
+
135
+ export const selectCVComponentRemoveError = (state, cvId) =>
136
+ selectAPIError(state, cvRemoveComponentKey(cvId));
137
+
138
+ export const selectCreateContentViewFilter = state =>
139
+ selectAPIResponse(state, CREATE_CONTENT_VIEW_FILTER_KEY) || {};
140
+
141
+ export const selectCreateContentViewFilterStatus = state =>
142
+ selectAPIStatus(state, CREATE_CONTENT_VIEW_FILTER_KEY) || STATUS.PENDING;
143
+
144
+ export const selectCreateContentViewFilterError = state =>
145
+ selectAPIError(state, CREATE_CONTENT_VIEW_FILTER_KEY);
146
+
104
147
  export const selectIsCVUpdating = state => state.katello?.contentViewDetails?.updating;
@@ -1,6 +1,8 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { useSelector, shallowEqual } from 'react-redux';
3
- import { Grid, GridItem, TextContent, Text, TextVariants, Button, Flex, FlexItem } from '@patternfly/react-core';
3
+ import { Link } from 'react-router-dom';
4
+ import { Grid, GridItem, TextContent, Text, TextVariants, Button, Flex, FlexItem, Breadcrumb, BreadcrumbItem } from '@patternfly/react-core';
5
+ import Skeleton from 'react-loading-skeleton';
4
6
  import { ExternalLinkAltIcon } from '@patternfly/react-icons';
5
7
  import { translate as __ } from 'foremanReact/common/I18n';
6
8
  import PropTypes from 'prop-types';
@@ -16,10 +18,13 @@ import ContentViewFilterDetails from './Filters/ContentViewFilterDetails';
16
18
  import { selectCVDetails } from './ContentViewDetailSelectors';
17
19
  import RoutedTabs from '../../../components/RoutedTabs';
18
20
  import ContentViewIcon from '../components/ContentViewIcon';
21
+ import PublishContentViewWizard from '../Publish/PublishContentViewWizard';
19
22
 
20
23
  const ContentViewDetails = ({ match }) => {
21
24
  const cvId = parseInt(match.params.id, 10);
22
25
  const details = useSelector(state => selectCVDetails(state, cvId), shallowEqual);
26
+ const [isPublishModalOpen, setIsPublishModalOpen] = useState(false);
27
+ const [currentStep, setCurrentStep] = useState(1);
23
28
 
24
29
  const { name, composite } = details;
25
30
  const tabs = [
@@ -60,6 +65,15 @@ const ContentViewDetails = ({ match }) => {
60
65
  <Grid className="grid-with-margin">
61
66
  <DetailsContainer cvId={cvId}>
62
67
  <React.Fragment>
68
+ <Breadcrumb style={{ marginTop: '15px' }}>
69
+ <BreadcrumbItem
70
+ aria-label="cv_breadcrumb"
71
+ render={() => (<Link to="/labs/content_views" >{__('Content Views')}</Link>)}
72
+ />
73
+ <BreadcrumbItem aria-label="cv_breadcrumb_cv" isActive>
74
+ {name || <Skeleton />}
75
+ </BreadcrumbItem>
76
+ </Breadcrumb>
63
77
  <GridItem span={8}>
64
78
  <Flex>
65
79
  <FlexItem>
@@ -72,17 +86,34 @@ const ContentViewDetails = ({ match }) => {
72
86
  </FlexItem>
73
87
  </Flex>
74
88
  </GridItem>
75
- <GridItem span={4} style={{ textAlign: 'right' }}>
76
- <Button
77
- component="a"
78
- aria-label="view tasks button"
79
- href={`/foreman_tasks/tasks?search=resource_type%3D+Katello%3A%3AContentView+resource_id%3D${cvId}`}
80
- target="_blank"
81
- variant="secondary"
82
- >
83
- {'View tasks '}
84
- <ExternalLinkAltIcon />
85
- </Button>
89
+ <GridItem span={4}>
90
+ <Flex>
91
+ <FlexItem>
92
+ <Button onClick={() => { setIsPublishModalOpen(true); }} variant="primary" aria-label="publish_content_view">
93
+ Publish new version
94
+ </Button>
95
+ {isPublishModalOpen && <PublishContentViewWizard
96
+ details={details}
97
+ show={isPublishModalOpen}
98
+ setIsOpen={setIsPublishModalOpen}
99
+ currentStep={currentStep}
100
+ setCurrentStep={setCurrentStep}
101
+ aria-label="publish_content_view_modal"
102
+ />}
103
+ </FlexItem>
104
+ <FlexItem>
105
+ <Button
106
+ component="a"
107
+ aria-label="view tasks button"
108
+ href={`/foreman_tasks/tasks?search=resource_type%3D+Katello%3A%3AContentView+resource_id%3D${cvId}`}
109
+ target="_blank"
110
+ variant="secondary"
111
+ >
112
+ {'View tasks '}
113
+ <ExternalLinkAltIcon />
114
+ </Button>
115
+ </FlexItem>
116
+ </Flex>
86
117
  </GridItem>
87
118
  <GridItem span={12}>
88
119
  <RoutedTabs tabs={tabs} baseUrl={`/labs/content_views/${cvId}`} defaultTabIndex={1} />