foreman_openscap 5.2.1 → 5.2.3

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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/services/foreman_openscap/client_config/ansible.rb +1 -1
  3. data/app/services/foreman_openscap/client_config/puppet.rb +1 -1
  4. data/app/views/arf_reports/show.html.erb +1 -1
  5. data/app/views/smart_proxies/plugins/_openscap.html.erb +0 -1
  6. data/db/migrate/20200117135424_migrate_port_overrides_to_int.rb +1 -1
  7. data/db/migrate/20200803065041_migrate_port_overrides_for_ansible.rb +1 -1
  8. data/db/migrate/20201202110213_update_puppet_port_param_type.rb +1 -1
  9. data/lib/foreman_openscap/engine.rb +1 -1
  10. data/lib/foreman_openscap/version.rb +1 -1
  11. data/locale/de/LC_MESSAGES/foreman_openscap.mo +0 -0
  12. data/locale/de/foreman_openscap.po +145 -138
  13. data/locale/en_GB/LC_MESSAGES/foreman_openscap.mo +0 -0
  14. data/locale/en_GB/foreman_openscap.po +4 -4
  15. data/locale/es/LC_MESSAGES/foreman_openscap.mo +0 -0
  16. data/locale/es/foreman_openscap.po +96 -93
  17. data/locale/fr/LC_MESSAGES/foreman_openscap.mo +0 -0
  18. data/locale/fr/foreman_openscap.po +99 -96
  19. data/locale/gl/LC_MESSAGES/foreman_openscap.mo +0 -0
  20. data/locale/gl/foreman_openscap.po +5 -5
  21. data/locale/it/LC_MESSAGES/foreman_openscap.mo +0 -0
  22. data/locale/it/foreman_openscap.po +7 -6
  23. data/locale/ja/LC_MESSAGES/foreman_openscap.mo +0 -0
  24. data/locale/ja/foreman_openscap.po +112 -106
  25. data/locale/ko/LC_MESSAGES/foreman_openscap.mo +0 -0
  26. data/locale/ko/foreman_openscap.po +6 -6
  27. data/locale/pt_BR/LC_MESSAGES/foreman_openscap.mo +0 -0
  28. data/locale/pt_BR/foreman_openscap.po +93 -90
  29. data/locale/ru/LC_MESSAGES/foreman_openscap.mo +0 -0
  30. data/locale/ru/foreman_openscap.po +7 -7
  31. data/locale/sv_SE/LC_MESSAGES/foreman_openscap.mo +0 -0
  32. data/locale/sv_SE/foreman_openscap.po +5 -5
  33. data/locale/zh_CN/LC_MESSAGES/foreman_openscap.mo +0 -0
  34. data/locale/zh_CN/foreman_openscap.po +155 -155
  35. data/locale/zh_TW/LC_MESSAGES/foreman_openscap.mo +0 -0
  36. data/locale/zh_TW/foreman_openscap.po +11 -11
  37. data/test/test_plugin_helper.rb +2 -2
  38. data/webpack/components/IndexTable/IndexTableHelper.js +0 -3
  39. data/webpack/components/IndexTable/index.js +5 -9
  40. data/webpack/routes/OvalContents/OvalContentsIndex/__tests__/OvalContentsIndex.test.js +1 -34
  41. data/webpack/routes/OvalPolicies/OvalPoliciesIndex/__tests__/OvalPoliciesIndex.test.js +1 -30
  42. metadata +35 -35
@@ -8,8 +8,8 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: Foreman\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "PO-Revision-Date: 2020-05-12 09:50+0000\n"
12
- "Last-Translator: Transifex Bot <>\n"
11
+ "PO-Revision-Date: 2016-04-14 07:48+0000\n"
12
+ "Last-Translator: FIRST AUTHOR <EMAIL@ADDRESS>, 2016\n"
13
13
  "Language-Team: Chinese (Taiwan) (http://www.transifex.com/foreman/foreman/lang"
14
14
  "uage/zh_TW/)\n"
15
15
  "MIME-Version: 1.0\n"
@@ -57,10 +57,10 @@ msgid "A summary of reports for OpenSCAP policies"
57
57
  msgstr ""
58
58
 
59
59
  msgid "Action with sub plans"
60
- msgstr ""
60
+ msgstr "有子計畫的動作"
61
61
 
62
62
  msgid "Actions"
63
- msgstr ""
63
+ msgstr "動作"
64
64
 
65
65
  msgid "All messages"
66
66
  msgstr "所有訊息"
@@ -255,7 +255,7 @@ msgid "Directory to upload when using \"directory\" upload type"
255
255
  msgstr ""
256
256
 
257
257
  msgid "Documentation"
258
- msgstr ""
258
+ msgstr "文件"
259
259
 
260
260
  msgid "Download"
261
261
  msgstr "下載"
@@ -279,7 +279,7 @@ msgid "Download bzipped ARF report"
279
279
  msgstr ""
280
280
 
281
281
  msgid "Edit %s"
282
- msgstr ""
282
+ msgstr "編輯 %s"
283
283
 
284
284
  msgid "Effective Profile"
285
285
  msgstr ""
@@ -394,10 +394,10 @@ msgid "ID of OpenSCAP Proxy"
394
394
  msgstr ""
395
395
 
396
396
  msgid "Import Puppet classes"
397
- msgstr ""
397
+ msgstr "匯入 Puppet 類別"
398
398
 
399
399
  msgid "Import facts"
400
- msgstr ""
400
+ msgstr "匯入詳情"
401
401
 
402
402
  msgid "In Foreman, a compliance policy checklist is defined via %s."
403
403
  msgstr ""
@@ -476,7 +476,7 @@ msgid "More details"
476
476
  msgstr "更多詳細資訊"
477
477
 
478
478
  msgid "Name"
479
- msgstr ""
479
+ msgstr "名稱"
480
480
 
481
481
  msgid "Never audited"
482
482
  msgstr "未曾稽核"
@@ -745,7 +745,7 @@ msgid "References"
745
745
  msgstr "參照"
746
746
 
747
747
  msgid "Remote action:"
748
- msgstr ""
748
+ msgstr "遠端動作:"
749
749
 
750
750
  msgid "Report Metrics"
751
751
  msgstr "報告計量"
@@ -1082,7 +1082,7 @@ msgid "hostgroups"
1082
1082
  msgstr ""
1083
1083
 
1084
1084
  msgid "hosts"
1085
- msgstr ""
1085
+ msgstr "主機"
1086
1086
 
1087
1087
  msgid "invalid type %s"
1088
1088
  msgstr "無效的類型 %s"
@@ -5,14 +5,14 @@ require 'test_helper'
5
5
  FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
6
6
  # Add factories from foreman_ansible
7
7
  FactoryBot.definition_file_paths << File.join(ForemanAnsible::Engine.root, '/test/factories')
8
- FactoryBot.definition_file_paths << File.join(ForemanPuppet::Engine.root, '/test/factories') if defined?(ForemanPuppet)
8
+ FactoryBot.definition_file_paths << File.join(ForemanPuppet::Engine.root, '/test/factories') if defined?(ForemanPuppet::Engine)
9
9
  FactoryBot.reload
10
10
 
11
11
  require "#{ForemanOpenscap::Engine.root}/test/fixtures/cve_fixtures"
12
12
 
13
13
  module ScapClientPuppetclass
14
14
  def puppet_available?
15
- defined?(ForemanPuppet)
15
+ Foreman::Plugin.installed?("foreman_puppet")
16
16
  end
17
17
 
18
18
  def setup_puppet_class
@@ -1,8 +1,5 @@
1
1
  import { addSearch } from '../../helpers/pageParamsHelper';
2
2
 
3
- export const preparePerPageOptions = opts =>
4
- opts.map(item => ({ title: item.toString(), value: item }));
5
-
6
3
  export const refreshPage = (history, params = {}) => {
7
4
  const url = addSearch(history.location.pathname, params);
8
5
  history.push(url);
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Table, TableHeader, TableBody } from '@patternfly/react-table';
4
- import { Pagination, Flex, FlexItem } from '@patternfly/react-core';
5
- import { usePaginationOptions } from 'foremanReact/components/Pagination/PaginationHooks';
6
-
7
- import { preparePerPageOptions, refreshPage } from './IndexTableHelper';
4
+ import { Flex, FlexItem } from '@patternfly/react-core';
5
+ import Pagination from 'foremanReact/components/Pagination';
6
+ import { refreshPage } from './IndexTableHelper';
8
7
 
9
8
  const IndexTable = ({
10
9
  history,
@@ -15,16 +14,14 @@ const IndexTable = ({
15
14
  columns,
16
15
  ...rest
17
16
  }) => {
18
- const handlePerPageSelected = (event, perPage) => {
17
+ const handlePerPageSelected = perPage => {
19
18
  refreshPage(history, { page: 1, perPage });
20
19
  };
21
20
 
22
- const handlePageSelected = (event, page) => {
21
+ const handlePageSelected = page => {
23
22
  refreshPage(history, { ...pagination, page });
24
23
  };
25
24
 
26
- const perPageOptions = preparePerPageOptions(usePaginationOptions());
27
-
28
25
  return (
29
26
  <React.Fragment>
30
27
  <Flex className="pf-u-pt-md">
@@ -36,7 +33,6 @@ const IndexTable = ({
36
33
  perPage={pagination.perPage}
37
34
  onSetPage={handlePageSelected}
38
35
  onPerPageSelect={handlePerPageSelected}
39
- perPageOptions={perPageOptions}
40
36
  variant="top"
41
37
  />
42
38
  </FlexItem>
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
2
  import { render, screen, waitFor } from '@testing-library/react';
3
- import { within } from '@testing-library/dom';
4
- import userEvent from '@testing-library/user-event';
5
3
  import '@testing-library/jest-dom';
6
4
 
7
5
  import OvalContentsIndex from '../';
@@ -13,13 +11,9 @@ import {
13
11
  tick,
14
12
  historyMock,
15
13
  } from '../../../../testHelper';
16
- import { ovalContentsPath } from '../../../../helpers/pathsHelper';
17
14
 
18
15
  import {
19
16
  mocks,
20
- paginatedMocks,
21
- pushMock,
22
- pagePaginationHistoryMock,
23
17
  emptyMocks,
24
18
  errorMocks,
25
19
  viewerMocks,
@@ -32,9 +26,7 @@ const TestComponent = withRedux(
32
26
 
33
27
  describe('OvalContentsIndex', () => {
34
28
  it('should load page', async () => {
35
- const { container } = render(
36
- <TestComponent history={historyMock} mocks={mocks} location={{}} />
37
- );
29
+ render(<TestComponent history={historyMock} mocks={mocks} location={{}} />);
38
30
  expect(screen.getByText('Loading')).toBeInTheDocument();
39
31
  await waitFor(tick);
40
32
  expect(screen.queryByText('Loading')).not.toBeInTheDocument();
@@ -46,31 +38,6 @@ describe('OvalContentsIndex', () => {
46
38
  ).toBeInTheDocument();
47
39
  expect(screen.getByText('openshift OVAL content')).toBeInTheDocument();
48
40
  expect(screen.getByText('openshift.oval.xml.bz2')).toBeInTheDocument();
49
- const pageItems = container.querySelector('.pf-c-pagination__total-items');
50
- expect(within(pageItems).getByText(/1 - 4/)).toBeInTheDocument();
51
- expect(within(pageItems).getByText('of')).toBeInTheDocument();
52
- expect(within(pageItems).getByText('4')).toBeInTheDocument();
53
- });
54
- it('should load page with pagination params', async () => {
55
- const { container } = render(
56
- <TestComponent
57
- history={pagePaginationHistoryMock}
58
- location={{}}
59
- mocks={paginatedMocks}
60
- />
61
- );
62
- await waitFor(tick);
63
- const pageItems = container.querySelector('.pf-c-pagination__total-items');
64
- expect(within(pageItems).getByText(/6 - 7/)).toBeInTheDocument();
65
- expect(within(pageItems).getByText('of')).toBeInTheDocument();
66
- expect(within(pageItems).getByText('7')).toBeInTheDocument();
67
- userEvent.click(
68
- screen.getByRole('button', { name: 'Go to previous page' })
69
- );
70
-
71
- expect(pushMock).toHaveBeenCalledWith(
72
- `${ovalContentsPath}?page=1&perPage=5`
73
- );
74
41
  });
75
42
  it('should show empty state', async () => {
76
43
  render(
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
2
  import { render, screen, waitFor } from '@testing-library/react';
3
- import userEvent from '@testing-library/user-event';
4
- import { within } from '@testing-library/dom';
5
3
  import '@testing-library/jest-dom';
6
4
 
7
5
  import {
@@ -14,9 +12,6 @@ import {
14
12
 
15
13
  import {
16
14
  mocks,
17
- pushMock,
18
- pageParamsMocks,
19
- pageParamsHistoryMock,
20
15
  emptyMocks,
21
16
  errorMocks,
22
17
  viewerMocks,
@@ -24,7 +19,6 @@ import {
24
19
  } from './OvalPoliciesIndex.fixtures';
25
20
 
26
21
  import OvalPoliciesIndex from '../index';
27
- import { ovalPoliciesPath } from '../../../../helpers/pathsHelper';
28
22
 
29
23
  const TestComponent = withRouter(
30
24
  withRedux(withMockedProvider(OvalPoliciesIndex))
@@ -32,19 +26,13 @@ const TestComponent = withRouter(
32
26
 
33
27
  describe('OvalPoliciesIndex', () => {
34
28
  it('should load page', async () => {
35
- const { container } = render(
36
- <TestComponent history={historyMock} mocks={mocks} />
37
- );
29
+ render(<TestComponent history={historyMock} mocks={mocks} />);
38
30
  expect(screen.getByText('Loading')).toBeInTheDocument();
39
31
  await waitFor(tick);
40
32
  expect(screen.getByText('first policy')).toBeInTheDocument();
41
33
  expect(screen.getByText('second policy')).toBeInTheDocument();
42
34
  expect(screen.getByText('first content')).toBeInTheDocument();
43
35
  expect(screen.getByText('second content')).toBeInTheDocument();
44
- const pageItems = container.querySelector('.pf-c-pagination__total-items');
45
- expect(within(pageItems).getByText(/1 - 2/)).toBeInTheDocument();
46
- expect(within(pageItems).getByText('of')).toBeInTheDocument();
47
- expect(within(pageItems).getByText('2')).toBeInTheDocument();
48
36
 
49
37
  expect(screen.getByText('first policy').closest('a')).toHaveAttribute(
50
38
  'href',
@@ -55,23 +43,6 @@ describe('OvalPoliciesIndex', () => {
55
43
  '/experimental/compliance/oval_policies/40'
56
44
  );
57
45
  });
58
- it('should load page with page params', async () => {
59
- const { container } = render(
60
- <TestComponent history={pageParamsHistoryMock} mocks={pageParamsMocks} />
61
- );
62
- await waitFor(tick);
63
- const pageItems = container.querySelector('.pf-c-pagination__total-items');
64
- expect(within(pageItems).getByText(/6 - 7/)).toBeInTheDocument();
65
- expect(within(pageItems).getByText('of')).toBeInTheDocument();
66
- expect(within(pageItems).getByText('7')).toBeInTheDocument();
67
- userEvent.click(
68
- screen.getByRole('button', { name: 'Go to previous page' })
69
- );
70
-
71
- expect(pushMock).toHaveBeenCalledWith(
72
- `${ovalPoliciesPath}?page=1&perPage=5`
73
- );
74
- });
75
46
  it('should show empty state', async () => {
76
47
  render(<TestComponent history={historyMock} mocks={emptyMocks} />);
77
48
  expect(screen.getByText('Loading')).toBeInTheDocument();
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_openscap
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - slukasik@redhat.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-27 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -516,69 +516,69 @@ required_rubygems_version: !ruby/object:Gem::Requirement
516
516
  - !ruby/object:Gem::Version
517
517
  version: '0'
518
518
  requirements: []
519
- rubygems_version: 3.1.4
519
+ rubygems_version: 3.1.6
520
520
  signing_key:
521
521
  specification_version: 4
522
522
  summary: Foreman plug-in for displaying OpenSCAP audit reports
523
523
  test_files:
524
+ - test/factories/arf_report_factory.rb
524
525
  - test/factories/asset_factory.rb
525
- - test/factories/policy_arf_report_factory.rb
526
- - test/factories/policy_factory.rb
527
- - test/factories/scap_content_related.rb
528
526
  - test/factories/compliance_host_factory.rb
527
+ - test/factories/compliance_log_factory.rb
529
528
  - test/factories/oval_content_factory.rb
530
529
  - test/factories/oval_policy_factory.rb
531
- - test/factories/arf_report_factory.rb
532
- - test/factories/compliance_log_factory.rb
530
+ - test/factories/policy_arf_report_factory.rb
531
+ - test/factories/policy_factory.rb
532
+ - test/factories/scap_content_related.rb
533
533
  - test/files/arf_report/arf_report.bz2
534
534
  - test/files/arf_report/arf_report.html
535
535
  - test/files/arf_report/arf_report.json
536
536
  - test/files/arf_report/arf_report_msg_desc_changed.json
537
537
  - test/files/arf_report/arf_report_msg_value_changed.json
538
+ - test/files/oval_contents/ansible-2.9.oval.xml.bz2
538
539
  - test/files/scap_contents/ssg-fedora-ds.xml
539
540
  - test/files/tailoring_files/ssg-firefox-ds-tailoring-2.xml
540
541
  - test/files/tailoring_files/ssg-firefox-ds-tailoring.xml
541
- - test/files/oval_contents/ansible-2.9.oval.xml.bz2
542
- - test/functional/api/v2/compliance/scap_content_profiles_controller_test.rb
543
- - test/functional/api/v2/compliance/scap_contents_controller_test.rb
544
- - test/functional/api/v2/compliance/tailoring_files_controller_test.rb
542
+ - test/fixtures/cve_fixtures.rb
543
+ - test/functional/api/v2/compliance/arf_reports_controller_test.rb
545
544
  - test/functional/api/v2/compliance/oval_contents_controller_test.rb
546
545
  - test/functional/api/v2/compliance/oval_policies_controller_test.rb
547
- - test/functional/api/v2/compliance/arf_reports_controller_test.rb
548
546
  - test/functional/api/v2/compliance/oval_reports_controller_test.rb
549
547
  - test/functional/api/v2/compliance/policies_controller_test.rb
548
+ - test/functional/api/v2/compliance/scap_content_profiles_controller_test.rb
549
+ - test/functional/api/v2/compliance/scap_contents_controller_test.rb
550
+ - test/functional/api/v2/compliance/tailoring_files_controller_test.rb
550
551
  - test/functional/api/v2/hosts_controller_test.rb
551
552
  - test/functional/arf_reports_controller_test.rb
552
553
  - test/functional/openscap_proxies_controller_test.rb
553
554
  - test/functional/tailoring_files_controller_test.rb
555
+ - test/graphql/mutations/oval_policies/delete_mutation_test.rb
556
+ - test/graphql/queries/oval_content_query_test.rb
557
+ - test/graphql/queries/oval_contents_query_test.rb
558
+ - test/graphql/queries/oval_policies_query_test.rb
554
559
  - test/helpers/arf_report_dashboard_helper_test.rb
555
560
  - test/helpers/policy_dashboard_helper_test.rb
556
561
  - test/lib/foreman_openscap/bulk_upload_test.rb
557
- - test/unit/concerns/host_extensions_test.rb
558
- - test/unit/concerns/openscap_proxy_extenstions_test.rb
559
- - test/unit/services/tailoring_files_proxy_check_test.rb
560
- - test/unit/services/oval/setup_test.rb
561
- - test/unit/services/oval/cves_test.rb
562
- - test/unit/services/oval/setup_check_test.rb
563
- - test/unit/services/config_name_service_test.rb
564
- - test/unit/services/lookup_key_overrider_test.rb
565
- - test/unit/services/report_dashboard/data_test.rb
566
- - test/unit/services/hostgroup_overrider_test.rb
562
+ - test/test_plugin_helper.rb
567
563
  - test/unit/arf_report_status_calculator_test.rb
564
+ - test/unit/arf_report_test.rb
568
565
  - test/unit/compliance_status_test.rb
569
- - test/unit/policy_mailer_test.rb
570
- - test/unit/scap_content_test.rb
571
- - test/unit/tailoring_file_test.rb
566
+ - test/unit/concerns/host_extensions_test.rb
567
+ - test/unit/concerns/openscap_proxy_extenstions_test.rb
568
+ - test/unit/message_cleaner_test.rb
569
+ - test/unit/openscap_host_test.rb
572
570
  - test/unit/oval_host_test.rb
573
571
  - test/unit/oval_policy_test.rb
574
572
  - test/unit/oval_status_test.rb
573
+ - test/unit/policy_mailer_test.rb
575
574
  - test/unit/policy_test.rb
576
- - test/unit/arf_report_test.rb
577
- - test/unit/message_cleaner_test.rb
578
- - test/unit/openscap_host_test.rb
579
- - test/fixtures/cve_fixtures.rb
580
- - test/graphql/queries/oval_contents_query_test.rb
581
- - test/graphql/queries/oval_policies_query_test.rb
582
- - test/graphql/queries/oval_content_query_test.rb
583
- - test/graphql/mutations/oval_policies/delete_mutation_test.rb
584
- - test/test_plugin_helper.rb
575
+ - test/unit/scap_content_test.rb
576
+ - test/unit/services/config_name_service_test.rb
577
+ - test/unit/services/hostgroup_overrider_test.rb
578
+ - test/unit/services/lookup_key_overrider_test.rb
579
+ - test/unit/services/oval/cves_test.rb
580
+ - test/unit/services/oval/setup_check_test.rb
581
+ - test/unit/services/oval/setup_test.rb
582
+ - test/unit/services/report_dashboard/data_test.rb
583
+ - test/unit/services/tailoring_files_proxy_check_test.rb
584
+ - test/unit/tailoring_file_test.rb