katello 3.7.1.1 → 3.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -7
  3. data/app/assets/javascripts/katello/common/index.js +0 -1
  4. data/app/assets/javascripts/katello/sync_management/index.js +0 -1
  5. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +477 -0
  6. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
  7. data/app/controllers/katello/api/v2/activation_keys_controller.rb +2 -2
  8. data/app/controllers/katello/api/v2/api_controller.rb +3 -1
  9. data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -1
  10. data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
  11. data/app/controllers/katello/api/v2/content_view_versions_controller.rb +15 -1
  12. data/app/controllers/katello/api/v2/environments_controller.rb +5 -2
  13. data/app/controllers/katello/api/v2/errata_controller.rb +48 -34
  14. data/app/controllers/katello/api/v2/gpg_keys_controller.rb +1 -1
  15. data/app/controllers/katello/api/v2/host_collections_controller.rb +1 -1
  16. data/app/controllers/katello/api/v2/host_packages_controller.rb +5 -1
  17. data/app/controllers/katello/api/v2/organizations_controller.rb +1 -1
  18. data/app/controllers/katello/api/v2/packages_controller.rb +33 -22
  19. data/app/controllers/katello/api/v2/products_controller.rb +1 -1
  20. data/app/controllers/katello/api/v2/repositories_controller.rb +6 -5
  21. data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -10
  22. data/app/controllers/katello/api/v2/sync_plans_controller.rb +1 -1
  23. data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +20 -12
  24. data/app/controllers/katello/remote_execution_controller.rb +6 -6
  25. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +9 -37
  26. data/app/lib/actions/katello/content_view/promote.rb +6 -2
  27. data/app/lib/actions/katello/content_view_version/after_promote_hook.rb +11 -0
  28. data/app/lib/actions/katello/content_view_version/before_promote_hook.rb +11 -0
  29. data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
  30. data/app/lib/actions/pulp/consumer/abstract_content_action.rb +0 -12
  31. data/app/lib/actions/pulp/consumer/content_install.rb +1 -1
  32. data/app/lib/actions/pulp/consumer/content_uninstall.rb +1 -1
  33. data/app/lib/actions/pulp/consumer/content_update.rb +1 -1
  34. data/app/lib/katello/resources/registry.rb +40 -0
  35. data/app/lib/katello/util/package.rb +9 -4
  36. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -1
  37. data/app/models/katello/content_view.rb +4 -12
  38. data/app/models/katello/content_view_version.rb +26 -0
  39. data/app/models/katello/glue/candlepin/owner.rb +8 -0
  40. data/app/models/katello/glue/candlepin/pool.rb +11 -11
  41. data/app/models/katello/glue/candlepin/repository.rb +1 -1
  42. data/app/models/katello/glue/pulp/repos.rb +1 -0
  43. data/app/models/katello/host/content_facet.rb +1 -2
  44. data/app/models/katello/kt_environment.rb +6 -0
  45. data/app/models/katello/product_content.rb +1 -4
  46. data/app/models/katello/repository.rb +2 -0
  47. data/app/models/katello/rpm.rb +118 -14
  48. data/app/services/katello/puppet_class_importer_extensions.rb +17 -20
  49. data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +1 -3
  50. data/app/views/katello/api/v2/common/copy.json.rabl +3 -0
  51. data/app/views/katello/api/v2/environments/show.json.rabl +1 -1
  52. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -0
  53. data/app/views/katello/api/v2/repositories/show.json.rabl +4 -2
  54. data/app/views/overrides/activation_keys/_host_environment_select.html.erb +3 -2
  55. data/config/katello.yaml +89 -0
  56. data/config/routes.rb +0 -1
  57. data/config/routes/api/registry.rb +29 -0
  58. data/config/routes/api/v2.rb +1 -1
  59. data/db/migrate/20180612163403_add_foreign_key_to_hypervisor_id.rb +0 -3
  60. data/db/migrate/20180614184822_add_unauthenticated_pull.rb +9 -0
  61. data/db/migrate/20180618195941_add_description_to_repository.rb +5 -0
  62. data/db/seeds.d/75-job_templates.rb +2 -5
  63. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +3 -4
  64. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -4
  65. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +1 -1
  66. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js +1 -1
  67. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -1
  68. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +1 -1
  69. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +1 -0
  70. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version.controller.js +32 -18
  71. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-details.html +1 -1
  72. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-docker.html +2 -0
  73. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +32 -23
  74. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +6 -0
  75. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +8 -0
  76. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +1 -1
  77. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +1 -1
  78. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +0 -5
  79. data/lib/katello/engine.rb +1 -0
  80. data/lib/katello/permission_creator.rb +2 -0
  81. data/lib/katello/permissions/registry_permissions.rb +20 -0
  82. data/lib/katello/plugin.rb +1 -0
  83. data/lib/katello/tasks/clean_backend_objects.rake +3 -12
  84. data/lib/katello/version.rb +1 -1
  85. data/package.json +7 -10
  86. data/webpack/components/Search/Search.test.js +1 -3
  87. data/webpack/containers/Application/config.js +2 -9
  88. data/webpack/containers/Application/index.js +2 -4
  89. data/webpack/mockRequest.js +3 -3
  90. data/webpack/move_to_foreman/common/helpers.js +8 -45
  91. data/webpack/move_to_foreman/components/common/{EmptyState → emptyState}/index.js +3 -16
  92. data/webpack/move_to_foreman/components/common/table/components/Table.js +1 -1
  93. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +2 -2
  94. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionCell.test.js.snap +1 -1
  95. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +1 -1
  96. data/webpack/move_to_pf/LoadingState/LoadingState.js +14 -27
  97. data/webpack/move_to_pf/LoadingState/LoadingState.test.js +4 -8
  98. data/webpack/move_to_pf/react-bootstrap-select/index.js +1 -12
  99. data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -0
  100. data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
  101. data/webpack/redux/actions/RedHatRepositories/sets.js +1 -1
  102. data/webpack/redux/consts.js +0 -6
  103. data/webpack/redux/reducers/index.js +0 -2
  104. data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +23 -14
  105. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +1 -1
  106. data/webpack/scenes/RedHatRepositories/components/SearchBar.js +0 -1
  107. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RecommendedRepositorySetsToggler.test.js.snap +1 -3
  108. data/webpack/scenes/RedHatRepositories/index.js +3 -7
  109. data/webpack/scenes/RedHatRepositories/index.scss +0 -1
  110. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +8 -3
  111. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +1 -30
  112. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +28 -111
  113. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailReducer.test.js +1 -3
  114. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +1 -6
  115. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +424 -519
  116. data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +4 -7
  117. data/webpack/scenes/Subscriptions/Details/index.js +3 -5
  118. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +34 -78
  119. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +24 -5
  120. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +1 -9
  121. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +0 -3
  122. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +8 -20
  123. data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js +1 -3
  124. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +7 -34
  125. data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +16 -9
  126. data/webpack/scenes/Subscriptions/Manifest/index.js +0 -1
  127. data/webpack/scenes/Subscriptions/SubscriptionActions.js +26 -5
  128. data/webpack/scenes/Subscriptions/SubscriptionConstants.js +0 -1
  129. data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +0 -3
  130. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +4 -11
  131. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +36 -31
  132. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +12 -3
  133. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +27 -57
  134. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsReducer.js +3 -2
  135. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +5 -10
  136. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +5 -10
  137. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +4 -49
  138. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsReducer.test.js +3 -8
  139. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +11 -21
  140. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +8 -5
  141. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +0 -2
  142. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +3 -9
  143. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +2 -14
  144. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +17 -11
  145. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +5 -8
  146. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +58 -45
  147. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +4 -11
  148. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
  149. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +3 -16
  150. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +365 -392
  151. data/webpack/scenes/Subscriptions/index.js +0 -1
  152. data/webpack/services/api/fixtures.js +353 -0
  153. data/webpack/services/api/index.js +1 -17
  154. data/webpack/test_setup.js +0 -2
  155. metadata +16 -37
  156. data/config/katello.yml +0 -59
  157. data/webpack/__mocks__/foremanReact/components/BreadcrumbBar.js +0 -3
  158. data/webpack/__mocks__/foremanReact/redux.js +0 -3
  159. data/webpack/__mocks__/foremanReact/redux/actions/toasts.js +0 -8
  160. data/webpack/components/SelectOrg/SelectOrg.scss +0 -3
  161. data/webpack/components/SelectOrg/SelectOrgAction.js +0 -41
  162. data/webpack/components/SelectOrg/SelectOrgReducer.js +0 -33
  163. data/webpack/components/SelectOrg/SetOrganization.js +0 -116
  164. data/webpack/components/WithOrganization/withOrganization.js +0 -28
  165. data/webpack/global_test_setup.js +0 -6
  166. data/webpack/helpers/caret.js +0 -6
  167. data/webpack/move_to_pf/Select/Select.js +0 -40
  168. data/webpack/scenes/Products/ProductActions.js +0 -24
  169. data/webpack/scenes/Products/ProductConstants.js +0 -3
  170. data/webpack/scenes/Products/__tests__/ProductActions.test.js +0 -40
  171. data/webpack/scenes/Products/__tests__/products.fixtures.js +0 -90
  172. data/webpack/scenes/RedHatRepositories/components/EnabledRepositoryContent.js +0 -34
  173. data/webpack/scenes/RedHatRepositories/components/__tests__/EnabledRepository.test.js +0 -36
  174. data/webpack/scenes/RedHatRepositories/components/__tests__/EnabledRepositoryContent.test.js +0 -27
  175. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepository.test.js.snap +0 -25
  176. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepositoryContent.test.js.snap +0 -47
  177. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailEnabledProducts.js +0 -54
  178. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProduct.js +0 -29
  179. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.scss +0 -9
  180. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailEnabledProducts.test.js +0 -18
  181. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailProduct.test.js +0 -13
  182. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailEnabledProducts.test.js.snap +0 -45
  183. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProduct.test.js.snap +0 -67
  184. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/EntitlementsInlineEditFormatter.test.js +0 -110
  185. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +0 -228
  186. data/webpack/scenes/Tasks/helpers.js +0 -52
  187. data/webpack/services/api/testHelpers.js +0 -28
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import cx from 'classnames';
4
- import { Spinner, OverlayTrigger, Tooltip } from 'patternfly-react';
5
-
6
- const EnabledRepositoryContent = ({ loading, disableTooltipId, disableRepository }) => (
7
- <Spinner loading={loading} inline>
8
- <OverlayTrigger
9
- overlay={<Tooltip id={disableTooltipId}>{__('Disable')}</Tooltip>}
10
- placement="bottom"
11
- trigger={['hover', 'focus']}
12
- rootClose={false}
13
- >
14
- <button
15
- onClick={disableRepository}
16
- style={{
17
- backgroundColor: 'initial',
18
- border: 'none',
19
- color: '#0388ce',
20
- }}
21
- >
22
- <i className={cx('fa-2x', 'fa fa-minus-circle')} />
23
- </button>
24
- </OverlayTrigger>
25
- </Spinner>
26
- );
27
-
28
- EnabledRepositoryContent.propTypes = {
29
- loading: PropTypes.bool.isRequired,
30
- disableTooltipId: PropTypes.string.isRequired,
31
- disableRepository: PropTypes.func.isRequired,
32
- };
33
-
34
- export default EnabledRepositoryContent;
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- import thunk from 'redux-thunk';
3
- import { shallow } from 'enzyme';
4
- import toJson from 'enzyme-to-json';
5
- import configureMockStore from 'redux-mock-store';
6
- import EnabledRepository from '../EnabledRepository';
7
-
8
- jest.mock('../../../../move_to_foreman/foreman_toast_notifications');
9
-
10
- const mockStore = configureMockStore([thunk]);
11
- const store = mockStore({});
12
-
13
- describe('Enabled Repositories Component', () => {
14
- let shallowWrapper;
15
- beforeEach(() => {
16
- shallowWrapper = shallow(<EnabledRepository
17
- store={store}
18
- id={1}
19
- contentId={1}
20
- productId={1}
21
- name="foo"
22
- type="foo"
23
- arch="foo"
24
- releaseVer="1.1.1"
25
- setRepositoryDisabled={() => {}}
26
- />);
27
- });
28
-
29
- afterEach(() => {
30
- store.clearActions();
31
- });
32
-
33
- it('should render', async () => {
34
- expect(toJson(shallowWrapper)).toMatchSnapshot();
35
- });
36
- });
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import toJson from 'enzyme-to-json';
4
- import EnabledRepositoryContent from '../EnabledRepositoryContent';
5
-
6
- describe('Enabled Repositories Content Component', () => {
7
- const mockCallBack = jest.fn();
8
-
9
- let shallowWrapper;
10
- beforeEach(() => {
11
- shallowWrapper = shallow(<EnabledRepositoryContent
12
- loading
13
- disableTooltipId="disable-1"
14
- disableRepository={mockCallBack}
15
- />);
16
- });
17
-
18
- it('should render', async () => {
19
- expect(toJson(shallowWrapper)).toMatchSnapshot();
20
- });
21
-
22
- it('should run disableRepository on click', async () => {
23
- expect(mockCallBack).not.toHaveBeenCalled();
24
- shallowWrapper.find('button').at(0).simulate('click');
25
- expect(mockCallBack).toHaveBeenCalled();
26
- });
27
- });
@@ -1,25 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Enabled Repositories Component should render 1`] = `
4
- <EnabledRepository
5
- arch="foo"
6
- contentId={1}
7
- id={1}
8
- name="foo"
9
- productId={1}
10
- releaseVer="1.1.1"
11
- releasever=""
12
- setRepositoryDisabled={[Function]}
13
- store={
14
- Object {
15
- "clearActions": [Function],
16
- "dispatch": [Function],
17
- "getActions": [Function],
18
- "getState": [Function],
19
- "replaceReducer": [Function],
20
- "subscribe": [Function],
21
- }
22
- }
23
- type="foo"
24
- />
25
- `;
@@ -1,47 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Enabled Repositories Content Component should render 1`] = `
4
- <Spinner
5
- className=""
6
- inline={true}
7
- inverse={false}
8
- loading={true}
9
- size="md"
10
- >
11
- <OverlayTrigger
12
- defaultOverlayShown={false}
13
- overlay={
14
- <Tooltip
15
- bsClass="tooltip"
16
- id="disable-1"
17
- placement="right"
18
- >
19
- Disable
20
- </Tooltip>
21
- }
22
- placement="bottom"
23
- rootClose={false}
24
- trigger={
25
- Array [
26
- "hover",
27
- "focus",
28
- ]
29
- }
30
- >
31
- <button
32
- onClick={[MockFunction]}
33
- style={
34
- Object {
35
- "backgroundColor": "initial",
36
- "border": "none",
37
- "color": "#0388ce",
38
- }
39
- }
40
- >
41
- <i
42
- className="fa-2x fa fa-minus-circle"
43
- />
44
- </button>
45
- </OverlayTrigger>
46
- </Spinner>
47
- `;
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Col, ListView } from 'patternfly-react';
4
- import SubscriptionDetailProduct from './SubscriptionDetailProduct';
5
-
6
- const SubscriptionDetailEnabledProducts = ({ enabledProducts }) => {
7
- const listItems = enabledProducts.results.map(product => ({
8
- index: product.id,
9
- title: product.name,
10
- availableContent: (
11
- product.available_content.map(c => (
12
- {
13
- enabled: c.enabled,
14
- ...c.content,
15
- }
16
- ))
17
- ),
18
- }));
19
-
20
- if (listItems.length > 0) {
21
- return (
22
- <ListView>
23
- {listItems.map(({
24
- index,
25
- title,
26
- availableContent,
27
- }) => (
28
- <ListView.Item
29
- key={index}
30
- heading={title}
31
- hideCloseIcon
32
- >
33
-
34
- <Col sm={12}>
35
- {availableContent.map(content => (
36
- <SubscriptionDetailProduct key={content.id} content={content} />
37
- ))}
38
- </Col>
39
- </ListView.Item>
40
- ))}
41
- </ListView>
42
- );
43
- }
44
-
45
- return (
46
- <div>{ __('No products are enabled.') }</div>
47
- );
48
- };
49
-
50
- SubscriptionDetailEnabledProducts.propTypes = {
51
- enabledProducts: PropTypes.shape({}).isRequired,
52
- };
53
-
54
- export default SubscriptionDetailEnabledProducts;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Row, Col } from 'patternfly-react';
4
-
5
- const SubscriptionDetailProduct = ({ content }) => (
6
- <Row key={content.id}>
7
- <Col sm={12}>
8
- <Row><u>{content.name}</u></Row>
9
- </Col>
10
- <Col sm={3}>
11
- <Row>{ __('Content Download URL') }</Row>
12
- <Row>{ __('GPG Key URL') }</Row>
13
- <Row>{ __('Repo Type') }</Row>
14
- <Row>{ __('Enabled?') }</Row>
15
- </Col>
16
- <Col sm={9}>
17
- <Row>{content.content_url}</Row>
18
- <Row>{content.gpg_url}</Row>
19
- <Row>{content.type}</Row>
20
- <Row>{content.enabled ? __('yes') : __('no')}</Row>
21
- </Col>
22
- </Row>
23
- );
24
-
25
- SubscriptionDetailProduct.propTypes = {
26
- content: PropTypes.shape({}).isRequired,
27
- };
28
-
29
- export default SubscriptionDetailProduct;
@@ -1,9 +0,0 @@
1
- .scrolld-list {
2
- max-height: 400px;
3
- overflow-y: auto;
4
- }
5
-
6
- .list-view-pf-expand {
7
- max-height: 20px;
8
- padding: 0;
9
- }
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import TestRenderer from 'react-test-renderer';
3
- import { ListView } from 'patternfly-react';
4
- import SubscriptionDetailEnabledProducts from '../SubscriptionDetailEnabledProducts';
5
- import { availableContent, product } from '../../../Products/__tests__/products.fixtures.js';
6
-
7
- describe('subscription detail enabled products page', () => {
8
- it('renders correctly', () => {
9
- const testRenderer = TestRenderer
10
- .create(<SubscriptionDetailEnabledProducts
11
- enabledProducts={{ results: [product([availableContent])] }}
12
- />);
13
- const testInstance = testRenderer.root;
14
-
15
- expect(testRenderer.toJSON()).toMatchSnapshot();
16
- expect(testInstance.findAllByType(ListView.Item)).toHaveLength(1);
17
- });
18
- });
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import TestRenderer from 'react-test-renderer';
3
- import SubscriptionDetailProduct from '../SubscriptionDetailProduct';
4
- import { availableContent } from '../../../Products/__tests__/products.fixtures.js';
5
-
6
- describe('subscription detail enabled product component', () => {
7
- it('renders correctly', () => {
8
- const testRenderer = TestRenderer
9
- .create(<SubscriptionDetailProduct content={availableContent.content} />);
10
-
11
- expect(testRenderer.toJSON()).toMatchSnapshot();
12
- });
13
- });
@@ -1,45 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`subscription detail enabled products page renders correctly 1`] = `
4
- <div
5
- className="list-group list-view-pf list-view-pf-view"
6
- >
7
- <div
8
- className="list-group-item"
9
- >
10
- <div
11
- className="list-group-item-header"
12
- onClick={[Function]}
13
- >
14
- <div
15
- className="list-view-pf-expand"
16
- onClick={[Function]}
17
- >
18
- <span
19
- className="fa fa-angle-right"
20
- />
21
- </div>
22
- <div
23
- className="list-view-pf-main-info"
24
- >
25
- <div
26
- className="list-view-pf-body"
27
- >
28
- <div
29
- className="list-view-pf-description"
30
- >
31
- <div
32
- className="list-group-item-heading"
33
- >
34
- Red Hat Enterprise Linux Server
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- </div>
40
- <div
41
- className="list-group-item-container container-fluid hidden"
42
- />
43
- </div>
44
- </div>
45
- `;
@@ -1,67 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`subscription detail enabled product component renders correctly 1`] = `
4
- <div
5
- className="row"
6
- >
7
- <div
8
- className="col-sm-12"
9
- >
10
- <div
11
- className="row"
12
- >
13
- <u>
14
- Red Hat Enterprise Linux 7 Server (RPMs)
15
- </u>
16
- </div>
17
- </div>
18
- <div
19
- className="col-sm-3"
20
- >
21
- <div
22
- className="row"
23
- >
24
- Content Download URL
25
- </div>
26
- <div
27
- className="row"
28
- >
29
- GPG Key URL
30
- </div>
31
- <div
32
- className="row"
33
- >
34
- Repo Type
35
- </div>
36
- <div
37
- className="row"
38
- >
39
- Enabled?
40
- </div>
41
- </div>
42
- <div
43
- className="col-sm-9"
44
- >
45
- <div
46
- className="row"
47
- >
48
- /content/dist/rhel/server/7/$releasever/$basearch/os
49
- </div>
50
- <div
51
- className="row"
52
- >
53
- file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
54
- </div>
55
- <div
56
- className="row"
57
- >
58
- yum
59
- </div>
60
- <div
61
- className="row"
62
- >
63
- no
64
- </div>
65
- </div>
66
- </div>
67
- `;
@@ -1,110 +0,0 @@
1
- // import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import toJson from 'enzyme-to-json';
4
- import editFormatter from '../EntitlementsInlineEditFormatter';
5
-
6
- describe('EntitlementsInlineEditFormatter', () => {
7
- const data = rowData => ({
8
- rowData,
9
- });
10
-
11
- const mockController = (options = {}) => {
12
- const { editing = true, changed = false } = options;
13
- return {
14
- isEditing: () => editing,
15
- hasChanged: () => changed,
16
- };
17
- };
18
-
19
- describe('edit mode', () => {
20
- describe('when available quantities are being loaded', () => {
21
- it('renders spinner', async () => {
22
- const controller = mockController();
23
- const value = 100;
24
- const formatter = editFormatter(controller)(value, data({
25
- availableQuantityLoaded: false,
26
- }));
27
-
28
- expect(toJson(shallow(formatter))).toMatchSnapshot();
29
- });
30
- });
31
-
32
- describe('when available quantities are loaded', () => {
33
- it('renders edit field and max available', async () => {
34
- const controller = mockController();
35
- const value = 100;
36
- const formatter = editFormatter(controller)(value, data({
37
- availableQuantityLoaded: true,
38
- availableQuantity: 500,
39
- }));
40
-
41
- expect(toJson(shallow(formatter))).toMatchSnapshot();
42
- });
43
-
44
- it('renders edit field and unlimited message', async () => {
45
- const controller = mockController();
46
- const value = 100;
47
- const formatter = editFormatter(controller)(value, data({
48
- availableQuantityLoaded: true,
49
- availableQuantity: -1,
50
- }));
51
-
52
- expect(toJson(shallow(formatter))).toMatchSnapshot();
53
- });
54
-
55
- it('renders validation message', async () => {
56
- const controller = mockController();
57
- const value = 200;
58
- const formatter = editFormatter(controller)(value, data({
59
- availableQuantityLoaded: true,
60
- availableQuantity: 100,
61
- }));
62
-
63
- expect(toJson(shallow(formatter))).toMatchSnapshot();
64
- });
65
-
66
- it('renders changed values', async () => {
67
- const controller = mockController({ changed: true });
68
- const value = 100;
69
- const formatter = editFormatter(controller)(value, data({
70
- availableQuantityLoaded: true,
71
- availableQuantity: 200,
72
- }));
73
-
74
- expect(toJson(shallow(formatter))).toMatchSnapshot();
75
- });
76
- });
77
-
78
- describe('when available quantities failed to load', () => {
79
- it('renders just the edit field', async () => {
80
- const controller = mockController();
81
- const value = 200;
82
- const formatter = editFormatter(controller)(value, data({
83
- availableQuantityLoaded: true,
84
- }));
85
-
86
- expect(toJson(shallow(formatter))).toMatchSnapshot();
87
- });
88
- });
89
- });
90
-
91
- describe('value mode', () => {
92
- it('renders the value', async () => {
93
- const controller = mockController({ editing: false });
94
- const value = 200;
95
- const formatter = editFormatter(controller)(value, data({}));
96
-
97
- expect(toJson(shallow(formatter))).toMatchSnapshot();
98
- });
99
-
100
- it('renders unlimited for -1', async () => {
101
- const controller = mockController({ editing: false });
102
- const value = 200;
103
- const formatter = editFormatter(controller)(value, data({
104
- available: -1,
105
- }));
106
-
107
- expect(toJson(shallow(formatter))).toMatchSnapshot();
108
- });
109
- });
110
- });