foreman_scc_manager 1.8.19 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -10
- data/app/controllers/api/v2/scc_accounts_controller.rb +48 -5
- data/app/controllers/api/v2/scc_products_controller.rb +1 -1
- data/app/controllers/scc_accounts_controller.rb +47 -0
- data/app/lib/actions/scc_manager/subscribe_product.rb +61 -19
- data/app/models/scc_account.rb +4 -3
- data/app/models/scc_katello_repository.rb +4 -0
- data/app/models/scc_product.rb +7 -1
- data/app/models/scc_repository.rb +12 -4
- data/app/views/scc_accounts/show.html.erb +7 -51
- data/config/routes.rb +1 -0
- data/db/migrate/20220425132605_add_scc_katello_repository_relation.rb +10 -0
- data/db/migrate/20220429100843_remove_root_repository_id_from_scc_repository.rb +6 -0
- data/db/migrate/20220429102717_populate_scc_katello_repositories.rb +21 -0
- data/db/migrate/20220513132652_populate_upstream_authentication_token.rb +23 -0
- data/db/migrate/20220531120722_add_product_category_to_scc_products.rb +5 -0
- data/lib/foreman_scc_manager/engine.rb +1 -1
- data/lib/foreman_scc_manager/version.rb +1 -1
- data/lib/tasks/republish_repositories.rake +13 -0
- data/lib/tasks/setup_authentication_token.rake +27 -0
- data/package.json +54 -0
- data/test/controllers/scc_accounts_controller_test.rb +6 -0
- data/test/fixtures/models/katello_root_repositories.yml +44 -0
- data/test/fixtures/models/scc_repositories.yml +34 -0
- data/test/support/fixtures_support.rb +3 -1
- data/webpack/components/SCCProductPage/EmptySccProducts.js +46 -0
- data/webpack/components/SCCProductPage/SCCProductPage.js +96 -0
- data/webpack/components/SCCProductPage/SCCProductPageActions.js +27 -0
- data/webpack/components/SCCProductPage/SCCProductPageConstants.js +5 -0
- data/webpack/components/SCCProductPage/SCCProductPageReducer.js +34 -0
- data/webpack/components/SCCProductPage/SCCProductPageSelectors.js +7 -0
- data/webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCGenericPicker/index.js +80 -0
- data/webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCTreePicker/components/SCCRepoPicker/index.js +174 -0
- data/webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCTreePicker/components/SCCRepoPicker/styles.scss +3 -0
- data/webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCTreePicker/index.js +303 -0
- data/webpack/components/SCCProductPage/components/SCCProductPicker/index.js +235 -0
- data/webpack/components/SCCProductPage/components/SCCProductPicker/styles.scss +10 -0
- data/webpack/components/SCCProductPage/components/SCCProductPickerModal/index.js +81 -0
- data/webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/index.js +113 -0
- data/webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/styles.scss +14 -0
- data/webpack/components/SCCProductPage/components/SCCProductView/index.js +236 -0
- data/webpack/components/SCCProductPage/components/common/SCCGenericExpander/index.js +58 -0
- data/webpack/components/SCCProductPage/components/common/SCCProductTreeExpander/index.js +21 -0
- data/webpack/components/SCCProductPage/components/common/SCCSubscribedProductsExpander/index.js +21 -0
- data/webpack/components/SCCProductPage/index.js +18 -0
- data/webpack/components/SCCProductPage/sccProductPage.scss +8 -0
- data/webpack/index.js +11 -0
- data/webpack/reducer.js +7 -0
- metadata +48 -14
data/webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/index.js
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
import { foremanUrl } from 'foremanReact/common/helpers';
|
2
|
+
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
|
3
|
+
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import React, { useState } from 'react';
|
6
|
+
import {
|
7
|
+
Dropdown,
|
8
|
+
DropdownItem,
|
9
|
+
BadgeToggle,
|
10
|
+
Tooltip,
|
11
|
+
} from '@patternfly/react-core';
|
12
|
+
import { Icon } from 'patternfly-react';
|
13
|
+
import { BrowserRouter, Link } from 'react-router-dom';
|
14
|
+
|
15
|
+
import './styles.scss';
|
16
|
+
|
17
|
+
const createKatelloRepoLink = (repo, sccProductId) => {
|
18
|
+
const url = foremanUrl(
|
19
|
+
`/products/${sccProductId}/repositories/${repo.katello_root_repository_id}`
|
20
|
+
);
|
21
|
+
return (
|
22
|
+
<Tooltip content={__('Go to Repository page')}>
|
23
|
+
<BrowserRouter>
|
24
|
+
<Link to={url} target="_blank">
|
25
|
+
{repo.name}
|
26
|
+
</Link>
|
27
|
+
</BrowserRouter>
|
28
|
+
</Tooltip>
|
29
|
+
);
|
30
|
+
};
|
31
|
+
|
32
|
+
const createRepoDropDownItem = (repo, sccProductId) => (
|
33
|
+
<DropdownItem
|
34
|
+
key={repo.id}
|
35
|
+
component="button"
|
36
|
+
icon={
|
37
|
+
repo.subscription_valid ? (
|
38
|
+
repo.katello_root_repository_id !== null ? (
|
39
|
+
<Icon name="check" type="fa" />
|
40
|
+
) : (
|
41
|
+
<Tooltip content={__('Repository not imported')}>
|
42
|
+
<Icon name="ban" type="fa" />
|
43
|
+
</Tooltip>
|
44
|
+
)
|
45
|
+
) : (
|
46
|
+
<Tooltip content={__('Please check your SUSE subscription')}>
|
47
|
+
<Icon name="warning-triangle-o" type="pf" size="2x" />
|
48
|
+
</Tooltip>
|
49
|
+
)
|
50
|
+
}
|
51
|
+
>
|
52
|
+
{repo.katello_root_repository_id !== null
|
53
|
+
? createKatelloRepoLink(repo, sccProductId)
|
54
|
+
: repo.name}
|
55
|
+
</DropdownItem>
|
56
|
+
);
|
57
|
+
|
58
|
+
const SCCRepoView = ({ sccRepos, sccProductId }) => {
|
59
|
+
const [isOpen, setIsOpen] = useState(false);
|
60
|
+
const onToggle = (toggle) => {
|
61
|
+
setIsOpen(toggle);
|
62
|
+
};
|
63
|
+
|
64
|
+
const onFocus = () => {
|
65
|
+
const element = document.getElementById(
|
66
|
+
sprintf('scc-repo-show-toggle-id-%s', sccProductId)
|
67
|
+
);
|
68
|
+
element.focus();
|
69
|
+
};
|
70
|
+
|
71
|
+
const onSelect = (event) => {
|
72
|
+
setIsOpen(!isOpen);
|
73
|
+
onFocus();
|
74
|
+
};
|
75
|
+
|
76
|
+
const dropdownItems = sccRepos.map((repo) =>
|
77
|
+
createRepoDropDownItem(repo, sccProductId)
|
78
|
+
);
|
79
|
+
|
80
|
+
return (
|
81
|
+
<Dropdown
|
82
|
+
onSelect={onSelect}
|
83
|
+
toggle={
|
84
|
+
<BadgeToggle
|
85
|
+
id={sprintf('scc-repo-show-toggle-id-%s', sccProductId)}
|
86
|
+
key={sprintf('scc-repo-show-toggle-id-%s', sccProductId)}
|
87
|
+
onToggle={onToggle}
|
88
|
+
>
|
89
|
+
{sprintf(
|
90
|
+
__('Repositories (%s/%s)'),
|
91
|
+
sccRepos.filter((r) => r.katello_root_repository_id !== null)
|
92
|
+
.length,
|
93
|
+
sccRepos.length
|
94
|
+
)}
|
95
|
+
</BadgeToggle>
|
96
|
+
}
|
97
|
+
isOpen={isOpen}
|
98
|
+
dropdownItems={dropdownItems}
|
99
|
+
/>
|
100
|
+
);
|
101
|
+
};
|
102
|
+
|
103
|
+
SCCRepoView.propTypes = {
|
104
|
+
sccRepos: PropTypes.array,
|
105
|
+
sccProductId: PropTypes.number,
|
106
|
+
};
|
107
|
+
|
108
|
+
SCCRepoView.defaultProps = {
|
109
|
+
sccRepos: undefined,
|
110
|
+
sccProductId: undefined,
|
111
|
+
};
|
112
|
+
|
113
|
+
export default SCCRepoView;
|
data/webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/styles.scss
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
.pf-c-button.pf-m-plain {
|
2
|
+
--pf-c-button--PaddingTop: var(--pf-global--spacer--xs);
|
3
|
+
--pf-c-button--PaddingRight: var(--pf-global--spacer--sm);
|
4
|
+
--pf-c-button--PaddingBottom: var(--pf-global--spacer--xs);
|
5
|
+
--pf-c-button--PaddingLeft: var(--pf-global--spacer--sm);
|
6
|
+
}
|
7
|
+
|
8
|
+
.pf-c-dropdown__toggle::before {
|
9
|
+
--pf-c-button--PaddingTop: var(--pf-global--spacer--xs);
|
10
|
+
--pf-c-button--PaddingRight: var(--pf-global--spacer--xs);
|
11
|
+
--pf-c-button--PaddingBottom: var(--pf-global--spacer--xs);
|
12
|
+
--pf-c-button--PaddingLeft: var(--pf-global--spacer--xs);
|
13
|
+
}
|
14
|
+
|
@@ -0,0 +1,236 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import { Icon } from 'patternfly-react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
|
5
|
+
import { foremanUrl } from 'foremanReact/common/helpers';
|
6
|
+
import {
|
7
|
+
TreeView,
|
8
|
+
Button,
|
9
|
+
Card,
|
10
|
+
CardTitle,
|
11
|
+
CardBody,
|
12
|
+
Tooltip,
|
13
|
+
Flex,
|
14
|
+
FlexItem,
|
15
|
+
} from '@patternfly/react-core';
|
16
|
+
import { BrowserRouter, Link } from 'react-router-dom';
|
17
|
+
import { cloneDeep, filter, clone } from 'lodash';
|
18
|
+
import SCCProductTreeExpander from '../common/SCCProductTreeExpander';
|
19
|
+
import SCCSubscribedProductsExpander from '../common/SCCSubscribedProductsExpander';
|
20
|
+
import SCCRepoView from './components/SCCRepoView';
|
21
|
+
|
22
|
+
const addCheckBoxToTree = (tree) => {
|
23
|
+
const checkProps = {};
|
24
|
+
checkProps.checked = tree.product_id !== null;
|
25
|
+
checkProps.disabled = true;
|
26
|
+
tree.checkProps = checkProps;
|
27
|
+
};
|
28
|
+
|
29
|
+
const addKatelloLinkToTree = (tree) => {
|
30
|
+
const url = foremanUrl(`/products/${tree.product_id}`);
|
31
|
+
// Link component needs to be wrapped in a Router
|
32
|
+
tree.customBadgeContent.push(
|
33
|
+
<BrowserRouter>
|
34
|
+
<Link to={url} target="_blank">
|
35
|
+
<Tooltip content={__('Go to Product page')}>
|
36
|
+
<Button variant="plain" id="tt-ref">
|
37
|
+
<Icon name="external-link" type="fa" />
|
38
|
+
</Button>
|
39
|
+
</Tooltip>
|
40
|
+
</Link>
|
41
|
+
</BrowserRouter>
|
42
|
+
);
|
43
|
+
return tree;
|
44
|
+
};
|
45
|
+
|
46
|
+
const addEditIcon = (tree, editProductTree) => {
|
47
|
+
tree.customBadgeContent.push(
|
48
|
+
<Tooltip content={__('Add more sub products to Product tree')}>
|
49
|
+
<Button
|
50
|
+
variant="plain"
|
51
|
+
id={tree.id.toString()}
|
52
|
+
onClick={(evt) => editProductTree(evt, tree.id)}
|
53
|
+
>
|
54
|
+
<Icon name="edit" type="pf" size="2x" />
|
55
|
+
</Button>
|
56
|
+
</Tooltip>
|
57
|
+
);
|
58
|
+
|
59
|
+
return tree;
|
60
|
+
};
|
61
|
+
|
62
|
+
const addReposToTree = (tree) => {
|
63
|
+
tree.customBadgeContent.push(
|
64
|
+
<Tooltip content={__('Show currently added repositories')}>
|
65
|
+
<SCCRepoView
|
66
|
+
sccRepos={tree.scc_repositories}
|
67
|
+
sccProductId={tree.product_id}
|
68
|
+
/>
|
69
|
+
</Tooltip>
|
70
|
+
);
|
71
|
+
return tree;
|
72
|
+
};
|
73
|
+
|
74
|
+
const addValidationStatusToTree = (tree) => {
|
75
|
+
tree.customBadgeContent.push(
|
76
|
+
<Tooltip content={__('Please check your SUSE subscription')}>
|
77
|
+
<Button variant="plain">
|
78
|
+
<Icon name="warning-triangle-o" type="pf" size="2x" />
|
79
|
+
</Button>
|
80
|
+
</Tooltip>
|
81
|
+
);
|
82
|
+
return tree;
|
83
|
+
};
|
84
|
+
|
85
|
+
const setupTreeViewListItem = (tree, isRoot, editProductTree) => {
|
86
|
+
tree.key = 'view'.concat(tree.id.toString());
|
87
|
+
tree.customBadgeContent = [];
|
88
|
+
if (!tree.subscription_valid) addValidationStatusToTree(tree);
|
89
|
+
addReposToTree(tree);
|
90
|
+
addCheckBoxToTree(tree);
|
91
|
+
if (tree.product_id !== null) {
|
92
|
+
addKatelloLinkToTree(tree);
|
93
|
+
if (isRoot) {
|
94
|
+
addEditIcon(tree, editProductTree);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
if ('children' in tree) {
|
98
|
+
tree.children = tree.children.map((c) =>
|
99
|
+
setupTreeViewListItem(c, false, editProductTree)
|
100
|
+
);
|
101
|
+
}
|
102
|
+
return tree;
|
103
|
+
};
|
104
|
+
|
105
|
+
const filterDeep = (tree) => {
|
106
|
+
if (tree.product_id !== null) {
|
107
|
+
const filtered = clone(tree);
|
108
|
+
if ('children' in tree) {
|
109
|
+
filtered.children = filter(
|
110
|
+
tree.children,
|
111
|
+
(child) => child.product_id !== null
|
112
|
+
).map(filterDeep);
|
113
|
+
if (filtered.children.length === 0) {
|
114
|
+
delete filtered.children;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
return filtered;
|
118
|
+
}
|
119
|
+
return null;
|
120
|
+
};
|
121
|
+
|
122
|
+
const SCCProductView = ({
|
123
|
+
sccProducts,
|
124
|
+
editProductTreeGlobal,
|
125
|
+
subscriptionTaskId,
|
126
|
+
}) => {
|
127
|
+
const editProductTree = (evt, productId) => {
|
128
|
+
editProductTreeGlobal(productId);
|
129
|
+
};
|
130
|
+
const sccProductsClone = cloneDeep(sccProducts);
|
131
|
+
// wrap actual iterator function into anonymous function to pass extra parameters
|
132
|
+
const [allProducts, setAllProducts] = useState(
|
133
|
+
sccProductsClone.map((tree) =>
|
134
|
+
setupTreeViewListItem(tree, true, editProductTree)
|
135
|
+
)
|
136
|
+
);
|
137
|
+
const [subscribedProducts, setSubscribedProducts] = useState(null);
|
138
|
+
const [showAll, setShowAll] = useState(true);
|
139
|
+
const [expandAll, setExpandAll] = useState();
|
140
|
+
|
141
|
+
const showSubscribed = () => {
|
142
|
+
if (subscribedProducts === null) {
|
143
|
+
const test = allProducts.map(filterDeep);
|
144
|
+
setSubscribedProducts(test);
|
145
|
+
}
|
146
|
+
};
|
147
|
+
|
148
|
+
const setShowAllFromChild = (showAllFromChild) => {
|
149
|
+
if (!showAllFromChild) {
|
150
|
+
showSubscribed();
|
151
|
+
}
|
152
|
+
setShowAll(showAllFromChild);
|
153
|
+
};
|
154
|
+
|
155
|
+
const setExpandAllFromChild = (expandAllFromChild) => {
|
156
|
+
setExpandAll(expandAllFromChild);
|
157
|
+
};
|
158
|
+
|
159
|
+
return (
|
160
|
+
<Card>
|
161
|
+
<CardTitle>{__('Selected SUSE Products')}</CardTitle>
|
162
|
+
{sccProducts.length > 0 && (
|
163
|
+
<CardBody>
|
164
|
+
<Flex>
|
165
|
+
<SCCProductTreeExpander
|
166
|
+
setExpandAllInParent={setExpandAllFromChild}
|
167
|
+
/>
|
168
|
+
<SCCSubscribedProductsExpander
|
169
|
+
setExpandAllInParent={setShowAllFromChild}
|
170
|
+
/>
|
171
|
+
</Flex>
|
172
|
+
<Flex>
|
173
|
+
<TreeView
|
174
|
+
data={showAll ? allProducts : subscribedProducts}
|
175
|
+
allExpanded={expandAll}
|
176
|
+
hasChecks
|
177
|
+
hasBadges
|
178
|
+
hasGuides
|
179
|
+
/>
|
180
|
+
</Flex>
|
181
|
+
</CardBody>
|
182
|
+
)}
|
183
|
+
{sccProducts.length === 0 && (
|
184
|
+
<CardBody>
|
185
|
+
{__(
|
186
|
+
'You currently have no SUSE products selected. Search and add SUSE products in the section below.'
|
187
|
+
)}
|
188
|
+
</CardBody>
|
189
|
+
)}
|
190
|
+
<Flex>
|
191
|
+
{sccProducts.length > 0 && (
|
192
|
+
<FlexItem>
|
193
|
+
<Button variant="link">
|
194
|
+
<BrowserRouter>
|
195
|
+
<Link
|
196
|
+
to="/foreman_tasks/tasks/?search=Subscribe+SCC+Product"
|
197
|
+
target="_blank"
|
198
|
+
>
|
199
|
+
{__('Show all subscription tasks')}
|
200
|
+
</Link>
|
201
|
+
</BrowserRouter>
|
202
|
+
</Button>
|
203
|
+
</FlexItem>
|
204
|
+
)}
|
205
|
+
{subscriptionTaskId !== '' && (
|
206
|
+
<FlexItem>
|
207
|
+
<Button variant="link">
|
208
|
+
<BrowserRouter>
|
209
|
+
<Link
|
210
|
+
to={sprintf('/foreman_tasks/tasks/%s', subscriptionTaskId)}
|
211
|
+
target="_blank"
|
212
|
+
>
|
213
|
+
{__('Show last product subscription task')}
|
214
|
+
</Link>
|
215
|
+
</BrowserRouter>
|
216
|
+
</Button>
|
217
|
+
</FlexItem>
|
218
|
+
)}
|
219
|
+
</Flex>
|
220
|
+
</Card>
|
221
|
+
);
|
222
|
+
};
|
223
|
+
|
224
|
+
SCCProductView.propTypes = {
|
225
|
+
sccProducts: PropTypes.array,
|
226
|
+
editProductTreeGlobal: PropTypes.func,
|
227
|
+
subscriptionTaskId: PropTypes.string,
|
228
|
+
};
|
229
|
+
|
230
|
+
SCCProductView.defaultProps = {
|
231
|
+
sccProducts: undefined,
|
232
|
+
editProductTreeGlobal: undefined,
|
233
|
+
subscriptionTaskId: '',
|
234
|
+
};
|
235
|
+
|
236
|
+
export default SCCProductView;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Flex, FlexItem, Select, SelectOption } from '@patternfly/react-core';
|
4
|
+
|
5
|
+
const SCCGenericExpander = ({
|
6
|
+
setInParent,
|
7
|
+
selectOptionOpen,
|
8
|
+
selectOptionClose,
|
9
|
+
initLabel,
|
10
|
+
}) => {
|
11
|
+
const [label, setLabel] = useState(initLabel);
|
12
|
+
const [isOpen, setIsOpen] = useState(false);
|
13
|
+
|
14
|
+
const options = [
|
15
|
+
<SelectOption key={0} value={selectOptionOpen} />,
|
16
|
+
<SelectOption key={1} value={selectOptionClose} />,
|
17
|
+
];
|
18
|
+
|
19
|
+
const onSelect = (evt, selection) => {
|
20
|
+
if (selection === selectOptionOpen) {
|
21
|
+
setInParent(true);
|
22
|
+
} else {
|
23
|
+
setInParent(false);
|
24
|
+
}
|
25
|
+
setLabel(selection);
|
26
|
+
setIsOpen(false);
|
27
|
+
};
|
28
|
+
|
29
|
+
const onToggle = (isOpenSelect) => {
|
30
|
+
setIsOpen(isOpenSelect);
|
31
|
+
};
|
32
|
+
|
33
|
+
return (
|
34
|
+
<Flex>
|
35
|
+
<FlexItem>
|
36
|
+
<Select
|
37
|
+
onToggle={onToggle}
|
38
|
+
onSelect={onSelect}
|
39
|
+
selections={label}
|
40
|
+
isOpen={isOpen}
|
41
|
+
>
|
42
|
+
{options}
|
43
|
+
</Select>
|
44
|
+
</FlexItem>
|
45
|
+
</Flex>
|
46
|
+
);
|
47
|
+
};
|
48
|
+
|
49
|
+
SCCGenericExpander.propTypes = {
|
50
|
+
setInParent: PropTypes.func.isRequired,
|
51
|
+
selectOptionOpen: PropTypes.string.isRequired,
|
52
|
+
selectOptionClose: PropTypes.string.isRequired,
|
53
|
+
initLabel: PropTypes.string.isRequired,
|
54
|
+
};
|
55
|
+
|
56
|
+
SCCGenericExpander.deaultProps = {};
|
57
|
+
|
58
|
+
export default SCCGenericExpander;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
+
import SCCGenericExpander from '../SCCGenericExpander';
|
5
|
+
|
6
|
+
const SCCProductTreeExpander = ({ setExpandAllInParent }) => (
|
7
|
+
<SCCGenericExpander
|
8
|
+
setInParent={setExpandAllInParent}
|
9
|
+
selectOptionOpen={__('Expand products')}
|
10
|
+
selectOptionClose={__('Collapse products')}
|
11
|
+
initLabel={__('Collapse/Expand')}
|
12
|
+
/>
|
13
|
+
);
|
14
|
+
|
15
|
+
SCCProductTreeExpander.propTypes = {
|
16
|
+
setExpandAllInParent: PropTypes.func.isRequired,
|
17
|
+
};
|
18
|
+
|
19
|
+
SCCProductTreeExpander.defaultProps = {};
|
20
|
+
|
21
|
+
export default SCCProductTreeExpander;
|
data/webpack/components/SCCProductPage/components/common/SCCSubscribedProductsExpander/index.js
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
+
import SCCGenericExpander from '../SCCGenericExpander';
|
5
|
+
|
6
|
+
const SCCSubscribedProductsExpander = ({ setExpandAllInParent }) => (
|
7
|
+
<SCCGenericExpander
|
8
|
+
setInParent={setExpandAllInParent}
|
9
|
+
selectOptionOpen={__('Show all products')}
|
10
|
+
selectOptionClose={__('Show only subscribed products')}
|
11
|
+
initLabel={__('Show/Hide unsubscribed')}
|
12
|
+
/>
|
13
|
+
);
|
14
|
+
|
15
|
+
SCCSubscribedProductsExpander.propTypes = {
|
16
|
+
setExpandAllInParent: PropTypes.func.isRequired,
|
17
|
+
};
|
18
|
+
|
19
|
+
SCCSubscribedProductsExpander.defaultProps = {};
|
20
|
+
|
21
|
+
export default SCCSubscribedProductsExpander;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { bindActionCreators } from 'redux';
|
2
|
+
import { connect } from 'react-redux';
|
3
|
+
|
4
|
+
import * as actions from './SCCProductPageActions';
|
5
|
+
import SCCProductPage from './SCCProductPage';
|
6
|
+
import * as Selector from './SCCProductPageSelectors';
|
7
|
+
|
8
|
+
// map state to props
|
9
|
+
const mapStateToProps = (state) => ({
|
10
|
+
scc_products: Selector.selectSCCProducts(state),
|
11
|
+
scc_account_id: Selector.selectSCCAccountId(state),
|
12
|
+
});
|
13
|
+
|
14
|
+
// map action dispatchers to props
|
15
|
+
const mapDispatchToProps = (dispatch) => bindActionCreators(actions, dispatch);
|
16
|
+
|
17
|
+
// export connected component
|
18
|
+
export default connect(mapStateToProps, mapDispatchToProps)(SCCProductPage);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
@import '~@theforeman/vendor/scss/variables';
|
2
|
+
|
3
|
+
.pf-c-tile {
|
4
|
+
--pf-c-tile--PaddingTop: var(--pf-global--spacer--xs);
|
5
|
+
--pf-c-tile--PaddingRight: var(--pf-global--spacer--xs);
|
6
|
+
--pf-c-tile--PaddingBottom: var(--pf-global--spacer--xs);
|
7
|
+
--pf-c-tile--PaddingLeft: var(--pf-global--spacer--xs);
|
8
|
+
}
|
data/webpack/index.js
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import componentRegistry from 'foremanReact/components/componentRegistry';
|
2
|
+
import injectReducer from 'foremanReact/redux/reducers/registerReducer';
|
3
|
+
import SCCProductPage from './components/SCCProductPage';
|
4
|
+
import reducer from './reducer';
|
5
|
+
|
6
|
+
componentRegistry.register({
|
7
|
+
name: 'SCCProductPage',
|
8
|
+
type: SCCProductPage,
|
9
|
+
});
|
10
|
+
|
11
|
+
injectReducer('foremanSccManager', reducer);
|
data/webpack/reducer.js
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_scc_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- app/models/scc_account.rb
|
129
129
|
- app/models/scc_account_sync_plan_task_group.rb
|
130
130
|
- app/models/scc_extending.rb
|
131
|
+
- app/models/scc_katello_repository.rb
|
131
132
|
- app/models/scc_product.rb
|
132
133
|
- app/models/scc_repository.rb
|
133
134
|
- app/views/api/v2/scc_accounts/base.json.rabl
|
@@ -165,10 +166,17 @@ files:
|
|
165
166
|
- db/migrate/20210210104407_add_root_repository_id_to_scc_repository.rb
|
166
167
|
- db/migrate/20210224095050_connect_katello_root_repository_to_scc_repository.rb
|
167
168
|
- db/migrate/20210713092440_add_permissions.rb
|
169
|
+
- db/migrate/20220425132605_add_scc_katello_repository_relation.rb
|
170
|
+
- db/migrate/20220429100843_remove_root_repository_id_from_scc_repository.rb
|
171
|
+
- db/migrate/20220429102717_populate_scc_katello_repositories.rb
|
172
|
+
- db/migrate/20220513132652_populate_upstream_authentication_token.rb
|
173
|
+
- db/migrate/20220531120722_add_product_category_to_scc_products.rb
|
168
174
|
- lib/foreman_scc_manager.rb
|
169
175
|
- lib/foreman_scc_manager/engine.rb
|
170
176
|
- lib/foreman_scc_manager/version.rb
|
177
|
+
- lib/tasks/republish_repositories.rake
|
171
178
|
- lib/tasks/rubocop.rake
|
179
|
+
- lib/tasks/setup_authentication_token.rake
|
172
180
|
- lib/tasks/test.rake
|
173
181
|
- locale/Makefile
|
174
182
|
- locale/action_names.rb
|
@@ -178,6 +186,7 @@ files:
|
|
178
186
|
- locale/en/foreman_scc_manager.po
|
179
187
|
- locale/foreman_scc_manager.pot
|
180
188
|
- locale/gemspec.rb
|
189
|
+
- package.json
|
181
190
|
- test/actions/sync_test.rb
|
182
191
|
- test/controllers/api/v2/scc_accounts_test.rb
|
183
192
|
- test/controllers/api/v2/scc_products_test.rb
|
@@ -188,6 +197,7 @@ files:
|
|
188
197
|
- test/fixtures/files/data_products_page2.json
|
189
198
|
- test/fixtures/files/data_repositories.json
|
190
199
|
- test/fixtures/files/data_subscriptions.json
|
200
|
+
- test/fixtures/models/katello_root_repositories.yml
|
191
201
|
- test/fixtures/models/scc_accounts.yml
|
192
202
|
- test/fixtures/models/scc_products.yml
|
193
203
|
- test/fixtures/models/scc_repositories.yml
|
@@ -196,6 +206,29 @@ files:
|
|
196
206
|
- test/support/fixtures_support.rb
|
197
207
|
- test/test_plugin_helper.rb
|
198
208
|
- test/unit/foreman_scc_manager_test.rb
|
209
|
+
- webpack/components/SCCProductPage/EmptySccProducts.js
|
210
|
+
- webpack/components/SCCProductPage/SCCProductPage.js
|
211
|
+
- webpack/components/SCCProductPage/SCCProductPageActions.js
|
212
|
+
- webpack/components/SCCProductPage/SCCProductPageConstants.js
|
213
|
+
- webpack/components/SCCProductPage/SCCProductPageReducer.js
|
214
|
+
- webpack/components/SCCProductPage/SCCProductPageSelectors.js
|
215
|
+
- webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCGenericPicker/index.js
|
216
|
+
- webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCTreePicker/components/SCCRepoPicker/index.js
|
217
|
+
- webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCTreePicker/components/SCCRepoPicker/styles.scss
|
218
|
+
- webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCTreePicker/index.js
|
219
|
+
- webpack/components/SCCProductPage/components/SCCProductPicker/index.js
|
220
|
+
- webpack/components/SCCProductPage/components/SCCProductPicker/styles.scss
|
221
|
+
- webpack/components/SCCProductPage/components/SCCProductPickerModal/index.js
|
222
|
+
- webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/index.js
|
223
|
+
- webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/styles.scss
|
224
|
+
- webpack/components/SCCProductPage/components/SCCProductView/index.js
|
225
|
+
- webpack/components/SCCProductPage/components/common/SCCGenericExpander/index.js
|
226
|
+
- webpack/components/SCCProductPage/components/common/SCCProductTreeExpander/index.js
|
227
|
+
- webpack/components/SCCProductPage/components/common/SCCSubscribedProductsExpander/index.js
|
228
|
+
- webpack/components/SCCProductPage/index.js
|
229
|
+
- webpack/components/SCCProductPage/sccProductPage.scss
|
230
|
+
- webpack/index.js
|
231
|
+
- webpack/reducer.js
|
199
232
|
homepage: https://www.orcharhino.com/
|
200
233
|
licenses:
|
201
234
|
- GPL-3.0
|
@@ -215,26 +248,27 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
248
|
- !ruby/object:Gem::Version
|
216
249
|
version: '0'
|
217
250
|
requirements: []
|
218
|
-
rubygems_version: 3.
|
251
|
+
rubygems_version: 3.2.5
|
219
252
|
signing_key:
|
220
253
|
specification_version: 4
|
221
254
|
summary: Suse Customer Center plugin for Foreman
|
222
255
|
test_files:
|
223
|
-
- test/support/fixtures_support.rb
|
224
|
-
- test/unit/foreman_scc_manager_test.rb
|
225
|
-
- test/actions/sync_test.rb
|
226
|
-
- test/test_plugin_helper.rb
|
227
|
-
- test/factories/foreman_scc_manager_factories.rb
|
228
256
|
- test/models/scc_product_test.rb
|
229
257
|
- test/models/scc_account_test.rb
|
230
|
-
- test/
|
231
|
-
- test/
|
258
|
+
- test/controllers/scc_accounts_controller_test.rb
|
259
|
+
- test/controllers/api/v2/scc_accounts_test.rb
|
260
|
+
- test/controllers/api/v2/scc_products_test.rb
|
261
|
+
- test/fixtures/models/katello_root_repositories.yml
|
232
262
|
- test/fixtures/models/scc_accounts.yml
|
233
263
|
- test/fixtures/models/scc_products.yml
|
264
|
+
- test/fixtures/models/scc_repositories.yml
|
265
|
+
- test/fixtures/files/data_products_page2.json
|
234
266
|
- test/fixtures/files/data_products_page1.json
|
235
267
|
- test/fixtures/files/data_subscriptions.json
|
236
|
-
- test/fixtures/files/data_products_page2.json
|
237
268
|
- test/fixtures/files/data_repositories.json
|
238
|
-
- test/
|
239
|
-
- test/
|
240
|
-
- test/
|
269
|
+
- test/features/sync_test.rb
|
270
|
+
- test/unit/foreman_scc_manager_test.rb
|
271
|
+
- test/actions/sync_test.rb
|
272
|
+
- test/support/fixtures_support.rb
|
273
|
+
- test/factories/foreman_scc_manager_factories.rb
|
274
|
+
- test/test_plugin_helper.rb
|