foreman_rh_cloud 14.2.0 → 14.3.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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/concerns/rh_cloud_host.rb +36 -1
  3. data/config/routes.rb +1 -0
  4. data/lib/foreman_inventory_upload/async/upload_report_direct_job.rb +2 -0
  5. data/lib/foreman_rh_cloud/version.rb +1 -1
  6. data/package.json +1 -1
  7. data/test/jobs/upload_report_direct_job_test.rb +29 -0
  8. data/test/unit/insights_facet_test.rb +5 -0
  9. data/test/unit/rh_cloud_host_test.rb +68 -0
  10. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +5 -1
  11. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListConstants.js +5 -0
  12. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/EmptyResults.js +15 -6
  13. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss +1 -5
  14. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +15 -7
  15. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +1 -3
  16. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +1 -5
  17. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +2 -2
  18. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +0 -1
  19. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +2 -6
  20. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js +13 -10
  21. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +30 -11
  22. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +3 -1
  23. data/webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss +28 -22
  24. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js +4 -4
  25. data/webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.scss +16 -3
  26. data/webpack/ForemanInventoryUpload/Components/InventorySettings/MinimalInventoryDropdown.js +13 -14
  27. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +7 -7
  28. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.scss +3 -2
  29. data/webpack/ForemanInventoryUpload/Components/PageHeader/PageTitle.js +63 -46
  30. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +4 -7
  31. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageTitle.test.js +83 -12
  32. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudPingModal/index.js +31 -38
  33. data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +3 -1
  34. data/webpack/ForemanInventoryUpload/Components/TaskConstants.js +6 -0
  35. data/webpack/ForemanInventoryUpload/Components/TaskHistory/TaskHistory.js +3 -2
  36. data/webpack/ForemanInventoryUpload/Components/TaskProgress/TaskProgress.js +4 -3
  37. data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +1 -1
  38. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js +29 -22
  39. data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +6 -2
  40. data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +9 -6
  41. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTable.js +90 -23
  42. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableActions.js +1 -2
  43. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableConstants.js +24 -30
  44. data/webpack/InsightsCloudSync/Components/InsightsTable/InsightsTableHelpers.js +5 -6
  45. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTable.test.js +193 -8
  46. data/webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableActions.test.js +4 -1
  47. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationHelpers.js +8 -9
  48. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModal.js +26 -13
  49. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationModalFooter.js +5 -2
  50. data/webpack/InsightsCloudSync/Components/RemediationModal/RemediationTableConstants.js +16 -10
  51. data/webpack/InsightsCloudSync/Components/ToolbarDropdown.js +21 -9
  52. data/webpack/InsightsCloudSync/InsightsCloudSync.test.js +12 -19
  53. data/webpack/InsightsCloudSync/__tests__/InsightsCloudSyncActions.test.js +0 -1
  54. data/webpack/IopRecommendationDetails/IopRecommendationDetails.js +19 -0
  55. data/webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js +5 -1
  56. data/webpack/common/DropdownToggle.js +20 -6
  57. metadata +3 -45
  58. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
  59. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +0 -25
  60. data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
  61. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +0 -17
  62. data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +0 -5
  63. data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +0 -1
  64. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +0 -20
  65. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +0 -66
  66. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js +0 -0
  67. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +0 -69
  68. data/webpack/ForemanInventoryUpload/Components/NavContainer/index.js +0 -1
  69. data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +0 -9
  70. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +0 -4
  71. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +0 -29
  72. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js +0 -0
  73. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +0 -33
  74. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +0 -12
  75. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +0 -13
  76. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js +0 -0
  77. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +0 -57
  78. data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
  79. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +0 -30
  80. data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +0 -1
  81. data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +0 -10
  82. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
  83. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +0 -24
  84. data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
  85. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +0 -15
  86. data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +0 -1
  87. data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +0 -10
  88. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
  89. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +0 -19
  90. data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
  91. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +0 -15
  92. data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +0 -1
  93. data/webpack/ForemanInventoryUpload/Components/TabFooter/tabFooter.scss +0 -0
  94. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.fixtures.js +0 -0
  95. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeader.js +0 -85
  96. data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js +0 -0
  97. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +0 -114
  98. data/webpack/ForemanInventoryUpload/Components/TabHeader/index.js +0 -1
  99. data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +0 -23
  100. data/webpack/common/Switcher/index.js +0 -80
@@ -1,13 +0,0 @@
1
- .rh-cloud-inventory-page {
2
- .scheduled_run {
3
- font-size: 14px;
4
-
5
- p {
6
- margin: 0 0 -10px 0;
7
-
8
- .fa {
9
- margin-right: 5px;
10
- }
11
- }
12
- }
13
- }
@@ -1,57 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid, DonutChart } from 'patternfly-react';
4
- import { translate as __ } from 'foremanReact/common/I18n';
5
- import './statusChart.scss';
6
-
7
- const StatusChart = ({ completed }) => {
8
- const donutConfigData = {
9
- columns: [
10
- [__('Completed'), completed],
11
- [__('Remain'), 100 - completed],
12
- ],
13
- order: null,
14
- };
15
-
16
- const pfGetUtilizationDonutTooltipContents = d => {
17
- const {
18
- 0: { name, value },
19
- } = d;
20
- return `<span class="donut-tooltip-pf" style="white-space: nowrap;">${value}% ${name}</span>`;
21
- };
22
-
23
- const donutConfigTooltip = {
24
- contents: pfGetUtilizationDonutTooltipContents,
25
- };
26
-
27
- return (
28
- <Grid.Col sm={4}>
29
- <div className="status-chart">
30
- <DonutChart
31
- id="donut-chart-1"
32
- size={{
33
- width: 210,
34
- height: 210,
35
- }}
36
- data={donutConfigData}
37
- tooltip={donutConfigTooltip}
38
- title={{
39
- type: 'percent',
40
- primary: `${completed}%`,
41
- secondary: __('Completed'),
42
- }}
43
- />
44
- </div>
45
- </Grid.Col>
46
- );
47
- };
48
-
49
- StatusChart.propTypes = {
50
- completed: PropTypes.number,
51
- };
52
-
53
- StatusChart.defaultProps = {
54
- completed: 0,
55
- };
56
-
57
- export default StatusChart;
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import StatusChart from '../StatusChart';
4
-
5
- jest.mock('patternfly-react', () => ({
6
- Grid: { Col: ({ children }) => <div>{children}</div> },
7
- DonutChart: ({ title }) => (
8
- <div data-testid="donut-chart">
9
- <span>{title?.primary}</span>
10
- <span>{title?.secondary}</span>
11
- </div>
12
- ),
13
- }));
14
-
15
- describe('StatusChart', () => {
16
- it('renders the status chart container', () => {
17
- const { container } = render(<StatusChart />);
18
- expect(container.querySelector('.status-chart')).toBeTruthy();
19
- });
20
-
21
- it('passes the completed percentage to the chart', () => {
22
- const { getByText } = render(<StatusChart completed={75} />);
23
- expect(getByText('75%')).toBeTruthy();
24
- });
25
-
26
- it('shows Completed label', () => {
27
- const { getByText } = render(<StatusChart completed={50} />);
28
- expect(getByText('Completed')).toBeTruthy();
29
- });
30
- });
@@ -1 +0,0 @@
1
- export { default } from './StatusChart';
@@ -1,10 +0,0 @@
1
- .rh-cloud-inventory-page {
2
- .status-chart {
3
- display: flex;
4
- align-items: center;
5
- -webkit-justify-content: center;
6
- justify-content: center;
7
- margin: 10%;
8
- padding: 5%;
9
- }
10
- }
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid } from 'patternfly-react';
4
- import './tabContainer.scss';
5
-
6
- const TabContainer = ({ children, className }) => (
7
- <div className={className}>
8
- <Grid>
9
- <Grid.Col>{children}</Grid.Col>
10
- </Grid>
11
- </div>
12
- );
13
-
14
- TabContainer.propTypes = {
15
- children: PropTypes.node,
16
- className: PropTypes.string,
17
- };
18
-
19
- TabContainer.defaultProps = {
20
- children: null,
21
- className: '',
22
- };
23
-
24
- export default TabContainer;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import TabContainer from '../TabContainer';
4
-
5
- describe('TabContainer', () => {
6
- it('renders children', () => {
7
- render(<TabContainer><span>Tab content</span></TabContainer>);
8
- expect(screen.getByText('Tab content')).toBeTruthy();
9
- });
10
-
11
- it('renders with custom className', () => {
12
- const { container } = render(<TabContainer className="my-tab" />);
13
- expect(container.querySelector('.my-tab')).toBeTruthy();
14
- });
15
- });
@@ -1 +0,0 @@
1
- export { default } from './TabContainer';
@@ -1,10 +0,0 @@
1
- .rh-cloud-inventory-page {
2
- .dashboard .tab-content {
3
- padding: 20px;
4
- min-height: 0;
5
-
6
- .row {
7
- margin-bottom: 20px;
8
- }
9
- }
10
- }
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Grid } from 'patternfly-react';
4
-
5
- const TabFooter = ({ children }) => (
6
- <Grid.Row>
7
- <div className="tab-footer">{children}</div>
8
- </Grid.Row>
9
- );
10
-
11
- TabFooter.propTypes = {
12
- children: PropTypes.node,
13
- };
14
-
15
- TabFooter.defaultProps = {
16
- children: null,
17
- };
18
-
19
- export default TabFooter;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import TabFooter from '../TabFooter';
4
-
5
- describe('TabFooter', () => {
6
- it('renders children', () => {
7
- render(<TabFooter><span>Footer content</span></TabFooter>);
8
- expect(screen.getByText('Footer content')).toBeTruthy();
9
- });
10
-
11
- it('renders with the tab-footer class', () => {
12
- const { container } = render(<TabFooter />);
13
- expect(container.querySelector('.tab-footer')).toBeTruthy();
14
- });
15
- });
@@ -1 +0,0 @@
1
- export { default } from './TabFooter';
@@ -1,85 +0,0 @@
1
- import React from 'react';
2
- import { useSelector } from 'react-redux';
3
- import PropTypes from 'prop-types';
4
- import { Grid, Button, Icon } from 'patternfly-react';
5
- import { Tooltip } from '@patternfly/react-core';
6
- import { noop } from 'foremanReact/common/helpers';
7
- import { sprintf, translate as __ } from 'foremanReact/common/I18n';
8
- import { selectSubscriptionConnectionEnabled } from '../InventorySettings/InventorySettingsSelectors';
9
- import { isExitCodeLoading } from '../../ForemanInventoryHelpers';
10
- import { useIopConfig } from '../../../common/Hooks/ConfigHooks';
11
- import './tabHeader.scss';
12
-
13
- const TabHeader = ({
14
- exitCode,
15
- onRestart,
16
- onDownload,
17
- downloadButtonDisabled,
18
- toggleFullScreen,
19
- }) => {
20
- const subscriptionConnectionEnabled = useSelector(
21
- selectSubscriptionConnectionEnabled
22
- );
23
- const isIop = Boolean(useIopConfig());
24
- const buttonGenerateLabel = subscriptionConnectionEnabled
25
- ? __('Generate and upload report')
26
- : __('Generate report');
27
-
28
- const isUploadDisabled = !isIop && !subscriptionConnectionEnabled;
29
- const isButtonDisabled = isExitCodeLoading(exitCode) || isUploadDisabled;
30
- const tooltipContent = __(
31
- 'Upload is disabled because subscription connection is not enabled. Enable it in Administer > Settings > Content.'
32
- );
33
-
34
- const generateButton = onRestart ? (
35
- <Button bsStyle="primary" onClick={onRestart} disabled={isButtonDisabled}>
36
- {buttonGenerateLabel}
37
- </Button>
38
- ) : null;
39
-
40
- return (
41
- <Grid.Row className="tab-header">
42
- <Grid.Col sm={6}>
43
- <p>{sprintf(__('Exit Code: %s'), exitCode)}</p>
44
- </Grid.Col>
45
- <Grid.Col sm={6}>
46
- <div className="tab-action-buttons">
47
- {generateButton && isUploadDisabled ? (
48
- <Tooltip content={tooltipContent}>
49
- <div style={{ display: 'inline-block' }}>{generateButton}</div>
50
- </Tooltip>
51
- ) : (
52
- generateButton
53
- )}
54
- {onDownload ? (
55
- <Button onClick={onDownload} disabled={downloadButtonDisabled()}>
56
- {__('Download Report')} <Icon name="download" />
57
- </Button>
58
- ) : null}
59
- <Button onClick={toggleFullScreen}>
60
- {__('Full Screen')}
61
- <Icon name="arrows-alt" />
62
- </Button>
63
- </div>
64
- </Grid.Col>
65
- </Grid.Row>
66
- );
67
- };
68
-
69
- TabHeader.propTypes = {
70
- onRestart: PropTypes.func,
71
- onDownload: PropTypes.func,
72
- exitCode: PropTypes.string,
73
- downloadButtonDisabled: PropTypes.func,
74
- toggleFullScreen: PropTypes.func,
75
- };
76
-
77
- TabHeader.defaultProps = {
78
- onRestart: null,
79
- exitCode: '',
80
- onDownload: null,
81
- downloadButtonDisabled: noop,
82
- toggleFullScreen: noop,
83
- };
84
-
85
- export default TabHeader;
@@ -1,114 +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 { noop } from 'foremanReact/common/helpers';
7
- import * as ConfigHooks from '../../../../common/Hooks/ConfigHooks';
8
- import TabHeader from '../TabHeader';
9
-
10
- const middlewares = [thunk];
11
- const mockStore = configureMockStore(middlewares);
12
-
13
- jest.mock('../../../../common/Hooks/ConfigHooks');
14
-
15
- describe('TabHeader', () => {
16
- beforeEach(() => {
17
- ConfigHooks.useIopConfig = jest.fn();
18
- });
19
-
20
- test('when subscription connection is enabled and not IoP', () => {
21
- ConfigHooks.useIopConfig.mockReturnValue(false);
22
- const renderOptions = {
23
- API: {
24
- INVENTORY_SETTINGS: {
25
- response: { subscriptionConnectionEnabled: true },
26
- },
27
- },
28
- };
29
- const store = mockStore(renderOptions);
30
-
31
- const { container } = render(
32
- <Provider store={store}>
33
- <TabHeader exitCode="exit 0" onRestart={noop} toggleFullScreen={noop} />
34
- </Provider>
35
- );
36
- expect(screen.queryAllByText('Generate and upload report')).toHaveLength(1);
37
- expect(screen.queryAllByText('Full Screen')).toHaveLength(1);
38
- const button = container.querySelector('button[class*="btn-primary"]');
39
- expect(button.hasAttribute('disabled')).toBe(false);
40
- });
41
-
42
- test('when subscription connection is not enabled and not IoP - button is disabled with tooltip', () => {
43
- ConfigHooks.useIopConfig.mockReturnValue(false);
44
- const renderOptions = {
45
- API: {
46
- INVENTORY_SETTINGS: {
47
- response: { subscriptionConnectionEnabled: false },
48
- },
49
- },
50
- };
51
- const store = mockStore(renderOptions);
52
-
53
- const { container } = render(
54
- <Provider store={store}>
55
- <TabHeader exitCode="exit 0" onRestart={noop} toggleFullScreen={noop} />
56
- </Provider>
57
- );
58
-
59
- expect(screen.queryAllByText('Generate report')).toHaveLength(1);
60
- expect(screen.queryAllByText('Full Screen')).toHaveLength(1);
61
- const button = container.querySelector('button[class*="btn-primary"]');
62
- expect(button.hasAttribute('disabled')).toBe(true);
63
-
64
- // Verify button is wrapped in a div for tooltip (Patternfly requirement)
65
- // The tooltip content prop is passed but not rendered in the DOM until hover
66
- const wrapper = button.parentElement;
67
- expect(wrapper.tagName).toBe('DIV');
68
- expect(wrapper.style.display).toBe('inline-block');
69
- });
70
-
71
- test('when subscription connection is not enabled but IoP is enabled - button is enabled', () => {
72
- ConfigHooks.useIopConfig.mockReturnValue(true);
73
- const renderOptions = {
74
- API: {
75
- INVENTORY_SETTINGS: {
76
- response: { subscriptionConnectionEnabled: false },
77
- },
78
- },
79
- };
80
- const store = mockStore(renderOptions);
81
-
82
- const { container } = render(
83
- <Provider store={store}>
84
- <TabHeader exitCode="exit 0" onRestart={noop} toggleFullScreen={noop} />
85
- </Provider>
86
- );
87
-
88
- expect(screen.queryAllByText('Generate report')).toHaveLength(1);
89
- const button = container.querySelector('button[class*="btn-primary"]');
90
- expect(button.hasAttribute('disabled')).toBe(false);
91
- });
92
-
93
- test('when IoP is enabled and subscription connection is enabled - button is enabled', () => {
94
- ConfigHooks.useIopConfig.mockReturnValue(true);
95
- const renderOptions = {
96
- API: {
97
- INVENTORY_SETTINGS: {
98
- response: { subscriptionConnectionEnabled: true },
99
- },
100
- },
101
- };
102
- const store = mockStore(renderOptions);
103
-
104
- const { container } = render(
105
- <Provider store={store}>
106
- <TabHeader exitCode="exit 0" onRestart={noop} toggleFullScreen={noop} />
107
- </Provider>
108
- );
109
-
110
- expect(screen.queryAllByText('Generate and upload report')).toHaveLength(1);
111
- const button = container.querySelector('button[class*="btn-primary"]');
112
- expect(button.hasAttribute('disabled')).toBe(false);
113
- });
114
- });
@@ -1 +0,0 @@
1
- export { default } from './TabHeader';
@@ -1,23 +0,0 @@
1
- .rh-cloud-inventory-page {
2
- .tab-header {
3
- h1 {
4
- margin-top: 0;
5
- }
6
-
7
- p {
8
- font-size: 16px;
9
- }
10
-
11
- .tab-action-buttons {
12
- float: right;
13
-
14
- button {
15
- margin-left: 5px;
16
-
17
- span {
18
- margin-left: 5px;
19
- }
20
- }
21
- }
22
- }
23
- }
@@ -1,80 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Switch, Level, LevelItem } from '@patternfly/react-core';
4
- import {
5
- OverlayTrigger,
6
- Tooltip,
7
- Icon,
8
- Grid,
9
- ControlLabel,
10
- noop,
11
- } from 'patternfly-react';
12
-
13
- const Switcher = ({
14
- id,
15
- label,
16
- tooltip,
17
- isChecked,
18
- onChange,
19
- labelCol = 5,
20
- SwitchCol = 2,
21
- }) => (
22
- <React.Fragment>
23
- <Grid.Col sm={labelCol}>
24
- <ControlLabel className="control-label" style={{ paddingTop: '0' }}>
25
- <Level>
26
- <LevelItem>
27
- <span className={`rh-cloud-switcher-${id}-label`}>{label}</span>
28
- </LevelItem>
29
- <LevelItem>
30
- <OverlayTrigger
31
- overlay={
32
- <Tooltip
33
- id={`rh-cloud-switcher-${id}-tooltip`}
34
- style={{ zIndex: 10000 }}
35
- >
36
- {tooltip}
37
- </Tooltip>
38
- }
39
- placement="bottom"
40
- trigger={['hover', 'focus']}
41
- rootClose={false}
42
- >
43
- <Icon type="pf" name="info" />
44
- </OverlayTrigger>
45
- </LevelItem>
46
- </Level>
47
- </ControlLabel>
48
- </Grid.Col>
49
- <Grid.Col sm={SwitchCol} style={{ marginBottom: '5px' }}>
50
- <Switch
51
- id={`rh-cloud-switcher-${id}`}
52
- ouiaId={`rh-cloud-switcher-${id}`}
53
- isChecked={isChecked}
54
- onChange={onChange}
55
- label=" "
56
- />
57
- </Grid.Col>
58
- </React.Fragment>
59
- );
60
-
61
- Switcher.propTypes = {
62
- id: PropTypes.string.isRequired,
63
- label: PropTypes.string,
64
- tooltip: PropTypes.string,
65
- isChecked: PropTypes.bool,
66
- onChange: PropTypes.func,
67
- labelCol: PropTypes.number,
68
- SwitchCol: PropTypes.number,
69
- };
70
-
71
- Switcher.defaultProps = {
72
- label: null,
73
- tooltip: null,
74
- isChecked: true,
75
- onChange: noop,
76
- labelCol: 5,
77
- SwitchCol: 2,
78
- };
79
-
80
- export default Switcher;