foreman_rh_cloud 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_inventory_upload/accounts_controller.rb +2 -6
- data/app/controllers/foreman_rh_cloud/react_controller.rb +8 -0
- data/app/models/setting/rh_cloud.rb +1 -0
- data/app/views/foreman_rh_cloud/react/inventory_upload.html.erb +1 -0
- data/app/views/{foreman_inventory_upload/layouts/react.html.erb → layouts/foreman_rh_cloud/application.html.erb} +2 -2
- data/config/routes.rb +4 -1
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +43 -0
- data/lib/foreman_inventory_upload/generators/queries.rb +5 -0
- data/lib/foreman_inventory_upload/generators/slice.rb +2 -1
- data/lib/foreman_rh_cloud/engine.rb +16 -4
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/test/unit/slice_generator_test.rb +132 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +6 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +13 -10
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +3 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/EmptyResults.js +15 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/EmptyResults.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/__snapshots__/EmptyResults.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +1 -4
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListHelper.test.js +12 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +7 -8
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +2 -3
- data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +2 -0
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +4 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +4 -3
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +2 -3
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +3 -2
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js +2 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +39 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterActions.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterConstants.js +3 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js +36 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterSelectors.js +7 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterActions.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +35 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterSelectors.test.js +21 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilter.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterActions.test.js.snap +17 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterReducer.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterSelectors.test.js.snap +9 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/integration.test.js.snap +31 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/index.js +17 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss +28 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +12 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +11 -2
- data/webpack/ForemanInventoryUpload/Components/PageHeader/pageHeader.scss +3 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryConstants.js +3 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +4 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +16 -8
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +4 -4
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +9 -0
- data/webpack/ForemanInventoryUpload/{ForemanInventoryUpload.test.js → __tests__/ForemanInventoryUpload.test.js} +1 -1
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +3 -0
- data/webpack/ForemanInventoryUpload/{__snapshots__ → __tests__/__snapshots__}/ForemanInventoryUpload.test.js.snap +0 -0
- data/webpack/ForemanRhCloudHelpers.js +6 -0
- data/webpack/ForemanRhCloudReducers.js +8 -0
- data/webpack/ForemanRhCloudSelectors.js +3 -0
- data/webpack/ForemanRhCloudTestHelpers.js +5 -0
- data/webpack/__mocks__/foremanReact/components/Layout/LayoutConstants.js +1 -0
- data/webpack/__tests__/ForemanRhCloudHelpers.test.js +11 -0
- data/webpack/__tests__/ForemanRhCloudSelectors.test.js +17 -0
- data/webpack/__tests__/ForemanRhCloudTestHelpers.test.js +10 -0
- data/webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap +3 -0
- data/webpack/__tests__/__snapshots__/ForemanRhCloudSelectors.test.js.snap +15 -0
- data/webpack/__tests__/__snapshots__/ForemanRhCloudTestHelpers.test.js.snap +11 -0
- data/webpack/index.js +1 -1
- metadata +49 -9
- data/app/controllers/foreman_inventory_upload/react_controller.rb +0 -7
- data/test/unit/slice_generator_test.rb.orig +0 -280
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +0 -4
@@ -0,0 +1,7 @@
|
|
1
|
+
import { selectForemanInventoryUpload } from '../../../ForemanRhCloudSelectors';
|
2
|
+
|
3
|
+
export const selectInventoryFilter = state =>
|
4
|
+
selectForemanInventoryUpload(state).inventoryFilter;
|
5
|
+
|
6
|
+
export const selectFilterTerm = state =>
|
7
|
+
selectInventoryFilter(state).filterTerm;
|
data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
2
|
+
import { noop } from 'patternfly-react';
|
3
|
+
|
4
|
+
import InventoryFilter from '../InventoryFilter';
|
5
|
+
|
6
|
+
const fixtures = {
|
7
|
+
'render with props': { handleFilterChange: noop },
|
8
|
+
/** fixtures, props for the component */
|
9
|
+
};
|
10
|
+
|
11
|
+
describe('InventoryFilter', () => {
|
12
|
+
describe('rendering', () =>
|
13
|
+
testComponentSnapshotsWithFixtures(InventoryFilter, fixtures));
|
14
|
+
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
import {
|
3
|
+
handleFilterChange,
|
4
|
+
handleFilterClear,
|
5
|
+
} from '../InventoryFilterActions';
|
6
|
+
import { filterTerm } from '../InventoryFilter.fixtures';
|
7
|
+
|
8
|
+
const fixtures = {
|
9
|
+
'should handleFilterChange': () => handleFilterChange(filterTerm),
|
10
|
+
'should handleFilterClear': () => handleFilterClear(),
|
11
|
+
};
|
12
|
+
|
13
|
+
describe('InventoryFilter actions', () =>
|
14
|
+
testActionSnapshotWithFixtures(fixtures));
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { testReducerSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
import { LAYOUT_CHANGE_ORG } from 'foremanReact/components/Layout/LayoutConstants';
|
3
|
+
import reducer from '../InventoryFilterReducer';
|
4
|
+
import { filterTerm, org } from '../InventoryFilter.fixtures';
|
5
|
+
import {
|
6
|
+
INVENTORY_FILTER_UPDATE,
|
7
|
+
INVENTORY_FILTER_CLEAR,
|
8
|
+
} from '../InventoryFilterConstants';
|
9
|
+
|
10
|
+
const fixtures = {
|
11
|
+
'should return the initial state': {},
|
12
|
+
'should handle INVENTORY_FILTER_UPDATE': {
|
13
|
+
action: {
|
14
|
+
type: INVENTORY_FILTER_UPDATE,
|
15
|
+
payload: {
|
16
|
+
filterTerm,
|
17
|
+
},
|
18
|
+
},
|
19
|
+
},
|
20
|
+
'should handle INVENTORY_FILTER_CLEAR': {
|
21
|
+
action: {
|
22
|
+
type: INVENTORY_FILTER_CLEAR,
|
23
|
+
payload: {},
|
24
|
+
},
|
25
|
+
},
|
26
|
+
'should handle LAYOUT_CHANGE_ORG': {
|
27
|
+
action: {
|
28
|
+
type: LAYOUT_CHANGE_ORG,
|
29
|
+
payload: { org },
|
30
|
+
},
|
31
|
+
},
|
32
|
+
};
|
33
|
+
|
34
|
+
describe('AccountList reducer', () =>
|
35
|
+
testReducerSnapshotWithFixtures(reducer, fixtures));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
import { filterTerm } from '../InventoryFilter.fixtures';
|
3
|
+
import { inventoryStateWrapper } from '../../../../ForemanRhCloudTestHelpers';
|
4
|
+
import {
|
5
|
+
selectInventoryFilter,
|
6
|
+
selectFilterTerm,
|
7
|
+
} from '../InventoryFilterSelectors';
|
8
|
+
|
9
|
+
const state = inventoryStateWrapper({
|
10
|
+
inventoryFilter: {
|
11
|
+
filterTerm,
|
12
|
+
},
|
13
|
+
});
|
14
|
+
|
15
|
+
const fixtures = {
|
16
|
+
'should return InventoryFilter': () => selectInventoryFilter(state),
|
17
|
+
'should return filterTerm': () => selectFilterTerm(state),
|
18
|
+
};
|
19
|
+
|
20
|
+
describe('InventoryFilter selectors', () =>
|
21
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`InventoryFilter rendering render with props 1`] = `
|
4
|
+
<form
|
5
|
+
id="inventory_filter_form"
|
6
|
+
>
|
7
|
+
<FormGroup
|
8
|
+
bsClass="form-group"
|
9
|
+
controlId="inventory_filter_input"
|
10
|
+
>
|
11
|
+
<FormControl
|
12
|
+
bsClass="form-control"
|
13
|
+
bsSize="lg"
|
14
|
+
componentClass="input"
|
15
|
+
onChange={[Function]}
|
16
|
+
placeholder="Filter.."
|
17
|
+
type="text"
|
18
|
+
value=""
|
19
|
+
/>
|
20
|
+
<ClearButton
|
21
|
+
onClear={[Function]}
|
22
|
+
/>
|
23
|
+
</FormGroup>
|
24
|
+
</form>
|
25
|
+
`;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`InventoryFilter actions should handleFilterChange 1`] = `
|
4
|
+
Object {
|
5
|
+
"payload": Object {
|
6
|
+
"filterTerm": "test_filter_term",
|
7
|
+
},
|
8
|
+
"type": "INVENTORY_FILTER_UPDATE",
|
9
|
+
}
|
10
|
+
`;
|
11
|
+
|
12
|
+
exports[`InventoryFilter actions should handleFilterClear 1`] = `
|
13
|
+
Object {
|
14
|
+
"payload": Object {},
|
15
|
+
"type": "INVENTORY_FILTER_CLEAR",
|
16
|
+
}
|
17
|
+
`;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`AccountList reducer should handle INVENTORY_FILTER_CLEAR 1`] = `
|
4
|
+
Object {
|
5
|
+
"filterTerm": "",
|
6
|
+
}
|
7
|
+
`;
|
8
|
+
|
9
|
+
exports[`AccountList reducer should handle INVENTORY_FILTER_UPDATE 1`] = `
|
10
|
+
Object {
|
11
|
+
"filterTerm": "test_filter_term",
|
12
|
+
}
|
13
|
+
`;
|
14
|
+
|
15
|
+
exports[`AccountList reducer should handle LAYOUT_CHANGE_ORG 1`] = `
|
16
|
+
Object {
|
17
|
+
"filterTerm": "some_org",
|
18
|
+
}
|
19
|
+
`;
|
20
|
+
|
21
|
+
exports[`AccountList reducer should return the initial state 1`] = `
|
22
|
+
Object {
|
23
|
+
"filterTerm": "",
|
24
|
+
}
|
25
|
+
`;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`InventoryFilter selectors should return InventoryFilter 1`] = `
|
4
|
+
Object {
|
5
|
+
"filterTerm": "test_filter_term",
|
6
|
+
}
|
7
|
+
`;
|
8
|
+
|
9
|
+
exports[`InventoryFilter selectors should return filterTerm 1`] = `"test_filter_term"`;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`InventoryFilter integration test should flow: filter have been updated 1`] = `
|
4
|
+
Object {
|
5
|
+
"action": Array [
|
6
|
+
Array [
|
7
|
+
Object {
|
8
|
+
"payload": Object {
|
9
|
+
"filterTerm": "some_new_filter",
|
10
|
+
},
|
11
|
+
"type": "INVENTORY_FILTER_UPDATE",
|
12
|
+
},
|
13
|
+
],
|
14
|
+
],
|
15
|
+
"state": Object {
|
16
|
+
"ForemanRhCloud": Object {
|
17
|
+
"inventoryUpload": Object {
|
18
|
+
"accountsList": Object {
|
19
|
+
"accounts": Object {},
|
20
|
+
"error": null,
|
21
|
+
"pollingProcessID": 0,
|
22
|
+
},
|
23
|
+
"dashboard": Object {},
|
24
|
+
"inventoryFilter": Object {
|
25
|
+
"filterTerm": "some_new_filter",
|
26
|
+
},
|
27
|
+
},
|
28
|
+
},
|
29
|
+
},
|
30
|
+
}
|
31
|
+
`;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IntegrationTestHelper } from '@theforeman/test';
|
3
|
+
import InventoryFilter from '../index';
|
4
|
+
import reducers from '../../../../ForemanRhCloudReducers';
|
5
|
+
|
6
|
+
describe('InventoryFilter integration test', () => {
|
7
|
+
it('should flow', async () => {
|
8
|
+
const integrationTestHelper = new IntegrationTestHelper(reducers);
|
9
|
+
const wrapper = integrationTestHelper.mount(<InventoryFilter />);
|
10
|
+
const input = wrapper.find('#inventory_filter_input');
|
11
|
+
input.simulate('change', { target: { value: 'some_new_filter' } });
|
12
|
+
await IntegrationTestHelper.flushAllPromises();
|
13
|
+
wrapper.update();
|
14
|
+
integrationTestHelper.takeStoreAndLastActionSnapshot(
|
15
|
+
'filter have been updated'
|
16
|
+
);
|
17
|
+
});
|
18
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { bindActionCreators } from 'redux';
|
2
|
+
import { connect } from 'react-redux';
|
3
|
+
import reducer from './InventoryFilterReducer';
|
4
|
+
import * as actions from './InventoryFilterActions';
|
5
|
+
import InventoryFilter from './InventoryFilter';
|
6
|
+
import { selectFilterTerm } from './InventoryFilterSelectors';
|
7
|
+
|
8
|
+
export const reducers = { inventoryFilter: reducer };
|
9
|
+
|
10
|
+
const mapStateToProps = state => ({
|
11
|
+
filterTerm: selectFilterTerm(state),
|
12
|
+
});
|
13
|
+
// map action dispatchers to props
|
14
|
+
const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
|
15
|
+
|
16
|
+
// export connected component
|
17
|
+
export default connect(mapStateToProps, mapDispatchToProps)(InventoryFilter);
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#inventory_filter_form {
|
2
|
+
.form-group {
|
3
|
+
display: -ms-flexbox;
|
4
|
+
display: -webkit-flex;
|
5
|
+
display: flex;
|
6
|
+
-webkit-flex-direction: row;
|
7
|
+
-ms-flex-direction: row;
|
8
|
+
flex-direction: row;
|
9
|
+
-webkit-flex-wrap: nowrap;
|
10
|
+
-ms-flex-wrap: nowrap;
|
11
|
+
flex-wrap: nowrap;
|
12
|
+
-webkit-justify-content: flex-end;
|
13
|
+
-ms-flex-pack: end;
|
14
|
+
justify-content: flex-end;
|
15
|
+
-webkit-align-content: center;
|
16
|
+
-ms-flex-line-pack: center;
|
17
|
+
align-content: center;
|
18
|
+
-webkit-align-items: center;
|
19
|
+
-ms-flex-align: center;
|
20
|
+
align-items: center;
|
21
|
+
margin-bottom: 0;
|
22
|
+
|
23
|
+
.inventory-clear-button {
|
24
|
+
position: absolute;
|
25
|
+
right: 27px;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -1,21 +1,30 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Grid } from 'patternfly-react';
|
3
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
4
3
|
import AutoUploadSwitcher from '../AutoUploadSwitcher';
|
4
|
+
import InventoryFilter from '../InventoryFilter';
|
5
|
+
import { INVENTORY_PAGE_TITLE } from '../../ForemanInventoryConstants';
|
6
|
+
import './pageHeader.scss';
|
5
7
|
|
6
8
|
const PageHeader = () => (
|
7
9
|
<React.Fragment>
|
8
10
|
<Grid.Row>
|
9
11
|
<Grid.Col xs={12}>
|
10
|
-
<h1>{
|
12
|
+
<h1 className="inventory_title">{INVENTORY_PAGE_TITLE}</h1>
|
11
13
|
</Grid.Col>
|
12
14
|
</Grid.Row>
|
13
15
|
<Grid.Row>
|
14
|
-
<Grid.Col xs={
|
16
|
+
<Grid.Col xs={3}>
|
17
|
+
<InventoryFilter />
|
18
|
+
</Grid.Col>
|
19
|
+
<Grid.Col xs={4} xsOffset={5}>
|
15
20
|
<AutoUploadSwitcher />
|
16
21
|
</Grid.Col>
|
17
22
|
</Grid.Row>
|
18
23
|
</React.Fragment>
|
19
24
|
);
|
20
25
|
|
26
|
+
PageHeader.propTypes = {};
|
27
|
+
|
28
|
+
PageHeader.defaultProps = {};
|
29
|
+
|
21
30
|
export default PageHeader;
|
@@ -11,7 +11,9 @@ exports[`PageHeader rendering render without Props 1`] = `
|
|
11
11
|
componentClass="div"
|
12
12
|
xs={12}
|
13
13
|
>
|
14
|
-
<h1
|
14
|
+
<h1
|
15
|
+
className="inventory_title"
|
16
|
+
>
|
15
17
|
Red Hat Inventory Uploads
|
16
18
|
</h1>
|
17
19
|
</Col>
|
@@ -20,11 +22,18 @@ exports[`PageHeader rendering render without Props 1`] = `
|
|
20
22
|
bsClass="row"
|
21
23
|
componentClass="div"
|
22
24
|
>
|
25
|
+
<Col
|
26
|
+
bsClass="col"
|
27
|
+
componentClass="div"
|
28
|
+
xs={3}
|
29
|
+
>
|
30
|
+
<Connect(InventoryFilter) />
|
31
|
+
</Col>
|
23
32
|
<Col
|
24
33
|
bsClass="col"
|
25
34
|
componentClass="div"
|
26
35
|
xs={4}
|
27
|
-
xsOffset={
|
36
|
+
xsOffset={5}
|
28
37
|
>
|
29
38
|
<Connect(AutoUploadSwitcher) />
|
30
39
|
</Col>
|
@@ -3,14 +3,22 @@ import { IntlProvider } from 'react-intl';
|
|
3
3
|
import { Grid } from 'patternfly-react';
|
4
4
|
import AccountList from './Components/AccountList';
|
5
5
|
import PageHeader from './Components/PageHeader';
|
6
|
+
import { INVENTORY_PAGE_TITLE } from './ForemanInventoryConstants';
|
6
7
|
|
7
|
-
const ForemanInventoryUpload = () =>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
const ForemanInventoryUpload = () => {
|
9
|
+
document.title = INVENTORY_PAGE_TITLE;
|
10
|
+
return (
|
11
|
+
<IntlProvider locale={navigator.language}>
|
12
|
+
<Grid fluid className="inventory-upload">
|
13
|
+
<PageHeader />
|
14
|
+
<AccountList />
|
15
|
+
</Grid>
|
16
|
+
</IntlProvider>
|
17
|
+
);
|
18
|
+
};
|
19
|
+
|
20
|
+
ForemanInventoryUpload.propTypes = {};
|
21
|
+
|
22
|
+
ForemanInventoryUpload.defaultProps = {};
|
15
23
|
|
16
24
|
export default ForemanInventoryUpload;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { combineReducers } from 'redux';
|
2
2
|
import { reducers as accountListReducers } from './Components/AccountList';
|
3
3
|
import { reducers as dashboardReducers } from './Components/Dashboard';
|
4
|
+
import { reducers as filterReducers } from './Components/InventoryFilter';
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
export default {
|
7
|
+
inventoryUpload: combineReducers({
|
7
8
|
...accountListReducers,
|
8
9
|
...dashboardReducers,
|
10
|
+
...filterReducers,
|
9
11
|
}),
|
10
12
|
};
|
11
|
-
|
12
|
-
export default reducers;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
import { inventoryUrl } from '../ForemanInventoryHelpers';
|
3
|
+
|
4
|
+
const fixtures = {
|
5
|
+
'should return inventory Url': () => inventoryUrl('test_path'),
|
6
|
+
};
|
7
|
+
|
8
|
+
describe('ForemanInventoryUpload helpers', () =>
|
9
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
File without changes
|