foreman_rh_cloud 4.0.23 → 4.0.25.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_inventory_upload/cloud_status_controller.rb +26 -0
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +15 -7
- data/app/controllers/insights_cloud/hits_controller.rb +0 -1
- data/app/models/insights_client_report_status.rb +11 -22
- data/app/services/foreman_rh_cloud/cloud_auth.rb +4 -0
- data/app/services/foreman_rh_cloud/cloud_ping_service.rb +83 -0
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +1 -9
- data/app/services/foreman_rh_cloud/insights_status_cleaner.rb +17 -0
- data/app/services/foreman_rh_cloud/remediations_retriever.rb +5 -0
- data/config/Gemfile.lock.gh_test +0 -8
- data/config/rh_cert-api_chain.pem +74 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20210720000001_remove_old_insights_statuses.foreman_rh_cloud.rb +6 -0
- data/lib/foreman_inventory_upload.rb +9 -1
- data/lib/foreman_inventory_upload/generators/queries.rb +1 -16
- data/lib/foreman_inventory_upload/generators/slice.rb +1 -0
- data/lib/foreman_inventory_upload/generators/tags.rb +3 -1
- data/lib/foreman_rh_cloud.rb +4 -0
- data/lib/foreman_rh_cloud/engine.rb +14 -12
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/insights_cloud.rb +4 -0
- data/lib/insights_cloud/async/insights_client_status_aging.rb +23 -0
- data/lib/insights_cloud/async/insights_full_sync.rb +5 -0
- data/lib/insights_cloud/async/insights_resolutions_sync.rb +9 -0
- data/lib/insights_cloud/async/insights_rules_sync.rb +5 -0
- data/lib/inventory_sync/async/host_result.rb +4 -0
- data/lib/inventory_sync/async/inventory_full_sync.rb +5 -0
- data/lib/inventory_sync/async/inventory_hosts_sync.rb +15 -0
- data/lib/inventory_sync/async/inventory_self_host_sync.rb +39 -0
- data/lib/inventory_sync/async/query_inventory_job.rb +5 -1
- data/lib/tasks/insights.rake +15 -0
- data/lib/tasks/rh_cloud_inventory.rake +2 -9
- data/package.json +2 -2
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +45 -0
- data/test/controllers/inventory_upload/cloud_status_controller_test.rb +44 -0
- data/test/jobs/insights_client_status_aging_test.rb +33 -0
- data/test/jobs/insights_full_sync_test.rb +1 -0
- data/test/jobs/insights_resolutions_sync_test.rb +1 -0
- data/test/jobs/insights_rules_sync_test.rb +1 -0
- data/test/jobs/inventory_full_sync_test.rb +10 -0
- data/test/jobs/inventory_hosts_sync_test.rb +3 -0
- data/test/jobs/inventory_self_host_sync_test.rb +104 -0
- data/test/models/insights_client_report_status_test.rb +70 -72
- data/test/test_plugin_helper.rb +53 -0
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +6 -37
- data/test/unit/services/foreman_rh_cloud/cloud_status_service_test.rb +66 -0
- data/test/unit/services/foreman_rh_cloud/insights_status_cleaner_test.rb +31 -0
- data/test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb +1 -0
- data/test/unit/slice_generator_test.rb +15 -0
- data/test/unit/tags_generator_test.rb +41 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +1 -2
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +3 -1
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +2 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +1 -2
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterConstants.js +3 -1
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss +0 -4
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +12 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +10 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +144 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.scss +5 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +2 -2
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Toast.js +2 -2
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +4 -3
- data/webpack/ForemanInventoryUpload/ForemanInventoryConstants.js +2 -0
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +3 -1
- data/webpack/InsightsCloudSync/Components/InsightsHeader/InsightsHeader.scss +5 -1
- data/webpack/InsightsCloudSync/Components/InsightsHeader/index.js +6 -4
- data/webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js +9 -5
- data/webpack/InsightsCloudSync/Components/InsightsSettings/__tests__/__snapshots__/InsightsSettings.test.js.snap +6 -6
- data/webpack/InsightsCloudSync/Components/InsightsSettings/insightsSettings.scss +0 -14
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +4 -22
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +25 -4
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableSelectors.js +0 -3
- data/webpack/InsightsCloudSync/Components/InsightsTable/Pagination.js +51 -0
- data/webpack/InsightsCloudSync/Components/InsightsTable/SelectAllAlert.js +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTable.test.js.snap +3 -68
- data/webpack/InsightsCloudSync/Components/InsightsTable/table.scss +10 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +11 -10
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.scss +14 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/index.js +0 -2
- data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +32 -0
- data/webpack/InsightsCloudSync/Components/__tests__/__snapshots__/InsightsHeader.test.js.snap +5 -4
- data/webpack/InsightsCloudSync/InsightsCloudSync.js +17 -13
- data/webpack/InsightsCloudSync/InsightsCloudSync.scss +82 -2
- data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +15 -6
- data/webpack/InsightsHostDetailsTab/InsightsTab.js +3 -2
- data/webpack/InsightsHostDetailsTab/InsightsTab.scss +4 -4
- data/webpack/InsightsHostDetailsTab/components/ListItem/ListItem.js +9 -7
- data/webpack/common/Switcher/SwitcherPF4.js +1 -1
- data/webpack/common/Switcher/SwitcherPF4.scss +6 -7
- data/webpack/common/Switcher/__tests__/__snapshots__/SwitcherPF4.test.js.snap +1 -1
- metadata +23 -24
- data/app/subscribers/foreman_rh_cloud/insights_subscriber.rb +0 -9
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.fixtures.js +0 -1
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js +0 -45
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/InsightsSyncSwitcher.test.js +0 -17
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/__tests__/__snapshots__/InsightsSyncSwitcher.test.js.snap +0 -38
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/index.js +0 -1
- data/webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/insightsSyncSwitcher.scss +0 -3
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediateButton.js +0 -59
@@ -28,7 +28,7 @@ export const PageDescription = () => (
|
|
28
28
|
target="_blank"
|
29
29
|
rel="noopener noreferrer"
|
30
30
|
>
|
31
|
-
About subscription watch
|
31
|
+
{__('About subscription watch')}
|
32
32
|
</a>
|
33
33
|
</p>
|
34
34
|
<p>
|
@@ -39,7 +39,7 @@ export const PageDescription = () => (
|
|
39
39
|
target="_blank"
|
40
40
|
rel="noopener noreferrer"
|
41
41
|
>
|
42
|
-
Red Hat Insights Data and Application Security
|
42
|
+
{__('Red Hat Insights Data and Application Security')}
|
43
43
|
</a>
|
44
44
|
</p>
|
45
45
|
</div>
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Toast.js
CHANGED
@@ -20,13 +20,13 @@ const Toast = ({ syncHosts, disconnectHosts }) => {
|
|
20
20
|
<strong>{disconnectHosts}</strong>
|
21
21
|
</p>
|
22
22
|
<p>
|
23
|
-
For more info, please visit the{' '}
|
23
|
+
{__('For more info, please visit the')}{' '}
|
24
24
|
<a
|
25
25
|
href={foremanUrl('/hosts')}
|
26
26
|
target="_blank"
|
27
27
|
rel="noopener noreferrer"
|
28
28
|
>
|
29
|
-
hosts page
|
29
|
+
{__('hosts page')}
|
30
30
|
</a>
|
31
31
|
</p>
|
32
32
|
</span>
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Grid, DonutChart } from 'patternfly-react';
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
4
5
|
import './statusChart.scss';
|
5
6
|
|
6
7
|
const StatusChart = ({ completed }) => {
|
7
8
|
const donutConfigData = {
|
8
9
|
columns: [
|
9
|
-
['Completed', completed],
|
10
|
-
['Remain', 100 - completed],
|
10
|
+
[__('Completed'), completed],
|
11
|
+
[__('Remain'), 100 - completed],
|
11
12
|
],
|
12
13
|
order: null,
|
13
14
|
};
|
@@ -37,7 +38,7 @@ const StatusChart = ({ completed }) => {
|
|
37
38
|
title={{
|
38
39
|
type: 'percent',
|
39
40
|
primary: `${completed}%`,
|
40
|
-
secondary: 'Completed',
|
41
|
+
secondary: __('Completed'),
|
41
42
|
}}
|
42
43
|
/>
|
43
44
|
</div>
|
@@ -41,7 +41,9 @@ const InventoryAutoUploadSwitcher = ({
|
|
41
41
|
|
42
42
|
<Grid.Col sm={5}>
|
43
43
|
<Popover
|
44
|
-
headerContent={
|
44
|
+
headerContent={
|
45
|
+
<strong>{__('Advanced Inventory Settings')}</strong>
|
46
|
+
}
|
45
47
|
bodyContent={
|
46
48
|
<AdvancedSettings
|
47
49
|
autoUploadEnabled={autoUploadEnabled}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { Text, TextVariants } from '@patternfly/react-core';
|
2
3
|
import { translate as __ } from 'foremanReact/common/I18n';
|
3
4
|
import InsightsSettings from '../InsightsSettings';
|
4
5
|
import './InsightsHeader.scss';
|
@@ -6,10 +7,11 @@ import './InsightsHeader.scss';
|
|
6
7
|
const InsightsHeader = () => (
|
7
8
|
<div className="insights-header">
|
8
9
|
<InsightsSettings />
|
9
|
-
<p>
|
10
|
-
{__(
|
11
|
-
|
12
|
-
|
10
|
+
<Text component={TextVariants.p}>
|
11
|
+
{__(
|
12
|
+
'Insights synchronization process is used to provide Insights recommendations output for hosts managed here.'
|
13
|
+
)}
|
14
|
+
</Text>
|
13
15
|
</div>
|
14
16
|
);
|
15
17
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { Component } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { translate as __ } from 'foremanReact/common/I18n';
|
4
|
-
import
|
4
|
+
import SwitcherPF4 from '../../../common/Switcher/SwitcherPF4';
|
5
5
|
import './insightsSettings.scss';
|
6
6
|
|
7
7
|
class InsightsSettings extends Component {
|
@@ -14,10 +14,14 @@ class InsightsSettings extends Component {
|
|
14
14
|
const { insightsSyncEnabled, setInsightsSyncEnabled } = this.props;
|
15
15
|
return (
|
16
16
|
<div className="insights_settings">
|
17
|
-
<
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
<SwitcherPF4
|
18
|
+
id="insights_sync_switcher"
|
19
|
+
label={__('Sync automatically')}
|
20
|
+
tooltip={__(
|
21
|
+
'Enable automatic synchronization of Insights recommendations from the Red Hat cloud'
|
22
|
+
)}
|
23
|
+
isChecked={insightsSyncEnabled}
|
24
|
+
onChange={() => setInsightsSyncEnabled(!insightsSyncEnabled)}
|
21
25
|
/>
|
22
26
|
</div>
|
23
27
|
);
|
@@ -4,12 +4,12 @@ exports[`InsightsSettings rendering render without Props 1`] = `
|
|
4
4
|
<div
|
5
5
|
className="insights_settings"
|
6
6
|
>
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
<SwitcherPF4
|
8
|
+
id="insights_sync_switcher"
|
9
|
+
isChecked={false}
|
10
|
+
label="Sync automatically"
|
11
|
+
onChange={[Function]}
|
12
|
+
tooltip="Enable automatic synchronization of Insights recommendations from the Red Hat cloud"
|
13
13
|
/>
|
14
14
|
</div>
|
15
15
|
`;
|
@@ -1,17 +1,3 @@
|
|
1
1
|
.insights_settings {
|
2
|
-
margin-left: 10px;
|
3
|
-
border: 1px solid #ededed;
|
4
|
-
border-radius: 4px;
|
5
|
-
padding: 10px;
|
6
|
-
margin-bottom: 15px;
|
7
2
|
float: right;
|
8
|
-
|
9
|
-
h3 {
|
10
|
-
margin-top: 0;
|
11
|
-
font-weight: 600;
|
12
|
-
}
|
13
|
-
|
14
|
-
.bootstrap-switch {
|
15
|
-
float: right;
|
16
|
-
}
|
17
3
|
}
|
@@ -1,17 +1,13 @@
|
|
1
1
|
/* eslint-disable react-hooks/exhaustive-deps */
|
2
2
|
import React, { useEffect } from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
|
-
import { Pagination, PaginationVariant } from '@patternfly/react-core';
|
5
4
|
import { Table, TableHeader, TableBody } from '@patternfly/react-table';
|
6
5
|
import { useForemanSettings } from 'foremanReact/Root/Context/ForemanContext';
|
7
6
|
import SelectAllAlert from './SelectAllAlert';
|
8
7
|
import { columns } from './InsightsTableConstants';
|
9
8
|
import TableEmptyState from '../../../common/table/EmptyState';
|
10
|
-
import {
|
11
|
-
|
12
|
-
getSortColumnIndex,
|
13
|
-
getPerPageOptions,
|
14
|
-
} from './InsightsTableHelpers';
|
9
|
+
import { modifySelectedRows, getSortColumnIndex } from './InsightsTableHelpers';
|
10
|
+
import Pagination from './Pagination';
|
15
11
|
import './table.scss';
|
16
12
|
|
17
13
|
const InsightsTable = ({
|
@@ -22,10 +18,7 @@ const InsightsTable = ({
|
|
22
18
|
sortOrder,
|
23
19
|
hits,
|
24
20
|
query,
|
25
|
-
itemCount,
|
26
21
|
fetchInsights,
|
27
|
-
onTableSetPage,
|
28
|
-
onTablePerPageSelect,
|
29
22
|
onTableSort,
|
30
23
|
onTableSelect,
|
31
24
|
selectedIds,
|
@@ -68,21 +61,13 @@ const InsightsTable = ({
|
|
68
61
|
onSort={onTableSort}
|
69
62
|
cells={columns}
|
70
63
|
rows={rows}
|
64
|
+
variant="compact"
|
71
65
|
>
|
72
66
|
<TableHeader />
|
73
67
|
<TableBody />
|
74
68
|
</Table>
|
75
69
|
<TableEmptyState status={status} error={error} />
|
76
|
-
<Pagination
|
77
|
-
itemCount={itemCount}
|
78
|
-
widgetId="recommendation-pagination"
|
79
|
-
perPage={perPage}
|
80
|
-
page={page}
|
81
|
-
variant={PaginationVariant.bottom}
|
82
|
-
onSetPage={onTableSetPage}
|
83
|
-
onPerPageSelect={onTablePerPageSelect}
|
84
|
-
perPageOptions={getPerPageOptions(urlPerPage, appPerPage)}
|
85
|
-
/>
|
70
|
+
<Pagination variant="bottom" />
|
86
71
|
</React.Fragment>
|
87
72
|
);
|
88
73
|
};
|
@@ -94,9 +79,6 @@ InsightsTable.propTypes = {
|
|
94
79
|
sortBy: PropTypes.string,
|
95
80
|
sortOrder: PropTypes.string,
|
96
81
|
hits: PropTypes.array.isRequired,
|
97
|
-
itemCount: PropTypes.number.isRequired,
|
98
|
-
onTableSetPage: PropTypes.func.isRequired,
|
99
|
-
onTablePerPageSelect: PropTypes.func.isRequired,
|
100
82
|
onTableSort: PropTypes.func.isRequired,
|
101
83
|
onTableSelect: PropTypes.func.isRequired,
|
102
84
|
selectedIds: PropTypes.object,
|
@@ -5,7 +5,7 @@ import {
|
|
5
5
|
Section,
|
6
6
|
} from '@redhat-cloud-services/frontend-components';
|
7
7
|
import { sortable, cellWidth } from '@patternfly/react-table';
|
8
|
-
import {
|
8
|
+
import { AnsibeTowerIcon } from '@patternfly/react-icons';
|
9
9
|
import { translate as __ } from 'foremanReact/common/I18n';
|
10
10
|
import { foremanUrl } from '../../../ForemanRhCloudHelpers';
|
11
11
|
|
@@ -18,7 +18,14 @@ export const totalRiskFormatter = ({ title: totalRisk }) => ({
|
|
18
18
|
});
|
19
19
|
|
20
20
|
export const hasPlaybookFormatter = ({ title: hasPlaybook }) => ({
|
21
|
-
children: hasPlaybook ?
|
21
|
+
children: hasPlaybook ? (
|
22
|
+
<span className="td-insights-remediate-playbook">
|
23
|
+
<AnsibeTowerIcon />
|
24
|
+
{__('Playbook')}
|
25
|
+
</span>
|
26
|
+
) : (
|
27
|
+
<span className="td-insights-remediate-manual">{__('Manual')}</span>
|
28
|
+
),
|
22
29
|
});
|
23
30
|
|
24
31
|
export const columns = [
|
@@ -34,17 +41,31 @@ export const columns = [
|
|
34
41
|
},
|
35
42
|
{
|
36
43
|
sortKey: 'total_risk',
|
37
|
-
title: __('Total
|
44
|
+
title: __('Total risk'),
|
38
45
|
transforms: [cellWidth(15), sortable],
|
39
46
|
cellTransforms: [totalRiskFormatter],
|
40
47
|
},
|
41
48
|
{
|
42
|
-
title: __('
|
49
|
+
title: __('Remediate'),
|
43
50
|
transforms: [cellWidth(15)],
|
44
51
|
cellTransforms: [hasPlaybookFormatter],
|
45
52
|
},
|
46
53
|
];
|
47
54
|
|
55
|
+
export const paginationTitles = {
|
56
|
+
items: __('items'),
|
57
|
+
page: __('page'),
|
58
|
+
itemsPerPage: __('Items per page'),
|
59
|
+
perPageSuffix: __('per page'),
|
60
|
+
toFirstPage: __('Go to first page'),
|
61
|
+
toPreviousPage: __('Go to previous page'),
|
62
|
+
toLastPage: __('Go to last page'),
|
63
|
+
toNextPage: __('Go to next page'),
|
64
|
+
optionsToggle: __('Items per page'),
|
65
|
+
currPage: __('Current page'),
|
66
|
+
paginationTitle: __('Pagination'),
|
67
|
+
};
|
68
|
+
|
48
69
|
export const INSIGHTS_HITS_PATH = foremanUrl('/insights_cloud/hits');
|
49
70
|
|
50
71
|
export const INSIGHTS_HITS_API_KEY = 'INSIGHTS_HITS';
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { useDispatch, useSelector } from 'react-redux';
|
4
|
+
import {
|
5
|
+
Pagination as PfPagination,
|
6
|
+
PaginationVariant,
|
7
|
+
} from '@patternfly/react-core';
|
8
|
+
import { useForemanSettings } from 'foremanReact/Root/Context/ForemanContext';
|
9
|
+
import { onTablePerPageSelect, onTableSetPage } from './InsightsTableActions';
|
10
|
+
import { getPerPageOptions } from './InsightsTableHelpers';
|
11
|
+
import {
|
12
|
+
selectItemCount,
|
13
|
+
selectPage,
|
14
|
+
selectPerPage,
|
15
|
+
} from './InsightsTableSelectors';
|
16
|
+
|
17
|
+
const Pagination = ({ variant, ...props }) => {
|
18
|
+
const dispatch = useDispatch();
|
19
|
+
const onSetPage = (e, pageNumber) => dispatch(onTableSetPage(e, pageNumber));
|
20
|
+
const onPerPageSelect = (e, perPageNumber) =>
|
21
|
+
dispatch(onTablePerPageSelect(e, perPageNumber));
|
22
|
+
const itemCount = useSelector(state => selectItemCount(state));
|
23
|
+
const urlPerPage = useSelector(state => selectPerPage(state));
|
24
|
+
const page = useSelector(state => selectPage(state));
|
25
|
+
const { perPage: appPerPage } = useForemanSettings();
|
26
|
+
const perPage = urlPerPage || appPerPage;
|
27
|
+
|
28
|
+
return (
|
29
|
+
<PfPagination
|
30
|
+
itemCount={itemCount}
|
31
|
+
widgetId={`recommendation-pagination-${variant}`}
|
32
|
+
perPage={perPage}
|
33
|
+
page={page}
|
34
|
+
variant={PaginationVariant[variant]}
|
35
|
+
onSetPage={onSetPage}
|
36
|
+
onPerPageSelect={onPerPageSelect}
|
37
|
+
perPageOptions={getPerPageOptions(urlPerPage, appPerPage)}
|
38
|
+
{...props}
|
39
|
+
/>
|
40
|
+
);
|
41
|
+
};
|
42
|
+
|
43
|
+
Pagination.propTypes = {
|
44
|
+
variant: PropTypes.string,
|
45
|
+
};
|
46
|
+
|
47
|
+
Pagination.defaultProps = {
|
48
|
+
variant: 'top',
|
49
|
+
};
|
50
|
+
|
51
|
+
export default Pagination;
|
@@ -18,7 +18,7 @@ const SelectAllAlert = ({
|
|
18
18
|
<Alert
|
19
19
|
isInline
|
20
20
|
variant="info"
|
21
|
-
title={sprintf('Recommendations selected: %s.', selectedCount)}
|
21
|
+
title={sprintf(__('Recommendations selected: %s.'), selectedCount)}
|
22
22
|
actionLinks={
|
23
23
|
<AlertActionLink onClick={selectAll}>
|
24
24
|
{__('Select recommendations from all pages')}
|
@@ -37,7 +37,7 @@ exports[`InsightsTable rendering render with Props 1`] = `
|
|
37
37
|
[Function],
|
38
38
|
],
|
39
39
|
"sortKey": "total_risk",
|
40
|
-
"title": "Total
|
40
|
+
"title": "Total risk",
|
41
41
|
"transforms": Array [
|
42
42
|
[Function],
|
43
43
|
[Function],
|
@@ -47,7 +47,7 @@ exports[`InsightsTable rendering render with Props 1`] = `
|
|
47
47
|
"cellTransforms": Array [
|
48
48
|
[Function],
|
49
49
|
],
|
50
|
-
"title": "
|
50
|
+
"title": "Remediate",
|
51
51
|
"transforms": Array [
|
52
52
|
[Function],
|
53
53
|
],
|
@@ -74,7 +74,7 @@ exports[`InsightsTable rendering render with Props 1`] = `
|
|
74
74
|
"index": 3,
|
75
75
|
}
|
76
76
|
}
|
77
|
-
variant=
|
77
|
+
variant="compact"
|
78
78
|
>
|
79
79
|
<TableHeader />
|
80
80
|
<Component />
|
@@ -84,72 +84,7 @@ exports[`InsightsTable rendering render with Props 1`] = `
|
|
84
84
|
status="RESOLVED"
|
85
85
|
/>
|
86
86
|
<Pagination
|
87
|
-
className=""
|
88
|
-
defaultToFullPage={false}
|
89
|
-
firstPage={1}
|
90
|
-
isCompact={false}
|
91
|
-
isDisabled={false}
|
92
|
-
isSticky={false}
|
93
|
-
itemCount={2}
|
94
|
-
itemsEnd={null}
|
95
|
-
itemsStart={null}
|
96
|
-
offset={0}
|
97
|
-
onFirstClick={[Function]}
|
98
|
-
onLastClick={[Function]}
|
99
|
-
onNextClick={[Function]}
|
100
|
-
onPageInput={[Function]}
|
101
|
-
onPerPageSelect={[Function]}
|
102
|
-
onPreviousClick={[Function]}
|
103
|
-
onSetPage={[Function]}
|
104
|
-
ouiaSafe={true}
|
105
|
-
page={1}
|
106
|
-
perPage={5}
|
107
|
-
perPageOptions={
|
108
|
-
Array [
|
109
|
-
Object {
|
110
|
-
"title": "5",
|
111
|
-
"value": 5,
|
112
|
-
},
|
113
|
-
Object {
|
114
|
-
"title": "10",
|
115
|
-
"value": 10,
|
116
|
-
},
|
117
|
-
Object {
|
118
|
-
"title": "15",
|
119
|
-
"value": 15,
|
120
|
-
},
|
121
|
-
Object {
|
122
|
-
"title": "20",
|
123
|
-
"value": 20,
|
124
|
-
},
|
125
|
-
Object {
|
126
|
-
"title": "25",
|
127
|
-
"value": 25,
|
128
|
-
},
|
129
|
-
Object {
|
130
|
-
"title": "50",
|
131
|
-
"value": 50,
|
132
|
-
},
|
133
|
-
]
|
134
|
-
}
|
135
|
-
titles={
|
136
|
-
Object {
|
137
|
-
"currPage": "Current page",
|
138
|
-
"items": "",
|
139
|
-
"itemsPerPage": "Items per page",
|
140
|
-
"optionsToggle": "Items per page",
|
141
|
-
"page": "",
|
142
|
-
"paginationTitle": "Pagination",
|
143
|
-
"perPageSuffix": "per page",
|
144
|
-
"toFirstPage": "Go to first page",
|
145
|
-
"toLastPage": "Go to last page",
|
146
|
-
"toNextPage": "Go to next page",
|
147
|
-
"toPreviousPage": "Go to previous page",
|
148
|
-
}
|
149
|
-
}
|
150
|
-
toggleTemplate={[Function]}
|
151
87
|
variant="bottom"
|
152
|
-
widgetId="recommendation-pagination"
|
153
88
|
/>
|
154
89
|
</Fragment>
|
155
90
|
`;
|