katello 3.7.0.rc1 → 3.7.0.rc2
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.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/v2/content_views_controller.rb +5 -2
- data/app/controllers/katello/api/v2/environments_controller.rb +8 -3
- data/app/controllers/katello/api/v2/host_tracer_controller.rb +1 -1
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +4 -4
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +5 -22
- data/app/lib/actions/katello/host/update_content_overrides.rb +1 -0
- data/app/lib/actions/katello/product/content_create.rb +1 -0
- data/app/lib/actions/katello/product/repositories_certs_reset.rb +25 -0
- data/app/lib/actions/katello/product/update.rb +6 -0
- data/app/lib/katello/resources/candlepin/activation_key.rb +8 -4
- data/app/lib/katello/resources/candlepin/product.rb +2 -1
- data/app/lib/katello/util/cdn_var_substitutor.rb +5 -3
- data/app/lib/katello/util/package.rb +21 -13
- data/app/lib/katello/util/package_filter.rb +33 -31
- data/app/lib/katello/validators/prior_validator.rb +6 -10
- data/app/models/katello/concerns/host_managed_extensions.rb +2 -0
- data/app/models/katello/concerns/organization_extensions.rb +1 -0
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +10 -6
- data/app/models/katello/content.rb +23 -2
- data/app/models/katello/content_view_docker_filter.rb +1 -1
- data/app/models/katello/content_view_puppet_module.rb +3 -3
- data/app/models/katello/content_view_version.rb +4 -0
- data/app/models/katello/environment_prior.rb +7 -0
- data/app/models/katello/glue/candlepin/candlepin_object.rb +2 -2
- data/app/models/katello/glue/candlepin/pool.rb +10 -13
- data/app/models/katello/glue/candlepin/product.rb +19 -9
- data/app/models/katello/glue/candlepin/repository.rb +16 -0
- data/app/models/katello/glue/candlepin/subscription.rb +1 -1
- data/app/models/katello/glue/provider.rb +15 -81
- data/app/models/katello/host/subscription_facet.rb +1 -1
- data/app/models/katello/kt_environment.rb +39 -8
- data/app/models/katello/pool.rb +2 -1
- data/app/models/katello/rpm.rb +144 -2
- data/app/models/katello/upstream_pool.rb +7 -10
- data/app/services/katello/candlepin/pool_service.rb +18 -3
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +13 -16
- data/app/views/dashboard/_content_views_widget.html.erb +3 -3
- data/app/views/dashboard/_errata_widget.html.erb +2 -2
- data/app/views/dashboard/_host_collection_widget.html.erb +3 -3
- data/app/views/dashboard/_subscription_status_widget.html.erb +2 -2
- data/app/views/dashboard/_subscription_widget.html.erb +1 -1
- data/app/views/dashboard/_sync_widget.html.erb +3 -3
- data/app/views/katello/api/v2/subscriptions/base.json.rabl +1 -1
- data/app/views/katello/api/v2/upstream_subscriptions/base.json.rabl +2 -6
- data/app/views/katello/layouts/react.html.erb +3 -3
- data/config/katello.yaml +89 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20160302091113_change_environment_prior.rb +9 -0
- data/db/migrate/20180410140909_add_organization_id_to_pool.rb +2 -1
- data/db/migrate/20180612163403_add_foreign_key_to_hypervisor_id.rb +10 -0
- data/db/migrate/20180612164926_add_content_org_id.rb +39 -0
- data/db/migrate/20180612165011_remove_content_fields_from_host.rb +7 -0
- data/db/migrate/20180626160422_add_upstream_pool_id_to_katello_pool.rb +9 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js +2 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +4 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.controller.js +19 -14
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/new-environment.controller.js +18 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/paths.service.js +51 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/new-environment.html +16 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +3 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks.module.js +1 -6
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +4 -0
- data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
- data/lib/katello/plugin.rb +2 -11
- data/lib/katello/scheduled_jobs.rb +2 -14
- data/lib/katello/tasks/clean_backend_objects.rake +2 -0
- data/lib/katello/tasks/repository.rake +11 -2
- data/lib/katello/tasks/upgrades/3.7/import_pools.rake +12 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +4 -3
- data/webpack/components/PaginationRow/index.js +6 -2
- data/webpack/containers/Application/config.js +7 -2
- data/webpack/index.js +3 -5
- data/webpack/move_to_foreman/common/helpers.js +5 -24
- data/webpack/move_to_foreman/components/common/emptyState/index.js +12 -7
- data/webpack/move_to_foreman/components/common/table/components/CollapseSubscriptionGroupButton.js +31 -0
- data/webpack/move_to_foreman/components/common/table/components/CollapseSubscriptionGroupButton.test.js +16 -0
- data/webpack/move_to_foreman/components/common/table/components/Table.js +76 -0
- data/webpack/move_to_foreman/components/common/table/components/Table.test.js +31 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBody.js +27 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBody.test.js +18 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBodyMessage.js +18 -0
- data/webpack/move_to_foreman/components/common/table/components/TableBodyMessage.test.js +12 -0
- data/webpack/move_to_foreman/components/common/table/components/TableFixtures.js +14 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +39 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.test.js +16 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionHeaderCell.js +34 -0
- data/webpack/move_to_foreman/components/common/table/components/TableSelectionHeaderCell.test.js +14 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +19 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/Table.test.js.snap +167 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableBody.test.js.snap +28 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableBodyMessage.test.js.snap +13 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionCell.test.js.snap +16 -0
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +15 -0
- data/webpack/move_to_foreman/components/common/table/components/index.js +6 -0
- data/webpack/move_to_foreman/components/common/table/formatters/cellFormatter.js +4 -0
- data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +18 -0
- data/webpack/move_to_foreman/components/common/table/formatters/ellipsisCellFormatter.js +5 -0
- data/webpack/move_to_foreman/components/common/table/formatters/headerFormatter.js +4 -0
- data/webpack/move_to_foreman/components/common/table/formatters/index.js +6 -0
- data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +17 -0
- data/webpack/move_to_foreman/components/common/table/formatters/selectionHeaderCellFormatter.js +10 -0
- data/webpack/move_to_foreman/components/common/table/index.js +2 -88
- data/webpack/move_to_pf/LoadingState/LoadingState.js +35 -0
- data/webpack/move_to_pf/LoadingState/LoadingState.scss +12 -0
- data/webpack/move_to_pf/LoadingState/LoadingState.test.js +28 -0
- data/webpack/move_to_pf/LoadingState/__snapshots__/LoadingState.test.js.snap +20 -0
- data/webpack/move_to_pf/LoadingState/index.js +3 -0
- data/webpack/move_to_pf/test-utils/testHelpers.js +71 -0
- data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +34 -9
- data/webpack/redux/actions/RedHatRepositories/sets.js +28 -6
- data/webpack/redux/consts.js +1 -0
- data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +12 -2
- data/webpack/redux/reducers/RedHatRepositories/sets.js +34 -27
- data/webpack/redux/reducers/RedHatRepositories/sets.test.js +10 -2
- data/webpack/redux/reducers/index.js +2 -0
- data/webpack/scenes/Organizations/OrganizationActions.js +3 -3
- data/webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js +44 -0
- data/webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.scss +16 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +8 -2
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +5 -3
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +4 -2
- data/webpack/scenes/RedHatRepositories/components/Search.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/__tests__/RecommendedRepositorySetsToggler.test.js +17 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RecommendedRepositorySetsToggler.test.js.snap +37 -0
- data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
- data/webpack/scenes/RedHatRepositories/index.js +17 -7
- data/webpack/scenes/RedHatRepositories/index.scss +16 -4
- data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +17 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +28 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailAssociations.js +47 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailConstants.js +3 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js +65 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProducts.js +20 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +37 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +58 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +47 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailAssociations.test.js +16 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailInfo.test.js +15 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailProducts.test.js +16 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailReducer.test.js +39 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +28 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailAssociations.test.js.snap +53 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +185 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProducts.test.js.snap +77 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +432 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +167 -0
- data/webpack/scenes/Subscriptions/Details/index.js +19 -0
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +58 -12
- data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +6 -1
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +4 -4
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +7 -7
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -9
- data/webpack/scenes/Subscriptions/Manifest/index.js +2 -2
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +5 -6
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +2 -3
- data/webpack/scenes/Subscriptions/SubscriptionValidations.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +46 -30
- data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +38 -0
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +3 -3
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +7 -6
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +17 -14
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +12 -15
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +4 -4
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +5 -0
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +2 -2
- data/webpack/scenes/Subscriptions/{EntitlementsInlineEditFormatter.js → components/SubscriptionsTable/EntitlementsInlineEditFormatter.js} +7 -7
- data/webpack/scenes/Subscriptions/{SubscriptionsTable.js → components/SubscriptionsTable/SubscriptionsTable.js} +75 -47
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +60 -0
- data/webpack/scenes/Subscriptions/{SubscriptionsTableSchema.js → components/SubscriptionsTable/SubscriptionsTableSchema.js} +37 -26
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +56 -0
- data/webpack/scenes/Subscriptions/{__tests__ → components/SubscriptionsTable/__tests__}/__snapshots__/SubscriptionsTable.test.js.snap +16 -5
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/index.js +2 -0
- data/webpack/scenes/Subscriptions/index.js +2 -2
- data/webpack/scenes/Tasks/TaskActions.js +18 -11
- data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +92 -9
- data/webpack/scenes/Tasks/__tests__/task.fixtures.js +19 -9
- data/webpack/services/api/index.js +2 -2
- data/webpack/test_setup.js +1 -0
- metadata +79 -10
- data/webpack/scenes/Subscriptions/Subscriptions.scss +0 -14
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsTable.test.js +0 -47
@@ -17,7 +17,7 @@ const filterOptions = [
|
|
17
17
|
{ value: 'rpm', label: __('RPM') },
|
18
18
|
{ value: 'sourceRpm', label: __('Source RPM') },
|
19
19
|
{ value: 'debugRpm', label: __('Debug RPM') },
|
20
|
-
{ value: '
|
20
|
+
{ value: 'kickstart', label: __('Kickstart') },
|
21
21
|
{ value: 'ostree', label: __('OSTree') },
|
22
22
|
{ value: 'beta', label: __('Beta') },
|
23
23
|
{ value: 'other', label: __('Other') },
|
data/webpack/scenes/RedHatRepositories/components/__tests__/RecommendedRepositorySetsToggler.test.js
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '../../../../move_to_pf/test-utils/testHelpers';
|
2
|
+
|
3
|
+
import RecommendedRepositorySetsToggler from '../RecommendedRepositorySetsToggler';
|
4
|
+
|
5
|
+
const fixtures = {
|
6
|
+
'renders recommended-repository-sets-toggler': {
|
7
|
+
enabled: true,
|
8
|
+
className: 'some-class-name',
|
9
|
+
children: 'some-children',
|
10
|
+
help: 'some-help',
|
11
|
+
onChange: () => null,
|
12
|
+
},
|
13
|
+
};
|
14
|
+
|
15
|
+
describe('RecommendedRepositorySetsToggler', () => {
|
16
|
+
describe('rendering', () => testComponentSnapshotsWithFixtures(RecommendedRepositorySetsToggler, fixtures));
|
17
|
+
});
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`RecommendedRepositorySetsToggler rendering renders recommended-repository-sets-toggler 1`] = `
|
4
|
+
<div
|
5
|
+
className="recommended-repositories-toggler-container some-class-name"
|
6
|
+
>
|
7
|
+
<Switch
|
8
|
+
animate={true}
|
9
|
+
baseClass="bootstrap-switch"
|
10
|
+
bsSize="mini"
|
11
|
+
defaultValue={true}
|
12
|
+
disabled={false}
|
13
|
+
handleWidth="auto"
|
14
|
+
inverse={false}
|
15
|
+
labelText=" "
|
16
|
+
labelWidth="auto"
|
17
|
+
offColor="default"
|
18
|
+
offText="OFF"
|
19
|
+
onChange={[Function]}
|
20
|
+
onColor="primary"
|
21
|
+
onText="ON"
|
22
|
+
readonly={false}
|
23
|
+
tristate={false}
|
24
|
+
value={true}
|
25
|
+
wrapperClass="wrapper"
|
26
|
+
/>
|
27
|
+
<Icon
|
28
|
+
name="star"
|
29
|
+
type="fa"
|
30
|
+
/>
|
31
|
+
some-children
|
32
|
+
<FieldLevelHelp
|
33
|
+
close="true"
|
34
|
+
content="some-help"
|
35
|
+
/>
|
36
|
+
</div>
|
37
|
+
`;
|
@@ -22,7 +22,7 @@ export const getSetsComponent = (repoSetsState, onPaginationChange) => {
|
|
22
22
|
sprintf(
|
23
23
|
__('No Red Hat products currently exist, please import a manifest %(anchorBegin)s here %(anchorEnd)s to receive Red Hat content. No repository sets available.'),
|
24
24
|
{
|
25
|
-
anchorBegin: '<a href="/subscriptions/
|
25
|
+
anchorBegin: '<a href="/subscriptions/">',
|
26
26
|
anchorEnd: '</a>',
|
27
27
|
},
|
28
28
|
);
|
@@ -6,11 +6,12 @@ import React, { Component } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import { connect } from 'react-redux';
|
8
8
|
import { Grid, Row, Col } from 'react-bootstrap';
|
9
|
-
import {
|
9
|
+
import { LoadingState } from '../../move_to_pf/LoadingState';
|
10
10
|
|
11
11
|
import { createEnabledRepoParams, loadEnabledRepos } from '../../redux/actions/RedHatRepositories/enabled';
|
12
|
-
import { loadRepositorySets } from '../../redux/actions/RedHatRepositories/sets';
|
12
|
+
import { loadRepositorySets, updateRecommendedRepositorySets } from '../../redux/actions/RedHatRepositories/sets';
|
13
13
|
import SearchBar from './components/SearchBar';
|
14
|
+
import RecommendedRepositorySetsToggler from './components/RecommendedRepositorySetsToggler';
|
14
15
|
import { getSetsComponent, getEnabledComponent } from './helpers';
|
15
16
|
|
16
17
|
class RedHatRepositoriesPage extends Component {
|
@@ -39,8 +40,15 @@ class RedHatRepositoriesPage extends Component {
|
|
39
40
|
|
40
41
|
<Row className="row-eq-height">
|
41
42
|
<Col sm={6} className="available-repositories-container">
|
42
|
-
<
|
43
|
-
|
43
|
+
<div className="available-repositories-header">
|
44
|
+
<h2>{__('Available Repositories')}</h2>
|
45
|
+
<RecommendedRepositorySetsToggler
|
46
|
+
enabled={repositorySets.recommended}
|
47
|
+
onChange={value => this.props.updateRecommendedRepositorySets(value)}
|
48
|
+
className="recommended-repositories-toggler"
|
49
|
+
/>
|
50
|
+
</div>
|
51
|
+
<LoadingState loading={repositorySets.loading} loadingText={__('Loading')}>
|
44
52
|
{getSetsComponent(
|
45
53
|
repositorySets,
|
46
54
|
(pagination) => {
|
@@ -50,12 +58,12 @@ class RedHatRepositoriesPage extends Component {
|
|
50
58
|
});
|
51
59
|
},
|
52
60
|
)}
|
53
|
-
</
|
61
|
+
</LoadingState>
|
54
62
|
</Col>
|
55
63
|
|
56
64
|
<Col sm={6} className="enabled-repositories-container">
|
57
65
|
<h2>{__('Enabled Repositories')}</h2>
|
58
|
-
<
|
66
|
+
<LoadingState loading={enabledRepositories.loading} loadingText={__('Loading')}>
|
59
67
|
{getEnabledComponent(
|
60
68
|
enabledRepositories,
|
61
69
|
(pagination) => {
|
@@ -65,7 +73,7 @@ class RedHatRepositoriesPage extends Component {
|
|
65
73
|
});
|
66
74
|
},
|
67
75
|
)}
|
68
|
-
</
|
76
|
+
</LoadingState>
|
69
77
|
</Col>
|
70
78
|
</Row>
|
71
79
|
</Grid>
|
@@ -76,6 +84,7 @@ class RedHatRepositoriesPage extends Component {
|
|
76
84
|
RedHatRepositoriesPage.propTypes = {
|
77
85
|
loadEnabledRepos: PropTypes.func.isRequired,
|
78
86
|
loadRepositorySets: PropTypes.func.isRequired,
|
87
|
+
updateRecommendedRepositorySets: PropTypes.func.isRequired,
|
79
88
|
enabledRepositories: PropTypes.shape({}).isRequired,
|
80
89
|
repositorySets: PropTypes.shape({}).isRequired,
|
81
90
|
};
|
@@ -88,4 +97,5 @@ const mapStateToProps = ({ katello: { redHatRepositories: { enabled, sets } } })
|
|
88
97
|
export default connect(mapStateToProps, {
|
89
98
|
loadEnabledRepos,
|
90
99
|
loadRepositorySets,
|
100
|
+
updateRecommendedRepositorySets,
|
91
101
|
})(RedHatRepositoriesPage);
|
@@ -15,10 +15,6 @@
|
|
15
15
|
color: $color-pf-red-200;
|
16
16
|
}
|
17
17
|
|
18
|
-
.small-spacer {
|
19
|
-
margin: 10px 0;
|
20
|
-
}
|
21
|
-
|
22
18
|
#redhatRepositoriesPage {
|
23
19
|
.list-group-item-header .list-view-pf-description,
|
24
20
|
.enabled-repositories-container .list-view-pf-description {
|
@@ -33,9 +29,25 @@
|
|
33
29
|
background-color: inherit;
|
34
30
|
}
|
35
31
|
|
32
|
+
.recommended-repository-set-icon {
|
33
|
+
color: $color-pf-gold-300;
|
34
|
+
font-size: 2em;
|
35
|
+
}
|
36
|
+
|
36
37
|
.available-repositories-container {
|
37
38
|
background-color: $color-pf-white;
|
38
39
|
border-right: $color-pf-black-300 2px solid;
|
40
|
+
|
41
|
+
.available-repositories-header {
|
42
|
+
display: flex;
|
43
|
+
flex-wrap: wrap;
|
44
|
+
justify-content: space-between;
|
45
|
+
padding-top: 20px;
|
46
|
+
|
47
|
+
h2 {
|
48
|
+
margin: 0;
|
49
|
+
}
|
50
|
+
}
|
39
51
|
}
|
40
52
|
|
41
53
|
.content-view-pf-pagination {
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export default {
|
2
|
+
name: __('Name'),
|
3
|
+
description: __('Description'),
|
4
|
+
virt_who: __('Requires Virt-Who'),
|
5
|
+
consumed: __('Consumed'),
|
6
|
+
start_date: __('Starts'),
|
7
|
+
end_date: __('Ends'),
|
8
|
+
product_id: __('Product ID'),
|
9
|
+
contract_number: __('Contract Number'),
|
10
|
+
account_number: __('Account Number'),
|
11
|
+
support_level: __('Support Level'),
|
12
|
+
support_type: __('Support Type'),
|
13
|
+
arch: __('Architecture(s)'),
|
14
|
+
type: __('Type'),
|
15
|
+
mutli_entitlement: __('Multi-entitlement'),
|
16
|
+
stacking_id: __('Stacking ID'),
|
17
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import api, { orgId } from '../../../services/api';
|
2
|
+
import {
|
3
|
+
SUBSCRIPTION_DETAILS_REQUEST,
|
4
|
+
SUBSCRIPTION_DETAILS_SUCCESS,
|
5
|
+
SUBSCRIPTION_DETAILS_FAILURE,
|
6
|
+
} from './SubscriptionDetailConstants';
|
7
|
+
import { getResponseError } from '../../../move_to_foreman/common/helpers.js';
|
8
|
+
|
9
|
+
export const loadSubscriptionDetails = subscriptionId => (dispatch) => {
|
10
|
+
dispatch({ type: SUBSCRIPTION_DETAILS_REQUEST });
|
11
|
+
|
12
|
+
return api
|
13
|
+
.get(`/organizations/${orgId()}/subscriptions/${subscriptionId}`)
|
14
|
+
.then(({ data }) => {
|
15
|
+
dispatch({
|
16
|
+
type: SUBSCRIPTION_DETAILS_SUCCESS,
|
17
|
+
response: data,
|
18
|
+
});
|
19
|
+
})
|
20
|
+
.catch((result) => {
|
21
|
+
dispatch({
|
22
|
+
type: SUBSCRIPTION_DETAILS_FAILURE,
|
23
|
+
error: getResponseError(result.response),
|
24
|
+
});
|
25
|
+
});
|
26
|
+
};
|
27
|
+
|
28
|
+
export default loadSubscriptionDetails;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Table } from 'react-bootstrap';
|
4
|
+
import helpers from '../../../move_to_foreman/common/helpers.js';
|
5
|
+
|
6
|
+
const SubscriptionDetailAssociations = ({ subscriptionDetails }) => {
|
7
|
+
const searchQuery = 'subscription_id="%s"'.replace('%s', subscriptionDetails.id);
|
8
|
+
|
9
|
+
return (
|
10
|
+
<div>
|
11
|
+
<h2>{__('Associations')}</h2>
|
12
|
+
<Table striped bordered condensed hover>
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<td><b>{__('Resource')}</b></td>
|
16
|
+
<td><b>{__('Quantity')}</b></td>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
<tr>
|
21
|
+
<td>{__('Content Hosts')}</td>
|
22
|
+
<td>
|
23
|
+
<a href={helpers.urlWithSearch('content_hosts', searchQuery)}>
|
24
|
+
{subscriptionDetails.host_count}
|
25
|
+
</a>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
<tr>
|
29
|
+
<td>{__('Activation Keys')}</td>
|
30
|
+
<td>
|
31
|
+
<a href={helpers.urlWithSearch('activation_keys', searchQuery)}>
|
32
|
+
{subscriptionDetails.activation_keys &&
|
33
|
+
subscriptionDetails.activation_keys.length}
|
34
|
+
</a>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
</tbody>
|
38
|
+
</Table>
|
39
|
+
</div>
|
40
|
+
);
|
41
|
+
};
|
42
|
+
|
43
|
+
SubscriptionDetailAssociations.propTypes = {
|
44
|
+
subscriptionDetails: PropTypes.shape({}).isRequired,
|
45
|
+
};
|
46
|
+
|
47
|
+
export default SubscriptionDetailAssociations;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Table } from 'react-bootstrap';
|
4
|
+
import subscriptionAttributes from './SubscriptionAttributes';
|
5
|
+
|
6
|
+
const SubscriptionDetailInfo = ({ subscriptionDetails }) => {
|
7
|
+
const subscriptionLimits = (subDetails) => {
|
8
|
+
const limits = [];
|
9
|
+
if (subDetails.sockets) {
|
10
|
+
limits.push(__('Sockets: %s').replace('%s', subDetails.sockets));
|
11
|
+
}
|
12
|
+
if (subDetails.cores) {
|
13
|
+
limits.push(__('Cores: %s').replace('%s', subDetails.cores));
|
14
|
+
}
|
15
|
+
if (subDetails.ram) {
|
16
|
+
limits.push(__('RAM: %s GB').replace('%s', subDetails.ram));
|
17
|
+
}
|
18
|
+
if (limits.length > 0) {
|
19
|
+
return limits.join(', ');
|
20
|
+
}
|
21
|
+
return '';
|
22
|
+
};
|
23
|
+
|
24
|
+
const subscriptionDetailValue = (subDetails, key) => (subDetails[key] == null ? '' : String(subDetails[key]));
|
25
|
+
|
26
|
+
const formatInstanceBased = (subDetails) => {
|
27
|
+
if (subDetails.instance_multiplier == null ||
|
28
|
+
subDetails.instance_multiplier === '' ||
|
29
|
+
subDetails.instance_multiplier === 0) {
|
30
|
+
return __('No');
|
31
|
+
}
|
32
|
+
return __('Yes');
|
33
|
+
};
|
34
|
+
|
35
|
+
return (
|
36
|
+
<div>
|
37
|
+
<h2>{__('Subscription Info')}</h2>
|
38
|
+
<Table>
|
39
|
+
<tbody>
|
40
|
+
{Object.keys(subscriptionAttributes).map(key => (
|
41
|
+
<tr key={key}>
|
42
|
+
<td><b>{__(subscriptionAttributes[key])}</b></td>
|
43
|
+
<td>{subscriptionDetailValue(subscriptionDetails, key)}</td>
|
44
|
+
</tr>
|
45
|
+
))}
|
46
|
+
<tr>
|
47
|
+
<td><b>{__('Limits')}</b></td>
|
48
|
+
<td>{subscriptionLimits(subscriptionDetails)}</td>
|
49
|
+
</tr>
|
50
|
+
<tr>
|
51
|
+
<td><b>{__('Instance-based')}</b></td>
|
52
|
+
<td>{formatInstanceBased(subscriptionDetails)}</td>
|
53
|
+
</tr>
|
54
|
+
</tbody>
|
55
|
+
</Table>
|
56
|
+
|
57
|
+
</div>
|
58
|
+
);
|
59
|
+
};
|
60
|
+
|
61
|
+
SubscriptionDetailInfo.propTypes = {
|
62
|
+
subscriptionDetails: PropTypes.shape({}).isRequired,
|
63
|
+
};
|
64
|
+
|
65
|
+
export default SubscriptionDetailInfo;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
|
4
|
+
const SubscriptionDetailProducts = ({ subscriptionDetails }) => (
|
5
|
+
<div>
|
6
|
+
<h2>{__('Provided Products')}</h2>
|
7
|
+
<ul>
|
8
|
+
{subscriptionDetails.provided_products &&
|
9
|
+
subscriptionDetails.provided_products.map(prod => (
|
10
|
+
<li key={prod.id}>{prod.name}</li>
|
11
|
+
))}
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
);
|
15
|
+
|
16
|
+
SubscriptionDetailProducts.propTypes = {
|
17
|
+
subscriptionDetails: PropTypes.shape({}).isRequired,
|
18
|
+
};
|
19
|
+
|
20
|
+
export default SubscriptionDetailProducts;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import Immutable from 'seamless-immutable';
|
2
|
+
import {
|
3
|
+
SUBSCRIPTION_DETAILS_REQUEST,
|
4
|
+
SUBSCRIPTION_DETAILS_SUCCESS,
|
5
|
+
SUBSCRIPTION_DETAILS_FAILURE,
|
6
|
+
} from './SubscriptionDetailConstants';
|
7
|
+
|
8
|
+
const initialState = Immutable({
|
9
|
+
loading: false,
|
10
|
+
});
|
11
|
+
|
12
|
+
export default (state = initialState, action) => {
|
13
|
+
switch (action.type) {
|
14
|
+
case SUBSCRIPTION_DETAILS_REQUEST: {
|
15
|
+
return state.set('loading', true);
|
16
|
+
}
|
17
|
+
|
18
|
+
case SUBSCRIPTION_DETAILS_SUCCESS: {
|
19
|
+
const subscriptionDetails = action.response;
|
20
|
+
|
21
|
+
return state.merge({
|
22
|
+
...subscriptionDetails,
|
23
|
+
loading: false,
|
24
|
+
});
|
25
|
+
}
|
26
|
+
|
27
|
+
case SUBSCRIPTION_DETAILS_FAILURE: {
|
28
|
+
return state.merge({
|
29
|
+
error: action.error,
|
30
|
+
loading: false,
|
31
|
+
});
|
32
|
+
}
|
33
|
+
|
34
|
+
default:
|
35
|
+
return state;
|
36
|
+
}
|
37
|
+
};
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React, { Component } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Grid, Row, Col } from 'patternfly-react';
|
4
|
+
import SubscriptionDetailInfo from './SubscriptionDetailInfo';
|
5
|
+
import SubscriptionDetailAssociations from './SubscriptionDetailAssociations';
|
6
|
+
import SubscriptionDetailProducts from './SubscriptionDetailProducts';
|
7
|
+
import { LoadingState } from '../../../move_to_pf/LoadingState';
|
8
|
+
import { notify } from '../../../move_to_foreman/foreman_toast_notifications';
|
9
|
+
|
10
|
+
class SubscriptionDetails extends Component {
|
11
|
+
componentDidMount() {
|
12
|
+
// eslint-disable-next-line react/prop-types
|
13
|
+
const routerParams = this.props.match.params;
|
14
|
+
this.props.loadSubscriptionDetails(parseInt(routerParams.id, 10));
|
15
|
+
}
|
16
|
+
|
17
|
+
render() {
|
18
|
+
const { subscriptionDetails } = this.props;
|
19
|
+
|
20
|
+
if (subscriptionDetails.error) { notify({ message: subscriptionDetails.error }); }
|
21
|
+
|
22
|
+
return (
|
23
|
+
<Grid bsClass="container-fluid">
|
24
|
+
<div>
|
25
|
+
<LoadingState loading={subscriptionDetails.loading} loadingText={__('Loading')}>
|
26
|
+
<Row>
|
27
|
+
<Col sm={12}>
|
28
|
+
<h1>{subscriptionDetails.name}</h1>
|
29
|
+
</Col>
|
30
|
+
</Row>
|
31
|
+
<Row>
|
32
|
+
<Col sm={6}>
|
33
|
+
<SubscriptionDetailInfo
|
34
|
+
subscriptionDetails={subscriptionDetails}
|
35
|
+
/>
|
36
|
+
</Col>
|
37
|
+
<Col sm={6}>
|
38
|
+
<SubscriptionDetailAssociations
|
39
|
+
subscriptionDetails={subscriptionDetails}
|
40
|
+
/>
|
41
|
+
<SubscriptionDetailProducts
|
42
|
+
subscriptionDetails={subscriptionDetails}
|
43
|
+
/>
|
44
|
+
</Col>
|
45
|
+
</Row>
|
46
|
+
</LoadingState>
|
47
|
+
</div>
|
48
|
+
</Grid>
|
49
|
+
);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
SubscriptionDetails.propTypes = {
|
54
|
+
loadSubscriptionDetails: PropTypes.func.isRequired,
|
55
|
+
subscriptionDetails: PropTypes.shape({}).isRequired,
|
56
|
+
};
|
57
|
+
|
58
|
+
export default SubscriptionDetails;
|