foreman_openscap 5.2.3 → 6.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 567fbb46d134ce11280b987a4f08aa07e2be3cbcb59a4401c845445fc35bc18d
4
- data.tar.gz: 1c5f824f9909e205970e0ac17bf6326a0f345f162b586048d80bfe7fe7037dcc
3
+ metadata.gz: a2d17703ecb85f3b31723d710563f11e36c18215e555155459e4e7585babcb0a
4
+ data.tar.gz: e28e9b05e5103e3dd43fbadf8bfde0dc182eae32674fbb3bfc27b8302ccce227
5
5
  SHA512:
6
- metadata.gz: 177272d8e28eddfdc6f98b21bccacd580d8b37a26f931781558a52cbf6dc8fd9d36f5963d3da783de4449bef397d60dfd25ca8bc93c2883f370e37ea5b27679a
7
- data.tar.gz: 5cac704dc905427ad4f15a325cf250a18755fff8407edc764a5f11752a7da15391d7c9bde6f53e4577b942e27b5d588ad952d656cf5ebada0d334f62fbfa5e62
6
+ metadata.gz: 1f902c2d93e8ed9ff4d5d39ec9172d079fe2752ad9a4e54b86f9bd444152db1af2750856d0bcd4decf860bb4ac384f075b8e4dff08855d6064d2c93cf29d5701
7
+ data.tar.gz: f6aecc2a28bf566365b16138eecc33e335d22daa58a36af23d0345420188d0c80fe4333c2cf8a3ac0b68c69233e94410d3cda6ee5969db1bc38513419a76d09c
@@ -48,7 +48,7 @@ module ForemanOpenscap
48
48
 
49
49
  initializer 'foreman_openscap.register_plugin', :before => :finisher_hook do |app|
50
50
  Foreman::Plugin.register :foreman_openscap do
51
- requires_foreman '>= 1.24'
51
+ requires_foreman '>= 3.3'
52
52
 
53
53
  apipie_documented_controllers ["#{ForemanOpenscap::Engine.root}/app/controllers/api/v2/compliance/*.rb"]
54
54
 
@@ -1,3 +1,3 @@
1
1
  module ForemanOpenscap
2
- VERSION = "5.2.3".freeze
2
+ VERSION = "6.0.0".freeze
3
3
  end
data/package.json CHANGED
@@ -21,19 +21,19 @@
21
21
  "url": "https://projects.theforeman.org/projects/foreman_openscap/issues"
22
22
  },
23
23
  "peerDependencies": {
24
- "@theforeman/vendor": ">= 4.13.2"
24
+ "@theforeman/vendor": ">= 10.1.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@babel/core": "^7.7.0",
28
28
  "@testing-library/dom": "^8.9.1",
29
29
  "@testing-library/jest-dom": "^5.11.9",
30
30
  "@testing-library/user-event": "^13.2.1",
31
- "@theforeman/builder": "^8.4.1",
32
- "@theforeman/eslint-plugin-foreman": "8.4.1",
33
- "@theforeman/find-foreman": "^8.4.1",
34
- "@theforeman/stories": "^8.4.1",
35
- "@theforeman/test": "^8.9.0",
36
- "@theforeman/vendor-dev": "^8.4.1",
31
+ "@theforeman/builder": ">= 10.1.0",
32
+ "@theforeman/eslint-plugin-foreman": ">= 10.1.0",
33
+ "@theforeman/find-foreman": ">= 10.1.0",
34
+ "@theforeman/stories": ">= 10.1.0",
35
+ "@theforeman/test": ">= 10.1.0",
36
+ "@theforeman/vendor-dev": ">= 10.1.0",
37
37
  "babel-eslint": "^10.0.3",
38
38
  "eslint": "^6.7.2",
39
39
  "jed": "^1.1.1",
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { useSelector } from 'react-redux';
3
+ import { DropdownItem } from '@patternfly/react-core';
4
+ import { SecurityIcon } from '@patternfly/react-icons';
5
+ import { selectAPIResponse } from 'foremanReact/redux/API/APISelectors';
6
+ import { useAPI } from 'foremanReact/common/hooks/API/APIHooks';
7
+ import { translate as __ } from 'foremanReact/common/I18n';
8
+ import { HOST_DETAILS_KEY } from 'foremanReact/components/HostDetails/consts';
9
+ import { foremanUrl } from 'foremanReact/common/helpers';
10
+
11
+ const HostKebabItems = () => {
12
+ const { name, id } = useSelector(state =>
13
+ selectAPIResponse(state, HOST_DETAILS_KEY)
14
+ );
15
+
16
+ const ARFReportsAPIPath = name
17
+ ? `/api/v2/compliance/arf_reports?search=host+%3D+${name}`
18
+ : null;
19
+
20
+ const {
21
+ response: { results = [] },
22
+ } = useAPI('get', ARFReportsAPIPath);
23
+
24
+ const compliancePath = foremanUrl(`/compliance/hosts/${id}`);
25
+
26
+ const isDisabled = results.length === 0;
27
+
28
+ return (
29
+ <DropdownItem
30
+ ouiaId="compliance-dropdown-item"
31
+ key="compliance-report"
32
+ icon={<SecurityIcon />}
33
+ href={compliancePath}
34
+ target="_blank"
35
+ rel="noreferrer"
36
+ isAriaDisabled={isDisabled}
37
+ tooltip={isDisabled && __("There's no available report for this host")}
38
+ >
39
+ {__('Compliance')}
40
+ </DropdownItem>
41
+ );
42
+ };
43
+
44
+ export default HostKebabItems;
@@ -1,5 +1,14 @@
1
+ import React from 'react';
1
2
  import { registerRoutes } from 'foremanReact/routes/RoutingService';
2
-
3
+ import { addGlobalFill } from 'foremanReact/components/common/Fill/GlobalFill';
4
+ import HostKebabItems from './components/HostExtentions/HostKebabItems';
3
5
  import routes from './routes/routes';
4
6
 
5
7
  registerRoutes('foreman_openscap', routes);
8
+
9
+ addGlobalFill(
10
+ 'host-details-kebab',
11
+ `openscap-kebab-items`,
12
+ <HostKebabItems key="openscap-host-kebab" />,
13
+ 400
14
+ );
@@ -53,7 +53,7 @@ describe('OvalPoliciesShow', () => {
53
53
  '.pf-c-tabs__item.pf-m-current'
54
54
  );
55
55
  expect(within(activeTabHeader).getByText('Details')).toBeInTheDocument();
56
- userEvent.click(screen.getByRole('button', { name: 'CVEs' }));
56
+ userEvent.click(screen.getByRole('tab', { name: 'CVEs' }));
57
57
  expect(pushMock).toHaveBeenCalledWith(
58
58
  resolvePath(ovalPoliciesShowPath, {
59
59
  ':id': ovalPolicyId,
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.3
4
+ version: 6.0.0
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: 2023-03-09 00:00:00.000000000 Z
11
+ date: 2023-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -415,6 +415,7 @@ files:
415
415
  - webpack/components/EditableInput.js
416
416
  - webpack/components/EditableInput.scss
417
417
  - webpack/components/EmptyState.js
418
+ - webpack/components/HostExtentions/HostKebabItems.js
418
419
  - webpack/components/IndexLayout.js
419
420
  - webpack/components/IndexLayout.scss
420
421
  - webpack/components/IndexTable/IndexTableHelper.js