katello 5.0.0.rc2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/locale/bn/katello.js +41 -2
  3. data/app/assets/javascripts/katello/locale/bn_IN/katello.js +41 -2
  4. data/app/assets/javascripts/katello/locale/ca/katello.js +41 -2
  5. data/app/assets/javascripts/katello/locale/cs/katello.js +41 -2
  6. data/app/assets/javascripts/katello/locale/cs_CZ/katello.js +42 -3
  7. data/app/assets/javascripts/katello/locale/de/katello.js +42 -3
  8. data/app/assets/javascripts/katello/locale/de_AT/katello.js +41 -2
  9. data/app/assets/javascripts/katello/locale/de_DE/katello.js +41 -2
  10. data/app/assets/javascripts/katello/locale/el/katello.js +41 -2
  11. data/app/assets/javascripts/katello/locale/en/katello.js +41 -2
  12. data/app/assets/javascripts/katello/locale/en_GB/katello.js +41 -2
  13. data/app/assets/javascripts/katello/locale/en_US/katello.js +41 -2
  14. data/app/assets/javascripts/katello/locale/es/katello.js +42 -3
  15. data/app/assets/javascripts/katello/locale/et_EE/katello.js +41 -2
  16. data/app/assets/javascripts/katello/locale/fr/katello.js +42 -3
  17. data/app/assets/javascripts/katello/locale/gl/katello.js +41 -2
  18. data/app/assets/javascripts/katello/locale/gu/katello.js +41 -2
  19. data/app/assets/javascripts/katello/locale/he_IL/katello.js +41 -2
  20. data/app/assets/javascripts/katello/locale/hi/katello.js +41 -2
  21. data/app/assets/javascripts/katello/locale/id/katello.js +41 -2
  22. data/app/assets/javascripts/katello/locale/it/katello.js +42 -3
  23. data/app/assets/javascripts/katello/locale/ja/katello.js +42 -3
  24. data/app/assets/javascripts/katello/locale/ka/katello.js +42 -3
  25. data/app/assets/javascripts/katello/locale/kn/katello.js +41 -2
  26. data/app/assets/javascripts/katello/locale/ko/katello.js +42 -3
  27. data/app/assets/javascripts/katello/locale/ml_IN/katello.js +41 -2
  28. data/app/assets/javascripts/katello/locale/mr/katello.js +41 -2
  29. data/app/assets/javascripts/katello/locale/nl_NL/katello.js +41 -2
  30. data/app/assets/javascripts/katello/locale/or/katello.js +41 -2
  31. data/app/assets/javascripts/katello/locale/pa/katello.js +41 -2
  32. data/app/assets/javascripts/katello/locale/pl/katello.js +41 -2
  33. data/app/assets/javascripts/katello/locale/pl_PL/katello.js +41 -2
  34. data/app/assets/javascripts/katello/locale/pt/katello.js +41 -2
  35. data/app/assets/javascripts/katello/locale/pt_BR/katello.js +42 -3
  36. data/app/assets/javascripts/katello/locale/ro/katello.js +41 -2
  37. data/app/assets/javascripts/katello/locale/ro_RO/katello.js +41 -2
  38. data/app/assets/javascripts/katello/locale/ru/katello.js +42 -3
  39. data/app/assets/javascripts/katello/locale/sl/katello.js +41 -2
  40. data/app/assets/javascripts/katello/locale/sv_SE/katello.js +41 -2
  41. data/app/assets/javascripts/katello/locale/ta/katello.js +41 -2
  42. data/app/assets/javascripts/katello/locale/ta_IN/katello.js +41 -2
  43. data/app/assets/javascripts/katello/locale/te/katello.js +41 -2
  44. data/app/assets/javascripts/katello/locale/tr/katello.js +41 -2
  45. data/app/assets/javascripts/katello/locale/vi/katello.js +41 -2
  46. data/app/assets/javascripts/katello/locale/vi_VN/katello.js +41 -2
  47. data/app/assets/javascripts/katello/locale/zh/katello.js +41 -2
  48. data/app/assets/javascripts/katello/locale/zh_CN/katello.js +42 -3
  49. data/app/assets/javascripts/katello/locale/zh_TW/katello.js +42 -3
  50. data/app/controllers/katello/concerns/api/v2/hosts_controller_extensions.rb +10 -10
  51. data/app/controllers/katello/concerns/registration_commands_controller_extensions.rb +1 -1
  52. data/app/models/katello/concerns/smart_proxy_extensions.rb +1 -1
  53. data/app/views/katello/api/v2/activation_keys/base.json.rabl +18 -18
  54. data/app/views/katello/api/v2/content_facet/base.json.rabl +19 -19
  55. data/app/views/katello/api/v2/content_view_environments/show.json.rabl +10 -10
  56. data/app/views/katello/api/v2/content_view_versions/base.json.rabl +2 -2
  57. data/db/migrate/20220929204746_add_content_view_environment_content_facet.rb +5 -5
  58. data/db/migrate/20240730163043_add_content_view_environment_activation_key.rb +5 -5
  59. data/db/migrate/20260402151630_add_content_view_environment_to_hostgroup_content_facet.rb +4 -4
  60. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/details/views/activation-key-info.html +1 -1
  61. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/activation-keys/new/views/activation-key-new.html +1 -1
  62. data/lib/katello/tasks/upgrades/4.20/clean_cve_with_no_cvv.rake +4 -4
  63. data/lib/katello/version.rb +1 -1
  64. data/lib/rubocop/cop/katello/cve_abbreviation.rb +82 -0
  65. data/locale/bn/LC_MESSAGES/katello.mo +0 -0
  66. data/locale/bn/katello.po +41 -2
  67. data/locale/bn_IN/LC_MESSAGES/katello.mo +0 -0
  68. data/locale/bn_IN/katello.po +41 -2
  69. data/locale/ca/LC_MESSAGES/katello.mo +0 -0
  70. data/locale/ca/katello.po +41 -2
  71. data/locale/cs/LC_MESSAGES/katello.mo +0 -0
  72. data/locale/cs/katello.po +41 -2
  73. data/locale/cs_CZ/LC_MESSAGES/katello.mo +0 -0
  74. data/locale/cs_CZ/katello.po +42 -3
  75. data/locale/de/LC_MESSAGES/katello.mo +0 -0
  76. data/locale/de/katello.po +42 -3
  77. data/locale/de_AT/LC_MESSAGES/katello.mo +0 -0
  78. data/locale/de_AT/katello.po +41 -2
  79. data/locale/de_DE/LC_MESSAGES/katello.mo +0 -0
  80. data/locale/de_DE/katello.po +41 -2
  81. data/locale/el/LC_MESSAGES/katello.mo +0 -0
  82. data/locale/el/katello.po +41 -2
  83. data/locale/en/LC_MESSAGES/katello.mo +0 -0
  84. data/locale/en/katello.po +41 -2
  85. data/locale/en_GB/LC_MESSAGES/katello.mo +0 -0
  86. data/locale/en_GB/katello.po +41 -2
  87. data/locale/en_US/LC_MESSAGES/katello.mo +0 -0
  88. data/locale/en_US/katello.po +41 -2
  89. data/locale/es/LC_MESSAGES/katello.mo +0 -0
  90. data/locale/es/katello.po +42 -3
  91. data/locale/et_EE/LC_MESSAGES/katello.mo +0 -0
  92. data/locale/et_EE/katello.po +41 -2
  93. data/locale/fr/LC_MESSAGES/katello.mo +0 -0
  94. data/locale/fr/katello.po +42 -3
  95. data/locale/gl/LC_MESSAGES/katello.mo +0 -0
  96. data/locale/gl/katello.po +41 -2
  97. data/locale/gu/LC_MESSAGES/katello.mo +0 -0
  98. data/locale/gu/katello.po +41 -2
  99. data/locale/he_IL/LC_MESSAGES/katello.mo +0 -0
  100. data/locale/he_IL/katello.po +41 -2
  101. data/locale/hi/LC_MESSAGES/katello.mo +0 -0
  102. data/locale/hi/katello.po +41 -2
  103. data/locale/id/LC_MESSAGES/katello.mo +0 -0
  104. data/locale/id/katello.po +41 -2
  105. data/locale/it/LC_MESSAGES/katello.mo +0 -0
  106. data/locale/it/katello.po +42 -3
  107. data/locale/ja/LC_MESSAGES/katello.mo +0 -0
  108. data/locale/ja/katello.po +42 -3
  109. data/locale/ka/LC_MESSAGES/katello.mo +0 -0
  110. data/locale/ka/katello.po +42 -3
  111. data/locale/katello.pot +315 -257
  112. data/locale/kn/LC_MESSAGES/katello.mo +0 -0
  113. data/locale/kn/katello.po +41 -2
  114. data/locale/ko/LC_MESSAGES/katello.mo +0 -0
  115. data/locale/ko/katello.po +42 -3
  116. data/locale/ml_IN/LC_MESSAGES/katello.mo +0 -0
  117. data/locale/ml_IN/katello.po +41 -2
  118. data/locale/mr/LC_MESSAGES/katello.mo +0 -0
  119. data/locale/mr/katello.po +41 -2
  120. data/locale/nl_NL/LC_MESSAGES/katello.mo +0 -0
  121. data/locale/nl_NL/katello.po +41 -2
  122. data/locale/or/LC_MESSAGES/katello.mo +0 -0
  123. data/locale/or/katello.po +41 -2
  124. data/locale/pa/LC_MESSAGES/katello.mo +0 -0
  125. data/locale/pa/katello.po +41 -2
  126. data/locale/pl/LC_MESSAGES/katello.mo +0 -0
  127. data/locale/pl/katello.po +41 -2
  128. data/locale/pl_PL/LC_MESSAGES/katello.mo +0 -0
  129. data/locale/pl_PL/katello.po +41 -2
  130. data/locale/pt/LC_MESSAGES/katello.mo +0 -0
  131. data/locale/pt/katello.po +41 -2
  132. data/locale/pt_BR/LC_MESSAGES/katello.mo +0 -0
  133. data/locale/pt_BR/katello.po +42 -3
  134. data/locale/ro/LC_MESSAGES/katello.mo +0 -0
  135. data/locale/ro/katello.po +41 -2
  136. data/locale/ro_RO/LC_MESSAGES/katello.mo +0 -0
  137. data/locale/ro_RO/katello.po +41 -2
  138. data/locale/ru/LC_MESSAGES/katello.mo +0 -0
  139. data/locale/ru/katello.po +42 -3
  140. data/locale/sl/LC_MESSAGES/katello.mo +0 -0
  141. data/locale/sl/katello.po +41 -2
  142. data/locale/sv_SE/LC_MESSAGES/katello.mo +0 -0
  143. data/locale/sv_SE/katello.po +41 -2
  144. data/locale/ta/LC_MESSAGES/katello.mo +0 -0
  145. data/locale/ta/katello.po +41 -2
  146. data/locale/ta_IN/LC_MESSAGES/katello.mo +0 -0
  147. data/locale/ta_IN/katello.po +41 -2
  148. data/locale/te/LC_MESSAGES/katello.mo +0 -0
  149. data/locale/te/katello.po +41 -2
  150. data/locale/tr/LC_MESSAGES/katello.mo +0 -0
  151. data/locale/tr/katello.po +41 -2
  152. data/locale/vi/LC_MESSAGES/katello.mo +0 -0
  153. data/locale/vi/katello.po +41 -2
  154. data/locale/vi_VN/LC_MESSAGES/katello.mo +0 -0
  155. data/locale/vi_VN/katello.po +41 -2
  156. data/locale/zh/LC_MESSAGES/katello.mo +0 -0
  157. data/locale/zh/katello.po +41 -2
  158. data/locale/zh_CN/LC_MESSAGES/katello.mo +0 -0
  159. data/locale/zh_CN/katello.po +42 -3
  160. data/locale/zh_TW/LC_MESSAGES/katello.mo +0 -0
  161. data/locale/zh_TW/katello.po +42 -3
  162. data/package.json +2 -2
  163. data/webpack/ForemanColumnExtensions/index.js +1 -1
  164. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/AssignHostCVModal.js +3 -3
  165. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +5 -5
  166. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/OrderableAssignments.js +5 -5
  167. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/__tests__/AssignHostCVModal.test.js +17 -17
  168. data/webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/BulkAssignCVEnvsModal.js +4 -8
  169. data/webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/__tests__/BulkAssignCVEnvsModal.test.js +1 -1
  170. data/webpack/components/extensions/Hosts/BulkActions/BulkAssignCVEnvsModal/index.js +2 -1
  171. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/BulkChangeHostCollectionsModal.js +5 -10
  172. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/__tests__/BulkChangeHostCollectionsModal.test.js +6 -24
  173. data/webpack/components/extensions/Hosts/BulkActions/BulkChangeHostCollectionsModal/index.js +2 -1
  174. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/04_ReviewFooter.js +2 -0
  175. data/webpack/components/extensions/Hosts/BulkActions/BulkErrataWizard/BulkErrataWizard.js +2 -1
  176. data/webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/BulkManageTracesModal.js +4 -0
  177. data/webpack/components/extensions/Hosts/BulkActions/BulkManageTracesModal/index.js +2 -1
  178. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/04_ReviewFooter.js +2 -0
  179. data/webpack/components/extensions/Hosts/BulkActions/BulkPackagesWizard/BulkPackagesWizard.js +2 -1
  180. data/webpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/03_ReviewFooter.js +2 -0
  181. data/webpack/components/extensions/Hosts/BulkActions/BulkRepositorySetsWizard/BulkRepositorySetsWizard.js +2 -1
  182. data/webpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/BulkSystemPurposeModal.js +5 -0
  183. data/webpack/components/extensions/Hosts/BulkActions/BulkSystemPurposeModal/index.js +2 -1
  184. data/webpack/components/extensions/Hosts/BulkActions/__tests__/bulkSystemPurposeModal.test.js +6 -1
  185. data/webpack/components/extensions/RegistrationCommands/__tests__/ActivationKeys.test.js +6 -6
  186. data/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +1 -1
  187. data/webpack/containers/Application/config.js +1 -1
  188. data/webpack/eslint-rules/no-cve-abbreviation.js +121 -0
  189. data/webpack/global_index.js +6 -6
  190. data/webpack/redux/reducers/index.js +0 -2
  191. data/webpack/scenes/ActivationKeys/Details/ActivationKeyDetails.js +2 -2
  192. data/webpack/scenes/ActivationKeys/Details/components/AssignAKCVModal.js +3 -3
  193. data/webpack/scenes/ActivationKeys/Details/components/CreateAKCVModal.js +1 -1
  194. data/webpack/scenes/ActivationKeys/Details/components/{CVEDetailsCard.js → CvEnvDetailsCard.js} +9 -9
  195. data/webpack/scenes/ActivationKeys/Details/components/{CVEDetailsCreateCard.js → CvEnvDetailsCreateCard.js} +10 -10
  196. data/webpack/scenes/ActivationKeys/Details/components/__tests__/{CVEDetailsCreateCard.test.js → CvEnvDetailsCreateCard.test.js} +8 -8
  197. data/webpack/scenes/ContainerImages/Booted/BootedContainerImagesPage.js +2 -2
  198. data/webpack/scenes/ContainerImages/ContainerImagesPage.js +59 -52
  199. data/webpack/scenes/ContainerImages/ContainerImagesPage.scss +27 -4
  200. data/webpack/scenes/ContainerImages/Synced/SyncedContainerImagesPage.js +1 -1
  201. data/webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js +9 -9
  202. data/webpack/scenes/Hosts/ChangeContentSource/actions.js +2 -2
  203. data/webpack/scenes/Subscriptions/Manifest/CdnTabContent.js +44 -0
  204. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +179 -307
  205. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModalConstants.js +5 -0
  206. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +64 -70
  207. data/webpack/scenes/Subscriptions/Manifest/ManifestConstants.js +5 -0
  208. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryContent.js +61 -0
  209. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +1 -1
  210. data/webpack/scenes/Subscriptions/Manifest/ManifestTabContent.js +357 -0
  211. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +129 -0
  212. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +69 -110
  213. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js +6 -2
  214. data/webpack/scenes/Subscriptions/Manifest/index.js +16 -1
  215. data/webpack/scenes/Subscriptions/SubscriptionActions.js +79 -145
  216. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +4 -35
  217. data/webpack/scenes/Subscriptions/SubscriptionsColumns.js +90 -0
  218. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +297 -217
  219. data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +40 -30
  220. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +11 -8
  221. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsConstants.js +0 -1
  222. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +104 -205
  223. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +12 -8
  224. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +245 -241
  225. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +61 -27
  226. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/components/Table.js +487 -73
  227. data/webpack/scenes/Subscriptions/components/SubscriptionsToolbar/SubscriptionsToolbar.js +22 -4
  228. data/webpack/utils/contentViewEnvironmentLabel.js +3 -3
  229. data/webpack/utils/helpers.js +2 -2
  230. metadata +15 -20
  231. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.scss +0 -39
  232. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +0 -47
  233. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +0 -223
  234. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +0 -31
  235. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsActions.test.js +0 -297
  236. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +0 -244
  237. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsSelectors.test.js +0 -47
  238. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionNameFormatter.js +0 -23
  239. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionTypeFormatter.js +0 -32
  240. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +0 -169
  241. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionTypeFormatter.test.js +0 -41
  242. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/index.js +0 -2
  243. data/webpack/scenes/Subscriptions/index.js +0 -57
@@ -1,169 +0,0 @@
1
- /* eslint-disable import/prefer-default-export */
2
- import React from 'react';
3
- import { translate as __ } from 'foremanReact/common/I18n';
4
- import entitlementsValueFormatter from '../../../../components/pf3Table/formatters/entitlementsValueFormatter.js';
5
- import { entitlementsInlineEditFormatter } from '../../../../components/pf3Table/formatters/EntitlementsInlineEditFormatter';
6
- import { subscriptionTypeFormatter } from './SubscriptionTypeFormatter';
7
- import { subscriptionNameFormatter } from './SubscriptionNameFormatter';
8
- import {
9
- headerFormatter,
10
- cellFormatter,
11
- selectionHeaderCellFormatter,
12
- collapseableAndSelectionCellFormatter,
13
- } from '../../../../components/pf3Table';
14
-
15
- function getEntitlementsFormatter(inlineEditController, canManageSubscriptionAllocations) {
16
- if (canManageSubscriptionAllocations) {
17
- return entitlementsInlineEditFormatter(inlineEditController);
18
- }
19
- return entitlementsValueFormatter;
20
- }
21
-
22
- // Helper function to format dates consistently
23
- const formatDate = (dateString) => {
24
- if (!dateString) return <td>—</td>;
25
- const date = new Date(dateString);
26
- if (Number.isNaN(date.getTime())) return <td>—</td>;
27
- return <td>{date.toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' })}</td>;
28
- };
29
-
30
- // Helper function to format SKU
31
- const skuFormatter = (value, { rowData }) => {
32
- if (!rowData.upstream_pool_id) {
33
- return <td>—</td>;
34
- }
35
- return cellFormatter(value, { rowData });
36
- };
37
-
38
- const textFormatter = (value, additionalData) => {
39
- if (!value) return <td>—</td>;
40
- return cellFormatter(value, additionalData);
41
- };
42
-
43
- export const createSubscriptionsTableSchema = (
44
- inlineEditController,
45
- selectionController,
46
- groupingController,
47
- hasPermission,
48
- ) => [
49
- {
50
- property: 'select',
51
- header: {
52
- label: __('Select all rows'),
53
- formatters: [
54
- label => selectionHeaderCellFormatter(selectionController, label, hasPermission),
55
- ],
56
- },
57
- cell: {
58
- formatters: [
59
- (value, additionalData) => {
60
- // eslint-disable-next-line no-param-reassign
61
- additionalData.disabled = !hasPermission || !additionalData.rowData.upstream_pool_id;
62
-
63
- return collapseableAndSelectionCellFormatter(
64
- groupingController,
65
- selectionController,
66
- additionalData,
67
- );
68
- },
69
- ],
70
- },
71
- },
72
- {
73
- property: 'id',
74
- header: {
75
- label: __('Name'),
76
- formatters: [headerFormatter],
77
- },
78
- cell: {
79
- formatters: [subscriptionNameFormatter],
80
- },
81
- },
82
- {
83
- property: 'type',
84
- header: {
85
- label: __('Type'),
86
- formatters: [headerFormatter],
87
- },
88
- cell: {
89
- formatters: [subscriptionTypeFormatter],
90
- },
91
- },
92
- {
93
- property: 'product_id',
94
- header: {
95
- label: __('SKU'),
96
- formatters: [headerFormatter],
97
- },
98
- cell: {
99
- formatters: [skuFormatter],
100
- },
101
- },
102
- {
103
- property: 'contract_number',
104
- header: {
105
- label: __('Contract'),
106
- formatters: [headerFormatter],
107
- },
108
- cell: {
109
- formatters: [textFormatter],
110
- },
111
- },
112
- {
113
- property: 'start_date',
114
- header: {
115
- label: __('Start date'),
116
- formatters: [headerFormatter],
117
- },
118
- cell: {
119
- formatters: [(value, { rowData }) => formatDate(rowData.start_date)],
120
- },
121
- },
122
- {
123
- property: 'end_date',
124
- header: {
125
- label: __('End date'),
126
- formatters: [headerFormatter],
127
- },
128
- cell: {
129
- formatters: [(value, { rowData }) => formatDate(rowData.end_date)],
130
- },
131
- },
132
- {
133
- property: 'virt_who',
134
- header: {
135
- label: __('Requires virt-who'),
136
- formatters: [headerFormatter],
137
- },
138
- cell: {
139
- formatters: [
140
- (value, { rowData }) => {
141
- if (rowData.virt_who === null || rowData.virt_who === undefined) {
142
- return <td>—</td>;
143
- }
144
- return <td>{rowData.virt_who ? __('True') : __('False')}</td>;
145
- },
146
- ],
147
- },
148
- },
149
- {
150
- property: 'quantity',
151
- header: {
152
- label: __('Entitlements'),
153
- formatters: [headerFormatter],
154
- },
155
- cell: {
156
- formatters: [getEntitlementsFormatter(inlineEditController, hasPermission)],
157
- },
158
- },
159
- {
160
- property: 'product_host_count',
161
- header: {
162
- label: __('Hosts'),
163
- formatters: [headerFormatter],
164
- },
165
- cell: {
166
- formatters: [cellFormatter],
167
- },
168
- },
169
- ];
@@ -1,41 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { subscriptionTypeFormatter } from '../SubscriptionTypeFormatter';
4
-
5
- describe('subscriptionTypeFormatter', () => {
6
- const renderFormatter = (rowData) => {
7
- const content = (
8
- <table>
9
- <tbody>
10
- <tr>{subscriptionTypeFormatter(null, { rowData })}</tr>
11
- </tbody>
12
- </table>
13
- );
14
- return render(content);
15
- };
16
-
17
- it('renders physical subscriptions', () => {
18
- renderFormatter({ virt_only: false });
19
- expect(screen.getByText('Physical')).toBeInTheDocument();
20
- });
21
-
22
- it('renders temporary subscriptions', () => {
23
- renderFormatter({ unmapped_guest: true });
24
- expect(screen.getByText('Temporary')).toBeInTheDocument();
25
- });
26
-
27
- it('renders virtual subscriptions', () => {
28
- renderFormatter({});
29
- expect(screen.getByText('Virtual')).toBeInTheDocument();
30
- });
31
-
32
- it('renders link to a host', () => {
33
- renderFormatter({ hypervisor: { name: 'host.example.com', id: 83 } });
34
-
35
- expect(screen.getByText('Guests of')).toBeInTheDocument();
36
- expect(screen.getByRole('link', { name: 'host.example.com' })).toHaveAttribute(
37
- 'href',
38
- '/new/hosts/83/',
39
- );
40
- });
41
- });
@@ -1,2 +0,0 @@
1
- export { default as SubscriptionsTable } from './SubscriptionsTable';
2
- export { default as SubscriptionsTableSchema } from './SubscriptionsTableSchema';
@@ -1,57 +0,0 @@
1
- import { bindActionCreators } from 'redux';
2
- import { connect } from 'react-redux';
3
- import * as subscriptionActions from './SubscriptionActions';
4
- import * as taskActions from '../Tasks/TaskActions';
5
- import * as manifestActions from './Manifest/ManifestActions';
6
-
7
- import {
8
- selectSubscriptionsState,
9
- selectSearchQuery,
10
- selectDeleteButtonDisabled,
11
- selectSubscriptionsTask,
12
- selectActivePermissions,
13
- selectIsTaskPending,
14
- selectHasUpstreamConnection,
15
- selectDeleteModalOpened,
16
- } from './SubscriptionsSelectors';
17
- import { selectIsPollingTask } from '../Tasks/TaskSelectors';
18
- import { selectOrganizationState, selectIsManifestImported } from '../Organizations/OrganizationSelectors';
19
- import pingUpstreamSubscriptions from './UpstreamSubscriptions/UpstreamSubscriptionsActions';
20
- import reducer from './SubscriptionReducer';
21
- import { SUBSCRIPTIONS } from './SubscriptionConstants';
22
- import SubscriptionsPage from './SubscriptionsPage';
23
-
24
- // map state to props
25
- const mapStateToProps = (state) => {
26
- const subscriptions = selectSubscriptionsState(state);
27
-
28
- return {
29
- subscriptions,
30
- activePermissions: selectActivePermissions(state),
31
- isManifestImported: selectIsManifestImported(state),
32
- hasUpstreamConnection: selectHasUpstreamConnection(state),
33
- task: selectSubscriptionsTask(state),
34
- isTaskPending: selectIsTaskPending(state),
35
- isPollingTask: selectIsPollingTask(state, SUBSCRIPTIONS),
36
- searchQuery: selectSearchQuery(state),
37
- deleteModalOpened: selectDeleteModalOpened(state),
38
- deleteButtonDisabled: selectDeleteButtonDisabled(state),
39
- organization: selectOrganizationState(state),
40
- };
41
- };
42
-
43
- // map action dispatchers to props
44
- const actions = {
45
- pingUpstreamSubscriptions,
46
- ...subscriptionActions,
47
- ...taskActions,
48
- ...manifestActions,
49
- };
50
-
51
- const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
52
-
53
- // export reducers
54
- export const subscriptions = reducer;
55
-
56
- // export connected component
57
- export default connect(mapStateToProps, mapDispatchToProps)(SubscriptionsPage);