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.
- checksums.yaml +4 -4
- data/README.md +8 -7
- data/app/assets/javascripts/katello/common/index.js +0 -1
- data/app/assets/javascripts/katello/sync_management/index.js +0 -1
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +477 -0
- data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/activation_keys_controller.rb +2 -2
- data/app/controllers/katello/api/v2/api_controller.rb +3 -1
- data/app/controllers/katello/api/v2/content_credentials_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_filter_rules_controller.rb +1 -1
- data/app/controllers/katello/api/v2/content_view_versions_controller.rb +15 -1
- data/app/controllers/katello/api/v2/environments_controller.rb +5 -2
- data/app/controllers/katello/api/v2/errata_controller.rb +48 -34
- data/app/controllers/katello/api/v2/gpg_keys_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_collections_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_packages_controller.rb +5 -1
- data/app/controllers/katello/api/v2/organizations_controller.rb +1 -1
- data/app/controllers/katello/api/v2/packages_controller.rb +33 -22
- data/app/controllers/katello/api/v2/products_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repositories_controller.rb +6 -5
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +1 -10
- data/app/controllers/katello/api/v2/sync_plans_controller.rb +1 -1
- data/app/controllers/katello/concerns/api/v2/repository_content_controller.rb +20 -12
- data/app/controllers/katello/remote_execution_controller.rb +6 -6
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +9 -37
- data/app/lib/actions/katello/content_view/promote.rb +6 -2
- data/app/lib/actions/katello/content_view_version/after_promote_hook.rb +11 -0
- data/app/lib/actions/katello/content_view_version/before_promote_hook.rb +11 -0
- data/app/lib/actions/katello/host/remove_subscriptions.rb +1 -1
- data/app/lib/actions/pulp/consumer/abstract_content_action.rb +0 -12
- data/app/lib/actions/pulp/consumer/content_install.rb +1 -1
- data/app/lib/actions/pulp/consumer/content_uninstall.rb +1 -1
- data/app/lib/actions/pulp/consumer/content_update.rb +1 -1
- data/app/lib/katello/resources/registry.rb +40 -0
- data/app/lib/katello/util/package.rb +9 -4
- data/app/models/katello/concerns/subscription_facet_host_extensions.rb +1 -1
- data/app/models/katello/content_view.rb +4 -12
- data/app/models/katello/content_view_version.rb +26 -0
- data/app/models/katello/glue/candlepin/owner.rb +8 -0
- data/app/models/katello/glue/candlepin/pool.rb +11 -11
- data/app/models/katello/glue/candlepin/repository.rb +1 -1
- data/app/models/katello/glue/pulp/repos.rb +1 -0
- data/app/models/katello/host/content_facet.rb +1 -2
- data/app/models/katello/kt_environment.rb +6 -0
- data/app/models/katello/product_content.rb +1 -4
- data/app/models/katello/repository.rb +2 -0
- data/app/models/katello/rpm.rb +118 -14
- data/app/services/katello/puppet_class_importer_extensions.rb +17 -20
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +1 -3
- data/app/views/katello/api/v2/common/copy.json.rabl +3 -0
- data/app/views/katello/api/v2/environments/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -0
- data/app/views/katello/api/v2/repositories/show.json.rabl +4 -2
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +3 -2
- data/config/katello.yaml +89 -0
- data/config/routes.rb +0 -1
- data/config/routes/api/registry.rb +29 -0
- data/config/routes/api/v2.rb +1 -1
- data/db/migrate/20180612163403_add_foreign_key_to_hypervisor_id.rb +0 -3
- data/db/migrate/20180614184822_add_unauthenticated_pull.rb +9 -0
- data/db/migrate/20180618195941_add_description_to_repository.rb +5 -0
- data/db/seeds.d/75-job_templates.rb +2 -5
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-repository-sets-modal.controller.js +3 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/content-hosts-bulk-subscriptions-modal.controller.js +1 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-subscriptions-modal.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content/content-host-packages-installed.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/details/content-host-add-subscriptions.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/content-views.routes.js +1 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version.controller.js +32 -18
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-details.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-docker.html +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +32 -23
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +6 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +8 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +1 -1
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +0 -5
- data/lib/katello/engine.rb +1 -0
- data/lib/katello/permission_creator.rb +2 -0
- data/lib/katello/permissions/registry_permissions.rb +20 -0
- data/lib/katello/plugin.rb +1 -0
- data/lib/katello/tasks/clean_backend_objects.rake +3 -12
- data/lib/katello/version.rb +1 -1
- data/package.json +7 -10
- data/webpack/components/Search/Search.test.js +1 -3
- data/webpack/containers/Application/config.js +2 -9
- data/webpack/containers/Application/index.js +2 -4
- data/webpack/mockRequest.js +3 -3
- data/webpack/move_to_foreman/common/helpers.js +8 -45
- data/webpack/move_to_foreman/components/common/{EmptyState → emptyState}/index.js +3 -16
- data/webpack/move_to_foreman/components/common/table/components/Table.js +1 -1
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +2 -2
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionCell.test.js.snap +1 -1
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +1 -1
- data/webpack/move_to_pf/LoadingState/LoadingState.js +14 -27
- data/webpack/move_to_pf/LoadingState/LoadingState.test.js +4 -8
- data/webpack/move_to_pf/react-bootstrap-select/index.js +1 -12
- data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -0
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
- data/webpack/redux/actions/RedHatRepositories/sets.js +1 -1
- data/webpack/redux/consts.js +0 -6
- data/webpack/redux/reducers/index.js +0 -2
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +23 -14
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +0 -1
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RecommendedRepositorySetsToggler.test.js.snap +1 -3
- data/webpack/scenes/RedHatRepositories/index.js +3 -7
- data/webpack/scenes/RedHatRepositories/index.scss +0 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +8 -3
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +1 -30
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +28 -111
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailReducer.test.js +1 -3
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +1 -6
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +424 -519
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +4 -7
- data/webpack/scenes/Subscriptions/Details/index.js +3 -5
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +34 -78
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +24 -5
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +1 -9
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +0 -3
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +8 -20
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js +1 -3
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +7 -34
- data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +16 -9
- data/webpack/scenes/Subscriptions/Manifest/index.js +0 -1
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +26 -5
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +0 -1
- data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +0 -3
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +4 -11
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +36 -31
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +12 -3
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +27 -57
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsReducer.js +3 -2
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +5 -10
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +5 -10
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +4 -49
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsReducer.test.js +3 -8
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +11 -21
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +8 -5
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +0 -2
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +3 -9
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +2 -14
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +17 -11
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +5 -8
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +58 -45
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +4 -11
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +3 -16
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +365 -392
- data/webpack/scenes/Subscriptions/index.js +0 -1
- data/webpack/services/api/fixtures.js +353 -0
- data/webpack/services/api/index.js +1 -17
- data/webpack/test_setup.js +0 -2
- metadata +16 -37
- data/config/katello.yml +0 -59
- data/webpack/__mocks__/foremanReact/components/BreadcrumbBar.js +0 -3
- data/webpack/__mocks__/foremanReact/redux.js +0 -3
- data/webpack/__mocks__/foremanReact/redux/actions/toasts.js +0 -8
- data/webpack/components/SelectOrg/SelectOrg.scss +0 -3
- data/webpack/components/SelectOrg/SelectOrgAction.js +0 -41
- data/webpack/components/SelectOrg/SelectOrgReducer.js +0 -33
- data/webpack/components/SelectOrg/SetOrganization.js +0 -116
- data/webpack/components/WithOrganization/withOrganization.js +0 -28
- data/webpack/global_test_setup.js +0 -6
- data/webpack/helpers/caret.js +0 -6
- data/webpack/move_to_pf/Select/Select.js +0 -40
- data/webpack/scenes/Products/ProductActions.js +0 -24
- data/webpack/scenes/Products/ProductConstants.js +0 -3
- data/webpack/scenes/Products/__tests__/ProductActions.test.js +0 -40
- data/webpack/scenes/Products/__tests__/products.fixtures.js +0 -90
- data/webpack/scenes/RedHatRepositories/components/EnabledRepositoryContent.js +0 -34
- data/webpack/scenes/RedHatRepositories/components/__tests__/EnabledRepository.test.js +0 -36
- data/webpack/scenes/RedHatRepositories/components/__tests__/EnabledRepositoryContent.test.js +0 -27
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepository.test.js.snap +0 -25
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepositoryContent.test.js.snap +0 -47
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailEnabledProducts.js +0 -54
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProduct.js +0 -29
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.scss +0 -9
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailEnabledProducts.test.js +0 -18
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailProduct.test.js +0 -13
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailEnabledProducts.test.js.snap +0 -45
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProduct.test.js.snap +0 -67
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/EntitlementsInlineEditFormatter.test.js +0 -110
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +0 -228
- data/webpack/scenes/Tasks/helpers.js +0 -52
- data/webpack/services/api/testHelpers.js +0 -28
@@ -34,6 +34,7 @@ export const createEnabledRepoParams = (extendedParams = {}) => {
|
|
34
34
|
export const loadEnabledRepos = (extendedParams = {}) => (dispatch) => {
|
35
35
|
dispatch({ type: ENABLED_REPOSITORIES_REQUEST, params: extendedParams });
|
36
36
|
const { searchParams, repoParams } = createEnabledRepoParams(extendedParams);
|
37
|
+
|
37
38
|
api
|
38
39
|
.get('/repositories', {}, repoParams)
|
39
40
|
.then(({ data }) => {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
const repoTypeSearchQueryMap = {
|
2
|
-
rpm: '(name
|
3
|
-
sourceRpm: '
|
4
|
-
debugRpm: '
|
5
|
-
kickstart: '
|
6
|
-
ostree: '
|
2
|
+
rpm: '(name ~ rpms) and (name !~ source rpm) and (name !~ debug rpm)',
|
3
|
+
sourceRpm: 'name ~ source rpm',
|
4
|
+
debugRpm: 'name ~ debug rpm',
|
5
|
+
kickstart: 'name ~ kickstart',
|
6
|
+
ostree: 'name ~ ostree',
|
7
7
|
beta: 'name ~ beta',
|
8
8
|
};
|
9
9
|
|
@@ -28,7 +28,7 @@ export const loadRepositorySets = (extendedParams = {}) => (dispatch, getState)
|
|
28
28
|
]);
|
29
29
|
|
30
30
|
const params = {
|
31
|
-
...{ organization_id: orgId()
|
31
|
+
...{ organization_id: orgId() },
|
32
32
|
...propsToSnakeCase(extendedParams),
|
33
33
|
search,
|
34
34
|
};
|
data/webpack/redux/consts.js
CHANGED
@@ -17,9 +17,3 @@ export const REPOSITORY_SETS_UPDATE_RECOMMENDED = 'REPOSITORY_SETS_UPDATE_RECOMM
|
|
17
17
|
|
18
18
|
export const REPOSITORY_ENABLED = 'REPOSITORY_ENABLED';
|
19
19
|
export const REPOSITORY_DISABLED = 'REPOSITORY_DISABLED';
|
20
|
-
|
21
|
-
export const GET_ORGANIZATIONS_LIST_SUCCESS = 'GET_ORGANIZATIONS_LIST_SUCCESS';
|
22
|
-
export const GET_ORGANIZATIONS_LIST_FAILURE = 'GET_ORGANIZATIONS_LIST_FAILURE';
|
23
|
-
export const CHANGE_CURRENT_ORGANIZATION_SUCCESS = 'CHANGE_CURRENT_ORGANIZATION_SUCCESS';
|
24
|
-
export const CHANGE_CURRENT_ORGANIZATION_FAILURE = 'CHANGE_CURRENT_ORGANIZATION_FAILURE';
|
25
|
-
export const GET_ORGANIZATIONS_LIST_REQUEST = 'GET_ORGANIZATIONS_LIST_REQUEST';
|
@@ -5,7 +5,6 @@ import { subscriptions } from '../../scenes/Subscriptions';
|
|
5
5
|
import { upstreamSubscriptions } from '../../scenes/Subscriptions/UpstreamSubscriptions';
|
6
6
|
import { manifestHistory } from '../../scenes/Subscriptions/Manifest';
|
7
7
|
import { subscriptionDetails } from '../../scenes/Subscriptions/Details';
|
8
|
-
import { setOrganization } from '../../components/SelectOrg/SetOrganization';
|
9
8
|
|
10
9
|
export default combineReducers({
|
11
10
|
organization,
|
@@ -14,5 +13,4 @@ export default combineReducers({
|
|
14
13
|
upstreamSubscriptions,
|
15
14
|
manifestHistory,
|
16
15
|
subscriptionDetails,
|
17
|
-
setOrganization,
|
18
16
|
});
|
@@ -1,14 +1,12 @@
|
|
1
1
|
import React, { Component } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import
|
3
|
+
import cx from 'classnames';
|
4
|
+
import { ListView, Spinner, OverlayTrigger, Tooltip } from 'patternfly-react';
|
4
5
|
import { connect } from 'react-redux';
|
5
6
|
|
6
7
|
import RepositoryTypeIcon from './RepositoryTypeIcon';
|
7
8
|
import { setRepositoryDisabled } from '../../../redux/actions/RedHatRepositories/enabled';
|
8
9
|
import api from '../../../services/api';
|
9
|
-
import { notify } from '../../../move_to_foreman/foreman_toast_notifications';
|
10
|
-
import { getResponseErrorMsgs } from '../../../move_to_foreman/common/helpers';
|
11
|
-
import EnabledRepositoryContent from './EnabledRepositoryContent';
|
12
10
|
|
13
11
|
class EnabledRepository extends Component {
|
14
12
|
constructor(props) {
|
@@ -51,12 +49,9 @@ class EnabledRepository extends Component {
|
|
51
49
|
api
|
52
50
|
.put(url, data)
|
53
51
|
.then(this.setDisabled)
|
54
|
-
.catch((
|
55
|
-
const errors = getResponseErrorMsgs(response);
|
56
|
-
errors.forEach((error) => {
|
57
|
-
notify({ message: error, type: 'error' });
|
58
|
-
});
|
52
|
+
.catch(() => {
|
59
53
|
this.setState({ loading: false });
|
54
|
+
// TODO: Add error component
|
60
55
|
});
|
61
56
|
};
|
62
57
|
|
@@ -72,11 +67,25 @@ class EnabledRepository extends Component {
|
|
72
67
|
<ListView.Item
|
73
68
|
key={id}
|
74
69
|
actions={
|
75
|
-
<
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
70
|
+
<Spinner loading={this.state.loading} inline>
|
71
|
+
<OverlayTrigger
|
72
|
+
overlay={<Tooltip id={this.disableTooltipId}>{__('Disable')}</Tooltip>}
|
73
|
+
placement="bottom"
|
74
|
+
trigger={['hover', 'focus']}
|
75
|
+
rootClose={false}
|
76
|
+
>
|
77
|
+
<button
|
78
|
+
onClick={this.disableRepository}
|
79
|
+
style={{
|
80
|
+
backgroundColor: 'initial',
|
81
|
+
border: 'none',
|
82
|
+
color: '#0388ce',
|
83
|
+
}}
|
84
|
+
>
|
85
|
+
<i className={cx('fa-2x', 'fa fa-minus-circle')} />
|
86
|
+
</button>
|
87
|
+
</OverlayTrigger>
|
88
|
+
</Spinner>
|
80
89
|
}
|
81
90
|
leftContent={<RepositoryTypeIcon id={id} type={type} />}
|
82
91
|
heading={name}
|
@@ -50,7 +50,7 @@ class RepositorySetRepository extends Component {
|
|
50
50
|
const data = {
|
51
51
|
id: contentId,
|
52
52
|
product_id: productId,
|
53
|
-
basearch: arch
|
53
|
+
basearch: arch == UNSPECIFIED_ARCH ? undefined : arch,
|
54
54
|
releasever: releasever || undefined,
|
55
55
|
};
|
56
56
|
|
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
|
|
7
7
|
import { connect } from 'react-redux';
|
8
8
|
import { Grid, Row, Col } from 'react-bootstrap';
|
9
9
|
import { LoadingState } from '../../move_to_pf/LoadingState';
|
10
|
+
|
10
11
|
import { createEnabledRepoParams, loadEnabledRepos } from '../../redux/actions/RedHatRepositories/enabled';
|
11
12
|
import { loadRepositorySets, updateRecommendedRepositorySets } from '../../redux/actions/RedHatRepositories/sets';
|
12
13
|
import SearchBar from './components/SearchBar';
|
@@ -30,6 +31,7 @@ class RedHatRepositoriesPage extends Component {
|
|
30
31
|
return (
|
31
32
|
<Grid id="redhatRepositoriesPage" bsClass="container-fluid">
|
32
33
|
<h1>{__('Red Hat Repositories')}</h1>
|
34
|
+
|
33
35
|
<Row className="toolbar-pf">
|
34
36
|
<Col sm={12}>
|
35
37
|
<SearchBar repoParams={repoParams} />
|
@@ -85,15 +87,9 @@ RedHatRepositoriesPage.propTypes = {
|
|
85
87
|
updateRecommendedRepositorySets: PropTypes.func.isRequired,
|
86
88
|
enabledRepositories: PropTypes.shape({}).isRequired,
|
87
89
|
repositorySets: PropTypes.shape({}).isRequired,
|
88
|
-
history: PropTypes.shape({}).isRequired,
|
89
|
-
location: PropTypes.shape({}).isRequired,
|
90
90
|
};
|
91
91
|
|
92
|
-
const mapStateToProps = ({
|
93
|
-
katello: {
|
94
|
-
redHatRepositories: { enabled, sets },
|
95
|
-
},
|
96
|
-
}) => ({
|
92
|
+
const mapStateToProps = ({ katello: { redHatRepositories: { enabled, sets } } }) => ({
|
97
93
|
enabledRepositories: enabled,
|
98
94
|
repositorySets: sets,
|
99
95
|
});
|
@@ -4,9 +4,9 @@ import {
|
|
4
4
|
SUBSCRIPTION_DETAILS_SUCCESS,
|
5
5
|
SUBSCRIPTION_DETAILS_FAILURE,
|
6
6
|
} from './SubscriptionDetailConstants';
|
7
|
-
import {
|
7
|
+
import { getResponseError } from '../../../move_to_foreman/common/helpers.js';
|
8
8
|
|
9
|
-
export const loadSubscriptionDetails = subscriptionId => (dispatch
|
9
|
+
export const loadSubscriptionDetails = subscriptionId => (dispatch) => {
|
10
10
|
dispatch({ type: SUBSCRIPTION_DETAILS_REQUEST });
|
11
11
|
|
12
12
|
return api
|
@@ -17,7 +17,12 @@ export const loadSubscriptionDetails = subscriptionId => (dispatch, getState) =>
|
|
17
17
|
response: data,
|
18
18
|
});
|
19
19
|
})
|
20
|
-
.catch(result =>
|
20
|
+
.catch((result) => {
|
21
|
+
dispatch({
|
22
|
+
type: SUBSCRIPTION_DETAILS_FAILURE,
|
23
|
+
error: getResponseError(result.response),
|
24
|
+
});
|
25
|
+
});
|
21
26
|
};
|
22
27
|
|
23
28
|
export default loadSubscriptionDetails;
|
@@ -4,18 +4,9 @@ import {
|
|
4
4
|
SUBSCRIPTION_DETAILS_SUCCESS,
|
5
5
|
SUBSCRIPTION_DETAILS_FAILURE,
|
6
6
|
} from './SubscriptionDetailConstants';
|
7
|
-
import {
|
8
|
-
PRODUCTS_REQUEST,
|
9
|
-
PRODUCTS_SUCCESS,
|
10
|
-
PRODUCTS_FAILURE,
|
11
|
-
} from '../../Products/ProductConstants';
|
12
7
|
|
13
8
|
const initialState = Immutable({
|
14
9
|
loading: false,
|
15
|
-
enabledProducts: {
|
16
|
-
results: [],
|
17
|
-
total: 0,
|
18
|
-
},
|
19
10
|
});
|
20
11
|
|
21
12
|
export default (state = initialState, action) => {
|
@@ -24,10 +15,6 @@ export default (state = initialState, action) => {
|
|
24
15
|
return state.set('loading', true);
|
25
16
|
}
|
26
17
|
|
27
|
-
case PRODUCTS_REQUEST: {
|
28
|
-
return state.set('loading', true);
|
29
|
-
}
|
30
|
-
|
31
18
|
case SUBSCRIPTION_DETAILS_SUCCESS: {
|
32
19
|
const subscriptionDetails = action.response;
|
33
20
|
|
@@ -37,25 +24,9 @@ export default (state = initialState, action) => {
|
|
37
24
|
});
|
38
25
|
}
|
39
26
|
|
40
|
-
case PRODUCTS_SUCCESS: {
|
41
|
-
const enabledProducts = { enabledProducts: action.response };
|
42
|
-
|
43
|
-
return state.merge({
|
44
|
-
...enabledProducts,
|
45
|
-
loading: false,
|
46
|
-
});
|
47
|
-
}
|
48
|
-
|
49
27
|
case SUBSCRIPTION_DETAILS_FAILURE: {
|
50
28
|
return state.merge({
|
51
|
-
error: action.
|
52
|
-
loading: false,
|
53
|
-
});
|
54
|
-
}
|
55
|
-
|
56
|
-
case PRODUCTS_FAILURE: {
|
57
|
-
return state.merge({
|
58
|
-
error: action.payload.message,
|
29
|
+
error: action.error,
|
59
30
|
loading: false,
|
60
31
|
});
|
61
32
|
}
|
@@ -1,141 +1,58 @@
|
|
1
1
|
import React, { Component } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import {
|
4
|
-
import BreadcrumbsBar from 'foremanReact/components/BreadcrumbBar';
|
3
|
+
import { Grid, Row, Col } from 'patternfly-react';
|
5
4
|
import SubscriptionDetailInfo from './SubscriptionDetailInfo';
|
6
5
|
import SubscriptionDetailAssociations from './SubscriptionDetailAssociations';
|
7
6
|
import SubscriptionDetailProducts from './SubscriptionDetailProducts';
|
8
|
-
import SubscriptionDetailEnabledProducts from './SubscriptionDetailEnabledProducts';
|
9
7
|
import { LoadingState } from '../../../move_to_pf/LoadingState';
|
10
8
|
import { notify } from '../../../move_to_foreman/foreman_toast_notifications';
|
11
|
-
import api from '../../../services/api';
|
12
9
|
|
13
10
|
class SubscriptionDetails extends Component {
|
14
|
-
constructor() {
|
15
|
-
super();
|
16
|
-
this.handleBreadcrumbSwitcherItem = this.handleBreadcrumbSwitcherItem.bind(this);
|
17
|
-
}
|
18
11
|
componentDidMount() {
|
19
12
|
// eslint-disable-next-line react/prop-types
|
20
13
|
const routerParams = this.props.match.params;
|
21
14
|
this.props.loadSubscriptionDetails(parseInt(routerParams.id, 10));
|
22
|
-
this.props.loadProducts({
|
23
|
-
subscription_id: parseInt(routerParams.id, 10),
|
24
|
-
include_available_content: true,
|
25
|
-
enabled: true,
|
26
|
-
});
|
27
|
-
}
|
28
|
-
|
29
|
-
componentDidUpdate(prevProps) {
|
30
|
-
const routerParams = this.props.match.params;
|
31
|
-
if (routerParams.id !== prevProps.match.params.id) {
|
32
|
-
this.props.loadSubscriptionDetails(parseInt(routerParams.id, 10));
|
33
|
-
this.props.loadProducts({
|
34
|
-
subscription_id: parseInt(routerParams.id, 10),
|
35
|
-
include_available_content: true,
|
36
|
-
enabled: true,
|
37
|
-
});
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
handleBreadcrumbSwitcherItem(e, url) {
|
42
|
-
this.props.history.push(url);
|
43
|
-
e.preventDefault();
|
44
15
|
}
|
45
16
|
|
46
17
|
render() {
|
47
18
|
const { subscriptionDetails } = this.props;
|
48
19
|
|
49
|
-
|
50
|
-
const resource = {
|
51
|
-
nameField: 'name',
|
52
|
-
resourceUrl: api.getApiUrl('/subscriptions'),
|
53
|
-
switcherItemUrl: '/subscriptions/:id',
|
54
|
-
};
|
55
|
-
|
56
|
-
if (subscriptionDetails.error) {
|
57
|
-
notify({ message: subscriptionDetails.error });
|
58
|
-
}
|
20
|
+
if (subscriptionDetails.error) { notify({ message: subscriptionDetails.error }); }
|
59
21
|
|
60
22
|
return (
|
61
|
-
<
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
<NavItem eventKey={2}>
|
88
|
-
<div>{__('Enabled Products')}</div>
|
89
|
-
</NavItem>
|
90
|
-
</Nav>
|
91
|
-
<Grid bsClass="container-fluid">
|
92
|
-
<TabContent animation={false}>
|
93
|
-
<TabPane eventKey={1}>
|
94
|
-
<div>
|
95
|
-
<Row>
|
96
|
-
<Col sm={6}>
|
97
|
-
<SubscriptionDetailInfo
|
98
|
-
subscriptionDetails={subscriptionDetails}
|
99
|
-
/>
|
100
|
-
</Col>
|
101
|
-
<Col sm={6}>
|
102
|
-
<SubscriptionDetailAssociations
|
103
|
-
subscriptionDetails={subscriptionDetails}
|
104
|
-
/>
|
105
|
-
<SubscriptionDetailProducts
|
106
|
-
subscriptionDetails={subscriptionDetails}
|
107
|
-
/>
|
108
|
-
</Col>
|
109
|
-
</Row>
|
110
|
-
</div>
|
111
|
-
</TabPane>
|
112
|
-
|
113
|
-
<TabPane eventKey={2}>
|
114
|
-
<div>
|
115
|
-
<Row>
|
116
|
-
<Col sm={12}>
|
117
|
-
<SubscriptionDetailEnabledProducts
|
118
|
-
enabledProducts={subscriptionDetails.enabledProducts}
|
119
|
-
/>
|
120
|
-
</Col>
|
121
|
-
</Row>
|
122
|
-
</div>
|
123
|
-
</TabPane>
|
124
|
-
</TabContent>
|
125
|
-
</Grid>
|
126
|
-
</LoadingState>
|
127
|
-
</div>
|
128
|
-
</TabContainer>
|
129
|
-
</div>
|
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>
|
130
49
|
);
|
131
50
|
}
|
132
51
|
}
|
133
52
|
|
134
53
|
SubscriptionDetails.propTypes = {
|
135
54
|
loadSubscriptionDetails: PropTypes.func.isRequired,
|
136
|
-
loadProducts: PropTypes.func.isRequired,
|
137
55
|
subscriptionDetails: PropTypes.shape({}).isRequired,
|
138
|
-
history: PropTypes.shape({ push: PropTypes.func.isRequired }).isRequired,
|
139
56
|
};
|
140
57
|
|
141
58
|
export default SubscriptionDetails;
|