foreman_scc_manager 3.0.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4db874ecb5f9ac07ff8647be41c6e07767e238306e52da387e193225f08fe69
4
- data.tar.gz: c211d00918ce0bb0d7655dbce0ba9f08349cdb339e5e29682093aa1584add37c
3
+ metadata.gz: 228ebf9bffa7254cfb6b9eb66c3cd5266a3f9027eb93723242e10d4f0831ceca
4
+ data.tar.gz: 481ca0001ebd66e8aaa74ab5339998a71b09f447f4b6cd5fc0ba45eb1a9c8bd2
5
5
  SHA512:
6
- metadata.gz: 2cecc139e3aaffb1a4fe652e137793892862ab78a80a6a4c039c8ed3a8c7044b931eb80a211e57536f257ffe5064ab5f9a1c3113a198ab849509b85906d32d12
7
- data.tar.gz: a4e7fcffdef24ab1388e3a13ac245f505e90c7914f667ed72ffa5444db9c2bb7fe5ee6ed7cea651beb51386c1f3a1450c6a98c773f79d2aa1faf57e363753e41
6
+ metadata.gz: 55d851abec9802a64f993457195ddeda0213f066655a6bfb48a01f097d3e21f048dc3d240b669dd4be079543f1db6ad837d003c0ddfd5879aa6ec2e80da42420
7
+ data.tar.gz: c7b7e0502631b2f1b4ade0883d91034119fcee65d8d2c5382188c61bf75986502313836467959c3e46eea27df4c9848c2e3032587387542a28a32a5d3545994c
@@ -38,6 +38,8 @@ class SccAccount < ApplicationRecord
38
38
  validates :mirroring_policy, :inclusion => { :in => SCC_MIRRORING_POLICIES }, :allow_blank => false
39
39
  validate :sync_date_is_valid_datetime
40
40
 
41
+ alias_attribute :recurring_logic_id, :foreman_tasks_recurring_logic_id
42
+
41
43
  after_initialize :init
42
44
  before_destroy :cancel_recurring_logic
43
45
 
@@ -1,3 +1,3 @@
1
1
  module ForemanSccManager
2
- VERSION = '3.0.0'.freeze
2
+ VERSION = '3.1.1'.freeze
3
3
  end
data/package.json CHANGED
@@ -8,7 +8,8 @@
8
8
  "test": "test"
9
9
  },
10
10
  "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1",
11
+ "lint": "tfm-lint --plugin -d /webpack",
12
+ "test": "tfm-test --plugin",
12
13
  "create-react-component": "yo react-domain"
13
14
  },
14
15
  "repository": {
@@ -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' => "rest-client/2.1.0 (linux x86_64) ruby/#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}",
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, setModalClosed } = useForemanModal({
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, setProductItems] = useState(
53
+ const [productItems] = useState(
54
54
  uniq(sccProducts.map((p) => p.product_category))
55
55
  );
56
56
  const [selectedProduct, setSelectedProduct] = useState('');
@@ -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, setAllProducts] = useState(
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.0.0
4
+ version: 3.1.1
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-01-05 00:00:00.000000000 Z
11
+ date: 2024-10-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
@@ -237,27 +238,27 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
238
  - !ruby/object:Gem::Version
238
239
  version: '0'
239
240
  requirements: []
240
- rubygems_version: 3.1.2
241
+ rubygems_version: 3.3.27
241
242
  signing_key:
242
243
  specification_version: 4
243
244
  summary: Suse Customer Center plugin for Foreman
244
245
  test_files:
245
- - test/support/fixtures_support.rb
246
- - test/unit/foreman_scc_manager_test.rb
247
246
  - test/actions/sync_test.rb
248
- - test/test_plugin_helper.rb
247
+ - test/controllers/api/v2/scc_accounts_test.rb
248
+ - test/controllers/api/v2/scc_products_test.rb
249
+ - test/controllers/scc_accounts_controller_test.rb
249
250
  - test/factories/foreman_scc_manager_factories.rb
250
- - test/models/scc_product_test.rb
251
- - test/models/scc_account_test.rb
252
251
  - test/features/sync_test.rb
253
- - test/fixtures/models/scc_repositories.yml
254
- - test/fixtures/models/katello_root_repositories.yml
255
- - test/fixtures/models/scc_accounts.yml
256
- - test/fixtures/models/scc_products.yml
257
252
  - test/fixtures/files/data_products_page1.json
258
- - test/fixtures/files/data_subscriptions.json
259
253
  - test/fixtures/files/data_products_page2.json
260
254
  - test/fixtures/files/data_repositories.json
261
- - test/controllers/scc_accounts_controller_test.rb
262
- - test/controllers/api/v2/scc_products_test.rb
263
- - test/controllers/api/v2/scc_accounts_test.rb
255
+ - test/fixtures/files/data_subscriptions.json
256
+ - test/fixtures/models/katello_root_repositories.yml
257
+ - test/fixtures/models/scc_accounts.yml
258
+ - test/fixtures/models/scc_products.yml
259
+ - test/fixtures/models/scc_repositories.yml
260
+ - test/models/scc_account_test.rb
261
+ - test/models/scc_product_test.rb
262
+ - test/support/fixtures_support.rb
263
+ - test/test_plugin_helper.rb
264
+ - test/unit/foreman_scc_manager_test.rb