foreman_scc_manager 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/foreman_scc_manager/version.rb +1 -1
- data/package.json +2 -1
- data/test/controllers/scc_accounts_controller_test.rb +1 -1
- data/webpack/components/SCCProductPage/SCCProductPage.js +2 -2
- data/webpack/components/SCCProductPage/components/SCCProductPicker/index.js +1 -1
- data/webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/index.js +2 -2
- data/webpack/components/SCCProductPage/components/SCCProductView/index.js +1 -1
- data/webpack/components/SCCProductPage/components/common/SCCGenericExpander/SCCGenericExpander.test.js +47 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 669ea1e4a29dacb7bb510a0ef50d72565e318210e4234bf91835030cccb68e09
|
4
|
+
data.tar.gz: 4e93f9ad2068857d52192850a0ec32096d6b27a2bbda17c47e8b375f75244277
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c50116ce7db1bfe958e41a27ebc0e14a96355b21ecbab1e0449b297a87562030043f2fe5750be8a15151a9e1df8e9970f6b4a8caa607f7e53e713443f2e507ed
|
7
|
+
data.tar.gz: 2a38bafa3ecf2ba0340dbb2fdd074971ba9e24f47708e67531833359f63175063bb00044136ca569c8f51c15c6f9f23ebdbe95ffcc988e9765b6b222ea1c8880
|
data/package.json
CHANGED
@@ -19,7 +19,7 @@ class SccAccountsControllerTest < ActionController::TestCase
|
|
19
19
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
20
20
|
'Authorization' => auth,
|
21
21
|
'Host' => host,
|
22
|
-
'User-Agent' =>
|
22
|
+
'User-Agent' => /rest-client\/2.1.0 \(linux(-gnu)? x86_64\) ruby\/#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}/,
|
23
23
|
}
|
24
24
|
)
|
25
25
|
.to_return(status: 200, body: '', headers: {})
|
@@ -5,7 +5,7 @@ import { useDispatch } from 'react-redux';
|
|
5
5
|
import { translate as __ } from 'foremanReact/common/I18n';
|
6
6
|
import { useForemanModal } from 'foremanReact/components/ForemanModal/ForemanModalHooks';
|
7
7
|
import SCCProductView from './components/SCCProductView';
|
8
|
-
import EmptySccProducts from './EmptySccProducts';
|
8
|
+
import { EmptySccProducts } from './EmptySccProducts';
|
9
9
|
import SCCProductPicker from './components/SCCProductPicker';
|
10
10
|
import SCCProductPickerModal from './components/SCCProductPickerModal';
|
11
11
|
import { SCCPRODUCTPAGE_SUMMARY_MODAL_ID } from './SCCProductPageConstants';
|
@@ -26,7 +26,7 @@ const SCCProductPage = ({
|
|
26
26
|
setProductToEdit(productId);
|
27
27
|
};
|
28
28
|
|
29
|
-
const { setModalOpen
|
29
|
+
const { setModalOpen } = useForemanModal({
|
30
30
|
id: SCCPRODUCTPAGE_SUMMARY_MODAL_ID,
|
31
31
|
});
|
32
32
|
|
@@ -50,7 +50,7 @@ const SCCProductPicker = ({
|
|
50
50
|
editProductId,
|
51
51
|
handleSubscribeCallback,
|
52
52
|
}) => {
|
53
|
-
const [productItems
|
53
|
+
const [productItems] = useState(
|
54
54
|
uniq(sccProducts.map((p) => p.product_category))
|
55
55
|
);
|
56
56
|
const [selectedProduct, setSelectedProduct] = useState('');
|
data/webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/index.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint no-nested-ternary: "off" */
|
1
2
|
import { foremanUrl } from 'foremanReact/common/helpers';
|
2
3
|
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
|
3
4
|
|
@@ -88,8 +89,7 @@ const SCCRepoView = ({ sccRepos, sccProductId }) => {
|
|
88
89
|
>
|
89
90
|
{sprintf(
|
90
91
|
__('Repositories (%s/%s)'),
|
91
|
-
sccRepos.filter((r) => r.katello_repository_id !== null)
|
92
|
-
.length,
|
92
|
+
sccRepos.filter((r) => r.katello_repository_id !== null).length,
|
93
93
|
sccRepos.length
|
94
94
|
)}
|
95
95
|
</BadgeToggle>
|
@@ -129,7 +129,7 @@ const SCCProductView = ({
|
|
129
129
|
};
|
130
130
|
const sccProductsClone = cloneDeep(sccProducts);
|
131
131
|
// wrap actual iterator function into anonymous function to pass extra parameters
|
132
|
-
const [allProducts
|
132
|
+
const [allProducts] = useState(
|
133
133
|
sccProductsClone.map((tree) =>
|
134
134
|
setupTreeViewListItem(tree, true, editProductTree)
|
135
135
|
)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
/* eslint-disable promise/prefer-await-to-then */
|
2
|
+
// Configure Enzyme
|
3
|
+
import { mount, shallow } from '@theforeman/test';
|
4
|
+
import React from 'react';
|
5
|
+
import SCCGenericExpander from './index';
|
6
|
+
|
7
|
+
describe('SCCGenericExpander', () => {
|
8
|
+
it('renders default properties', () => {
|
9
|
+
const wrapper = mount(
|
10
|
+
<SCCGenericExpander
|
11
|
+
setInParent={() => {}}
|
12
|
+
selectOptionOpen="open"
|
13
|
+
selectOptionClose="close"
|
14
|
+
initLabel="open/close"
|
15
|
+
/>
|
16
|
+
);
|
17
|
+
|
18
|
+
expect(wrapper.find('SCCGenericExpander')).toHaveLength(1);
|
19
|
+
expect(wrapper.find('Flex')).toHaveLength(1);
|
20
|
+
expect(wrapper.find('FlexItem')).toHaveLength(1);
|
21
|
+
expect(wrapper.find('Select')).toHaveLength(1);
|
22
|
+
});
|
23
|
+
|
24
|
+
it('passes properties', () => {
|
25
|
+
const wrapper = shallow(
|
26
|
+
<SCCGenericExpander
|
27
|
+
setInParent={() => {}}
|
28
|
+
selectOptionOpen="open"
|
29
|
+
selectOptionClose="close"
|
30
|
+
initLabel="open/close"
|
31
|
+
/>
|
32
|
+
);
|
33
|
+
|
34
|
+
// Select
|
35
|
+
const select = wrapper.find('Select');
|
36
|
+
expect(select.exists()).toBe(true);
|
37
|
+
expect(select.props()).toHaveProperty('selections');
|
38
|
+
expect(select.prop('selections')).toContain('open/close');
|
39
|
+
|
40
|
+
// SelectOptions
|
41
|
+
const selectOptions = wrapper.find('SelectOption');
|
42
|
+
expect(selectOptions).toHaveLength(2);
|
43
|
+
const optionValues = selectOptions.map((option) => option.prop('value'));
|
44
|
+
expect(optionValues).toContain('open');
|
45
|
+
expect(optionValues).toContain('close');
|
46
|
+
});
|
47
|
+
});
|
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: 3.
|
4
|
+
version: 3.1.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: 2024-
|
11
|
+
date: 2024-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -211,6 +211,7 @@ files:
|
|
211
211
|
- webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/index.js
|
212
212
|
- webpack/components/SCCProductPage/components/SCCProductView/components/SCCRepoView/styles.scss
|
213
213
|
- webpack/components/SCCProductPage/components/SCCProductView/index.js
|
214
|
+
- webpack/components/SCCProductPage/components/common/SCCGenericExpander/SCCGenericExpander.test.js
|
214
215
|
- webpack/components/SCCProductPage/components/common/SCCGenericExpander/index.js
|
215
216
|
- webpack/components/SCCProductPage/components/common/SCCProductTreeExpander/index.js
|
216
217
|
- webpack/components/SCCProductPage/components/common/SCCSubscribedProductsExpander/index.js
|