foreman_rh_cloud 3.0.19 → 4.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -5
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +17 -7
- data/app/controllers/insights_cloud/hits_controller.rb +37 -0
- data/app/controllers/insights_cloud/settings_controller.rb +1 -1
- data/app/controllers/insights_cloud/tasks_controller.rb +1 -2
- data/app/models/insights_client_report_status.rb +58 -0
- data/app/models/inventory_sync/inventory_status.rb +6 -0
- data/app/models/setting/rh_cloud.rb +5 -5
- data/app/services/foreman_rh_cloud/cloud_auth.rb +12 -0
- data/app/services/foreman_rh_cloud/cloud_connector.rb +1 -1
- data/app/services/foreman_rh_cloud/cloud_request.rb +14 -0
- data/app/services/foreman_rh_cloud/cloud_request_forwarder.rb +1 -6
- data/app/services/foreman_rh_cloud/remediations_retriever.rb +75 -0
- data/app/services/foreman_rh_cloud/template_renderer_helper.rb +22 -0
- data/app/subscribers/foreman_rh_cloud/insights_subscriber.rb +9 -0
- data/app/views/job_templates/rh_cloud_remediations.erb +14 -0
- data/config/routes.rb +1 -0
- data/db/migrate/20210404000001_change_resolutions.foreman_rh_cloud.rb +10 -0
- data/db/seeds.d/179_ui_notifications.rb +11 -0
- data/db/seeds.d/50_job_templates.rb +14 -0
- data/lib/foreman_inventory_upload.rb +5 -1
- data/lib/foreman_inventory_upload/async/generate_all_reports_job.rb +8 -2
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +19 -0
- data/lib/foreman_inventory_upload/generators/queries.rb +3 -2
- data/lib/foreman_inventory_upload/generators/slice.rb +6 -6
- data/lib/foreman_inventory_upload/generators/tags.rb +8 -6
- data/lib/foreman_rh_cloud.rb +18 -0
- data/lib/foreman_rh_cloud/engine.rb +36 -2
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/insights_cloud.rb +12 -0
- data/lib/insights_cloud/async/insights_full_sync.rb +31 -22
- data/lib/insights_cloud/async/insights_generate_notifications.rb +58 -0
- data/lib/insights_cloud/async/insights_resolutions_sync.rb +66 -0
- data/lib/insights_cloud/async/insights_rules_sync.rb +15 -24
- data/lib/insights_cloud/async/insights_scheduled_sync.rb +1 -1
- data/lib/inventory_sync/async/inventory_full_sync.rb +2 -1
- data/lib/inventory_sync/async/inventory_scheduled_sync.rb +25 -0
- data/lib/inventory_sync/async/query_inventory_job.rb +1 -4
- data/lib/tasks/insights.rake +4 -12
- data/lib/tasks/rh_cloud_inventory.rake +18 -4
- data/package.json +1 -1
- data/test/factories/insights_factories.rb +22 -0
- data/test/factories/inventory_upload_factories.rb +1 -1
- data/test/jobs/insights_full_sync_test.rb +17 -8
- data/test/jobs/insights_resolutions_sync_test.rb +77 -0
- data/test/jobs/insights_rules_sync_test.rb +8 -3
- data/test/jobs/inventory_full_sync_test.rb +4 -1
- data/test/models/insights_client_report_status_test.rb +77 -0
- data/test/test_plugin_helper.rb +0 -1
- data/test/unit/rh_cloud_http_proxy_test.rb +4 -4
- data/test/unit/services/foreman_rh_cloud/remediations_retriever_test.rb +49 -0
- data/test/unit/services/foreman_rh_cloud/template_renderer_helper_test.rb +28 -0
- data/test/unit/slice_generator_test.rb +66 -29
- data/test/unit/tags_generator_test.rb +10 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +1 -1
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +14 -16
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/AdvancedSettingsConstants.js +5 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +15 -2
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/__snapshots__/PageDescription.test.js.snap +13 -2
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js +28 -63
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/integrations.test.js.snap +2 -3
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap +2 -2
- data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +25 -27
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +1 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableActions.js +19 -19
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableSelectors.js +3 -0
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/__snapshots__/InsightsTableActions.test.js.snap +14 -14
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediateButton.js +59 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationActions.js +12 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationHelpers.js +43 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +101 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.scss +9 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js +43 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationTableConstants.js +38 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/Resolutions.js +55 -0
- data/webpack/InsightsCloudSync/Components/RemediationModal/index.js +34 -0
- data/webpack/InsightsCloudSync/InsightsCloudSync.js +11 -3
- data/webpack/InsightsCloudSync/InsightsCloudSync.scss +5 -0
- data/webpack/InsightsCloudSync/InsightsCloudSyncActions.js +44 -20
- data/webpack/InsightsCloudSync/InsightsCloudSyncConstants.js +2 -0
- data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +9 -6
- data/webpack/InsightsCloudSync/__tests__/__snapshots__/InsightsCloudSyncActions.test.js.snap +11 -7
- data/webpack/common/ForemanTasks/ForemanTasksActions.js +64 -0
- data/webpack/common/ForemanTasks/ForemanTasksHelpers.js +7 -0
- data/webpack/common/ForemanTasks/index.js +1 -0
- data/webpack/{InsightsCloudSync/Components/InsightsTable/components → common/table}/EmptyState.js +0 -0
- data/webpack/common/table/helpers.js +7 -0
- metadata +38 -4
@@ -52,6 +52,16 @@ class TagsGeneratorTest < ActiveSupport::TestCase
|
|
52
52
|
assert_equal @host.organization_id.to_s, actual['organization_id'].first.last
|
53
53
|
end
|
54
54
|
|
55
|
+
test 'filters tags with empty values' do
|
56
|
+
generator = create_generator
|
57
|
+
|
58
|
+
@host.stubs(:content_view)
|
59
|
+
|
60
|
+
actual = generator.generate.group_by { |key, value| key }
|
61
|
+
|
62
|
+
assert_equal false, actual.key?('content_view')
|
63
|
+
end
|
64
|
+
|
55
65
|
private
|
56
66
|
|
57
67
|
def create_generator
|
@@ -8,7 +8,7 @@ exports[`FullScreenModal rendering render without Props 1`] = `
|
|
8
8
|
bsClass="modal"
|
9
9
|
dialogComponentClass={[Function]}
|
10
10
|
enforceFocus={true}
|
11
|
-
id="full-screen-terminal"
|
11
|
+
id="rh-cloud-inventory-full-screen-terminal"
|
12
12
|
keyboard={true}
|
13
13
|
manager={
|
14
14
|
ModalManager {
|
@@ -1,21 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
margin: 30px 0 0 30px;
|
1
|
+
#rh-cloud-inventory-full-screen-terminal {
|
2
|
+
.modal-dialog {
|
3
|
+
width: 95%;
|
4
|
+
height: 95%;
|
5
|
+
margin: 30px 0 0 30px;
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
.modal-body {
|
8
|
+
padding: 0;
|
9
|
+
display: flex;
|
10
|
+
height: -webkit-fill-available;
|
11
|
+
height: -moz-available;
|
12
|
+
height: fill-available;
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
14
|
+
.rh-cloud-inventory-terminal {
|
15
|
+
margin: 0 -20px;
|
16
|
+
height: 100%;
|
19
17
|
}
|
20
18
|
}
|
21
19
|
}
|
@@ -3,7 +3,7 @@ import { translate as __ } from 'foremanReact/common/I18n';
|
|
3
3
|
export const settingsDict = {
|
4
4
|
autoUploadEnabled: {
|
5
5
|
name: 'allow_auto_inventory_upload',
|
6
|
-
label: __('
|
6
|
+
label: __('Automatic inventory upload'),
|
7
7
|
tooltip: __(
|
8
8
|
'Enable automatic upload of your hosts inventory to the Red Hat cloud'
|
9
9
|
),
|
@@ -20,7 +20,9 @@ export const settingsDict = {
|
|
20
20
|
},
|
21
21
|
excludePackagesEnabled: {
|
22
22
|
name: 'exclude_installed_packages',
|
23
|
-
label: __('Exclude Packages'),
|
24
|
-
tooltip: __(
|
23
|
+
label: __('Exclude installed Packages'),
|
24
|
+
tooltip: __(
|
25
|
+
'Exclude installed packages from being uploaded to the Red Hat cloud'
|
26
|
+
),
|
25
27
|
},
|
26
28
|
};
|
@@ -10,14 +10,27 @@ export const PageDescription = () => (
|
|
10
10
|
</p>
|
11
11
|
<p>
|
12
12
|
{__(
|
13
|
-
'
|
13
|
+
'You can toggle the Auto upload switch to the ON position to enable Satellite to automatically upload your host inventory once a day.'
|
14
14
|
)}
|
15
15
|
</p>
|
16
16
|
<p>
|
17
17
|
{__(
|
18
|
-
'
|
18
|
+
'Click Restart to upload your host inventory to Red Hat Insights. Perform this step for each organization from which you want to manually upload a host inventory.'
|
19
19
|
)}
|
20
20
|
</p>
|
21
|
+
<p>
|
22
|
+
{__(
|
23
|
+
'Enabling inventory uploads is required by subscription watch. For more information about subscription watch see link:'
|
24
|
+
)}
|
25
|
+
|
26
|
+
<a
|
27
|
+
href="https://access.redhat.com/documentation/en-us/subscription_central/2020-04/html/getting_started_with_subscription_watch/assembly-about-subscriptionwatch"
|
28
|
+
target="_blank"
|
29
|
+
rel="noopener noreferrer"
|
30
|
+
>
|
31
|
+
About subscription watch
|
32
|
+
</a>
|
33
|
+
</p>
|
21
34
|
</div>
|
22
35
|
);
|
23
36
|
|
@@ -8,10 +8,21 @@ exports[`PageDescription rendering render without Props 1`] = `
|
|
8
8
|
Red Hat Insights is a set of cloud services which provide unified subscription reporting, predictive analysis and remediation of issues through this Satellite instance.
|
9
9
|
</p>
|
10
10
|
<p>
|
11
|
-
|
11
|
+
You can toggle the Auto upload switch to the ON position to enable Satellite to automatically upload your host inventory once a day.
|
12
12
|
</p>
|
13
13
|
<p>
|
14
|
-
|
14
|
+
Click Restart to upload your host inventory to Red Hat Insights. Perform this step for each organization from which you want to manually upload a host inventory.
|
15
|
+
</p>
|
16
|
+
<p>
|
17
|
+
Enabling inventory uploads is required by subscription watch. For more information about subscription watch see link:
|
18
|
+
|
19
|
+
<a
|
20
|
+
href="https://access.redhat.com/documentation/en-us/subscription_central/2020-04/html/getting_started_with_subscription_watch/assembly-about-subscriptionwatch"
|
21
|
+
rel="noopener noreferrer"
|
22
|
+
target="_blank"
|
23
|
+
>
|
24
|
+
About subscription watch
|
25
|
+
</a>
|
15
26
|
</p>
|
16
27
|
</div>
|
17
28
|
`;
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
import { withInterval } from 'foremanReact/redux/middlewares/IntervalMiddleware';
|
2
|
+
import { post } from 'foremanReact/redux/API';
|
4
3
|
import { addToast } from 'foremanReact/redux/actions/toasts';
|
5
4
|
import { translate as __ } from 'foremanReact/common/I18n';
|
6
5
|
import { inventoryUrl } from '../../../../ForemanInventoryHelpers';
|
@@ -9,7 +8,10 @@ import {
|
|
9
8
|
INVENTORY_SYNC,
|
10
9
|
INVENTORY_SYNC_TASK_UPDATE,
|
11
10
|
} from './SyncButtonConstants';
|
12
|
-
import {
|
11
|
+
import {
|
12
|
+
setupTaskPolling,
|
13
|
+
taskRelatedToast,
|
14
|
+
} from '../../../../../common/ForemanTasks';
|
13
15
|
|
14
16
|
export const handleSync = () => dispatch => {
|
15
17
|
dispatch(
|
@@ -21,9 +23,9 @@ export const handleSync = () => dispatch => {
|
|
21
23
|
task: { id },
|
22
24
|
},
|
23
25
|
}) => {
|
24
|
-
dispatch(
|
26
|
+
dispatch(setupInventorySyncTaskPolling(id, dispatch));
|
25
27
|
return dispatch(
|
26
|
-
|
28
|
+
taskRelatedToast(id, 'info', __('Inventory sync has started:'))
|
27
29
|
);
|
28
30
|
},
|
29
31
|
errorToast: inventorySyncErrorToast,
|
@@ -31,62 +33,25 @@ export const handleSync = () => dispatch => {
|
|
31
33
|
);
|
32
34
|
};
|
33
35
|
|
34
|
-
export const
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
),
|
52
|
-
})
|
53
|
-
);
|
54
|
-
}
|
55
|
-
if (result === 'error') {
|
56
|
-
dispatch(
|
57
|
-
taskPageRefererToast(
|
58
|
-
id,
|
59
|
-
'error',
|
60
|
-
__('Inventory sync has failed:'),
|
61
|
-
true
|
62
|
-
)
|
63
|
-
);
|
64
|
-
}
|
65
|
-
stopTaskInterval();
|
66
|
-
},
|
67
|
-
errorToast: inventorySyncErrorToast,
|
68
|
-
})
|
69
|
-
)
|
70
|
-
);
|
71
|
-
};
|
72
|
-
|
73
|
-
const inventorySyncErrorToast = ({ message, response }) =>
|
74
|
-
`${__('Inventory sync has failed: ')} ${response.data?.message || message}`;
|
75
|
-
|
76
|
-
const taskPageRefererToast = (taskID, toastType, prefix, sticky = false) =>
|
77
|
-
addToast({
|
78
|
-
sticky,
|
79
|
-
type: toastType,
|
80
|
-
message: (
|
81
|
-
<span>
|
82
|
-
{prefix}{' '}
|
83
|
-
<a
|
84
|
-
target="_blank"
|
85
|
-
rel="noopener noreferrer"
|
86
|
-
href={foremanUrl(`/foreman_tasks/tasks/${taskID}`)}
|
87
|
-
>
|
88
|
-
{__('view the task page for more details')}
|
89
|
-
</a>
|
90
|
-
</span>
|
91
|
-
),
|
36
|
+
export const setupInventorySyncTaskPolling = (id, dispatch) =>
|
37
|
+
setupTaskPolling({
|
38
|
+
taskId: id,
|
39
|
+
key: INVENTORY_SYNC_TASK_UPDATE,
|
40
|
+
onTaskSuccess: ({
|
41
|
+
output: {
|
42
|
+
host_statuses: { sync, disconnect },
|
43
|
+
},
|
44
|
+
}) =>
|
45
|
+
dispatch(
|
46
|
+
addToast({
|
47
|
+
sticky: true,
|
48
|
+
type: 'success',
|
49
|
+
message: <Toast syncHosts={sync} disconnectHosts={disconnect} />,
|
50
|
+
})
|
51
|
+
),
|
52
|
+
dispatch,
|
92
53
|
});
|
54
|
+
|
55
|
+
const inventorySyncErrorToast = message =>
|
56
|
+
`${__('Inventory sync has failed: ')} ${message.response?.data?.message ||
|
57
|
+
message}`;
|
@@ -22,7 +22,7 @@ Array [
|
|
22
22
|
"errorToast": [Function],
|
23
23
|
"interval": 3000,
|
24
24
|
"type": "API_GET",
|
25
|
-
"url": "/
|
25
|
+
"url": "/foreman_tasks/api/tasks/1/details?include_permissions",
|
26
26
|
},
|
27
27
|
],
|
28
28
|
Array [
|
@@ -31,7 +31,7 @@ Array [
|
|
31
31
|
"message": Object {
|
32
32
|
"message": <span>
|
33
33
|
Inventory sync has started:
|
34
|
-
|
34
|
+
<br />
|
35
35
|
<a
|
36
36
|
href="/foreman_tasks/tasks/1"
|
37
37
|
rel="noopener noreferrer"
|
@@ -40,7 +40,6 @@ Array [
|
|
40
40
|
view the task page for more details
|
41
41
|
</a>
|
42
42
|
</span>,
|
43
|
-
"sticky": false,
|
44
43
|
"type": "info",
|
45
44
|
},
|
46
45
|
},
|
@@ -29,6 +29,6 @@ describe('Terminal', () => {
|
|
29
29
|
const text = 'some-string-log';
|
30
30
|
const modifiedProps = { ...props, logs: text };
|
31
31
|
const wrapper = mount(<Terminal {...modifiedProps} />);
|
32
|
-
expect(wrapper.find('.terminal p').text()).toEqual(text);
|
32
|
+
expect(wrapper.find('.rh-cloud-inventory-terminal p').text()).toEqual(text);
|
33
33
|
});
|
34
34
|
});
|
@@ -7,7 +7,7 @@ exports[`Terminal rendering render with props 1`] = `
|
|
7
7
|
sm={12}
|
8
8
|
>
|
9
9
|
<div
|
10
|
-
className="terminal"
|
10
|
+
className="rh-cloud-inventory-terminal"
|
11
11
|
onScroll={[Function]}
|
12
12
|
>
|
13
13
|
<Grid
|
@@ -65,7 +65,7 @@ exports[`Terminal rendering render without Props 1`] = `
|
|
65
65
|
sm={12}
|
66
66
|
>
|
67
67
|
<div
|
68
|
-
className="terminal"
|
68
|
+
className="rh-cloud-inventory-terminal"
|
69
69
|
onScroll={[Function]}
|
70
70
|
>
|
71
71
|
<Grid
|
@@ -1,34 +1,32 @@
|
|
1
|
-
.rh-cloud-inventory-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
overflow-x: hidden;
|
1
|
+
.rh-cloud-inventory-terminal {
|
2
|
+
height: 200px;
|
3
|
+
background-color: #222;
|
4
|
+
padding: 10px 0;
|
5
|
+
margin-bottom: 20px;
|
6
|
+
overflow-y: scroll;
|
7
|
+
overflow-x: hidden;
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
p {
|
10
|
+
font-family: monospace;
|
11
|
+
font-size: 16px;
|
12
|
+
color: #22da26;
|
13
|
+
overflow-wrap: anywhere;
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
}
|
15
|
+
&.terminal_error {
|
16
|
+
color: #f00;
|
19
17
|
}
|
18
|
+
}
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
&::-webkit-scrollbar {
|
21
|
+
width: 12px;
|
22
|
+
height: 12px;
|
23
|
+
background: #aaa;
|
24
|
+
}
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
26
|
+
&::-webkit-scrollbar-thumb {
|
27
|
+
background: #222;
|
28
|
+
border-radius: 6px;
|
29
|
+
border: 3px solid transparent;
|
30
|
+
background-clip: content-box;
|
33
31
|
}
|
34
32
|
}
|
@@ -6,7 +6,7 @@ import { Table, TableHeader, TableBody } from '@patternfly/react-table';
|
|
6
6
|
import { useForemanSettings } from 'foremanReact/Root/Context/ForemanContext';
|
7
7
|
import SelectAllAlert from './SelectAllAlert';
|
8
8
|
import { columns } from './InsightsTableConstants';
|
9
|
-
import TableEmptyState from '
|
9
|
+
import TableEmptyState from '../../../common/table/EmptyState';
|
10
10
|
import {
|
11
11
|
modifySelectedRows,
|
12
12
|
getSortColumnIndex,
|
@@ -19,25 +19,6 @@ export const fetchInsights = (queryParams = {}) => (dispatch, getState) => {
|
|
19
19
|
...queryParams,
|
20
20
|
};
|
21
21
|
|
22
|
-
dispatch(
|
23
|
-
get({
|
24
|
-
key: INSIGHTS_HITS_API_KEY,
|
25
|
-
url: INSIGHTS_HITS_PATH,
|
26
|
-
params: {
|
27
|
-
page,
|
28
|
-
per_page: perPage,
|
29
|
-
search: query,
|
30
|
-
order: `${sortBy} ${sortOrder}`,
|
31
|
-
},
|
32
|
-
handleSuccess: response => {
|
33
|
-
if (isSelectAll) {
|
34
|
-
selectAllIds(dispatch, response.data.hits || []);
|
35
|
-
dispatch(selectAll());
|
36
|
-
}
|
37
|
-
},
|
38
|
-
})
|
39
|
-
);
|
40
|
-
|
41
22
|
const uri = new URI();
|
42
23
|
uri.search({
|
43
24
|
page,
|
@@ -58,6 +39,25 @@ export const fetchInsights = (queryParams = {}) => (dispatch, getState) => {
|
|
58
39
|
if (!isSelectAll) {
|
59
40
|
dispatch(setSelectAllAlert(false));
|
60
41
|
}
|
42
|
+
|
43
|
+
return dispatch(
|
44
|
+
get({
|
45
|
+
key: INSIGHTS_HITS_API_KEY,
|
46
|
+
url: INSIGHTS_HITS_PATH,
|
47
|
+
params: {
|
48
|
+
page,
|
49
|
+
per_page: perPage,
|
50
|
+
search: query,
|
51
|
+
order: `${sortBy} ${sortOrder}`,
|
52
|
+
},
|
53
|
+
handleSuccess: response => {
|
54
|
+
if (isSelectAll) {
|
55
|
+
selectAllIds(dispatch, response.data.hits || []);
|
56
|
+
dispatch(selectAll());
|
57
|
+
}
|
58
|
+
},
|
59
|
+
})
|
60
|
+
);
|
61
61
|
};
|
62
62
|
|
63
63
|
const selectAllIds = (dispatch, results, prevSelectedIds = {}) => {
|