foreman_inventory_upload 1.0.0.beta1 → 1.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/foreman_inventory_upload/version.rb +1 -1
- data/package.json +124 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +34 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +72 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +65 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListReducer.js +55 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +8 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyState.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/EmptyStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/emptyState.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorState.js +23 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/ErrorStateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/errorState.scss +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.fixtures.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +39 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItemHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +48 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/listItem.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.fixtures.js +6 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatus.js +43 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/ListItemStatusHelper.js +29 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +78 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/listItemStatus.scss +16 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +60 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +41 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +47 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +66 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +40 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/accountList.scss +9 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +30 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.js +146 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +87 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardConstants.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardReducer.js +68 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +17 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +25 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +39 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +64 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +45 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/Dashboard.test.js.snap +36 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardActions.test.js.snap +76 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardReducer.test.js.snap +44 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/__snapshots__/DashboardSelectors.test.js.snap +42 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/dashboard.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/Dashboard/index.js +37 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownload.js +22 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/FileDownloadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/fileDownload.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModal.js +50 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/FullScreenModalHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/__snapshots__/FullScreenModal.test.js.snap +64 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/fullScreenModal.scss +10 -0
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.js +83 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +89 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/navContainer.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.fixtures.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerate.js +57 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/ReportGenerateHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/__snapshots__/ReportGenerate.test.js.snap +45 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/reportGenerate.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.fixtures.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUpload.js +57 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/ReportUploadHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/__snapshots__/ReportUpload.test.js.snap +45 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/reportUpload.scss +0 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.fixtures.js +3 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRun.js +27 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/ScheduledRunHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/scheduledRun.scss +11 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChart.js +53 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/StatusChartHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +74 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/statusChart.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBody.js +31 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/TabBodyHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/__snapshots__/TabBody.test.js.snap +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabBody/tabBody.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainer.js +24 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/TabContainerHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/tabContainer.scss +8 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.fixtures.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooter.js +19 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/TabFooterHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +12 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/index.js +1 -0
- 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 +45 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/TabHeaderHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/__snapshots__/TabHeader.test.js.snap +53 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/TabHeader/tabHeader.scss +21 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.fixtures.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +112 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/TerminalHelper.js +6 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +35 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/__snapshots__/Terminal.test.js.snap +98 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/Terminal/terminal.scss +31 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/Tree.fixtures.js +3 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/Tree.js +29 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/TreeHelper.js +0 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/__tests__/Tree.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/__tests__/__snapshots__/Tree.test.js.snap +63 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/Tree/tree.scss +0 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +15 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +10 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +12 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +4 -0
- data/webpack/ForemanInventoryUpload/__snapshots__/ForemanInventoryUpload.test.js.snap +16 -0
- data/webpack/ForemanInventoryUpload/index.js +1 -0
- data/webpack/__mocks__/foremanReact/API.js +7 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +5 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +3 -0
- data/webpack/index.js +18 -0
- data/webpack/stories/ForemanInventoryUploadReducers.js +3 -0
- data/webpack/stories/configureStore.js +15 -0
- data/webpack/stories/decorators/index.js +1 -0
- data/webpack/stories/decorators/withCardsDecorator.js +14 -0
- data/webpack/stories/index.js +10 -0
- data/webpack/stories/index.scss +7 -0
- data/webpack/test_setup.js +6 -0
- metadata +177 -2
@@ -0,0 +1,44 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`Dashboard reducer should handle INVENTORY_POLLING 1`] = `
|
4
|
+
Object {
|
5
|
+
"some-account-ID": Object {
|
6
|
+
"uploads": Object {
|
7
|
+
"error": null,
|
8
|
+
"logs": Array [
|
9
|
+
"some-logs...",
|
10
|
+
],
|
11
|
+
"scheduled": "2019-08-21T16:14:16.520+03:00",
|
12
|
+
},
|
13
|
+
},
|
14
|
+
}
|
15
|
+
`;
|
16
|
+
|
17
|
+
exports[`Dashboard reducer should handle INVENTORY_POLLING_ERROR 1`] = `
|
18
|
+
Object {
|
19
|
+
"some-account-ID": Object {
|
20
|
+
"uploads": Object {
|
21
|
+
"error": "some-error",
|
22
|
+
},
|
23
|
+
},
|
24
|
+
}
|
25
|
+
`;
|
26
|
+
|
27
|
+
exports[`Dashboard reducer should handle INVENTORY_POLLING_START 1`] = `
|
28
|
+
Object {
|
29
|
+
"some-account-ID": Object {
|
30
|
+
"activeTab": "generating",
|
31
|
+
"pollingProcessID": 1,
|
32
|
+
},
|
33
|
+
}
|
34
|
+
`;
|
35
|
+
|
36
|
+
exports[`Dashboard reducer should handle INVENTORY_TAB_CHANGED 1`] = `
|
37
|
+
Object {
|
38
|
+
"some-account-ID": Object {
|
39
|
+
"activeTab": "uploads",
|
40
|
+
},
|
41
|
+
}
|
42
|
+
`;
|
43
|
+
|
44
|
+
exports[`Dashboard reducer should return the initial state 1`] = `Object {}`;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`Dashboard selectors should return Dashboard 1`] = `
|
4
|
+
Object {
|
5
|
+
"activeTab": "uploads",
|
6
|
+
"generating": Object {
|
7
|
+
"completed": 25,
|
8
|
+
"logs": Array [
|
9
|
+
"some-logs...",
|
10
|
+
],
|
11
|
+
},
|
12
|
+
"pollingProcessID": 1,
|
13
|
+
"uploading": Object {
|
14
|
+
"completed": 25,
|
15
|
+
"logs": Array [
|
16
|
+
"some-logs...",
|
17
|
+
],
|
18
|
+
},
|
19
|
+
}
|
20
|
+
`;
|
21
|
+
|
22
|
+
exports[`Dashboard selectors should return Dashboard activeTab 1`] = `"uploads"`;
|
23
|
+
|
24
|
+
exports[`Dashboard selectors should return Dashboard generating 1`] = `
|
25
|
+
Object {
|
26
|
+
"completed": 25,
|
27
|
+
"logs": Array [
|
28
|
+
"some-logs...",
|
29
|
+
],
|
30
|
+
}
|
31
|
+
`;
|
32
|
+
|
33
|
+
exports[`Dashboard selectors should return Dashboard pollingProcessID 1`] = `1`;
|
34
|
+
|
35
|
+
exports[`Dashboard selectors should return Dashboard uploading 1`] = `
|
36
|
+
Object {
|
37
|
+
"completed": 25,
|
38
|
+
"logs": Array [
|
39
|
+
"some-logs...",
|
40
|
+
],
|
41
|
+
}
|
42
|
+
`;
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { bindActionCreators } from 'redux';
|
2
|
+
import { connect } from 'react-redux';
|
3
|
+
|
4
|
+
import * as actions from './DashboardActions';
|
5
|
+
import { restartProcess } from '../AccountList/AccountListActions';
|
6
|
+
import reducer from './DashboardReducer';
|
7
|
+
|
8
|
+
import Dashboard from './Dashboard';
|
9
|
+
import {
|
10
|
+
selectUploading,
|
11
|
+
selectGenerating,
|
12
|
+
selectPollingProcessID,
|
13
|
+
selectActiveTab,
|
14
|
+
selectShowFullScreen,
|
15
|
+
} from './DashboardSelectors';
|
16
|
+
|
17
|
+
// map state to props
|
18
|
+
const mapStateToProps = (state, { accountID }) => ({
|
19
|
+
uploading: selectUploading(state, accountID),
|
20
|
+
generating: selectGenerating(state, accountID),
|
21
|
+
pollingProcessID: selectPollingProcessID(state, accountID),
|
22
|
+
activeTab: selectActiveTab(state, accountID),
|
23
|
+
showFullScreen: selectShowFullScreen(state, accountID),
|
24
|
+
});
|
25
|
+
|
26
|
+
// map action dispatchers to props
|
27
|
+
const mapDispatchToProps = dispatch =>
|
28
|
+
bindActionCreators({ ...actions, restartProcess }, dispatch);
|
29
|
+
|
30
|
+
// export reducers
|
31
|
+
export const reducers = { dashboard: reducer };
|
32
|
+
|
33
|
+
// export connected component
|
34
|
+
export default connect(
|
35
|
+
mapStateToProps,
|
36
|
+
mapDispatchToProps
|
37
|
+
)(Dashboard);
|
File without changes
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { noop, Grid, Button, Icon } from 'patternfly-react';
|
4
|
+
import './fileDownload.scss';
|
5
|
+
|
6
|
+
const FileDownload = ({ onClick }) => (
|
7
|
+
<Grid.Col sm={12}>
|
8
|
+
<Button onClick={onClick} className="download-button">
|
9
|
+
Download Report <Icon name="download" />
|
10
|
+
</Button>
|
11
|
+
</Grid.Col>
|
12
|
+
);
|
13
|
+
|
14
|
+
FileDownload.propTypes = {
|
15
|
+
onClick: PropTypes.func,
|
16
|
+
};
|
17
|
+
|
18
|
+
FileDownload.defaultProps = {
|
19
|
+
onClick: noop,
|
20
|
+
};
|
21
|
+
|
22
|
+
export default FileDownload;
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import FileDownload from '../FileDownload';
|
4
|
+
|
5
|
+
const fixtures = {
|
6
|
+
'render without Props': {},
|
7
|
+
/** fixtures, props for the component */
|
8
|
+
};
|
9
|
+
|
10
|
+
describe('FileDownload', () => {
|
11
|
+
describe('rendering', () =>
|
12
|
+
testComponentSnapshotsWithFixtures(FileDownload, fixtures));
|
13
|
+
});
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`FileDownload rendering render without Props 1`] = `
|
4
|
+
<Col
|
5
|
+
bsClass="col"
|
6
|
+
componentClass="div"
|
7
|
+
sm={12}
|
8
|
+
>
|
9
|
+
<Button
|
10
|
+
active={false}
|
11
|
+
block={false}
|
12
|
+
bsClass="btn"
|
13
|
+
bsStyle="default"
|
14
|
+
className="download-button"
|
15
|
+
disabled={false}
|
16
|
+
onClick={[Function]}
|
17
|
+
>
|
18
|
+
Download Report
|
19
|
+
<Icon
|
20
|
+
name="download"
|
21
|
+
type="fa"
|
22
|
+
/>
|
23
|
+
</Button>
|
24
|
+
</Col>
|
25
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './FileDownload';
|
File without changes
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Modal, Icon, noop } from 'patternfly-react';
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
5
|
+
import Terminal from '../Terminal';
|
6
|
+
import './fullScreenModal.scss';
|
7
|
+
|
8
|
+
const FullScreenModal = ({
|
9
|
+
showFullScreen,
|
10
|
+
toggleFullScreen,
|
11
|
+
terminalProps,
|
12
|
+
}) => (
|
13
|
+
<Modal show={showFullScreen} onHide={toggleFullScreen}>
|
14
|
+
<Modal.Header>
|
15
|
+
<button
|
16
|
+
className="close"
|
17
|
+
onClick={toggleFullScreen}
|
18
|
+
aria-hidden="true"
|
19
|
+
aria-label="Close"
|
20
|
+
>
|
21
|
+
<Icon type="pf" name="close" />
|
22
|
+
</button>
|
23
|
+
<Modal.Title>{__('Full Screen')}</Modal.Title>
|
24
|
+
</Modal.Header>
|
25
|
+
<Modal.Body>
|
26
|
+
<Terminal autoScroll={false} {...terminalProps} />
|
27
|
+
</Modal.Body>
|
28
|
+
</Modal>
|
29
|
+
);
|
30
|
+
|
31
|
+
FullScreenModal.propTypes = {
|
32
|
+
showFullScreen: PropTypes.bool,
|
33
|
+
toggleFullScreen: PropTypes.func,
|
34
|
+
terminalProps: PropTypes.shape({
|
35
|
+
exitCode: PropTypes.string,
|
36
|
+
logs: PropTypes.oneOfType([
|
37
|
+
PropTypes.arrayOf(PropTypes.string),
|
38
|
+
PropTypes.string,
|
39
|
+
]),
|
40
|
+
error: PropTypes.string,
|
41
|
+
}),
|
42
|
+
};
|
43
|
+
|
44
|
+
FullScreenModal.defaultProps = {
|
45
|
+
showFullScreen: false,
|
46
|
+
toggleFullScreen: noop,
|
47
|
+
terminalProps: {},
|
48
|
+
};
|
49
|
+
|
50
|
+
export default FullScreenModal;
|
File without changes
|
data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import FullScreenModal from '../FullScreenModal';
|
4
|
+
|
5
|
+
const fixtures = {
|
6
|
+
'render without Props': {},
|
7
|
+
/** fixtures, props for the component */
|
8
|
+
};
|
9
|
+
|
10
|
+
describe('FullScreenModal', () => {
|
11
|
+
describe('rendering', () =>
|
12
|
+
testComponentSnapshotsWithFixtures(FullScreenModal, fixtures));
|
13
|
+
});
|
@@ -0,0 +1,64 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`FullScreenModal rendering render without Props 1`] = `
|
4
|
+
<Modal
|
5
|
+
animation={true}
|
6
|
+
autoFocus={true}
|
7
|
+
backdrop={true}
|
8
|
+
bsClass="modal"
|
9
|
+
dialogComponentClass={[Function]}
|
10
|
+
enforceFocus={true}
|
11
|
+
keyboard={true}
|
12
|
+
manager={
|
13
|
+
ModalManager {
|
14
|
+
"add": [Function],
|
15
|
+
"containers": Array [],
|
16
|
+
"data": Array [],
|
17
|
+
"handleContainerOverflow": true,
|
18
|
+
"hideSiblingNodes": true,
|
19
|
+
"isTopModal": [Function],
|
20
|
+
"modals": Array [],
|
21
|
+
"remove": [Function],
|
22
|
+
}
|
23
|
+
}
|
24
|
+
onHide={[Function]}
|
25
|
+
renderBackdrop={[Function]}
|
26
|
+
restoreFocus={true}
|
27
|
+
show={false}
|
28
|
+
>
|
29
|
+
<ModalHeader
|
30
|
+
bsClass="modal-header"
|
31
|
+
closeButton={false}
|
32
|
+
closeLabel="Close"
|
33
|
+
>
|
34
|
+
<button
|
35
|
+
aria-hidden="true"
|
36
|
+
aria-label="Close"
|
37
|
+
className="close"
|
38
|
+
onClick={[Function]}
|
39
|
+
>
|
40
|
+
<Icon
|
41
|
+
name="close"
|
42
|
+
type="pf"
|
43
|
+
/>
|
44
|
+
</button>
|
45
|
+
<ModalTitle
|
46
|
+
bsClass="modal-title"
|
47
|
+
componentClass="h4"
|
48
|
+
>
|
49
|
+
Full Screen
|
50
|
+
</ModalTitle>
|
51
|
+
</ModalHeader>
|
52
|
+
<ModalBody
|
53
|
+
bsClass="modal-body"
|
54
|
+
componentClass="div"
|
55
|
+
>
|
56
|
+
<Terminal
|
57
|
+
autoScroll={false}
|
58
|
+
error={null}
|
59
|
+
exitCode=""
|
60
|
+
logs={null}
|
61
|
+
/>
|
62
|
+
</ModalBody>
|
63
|
+
</Modal>
|
64
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './FullScreenModal';
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import {
|
4
|
+
TabContainer,
|
5
|
+
Nav,
|
6
|
+
NavItem,
|
7
|
+
TabContent,
|
8
|
+
TabPane,
|
9
|
+
Icon,
|
10
|
+
noop,
|
11
|
+
} from 'patternfly-react';
|
12
|
+
import './navContainer.scss';
|
13
|
+
import FullScreenModal from '../FullScreenModal';
|
14
|
+
|
15
|
+
const NavContainer = ({
|
16
|
+
items,
|
17
|
+
showFullScreen,
|
18
|
+
toggleFullScreen,
|
19
|
+
terminalProps,
|
20
|
+
}) => {
|
21
|
+
const navItems = items.map((item, index) => {
|
22
|
+
const { name, icon, onClick } = item;
|
23
|
+
return (
|
24
|
+
<NavItem
|
25
|
+
key={index}
|
26
|
+
eventKey={index}
|
27
|
+
onClick={onClick}
|
28
|
+
className="nav_item"
|
29
|
+
>
|
30
|
+
<Icon name={icon} size="2x" />
|
31
|
+
<p>{name}</p>
|
32
|
+
</NavItem>
|
33
|
+
);
|
34
|
+
});
|
35
|
+
const tabComponents = items.map(({ component: Component, props }, index) => (
|
36
|
+
<TabPane key={index} eventKey={index}>
|
37
|
+
<Component {...props} />
|
38
|
+
</TabPane>
|
39
|
+
));
|
40
|
+
return (
|
41
|
+
<TabContainer id="basic-tabs-pf" defaultActiveKey={0}>
|
42
|
+
<div className="dashboard">
|
43
|
+
<Nav bsClass="nav nav-tabs nav-tabs-pf">{navItems}</Nav>
|
44
|
+
<TabContent animation>{tabComponents}</TabContent>
|
45
|
+
<FullScreenModal
|
46
|
+
showFullScreen={showFullScreen}
|
47
|
+
toggleFullScreen={toggleFullScreen}
|
48
|
+
terminalProps={terminalProps}
|
49
|
+
/>
|
50
|
+
</div>
|
51
|
+
</TabContainer>
|
52
|
+
);
|
53
|
+
};
|
54
|
+
|
55
|
+
NavContainer.propTypes = {
|
56
|
+
items: PropTypes.arrayOf(
|
57
|
+
PropTypes.shape({
|
58
|
+
icon: PropTypes.string,
|
59
|
+
name: PropTypes.string,
|
60
|
+
component: PropTypes.func,
|
61
|
+
onClick: PropTypes.func,
|
62
|
+
})
|
63
|
+
),
|
64
|
+
showFullScreen: PropTypes.bool,
|
65
|
+
toggleFullScreen: PropTypes.func,
|
66
|
+
terminalProps: PropTypes.shape({
|
67
|
+
exitCode: PropTypes.string,
|
68
|
+
logs: PropTypes.oneOfType([
|
69
|
+
PropTypes.arrayOf(PropTypes.string),
|
70
|
+
PropTypes.string,
|
71
|
+
]),
|
72
|
+
error: PropTypes.string,
|
73
|
+
}),
|
74
|
+
};
|
75
|
+
|
76
|
+
NavContainer.defaultProps = {
|
77
|
+
items: [],
|
78
|
+
showFullScreen: false,
|
79
|
+
toggleFullScreen: noop,
|
80
|
+
terminalProps: {},
|
81
|
+
};
|
82
|
+
|
83
|
+
export default NavContainer;
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { mount } from 'enzyme';
|
3
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
4
|
+
import NavContainer from '../NavContainer';
|
5
|
+
import { props } from '../NavContainer.fixtures';
|
6
|
+
|
7
|
+
const fixtures = {
|
8
|
+
'render without Props': {},
|
9
|
+
'render with Props': props,
|
10
|
+
};
|
11
|
+
|
12
|
+
describe('NavContainer', () => {
|
13
|
+
describe('rendering', () =>
|
14
|
+
testComponentSnapshotsWithFixtures(NavContainer, fixtures));
|
15
|
+
|
16
|
+
it('click should call onTabClick prop', () => {
|
17
|
+
const onTabClick = jest.fn();
|
18
|
+
const modifiedProps = {
|
19
|
+
...props,
|
20
|
+
};
|
21
|
+
modifiedProps.items[0].onClick = onTabClick;
|
22
|
+
const wrapper = mount(<NavContainer {...modifiedProps} />);
|
23
|
+
wrapper.find('NavItem a').simulate('click');
|
24
|
+
expect(onTabClick).toBeCalled();
|
25
|
+
});
|
26
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`NavContainer rendering render with Props 1`] = `
|
4
|
+
<Uncontrolled(TabContainer)
|
5
|
+
defaultActiveKey={0}
|
6
|
+
id="basic-tabs-pf"
|
7
|
+
>
|
8
|
+
<div
|
9
|
+
className="dashboard"
|
10
|
+
>
|
11
|
+
<Nav
|
12
|
+
bsClass="nav nav-tabs nav-tabs-pf"
|
13
|
+
justified={false}
|
14
|
+
pullLeft={false}
|
15
|
+
pullRight={false}
|
16
|
+
stacked={false}
|
17
|
+
>
|
18
|
+
<NavItem
|
19
|
+
active={false}
|
20
|
+
className="nav_item"
|
21
|
+
disabled={false}
|
22
|
+
eventKey={0}
|
23
|
+
key="0"
|
24
|
+
onClick={[Function]}
|
25
|
+
>
|
26
|
+
<Icon
|
27
|
+
name="some-icon"
|
28
|
+
size="2x"
|
29
|
+
type="fa"
|
30
|
+
/>
|
31
|
+
<p>
|
32
|
+
some-name
|
33
|
+
</p>
|
34
|
+
</NavItem>
|
35
|
+
</Nav>
|
36
|
+
<TabContent
|
37
|
+
animation={true}
|
38
|
+
bsClass="tab"
|
39
|
+
componentClass="div"
|
40
|
+
mountOnEnter={false}
|
41
|
+
unmountOnExit={false}
|
42
|
+
>
|
43
|
+
<TabPane
|
44
|
+
bsClass="tab-pane"
|
45
|
+
eventKey={0}
|
46
|
+
key="0"
|
47
|
+
>
|
48
|
+
<bound fn />
|
49
|
+
</TabPane>
|
50
|
+
</TabContent>
|
51
|
+
<FullScreenModal
|
52
|
+
showFullScreen={false}
|
53
|
+
terminalProps={Object {}}
|
54
|
+
toggleFullScreen={[Function]}
|
55
|
+
/>
|
56
|
+
</div>
|
57
|
+
</Uncontrolled(TabContainer)>
|
58
|
+
`;
|
59
|
+
|
60
|
+
exports[`NavContainer rendering render without Props 1`] = `
|
61
|
+
<Uncontrolled(TabContainer)
|
62
|
+
defaultActiveKey={0}
|
63
|
+
id="basic-tabs-pf"
|
64
|
+
>
|
65
|
+
<div
|
66
|
+
className="dashboard"
|
67
|
+
>
|
68
|
+
<Nav
|
69
|
+
bsClass="nav nav-tabs nav-tabs-pf"
|
70
|
+
justified={false}
|
71
|
+
pullLeft={false}
|
72
|
+
pullRight={false}
|
73
|
+
stacked={false}
|
74
|
+
/>
|
75
|
+
<TabContent
|
76
|
+
animation={true}
|
77
|
+
bsClass="tab"
|
78
|
+
componentClass="div"
|
79
|
+
mountOnEnter={false}
|
80
|
+
unmountOnExit={false}
|
81
|
+
/>
|
82
|
+
<FullScreenModal
|
83
|
+
showFullScreen={false}
|
84
|
+
terminalProps={Object {}}
|
85
|
+
toggleFullScreen={[Function]}
|
86
|
+
/>
|
87
|
+
</div>
|
88
|
+
</Uncontrolled(TabContainer)>
|
89
|
+
`;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './NavContainer';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { noop } from 'patternfly-react';
|
2
|
+
|
3
|
+
export const exitCode = 'exit 0';
|
4
|
+
export const logs = ['No running process'];
|
5
|
+
export const completed = 0;
|
6
|
+
export const restartProcess = noop;
|
7
|
+
export const error = null;
|
8
|
+
export const scheduled = '2019-08-21T16:14:16.520+03:00';
|
9
|
+
export const props = {
|
10
|
+
exitCode,
|
11
|
+
logs,
|
12
|
+
completed,
|
13
|
+
restartProcess,
|
14
|
+
error,
|
15
|
+
scheduled,
|
16
|
+
};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { noop } from 'patternfly-react';
|
4
|
+
import TabContainer from '../TabContainer';
|
5
|
+
import TabHeader from '../TabHeader';
|
6
|
+
import TabBody from '../TabBody';
|
7
|
+
import './reportGenerate.scss';
|
8
|
+
|
9
|
+
const ReportGenerate = ({
|
10
|
+
exitCode,
|
11
|
+
logs,
|
12
|
+
completed,
|
13
|
+
error,
|
14
|
+
restartProcess,
|
15
|
+
toggleFullScreen,
|
16
|
+
scheduled,
|
17
|
+
}) => (
|
18
|
+
<TabContainer className="report-generate">
|
19
|
+
<TabHeader
|
20
|
+
exitCode={exitCode}
|
21
|
+
onRestart={restartProcess}
|
22
|
+
toggleFullScreen={toggleFullScreen}
|
23
|
+
/>
|
24
|
+
<TabBody
|
25
|
+
exitCode={exitCode}
|
26
|
+
logs={logs}
|
27
|
+
completed={completed}
|
28
|
+
error={error}
|
29
|
+
scheduled={scheduled}
|
30
|
+
/>
|
31
|
+
</TabContainer>
|
32
|
+
);
|
33
|
+
|
34
|
+
ReportGenerate.propTypes = {
|
35
|
+
exitCode: PropTypes.string,
|
36
|
+
logs: PropTypes.oneOfType([
|
37
|
+
PropTypes.arrayOf(PropTypes.string),
|
38
|
+
PropTypes.string,
|
39
|
+
]),
|
40
|
+
completed: PropTypes.number,
|
41
|
+
error: PropTypes.string,
|
42
|
+
restartProcess: PropTypes.func,
|
43
|
+
toggleFullScreen: PropTypes.func,
|
44
|
+
scheduled: PropTypes.string,
|
45
|
+
};
|
46
|
+
|
47
|
+
ReportGenerate.defaultProps = {
|
48
|
+
exitCode: '',
|
49
|
+
logs: null,
|
50
|
+
completed: 0,
|
51
|
+
error: null,
|
52
|
+
restartProcess: noop,
|
53
|
+
toggleFullScreen: noop,
|
54
|
+
scheduled: null,
|
55
|
+
};
|
56
|
+
|
57
|
+
export default ReportGenerate;
|
File without changes
|
data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
|
2
|
+
|
3
|
+
import ReportGenerate from '../ReportGenerate';
|
4
|
+
import { props } from '../ReportGenerate.fixtures';
|
5
|
+
|
6
|
+
const fixtures = {
|
7
|
+
'render without Props': {},
|
8
|
+
'render with Props': props,
|
9
|
+
};
|
10
|
+
|
11
|
+
describe('ReportGenerate', () => {
|
12
|
+
describe('rendering', () =>
|
13
|
+
testComponentSnapshotsWithFixtures(ReportGenerate, fixtures));
|
14
|
+
});
|