foreman_rh_cloud 14.1.3 → 14.2.1
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 +4 -4
- data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +157 -5
- data/lib/foreman_rh_cloud/plugin.rb +16 -5
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +1 -1
- data/test/unit/services/foreman_rh_cloud/insights_api_forwarder_test.rb +240 -4
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +0 -6
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/EmptyResults.js +15 -6
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss +1 -5
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +15 -7
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +1 -3
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +1 -5
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +2 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +2 -6
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +0 -2
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js +13 -10
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +30 -11
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +3 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss +28 -22
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +4 -4
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss +16 -3
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/MinimalInventoryDropdown.js +13 -14
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +7 -9
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +3 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +65 -42
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +4 -12
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageTitle.test.js +110 -6
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +31 -38
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +3 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/ToolbarButtons.js +0 -4
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/__tests__/ToolbarButtons.test.js +18 -47
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +4 -4
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +29 -22
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +6 -2
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +19 -1
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +90 -23
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableActions.js +1 -2
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +24 -30
- data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableHelpers.js +5 -6
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTable.test.js +193 -8
- data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableActions.test.js +4 -1
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationHelpers.js +8 -9
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +26 -13
- data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationTableConstants.js +12 -10
- data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +21 -9
- data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +12 -19
- data/webpack/InsightsCloudSync/__tests__/InsightsCloudSyncActions.test.js +0 -1
- data/webpack/common/DropdownToggle.js +20 -6
- metadata +2 -54
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +0 -25
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +0 -17
- data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +0 -5
- data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +0 -20
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +0 -66
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +0 -69
- data/webpack/ForemanInventoryUpload/Components/NavContainer/index.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +0 -9
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorActions.js +0 -21
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorButton.js +0 -59
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorConstants.js +0 -6
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorSelectors.js +0 -19
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorButton.test.js +0 -51
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js +0 -34
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.js +0 -66
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.test.js +0 -61
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/index.js +0 -25
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +0 -4
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +0 -29
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +0 -33
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +0 -12
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +0 -13
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +0 -57
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +0 -30
- data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +0 -10
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +0 -24
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +0 -15
- data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +0 -10
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +0 -19
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +0 -15
- data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +0 -85
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +0 -114
- data/webpack/ForemanInventoryUpload/Components/TabHeader/index.js +0 -1
- data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +0 -23
- data/webpack/common/Switcher/index.js +0 -80
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Dropdown,
|
|
3
|
+
import { Dropdown, DropdownList, MenuToggle } from '@patternfly/react-core';
|
|
4
|
+
import { EllipsisVIcon } from '@patternfly/react-icons';
|
|
5
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
|
4
6
|
|
|
5
7
|
const DropdownToggle = ({ items, ...props }) => {
|
|
6
8
|
const [isOpen, setOpen] = useState(false);
|
|
@@ -8,13 +10,25 @@ const DropdownToggle = ({ items, ...props }) => {
|
|
|
8
10
|
<Dropdown
|
|
9
11
|
ouiaId="toggle-dropdown"
|
|
10
12
|
onSelect={() => setOpen(false)}
|
|
11
|
-
|
|
13
|
+
onOpenChange={setOpen}
|
|
14
|
+
toggle={toggleRef => (
|
|
15
|
+
<MenuToggle
|
|
16
|
+
ref={toggleRef}
|
|
17
|
+
variant="plain"
|
|
18
|
+
aria-label={__('Table actions')}
|
|
19
|
+
onClick={() => setOpen(prev => !prev)}
|
|
20
|
+
isExpanded={isOpen}
|
|
21
|
+
>
|
|
22
|
+
<EllipsisVIcon />
|
|
23
|
+
</MenuToggle>
|
|
24
|
+
)}
|
|
12
25
|
isOpen={isOpen}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
position="right"
|
|
26
|
+
shouldFocusToggleOnSelect
|
|
27
|
+
popperProps={{ position: 'right' }}
|
|
16
28
|
{...props}
|
|
17
|
-
|
|
29
|
+
>
|
|
30
|
+
<DropdownList>{items}</DropdownList>
|
|
31
|
+
</Dropdown>
|
|
18
32
|
);
|
|
19
33
|
};
|
|
20
34
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_rh_cloud
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 14.1
|
|
4
|
+
version: 14.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Foreman Red Hat Cloud team
|
|
@@ -334,12 +334,6 @@ files:
|
|
|
334
334
|
- webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js
|
|
335
335
|
- webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss
|
|
336
336
|
- webpack/ForemanInventoryUpload/Components/Dashboard/index.js
|
|
337
|
-
- webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js
|
|
338
|
-
- webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js
|
|
339
|
-
- webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js
|
|
340
|
-
- webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js
|
|
341
|
-
- webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss
|
|
342
|
-
- webpack/ForemanInventoryUpload/Components/FileDownload/index.js
|
|
343
337
|
- webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js
|
|
344
338
|
- webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js
|
|
345
339
|
- webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js
|
|
@@ -362,30 +356,15 @@ files:
|
|
|
362
356
|
- webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettingsSelectors.js
|
|
363
357
|
- webpack/ForemanInventoryUpload/Components/InventorySettings/MinimalInventoryDropdown.js
|
|
364
358
|
- webpack/ForemanInventoryUpload/Components/InventorySettings/index.js
|
|
365
|
-
- webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js
|
|
366
|
-
- webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js
|
|
367
|
-
- webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js
|
|
368
|
-
- webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js
|
|
369
|
-
- webpack/ForemanInventoryUpload/Components/NavContainer/index.js
|
|
370
|
-
- webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss
|
|
371
359
|
- webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js
|
|
372
360
|
- webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss
|
|
373
361
|
- webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js
|
|
374
362
|
- webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js
|
|
375
363
|
- webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageTitle.test.js
|
|
376
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorActions.js
|
|
377
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorButton.js
|
|
378
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorConstants.js
|
|
379
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/CloudConnectorSelectors.js
|
|
380
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorButton.test.js
|
|
381
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
|
|
382
364
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js
|
|
383
365
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js
|
|
384
366
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/__tests__/PageDescription.test.js
|
|
385
367
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/index.js
|
|
386
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.js
|
|
387
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.test.js
|
|
388
|
-
- webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/index.js
|
|
389
368
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
|
|
390
369
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js
|
|
391
370
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonConstants.js
|
|
@@ -402,36 +381,6 @@ files:
|
|
|
402
381
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/index.js
|
|
403
382
|
- webpack/ForemanInventoryUpload/Components/PageHeader/components/ToolbarButtons/toolbarButtons.scss
|
|
404
383
|
- webpack/ForemanInventoryUpload/Components/PageHeader/index.js
|
|
405
|
-
- webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js
|
|
406
|
-
- webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js
|
|
407
|
-
- webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js
|
|
408
|
-
- webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js
|
|
409
|
-
- webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js
|
|
410
|
-
- webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss
|
|
411
|
-
- webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js
|
|
412
|
-
- webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js
|
|
413
|
-
- webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js
|
|
414
|
-
- webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js
|
|
415
|
-
- webpack/ForemanInventoryUpload/Components/StatusChart/index.js
|
|
416
|
-
- webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss
|
|
417
|
-
- webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js
|
|
418
|
-
- webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js
|
|
419
|
-
- webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js
|
|
420
|
-
- webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js
|
|
421
|
-
- webpack/ForemanInventoryUpload/Components/TabContainer/index.js
|
|
422
|
-
- webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss
|
|
423
|
-
- webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js
|
|
424
|
-
- webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js
|
|
425
|
-
- webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js
|
|
426
|
-
- webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js
|
|
427
|
-
- webpack/ForemanInventoryUpload/Components/TabFooter/index.js
|
|
428
|
-
- webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss
|
|
429
|
-
- webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js
|
|
430
|
-
- webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js
|
|
431
|
-
- webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js
|
|
432
|
-
- webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js
|
|
433
|
-
- webpack/ForemanInventoryUpload/Components/TabHeader/index.js
|
|
434
|
-
- webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss
|
|
435
384
|
- webpack/ForemanInventoryUpload/Components/TaskHistory/TaskHistory.js
|
|
436
385
|
- webpack/ForemanInventoryUpload/Components/TaskHistory/index.js
|
|
437
386
|
- webpack/ForemanInventoryUpload/Components/TaskHistory/taskHistory.scss
|
|
@@ -557,7 +506,6 @@ files:
|
|
|
557
506
|
- webpack/common/Switcher/SwitcherPF4.scss
|
|
558
507
|
- webpack/common/Switcher/__tests__/HelpLabel.test.js
|
|
559
508
|
- webpack/common/Switcher/__tests__/SwitcherPF4.test.js
|
|
560
|
-
- webpack/common/Switcher/index.js
|
|
561
509
|
- webpack/common/styles.scss
|
|
562
510
|
- webpack/common/table/EmptyState.js
|
|
563
511
|
- webpack/common/table/helpers.js
|
|
@@ -584,7 +532,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
584
532
|
- !ruby/object:Gem::Version
|
|
585
533
|
version: '0'
|
|
586
534
|
requirements: []
|
|
587
|
-
rubygems_version: 4.0.
|
|
535
|
+
rubygems_version: 4.0.10
|
|
588
536
|
specification_version: 4
|
|
589
537
|
summary: Summary of ForemanRhCloud.
|
|
590
538
|
test_files:
|
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Grid, Button, Icon } from 'patternfly-react';
|
|
4
|
-
import { noop } from 'foremanReact/common/helpers';
|
|
5
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
6
|
-
|
|
7
|
-
import './fileDownload.scss';
|
|
8
|
-
|
|
9
|
-
const FileDownload = ({ onClick }) => (
|
|
10
|
-
<Grid.Col sm={12}>
|
|
11
|
-
<Button onClick={onClick} className="download-button">
|
|
12
|
-
{__('Download Report')} <Icon name="download" />
|
|
13
|
-
</Button>
|
|
14
|
-
</Grid.Col>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
FileDownload.propTypes = {
|
|
18
|
-
onClick: PropTypes.func,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
FileDownload.defaultProps = {
|
|
22
|
-
onClick: noop,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default FileDownload;
|
|
File without changes
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
-
import FileDownload from '../FileDownload';
|
|
4
|
-
|
|
5
|
-
describe('FileDownload', () => {
|
|
6
|
-
it('renders the download button', () => {
|
|
7
|
-
render(<FileDownload />);
|
|
8
|
-
expect(screen.getByRole('button', { name: /Download Report/ })).toBeTruthy();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('calls onClick when button is clicked', () => {
|
|
12
|
-
const onClick = jest.fn();
|
|
13
|
-
render(<FileDownload onClick={onClick} />);
|
|
14
|
-
fireEvent.click(screen.getByRole('button', { name: /Download Report/ }));
|
|
15
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './FileDownload';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { noop } from 'foremanReact/common/helpers';
|
|
3
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
4
|
-
|
|
5
|
-
export const props = {
|
|
6
|
-
items: [
|
|
7
|
-
{
|
|
8
|
-
icon: 'some-icon',
|
|
9
|
-
name: __('Generating'),
|
|
10
|
-
component: () => <p>test1</p>,
|
|
11
|
-
onClick: noop,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
icon: 'other-icon',
|
|
15
|
-
name: __('Uploading'),
|
|
16
|
-
component: () => <p>test2</p>,
|
|
17
|
-
onClick: noop,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import {
|
|
5
|
-
TabContainer,
|
|
6
|
-
Nav,
|
|
7
|
-
NavItem,
|
|
8
|
-
TabContent,
|
|
9
|
-
TabPane,
|
|
10
|
-
Icon,
|
|
11
|
-
} from 'patternfly-react';
|
|
12
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
13
|
-
import './navContainer.scss';
|
|
14
|
-
import { selectSubscriptionConnectionEnabled } from '../InventorySettings/InventorySettingsSelectors';
|
|
15
|
-
|
|
16
|
-
const NavContainer = ({ items }) => {
|
|
17
|
-
const subscriptionConnectionEnabled = useSelector(
|
|
18
|
-
selectSubscriptionConnectionEnabled
|
|
19
|
-
);
|
|
20
|
-
const navItems = items.map((item, index) => {
|
|
21
|
-
const { name, icon, onClick } = item;
|
|
22
|
-
if (name === __('Uploading') && !subscriptionConnectionEnabled) return null;
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<NavItem
|
|
26
|
-
key={index}
|
|
27
|
-
eventKey={index}
|
|
28
|
-
onClick={onClick}
|
|
29
|
-
className="nav_item"
|
|
30
|
-
>
|
|
31
|
-
<Icon name={icon} size="2x" />
|
|
32
|
-
<p>{name}</p>
|
|
33
|
-
</NavItem>
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
const tabComponents = items.map(({ component: Component, props }, index) => (
|
|
37
|
-
<TabPane key={index} eventKey={index}>
|
|
38
|
-
<Component {...props} />
|
|
39
|
-
</TabPane>
|
|
40
|
-
));
|
|
41
|
-
return (
|
|
42
|
-
<TabContainer id="basic-tabs-pf" defaultActiveKey={0}>
|
|
43
|
-
<div className="dashboard">
|
|
44
|
-
<Nav bsClass="nav nav-tabs nav-tabs-pf">{navItems}</Nav>
|
|
45
|
-
<TabContent animation>{tabComponents}</TabContent>
|
|
46
|
-
</div>
|
|
47
|
-
</TabContainer>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
NavContainer.propTypes = {
|
|
52
|
-
items: PropTypes.arrayOf(
|
|
53
|
-
PropTypes.shape({
|
|
54
|
-
icon: PropTypes.string,
|
|
55
|
-
name: PropTypes.string,
|
|
56
|
-
component: PropTypes.func,
|
|
57
|
-
onClick: PropTypes.func,
|
|
58
|
-
})
|
|
59
|
-
),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
NavContainer.defaultProps = {
|
|
63
|
-
items: [],
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export default NavContainer;
|
|
File without changes
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Provider } from 'react-redux';
|
|
3
|
-
import configureMockStore from 'redux-mock-store';
|
|
4
|
-
import thunk from 'redux-thunk';
|
|
5
|
-
import { screen, render } from '@testing-library/react';
|
|
6
|
-
import { mount } from '@theforeman/test';
|
|
7
|
-
import NavContainer from '../NavContainer';
|
|
8
|
-
import { props } from '../NavContainer.fixtures';
|
|
9
|
-
|
|
10
|
-
const middlewares = [thunk];
|
|
11
|
-
const mockStore = configureMockStore(middlewares);
|
|
12
|
-
|
|
13
|
-
describe('NavContainer', () => {
|
|
14
|
-
const renderOptions = {
|
|
15
|
-
API: {
|
|
16
|
-
INVENTORY_SETTINGS: {
|
|
17
|
-
response: { subscriptionConnectionEnabled: false },
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
test('click should call onTabClick prop', () => {
|
|
23
|
-
const onTabClick = jest.fn();
|
|
24
|
-
const modifiedProps = {
|
|
25
|
-
...props,
|
|
26
|
-
};
|
|
27
|
-
modifiedProps.items[0].onClick = onTabClick;
|
|
28
|
-
const store = mockStore(renderOptions);
|
|
29
|
-
|
|
30
|
-
const wrapper = mount(
|
|
31
|
-
<Provider store={store}>
|
|
32
|
-
<NavContainer {...modifiedProps} />
|
|
33
|
-
</Provider>
|
|
34
|
-
);
|
|
35
|
-
wrapper.find('NavItem a').simulate('click');
|
|
36
|
-
expect(onTabClick).toBeCalled();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('when subscription connection is enabled', () => {
|
|
40
|
-
const options = {
|
|
41
|
-
API: {
|
|
42
|
-
INVENTORY_SETTINGS: {
|
|
43
|
-
response: { subscriptionConnectionEnabled: true },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
const store = mockStore(options);
|
|
48
|
-
render(
|
|
49
|
-
<Provider store={store}>
|
|
50
|
-
<NavContainer {...props} />
|
|
51
|
-
</Provider>
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
expect(screen.queryAllByText('Generating')).toHaveLength(1);
|
|
55
|
-
expect(screen.queryAllByText('Uploading')).toHaveLength(1);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test('when subscription connection is not enabled', () => {
|
|
59
|
-
const store = mockStore(renderOptions);
|
|
60
|
-
render(
|
|
61
|
-
<Provider store={store}>
|
|
62
|
-
<NavContainer {...props} />
|
|
63
|
-
</Provider>
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
expect(screen.queryAllByText('Generating')).toHaveLength(1);
|
|
67
|
-
expect(screen.queryAllByText('Uploading')).toHaveLength(0);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './NavContainer';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
3
|
-
import { post } from 'foremanReact/redux/API';
|
|
4
|
-
import { CONFIGURE_CLOUD_CONNECTOR } from './CloudConnectorConstants';
|
|
5
|
-
import { inventoryUrl } from '../../../../ForemanInventoryHelpers';
|
|
6
|
-
import { foremanUrl } from '../../../../../ForemanRhCloudHelpers';
|
|
7
|
-
|
|
8
|
-
export const configureCloudConnector = () =>
|
|
9
|
-
post({
|
|
10
|
-
key: CONFIGURE_CLOUD_CONNECTOR,
|
|
11
|
-
url: inventoryUrl('cloud_connector'),
|
|
12
|
-
successToast: response => (
|
|
13
|
-
<span>
|
|
14
|
-
{__('Cloud connector setup is in progress now: ')}
|
|
15
|
-
<a href={foremanUrl(`/job_invocations/${response.data.id}`)}>
|
|
16
|
-
{__('Cloud connector job link')}
|
|
17
|
-
</a>
|
|
18
|
-
</span>
|
|
19
|
-
),
|
|
20
|
-
errorToast: error => `${__('Cloud connector setup has failed: ')} ${error}`,
|
|
21
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Spinner, Button, Popover } from '@patternfly/react-core';
|
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
5
|
-
import { CONNECTOR_STATUS } from './CloudConnectorConstants';
|
|
6
|
-
|
|
7
|
-
export const CloudConnectorButton = ({ status, onClick, jobLink }) => {
|
|
8
|
-
const [isPopoverVisible, setIsPopoverVisible] = useState(false);
|
|
9
|
-
if (status === CONNECTOR_STATUS.PENDING) {
|
|
10
|
-
return (
|
|
11
|
-
<Popover
|
|
12
|
-
isVisible={isPopoverVisible}
|
|
13
|
-
shouldClose={() => setIsPopoverVisible(false)}
|
|
14
|
-
bodyContent={
|
|
15
|
-
<div>
|
|
16
|
-
{__('Cloud connector setup has started: ')}
|
|
17
|
-
<a href={jobLink} target="_blank" rel="noopener noreferrer">
|
|
18
|
-
{__('view the job in progress')}
|
|
19
|
-
</a>
|
|
20
|
-
</div>
|
|
21
|
-
}
|
|
22
|
-
aria-label="Popover with Link to cloud connector job"
|
|
23
|
-
closeBtnAriaLabel="Close cloud connector Popover"
|
|
24
|
-
>
|
|
25
|
-
<div
|
|
26
|
-
className="cloud-connector-pending-button"
|
|
27
|
-
onMouseEnter={() => setIsPopoverVisible(true)}
|
|
28
|
-
>
|
|
29
|
-
<Button variant="secondary" ouiaId="button-in-progress" isDisabled>
|
|
30
|
-
<Spinner size="sm" /> {__('Cloud Connector is in progress')}
|
|
31
|
-
</Button>
|
|
32
|
-
</div>
|
|
33
|
-
</Popover>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (status === CONNECTOR_STATUS.RESOLVED) {
|
|
38
|
-
return (
|
|
39
|
-
<Button variant="secondary" ouiaId="button-reconfigure" onClick={onClick}>
|
|
40
|
-
{__('Reconfigure cloud connector')}
|
|
41
|
-
</Button>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<Button variant="secondary" ouiaId="button-configure" onClick={onClick}>
|
|
47
|
-
{__('Configure cloud connector')}
|
|
48
|
-
</Button>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
CloudConnectorButton.propTypes = {
|
|
53
|
-
status: PropTypes.string.isRequired,
|
|
54
|
-
onClick: PropTypes.func.isRequired,
|
|
55
|
-
jobLink: PropTypes.string,
|
|
56
|
-
};
|
|
57
|
-
CloudConnectorButton.defaultProps = {
|
|
58
|
-
jobLink: '',
|
|
59
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { foremanUrl } from '../../../../../ForemanRhCloudHelpers';
|
|
2
|
-
import { selectAccountsList } from '../../../AccountList/AccountListSelectors';
|
|
3
|
-
import { CONNECTOR_STATUS } from './CloudConnectorConstants';
|
|
4
|
-
|
|
5
|
-
export const SelectCloudConnectorStatus = state =>
|
|
6
|
-
selectAccountsList(state).CloudConnectorStatus || {};
|
|
7
|
-
|
|
8
|
-
export const selectStatus = state => {
|
|
9
|
-
const { task } = SelectCloudConnectorStatus(state);
|
|
10
|
-
if (!task) return CONNECTOR_STATUS.NOT_RESOLVED;
|
|
11
|
-
if (task.result === 'pending') return CONNECTOR_STATUS.PENDING;
|
|
12
|
-
if (task.result === 'success') return CONNECTOR_STATUS.RESOLVED;
|
|
13
|
-
return CONNECTOR_STATUS.NOT_RESOLVED;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const selectJobLink = state => {
|
|
17
|
-
const { id } = SelectCloudConnectorStatus(state);
|
|
18
|
-
return id ? foremanUrl(`/job_invocations/${id}`) : '';
|
|
19
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
-
import { CloudConnectorButton } from '../CloudConnectorButton';
|
|
4
|
-
import { CONNECTOR_STATUS } from '../CloudConnectorConstants';
|
|
5
|
-
|
|
6
|
-
describe('CloudConnectorButton', () => {
|
|
7
|
-
it('renders "Configure cloud connector" when not resolved', () => {
|
|
8
|
-
render(
|
|
9
|
-
<CloudConnectorButton
|
|
10
|
-
status={CONNECTOR_STATUS.NOT_RESOLVED}
|
|
11
|
-
onClick={jest.fn()}
|
|
12
|
-
/>
|
|
13
|
-
);
|
|
14
|
-
expect(screen.getByRole('button', { name: /Configure cloud connector/ })).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('renders "Reconfigure cloud connector" when resolved', () => {
|
|
18
|
-
render(
|
|
19
|
-
<CloudConnectorButton
|
|
20
|
-
status={CONNECTOR_STATUS.RESOLVED}
|
|
21
|
-
onClick={jest.fn()}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
expect(screen.getByRole('button', { name: /Reconfigure cloud connector/ })).toBeTruthy();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('renders in-progress button when pending', () => {
|
|
28
|
-
render(
|
|
29
|
-
<CloudConnectorButton
|
|
30
|
-
status={CONNECTOR_STATUS.PENDING}
|
|
31
|
-
onClick={jest.fn()}
|
|
32
|
-
jobLink="/job-link"
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
expect(
|
|
36
|
-
screen.getByText('Cloud Connector is in progress')
|
|
37
|
-
).toBeTruthy();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('calls onClick when configure button is clicked', () => {
|
|
41
|
-
const onClick = jest.fn();
|
|
42
|
-
render(
|
|
43
|
-
<CloudConnectorButton
|
|
44
|
-
status={CONNECTOR_STATUS.NOT_RESOLVED}
|
|
45
|
-
onClick={onClick}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
fireEvent.click(screen.getByRole('button', { name: /Configure cloud connector/ }));
|
|
49
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
50
|
-
});
|
|
51
|
-
});
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/index.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSelector, useDispatch } from 'react-redux';
|
|
3
|
-
import { openConfirmModal } from 'foremanReact/components/ConfirmModal';
|
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
5
|
-
import { CloudConnectorButton } from './CloudConnectorButton';
|
|
6
|
-
import { configureCloudConnector } from './CloudConnectorActions';
|
|
7
|
-
import { selectStatus, selectJobLink } from './CloudConnectorSelectors';
|
|
8
|
-
|
|
9
|
-
const ConnectedCloudConnectorButton = () => {
|
|
10
|
-
const status = useSelector(selectStatus);
|
|
11
|
-
const jobLink = useSelector(selectJobLink);
|
|
12
|
-
const dispatch = useDispatch();
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<CloudConnectorButton
|
|
16
|
-
status={status}
|
|
17
|
-
onClick={() =>
|
|
18
|
-
dispatch(
|
|
19
|
-
openConfirmModal({
|
|
20
|
-
title: __('Notice'),
|
|
21
|
-
message: __(
|
|
22
|
-
'This action will also enable automatic reports upload'
|
|
23
|
-
),
|
|
24
|
-
isWarning: true,
|
|
25
|
-
onConfirm: () => dispatch(configureCloudConnector()),
|
|
26
|
-
})
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
jobLink={jobLink}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default ConnectedCloudConnectorButton;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Alert, AlertActionCloseButton } from '@patternfly/react-core';
|
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
5
|
-
|
|
6
|
-
export const SettingsWarning = ({
|
|
7
|
-
autoUpload,
|
|
8
|
-
hostObfuscation,
|
|
9
|
-
isCloudConnector,
|
|
10
|
-
}) => {
|
|
11
|
-
const [showUploadWarning, setShowUploadWarning] = useState(true);
|
|
12
|
-
const [showObfuscationWarning, setShowObfuscationWarning] = useState(true);
|
|
13
|
-
if (!isCloudConnector || (!showUploadWarning && !showObfuscationWarning)) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
if (autoUpload && !hostObfuscation) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const alerts = [];
|
|
21
|
-
if (!autoUpload && showUploadWarning) {
|
|
22
|
-
alerts.push(
|
|
23
|
-
<Alert
|
|
24
|
-
key="auto-upload"
|
|
25
|
-
ouiaId="auto-upload"
|
|
26
|
-
variant="warning"
|
|
27
|
-
title={__(
|
|
28
|
-
"Cloud Connector has been configured however the inventory auto-upload is disabled, it's recommended to enable it"
|
|
29
|
-
)}
|
|
30
|
-
actionClose={
|
|
31
|
-
<AlertActionCloseButton onClose={() => setShowUploadWarning(false)} />
|
|
32
|
-
}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
if (hostObfuscation && showObfuscationWarning) {
|
|
37
|
-
alerts.push(
|
|
38
|
-
<Alert
|
|
39
|
-
key="obfuscating-host"
|
|
40
|
-
ouiaId="obfuscating-host"
|
|
41
|
-
variant="warning"
|
|
42
|
-
title={__(
|
|
43
|
-
"Cloud Connector has been configured however obfuscating host names setting is enabled, it's recommended to disable it"
|
|
44
|
-
)}
|
|
45
|
-
actionClose={
|
|
46
|
-
<AlertActionCloseButton
|
|
47
|
-
onClose={() => setShowObfuscationWarning(false)}
|
|
48
|
-
/>
|
|
49
|
-
}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
return <div className="settings-alert">{alerts}</div>;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
SettingsWarning.propTypes = {
|
|
57
|
-
autoUpload: PropTypes.bool,
|
|
58
|
-
hostObfuscation: PropTypes.bool,
|
|
59
|
-
isCloudConnector: PropTypes.bool,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
SettingsWarning.defaultProps = {
|
|
63
|
-
autoUpload: false,
|
|
64
|
-
hostObfuscation: false,
|
|
65
|
-
isCloudConnector: false,
|
|
66
|
-
};
|