katello 3.8.0.rc1 → 3.8.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/katello/common/index.js +1 -0
- data/app/assets/javascripts/katello/sync_management/index.js +1 -0
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +1 -1
- data/app/controllers/katello/api/v2/environments_controller.rb +0 -1
- data/app/controllers/katello/api/v2/ostree_branches_controller.rb +1 -1
- data/app/controllers/katello/api/v2/repository_sets_controller.rb +10 -1
- data/app/controllers/katello/remote_execution_controller.rb +6 -6
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +37 -9
- data/app/lib/katello/resources/registry.rb +4 -4
- data/app/models/katello/authorization/repository.rb +2 -1
- data/app/models/katello/content_view.rb +12 -4
- data/app/models/katello/glue/candlepin/owner.rb +0 -8
- data/app/models/katello/glue/candlepin/pool.rb +11 -11
- data/app/models/katello/kt_environment.rb +0 -6
- data/app/models/katello/product_content.rb +4 -1
- data/app/models/katello/rpm.rb +13 -5
- data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +3 -1
- data/app/views/overrides/activation_keys/_host_environment_select.html.erb +2 -3
- data/config/katello.yaml.example +5 -0
- data/config/routes.rb +1 -0
- data/db/seeds.d/75-job_templates.rb +5 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-details.html +43 -8
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/discovery.controller.js +17 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery-create.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/discovery/views/discovery.html +1 -1
- data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +5 -0
- data/lib/katello/version.rb +1 -1
- data/package.json +11 -7
- data/webpack/__mocks__/foremanReact/components/BreadcrumbBar.js +3 -0
- data/webpack/__mocks__/foremanReact/redux/actions/toasts.js +8 -0
- data/webpack/__mocks__/foremanReact/redux.js +3 -0
- data/webpack/components/Search/Search.test.js +3 -1
- data/webpack/components/SelectOrg/SelectOrg.scss +3 -0
- data/webpack/components/SelectOrg/SelectOrgAction.js +41 -0
- data/webpack/components/SelectOrg/SelectOrgReducer.js +33 -0
- data/webpack/components/SelectOrg/SetOrganization.js +116 -0
- data/webpack/components/WithOrganization/withOrganization.js +28 -0
- data/webpack/containers/Application/config.js +9 -2
- data/webpack/containers/Application/index.js +4 -2
- data/webpack/global_test_setup.js +6 -0
- data/webpack/helpers/caret.js +6 -0
- data/webpack/mockRequest.js +3 -3
- data/webpack/move_to_foreman/common/helpers.js +45 -8
- data/webpack/move_to_foreman/components/common/{emptyState → EmptyState}/index.js +16 -3
- data/webpack/move_to_foreman/components/common/table/components/Table.js +1 -1
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +2 -2
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionCell.test.js.snap +1 -1
- data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +1 -1
- data/webpack/move_to_pf/LoadingState/LoadingState.js +27 -14
- data/webpack/move_to_pf/LoadingState/LoadingState.test.js +8 -4
- data/webpack/move_to_pf/Select/Select.js +40 -0
- data/webpack/move_to_pf/react-bootstrap-select/index.js +12 -1
- data/webpack/redux/actions/RedHatRepositories/enabled.js +0 -1
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -5
- data/webpack/redux/actions/RedHatRepositories/sets.js +1 -1
- data/webpack/redux/consts.js +6 -0
- data/webpack/redux/reducers/index.js +2 -0
- data/webpack/scenes/RedHatRepositories/components/EnabledRepository.js +14 -23
- data/webpack/scenes/RedHatRepositories/components/EnabledRepositoryContent.js +34 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +1 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/EnabledRepository.test.js +36 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/EnabledRepositoryContent.test.js +27 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepository.test.js.snap +25 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/EnabledRepositoryContent.test.js.snap +47 -0
- data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RecommendedRepositorySetsToggler.test.js.snap +3 -1
- data/webpack/scenes/RedHatRepositories/index.js +7 -3
- data/webpack/scenes/RedHatRepositories/index.scss +1 -0
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +3 -8
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProducts.js +5 -3
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +1 -1
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +44 -6
- data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.scss +4 -0
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailReducer.test.js +3 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +2 -1
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProducts.test.js.snap +113 -23
- data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +23 -14
- data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +3 -4
- data/webpack/scenes/Subscriptions/Details/index.js +2 -2
- data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +78 -34
- data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +5 -24
- data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js +9 -1
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManageManifestModal.test.js +3 -0
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestActions.test.js +20 -8
- data/webpack/scenes/Subscriptions/Manifest/__tests__/ManifestHistoryReducer.test.js +3 -1
- data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +34 -7
- data/webpack/scenes/Subscriptions/Manifest/__tests__/manifest.fixtures.js +9 -16
- data/webpack/scenes/Subscriptions/Manifest/index.js +1 -0
- data/webpack/scenes/Subscriptions/SubscriptionActions.js +5 -26
- data/webpack/scenes/Subscriptions/SubscriptionConstants.js +1 -0
- data/webpack/scenes/Subscriptions/SubscriptionHelpers.js +3 -0
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +11 -4
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +31 -36
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +3 -12
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +57 -27
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsReducer.js +2 -3
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +10 -5
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsActions.test.js +10 -5
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsPage.test.js +50 -5
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/UpstreamSubscriptionsReducer.test.js +8 -3
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +21 -11
- data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +5 -8
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsPage.test.js +2 -0
- data/webpack/scenes/Subscriptions/__tests__/SubscriptionsReducer.test.js +9 -3
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsPage.test.js.snap +14 -2
- data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +11 -17
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/EntitlementsInlineEditFormatter.js +8 -5
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTable.js +45 -58
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +11 -4
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableSchema.js +2 -2
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/EntitlementsInlineEditFormatter.test.js +110 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +16 -3
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/EntitlementsInlineEditFormatter.test.js.snap +228 -0
- data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap +392 -365
- data/webpack/scenes/Subscriptions/index.js +1 -0
- data/webpack/scenes/Tasks/helpers.js +52 -0
- data/webpack/services/api/index.js +17 -1
- data/webpack/services/api/testHelpers.js +28 -0
- data/webpack/test_setup.js +2 -0
- metadata +24 -5
- data/config/katello.yaml +0 -89
- data/webpack/services/api/fixtures.js +0 -353
data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js
CHANGED
@@ -1,15 +1,22 @@
|
|
1
1
|
const buildTableRow = (subscription, availableQuantities, updatedQuantity) => {
|
2
|
+
const availableQuantityLoaded = !!availableQuantities;
|
3
|
+
const availableQuantity = availableQuantityLoaded
|
4
|
+
? availableQuantities[subscription.id]
|
5
|
+
: null;
|
6
|
+
|
2
7
|
if (updatedQuantity[subscription.id]) {
|
3
8
|
return {
|
4
9
|
...subscription,
|
5
10
|
entitlementsChanged: true,
|
6
11
|
quantity: updatedQuantity[subscription.id],
|
7
|
-
availableQuantity
|
12
|
+
availableQuantity,
|
13
|
+
availableQuantityLoaded,
|
8
14
|
};
|
9
15
|
}
|
10
16
|
return {
|
11
17
|
...subscription,
|
12
|
-
availableQuantity
|
18
|
+
availableQuantity,
|
19
|
+
availableQuantityLoaded,
|
13
20
|
};
|
14
21
|
};
|
15
22
|
|
@@ -27,10 +34,10 @@ const buildTableRowsFromGroup = (subscriptionGroup, availableQuantities, updated
|
|
27
34
|
return [buildTableRow(firstSubscription, availableQuantities, updatedQuantity)];
|
28
35
|
};
|
29
36
|
|
30
|
-
export const buildTableRows = (
|
37
|
+
export const buildTableRows = (groupedSubscriptions, availableQuantities, updatedQuantity) => {
|
31
38
|
const rows = [];
|
32
39
|
|
33
|
-
Object.values(
|
40
|
+
Object.values(groupedSubscriptions).forEach(subscriptionGroup =>
|
34
41
|
rows.push(...buildTableRowsFromGroup(subscriptionGroup, availableQuantities, updatedQuantity)));
|
35
42
|
|
36
43
|
return rows;
|
@@ -97,9 +97,9 @@ export const createSubscriptionsTableSchema = (
|
|
97
97
|
},
|
98
98
|
cell: {
|
99
99
|
formatters: [
|
100
|
-
|
100
|
+
(value, { rowData }) => (
|
101
101
|
<td>
|
102
|
-
<Icon type="fa" name={
|
102
|
+
<Icon type="fa" name={rowData.virt_who ? 'check' : 'minus'} />
|
103
103
|
</td>
|
104
104
|
),
|
105
105
|
],
|
@@ -0,0 +1,110 @@
|
|
1
|
+
// import React from 'react';
|
2
|
+
import { shallow } from 'enzyme';
|
3
|
+
import toJson from 'enzyme-to-json';
|
4
|
+
import editFormatter from '../EntitlementsInlineEditFormatter';
|
5
|
+
|
6
|
+
describe('EntitlementsInlineEditFormatter', () => {
|
7
|
+
const data = rowData => ({
|
8
|
+
rowData,
|
9
|
+
});
|
10
|
+
|
11
|
+
const mockController = (options = {}) => {
|
12
|
+
const { editing = true, changed = false } = options;
|
13
|
+
return {
|
14
|
+
isEditing: () => editing,
|
15
|
+
hasChanged: () => changed,
|
16
|
+
};
|
17
|
+
};
|
18
|
+
|
19
|
+
describe('edit mode', () => {
|
20
|
+
describe('when available quantities are being loaded', () => {
|
21
|
+
it('renders spinner', async () => {
|
22
|
+
const controller = mockController();
|
23
|
+
const value = 100;
|
24
|
+
const formatter = editFormatter(controller)(value, data({
|
25
|
+
availableQuantityLoaded: false,
|
26
|
+
}));
|
27
|
+
|
28
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
29
|
+
});
|
30
|
+
});
|
31
|
+
|
32
|
+
describe('when available quantities are loaded', () => {
|
33
|
+
it('renders edit field and max available', async () => {
|
34
|
+
const controller = mockController();
|
35
|
+
const value = 100;
|
36
|
+
const formatter = editFormatter(controller)(value, data({
|
37
|
+
availableQuantityLoaded: true,
|
38
|
+
availableQuantity: 500,
|
39
|
+
}));
|
40
|
+
|
41
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
42
|
+
});
|
43
|
+
|
44
|
+
it('renders edit field and unlimited message', async () => {
|
45
|
+
const controller = mockController();
|
46
|
+
const value = 100;
|
47
|
+
const formatter = editFormatter(controller)(value, data({
|
48
|
+
availableQuantityLoaded: true,
|
49
|
+
availableQuantity: -1,
|
50
|
+
}));
|
51
|
+
|
52
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
53
|
+
});
|
54
|
+
|
55
|
+
it('renders validation message', async () => {
|
56
|
+
const controller = mockController();
|
57
|
+
const value = 200;
|
58
|
+
const formatter = editFormatter(controller)(value, data({
|
59
|
+
availableQuantityLoaded: true,
|
60
|
+
availableQuantity: 100,
|
61
|
+
}));
|
62
|
+
|
63
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
64
|
+
});
|
65
|
+
|
66
|
+
it('renders changed values', async () => {
|
67
|
+
const controller = mockController({ changed: true });
|
68
|
+
const value = 100;
|
69
|
+
const formatter = editFormatter(controller)(value, data({
|
70
|
+
availableQuantityLoaded: true,
|
71
|
+
availableQuantity: 200,
|
72
|
+
}));
|
73
|
+
|
74
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
75
|
+
});
|
76
|
+
});
|
77
|
+
|
78
|
+
describe('when available quantities failed to load', () => {
|
79
|
+
it('renders just the edit field', async () => {
|
80
|
+
const controller = mockController();
|
81
|
+
const value = 200;
|
82
|
+
const formatter = editFormatter(controller)(value, data({
|
83
|
+
availableQuantityLoaded: true,
|
84
|
+
}));
|
85
|
+
|
86
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
87
|
+
});
|
88
|
+
});
|
89
|
+
});
|
90
|
+
|
91
|
+
describe('value mode', () => {
|
92
|
+
it('renders the value', async () => {
|
93
|
+
const controller = mockController({ editing: false });
|
94
|
+
const value = 200;
|
95
|
+
const formatter = editFormatter(controller)(value, data({}));
|
96
|
+
|
97
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
98
|
+
});
|
99
|
+
|
100
|
+
it('renders unlimited for -1', async () => {
|
101
|
+
const controller = mockController({ editing: false });
|
102
|
+
const value = 200;
|
103
|
+
const formatter = editFormatter(controller)(value, data({
|
104
|
+
available: -1,
|
105
|
+
}));
|
106
|
+
|
107
|
+
expect(toJson(shallow(formatter))).toMatchSnapshot();
|
108
|
+
});
|
109
|
+
});
|
110
|
+
});
|
data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { render } from 'enzyme';
|
2
|
+
import { render, mount } from 'enzyme';
|
3
3
|
import toJson from 'enzyme-to-json';
|
4
4
|
import { MemoryRouter } from 'react-router-dom';
|
5
5
|
import SubscriptionsTable from '../SubscriptionsTable';
|
6
6
|
import { successState, loadingState, emptyState } from '../../../__tests__/subscriptions.fixtures';
|
7
7
|
import { loadSubscriptions, updateQuantity } from '../../../SubscriptionActions';
|
8
8
|
|
9
|
+
jest.mock('../../../../../move_to_foreman/foreman_toast_notifications');
|
10
|
+
jest.useFakeTimers();
|
9
11
|
describe('subscriptions table', () => {
|
10
12
|
it('should render a table', async () => {
|
11
13
|
// Wrapping SubscriptionTable in MemoryRouter here since it contains
|
@@ -20,16 +22,23 @@ describe('subscriptions table', () => {
|
|
20
22
|
onSubscriptionDeleteModalClose={() => { }}
|
21
23
|
onDeleteSubscriptions={() => {}}
|
22
24
|
toggleDeleteButton={() => {}}
|
25
|
+
emptyState={{}}
|
23
26
|
/>
|
24
27
|
</MemoryRouter>);
|
25
28
|
expect(toJson(page)).toMatchSnapshot();
|
26
29
|
});
|
27
|
-
/* eslint-enable react/jsx-indent */
|
28
30
|
|
29
31
|
it('should render an empty state', async () => {
|
32
|
+
const emptyStateData = {
|
33
|
+
header: __('Yay empty state'),
|
34
|
+
description: __('There is nothing to see here'),
|
35
|
+
};
|
36
|
+
|
37
|
+
/* eslint-disable react/jsx-indent */
|
30
38
|
const page = render(<MemoryRouter>
|
31
39
|
<SubscriptionsTable
|
32
40
|
subscriptions={emptyState}
|
41
|
+
emptyState={emptyStateData}
|
33
42
|
loadSubscriptions={loadSubscriptions}
|
34
43
|
updateQuantity={updateQuantity}
|
35
44
|
subscriptionDeleteModalOpen={false}
|
@@ -40,9 +49,10 @@ describe('subscriptions table', () => {
|
|
40
49
|
</MemoryRouter>);
|
41
50
|
expect(toJson(page)).toMatchSnapshot();
|
42
51
|
});
|
52
|
+
/* eslint-enable react/jsx-indent */
|
43
53
|
|
44
54
|
it('should render a loading state', async () => {
|
45
|
-
const page =
|
55
|
+
const page = mount(<SubscriptionsTable
|
46
56
|
subscriptions={loadingState}
|
47
57
|
loadSubscriptions={loadSubscriptions}
|
48
58
|
updateQuantity={updateQuantity}
|
@@ -50,7 +60,10 @@ describe('subscriptions table', () => {
|
|
50
60
|
onSubscriptionDeleteModalClose={() => { }}
|
51
61
|
onDeleteSubscriptions={() => {}}
|
52
62
|
toggleDeleteButton={() => {}}
|
63
|
+
emptyState={{}}
|
53
64
|
/>);
|
65
|
+
jest.runAllTimers();
|
66
|
+
page.update();
|
54
67
|
expect(toJson(page)).toMatchSnapshot();
|
55
68
|
});
|
56
69
|
});
|
@@ -0,0 +1,228 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`EntitlementsInlineEditFormatter edit mode when available quantities are being loaded renders spinner 1`] = `
|
4
|
+
<td
|
5
|
+
className="editable editing"
|
6
|
+
>
|
7
|
+
<Spinner
|
8
|
+
className=""
|
9
|
+
inline={false}
|
10
|
+
inverse={false}
|
11
|
+
loading={true}
|
12
|
+
size="xs"
|
13
|
+
>
|
14
|
+
<FormGroup
|
15
|
+
bsClass="form-group"
|
16
|
+
>
|
17
|
+
<FormControl
|
18
|
+
bsClass="form-control"
|
19
|
+
componentClass="input"
|
20
|
+
defaultValue={100}
|
21
|
+
onBlur={[Function]}
|
22
|
+
type="text"
|
23
|
+
/>
|
24
|
+
<HelpBlock
|
25
|
+
bsClass="help-block"
|
26
|
+
>
|
27
|
+
<div
|
28
|
+
className="validationMessages"
|
29
|
+
/>
|
30
|
+
</HelpBlock>
|
31
|
+
</FormGroup>
|
32
|
+
</Spinner>
|
33
|
+
</td>
|
34
|
+
`;
|
35
|
+
|
36
|
+
exports[`EntitlementsInlineEditFormatter edit mode when available quantities are loaded renders changed values 1`] = `
|
37
|
+
<td
|
38
|
+
className="editable editing changed"
|
39
|
+
>
|
40
|
+
<Spinner
|
41
|
+
className=""
|
42
|
+
inline={false}
|
43
|
+
inverse={false}
|
44
|
+
loading={false}
|
45
|
+
size="xs"
|
46
|
+
>
|
47
|
+
<FormGroup
|
48
|
+
bsClass="form-group"
|
49
|
+
>
|
50
|
+
<FormControl
|
51
|
+
bsClass="form-control"
|
52
|
+
componentClass="input"
|
53
|
+
defaultValue={100}
|
54
|
+
onBlur={[Function]}
|
55
|
+
type="text"
|
56
|
+
/>
|
57
|
+
<HelpBlock
|
58
|
+
bsClass="help-block"
|
59
|
+
>
|
60
|
+
Max 200
|
61
|
+
<div
|
62
|
+
className="validationMessages"
|
63
|
+
/>
|
64
|
+
</HelpBlock>
|
65
|
+
</FormGroup>
|
66
|
+
</Spinner>
|
67
|
+
</td>
|
68
|
+
`;
|
69
|
+
|
70
|
+
exports[`EntitlementsInlineEditFormatter edit mode when available quantities are loaded renders edit field and max available 1`] = `
|
71
|
+
<td
|
72
|
+
className="editable editing"
|
73
|
+
>
|
74
|
+
<Spinner
|
75
|
+
className=""
|
76
|
+
inline={false}
|
77
|
+
inverse={false}
|
78
|
+
loading={false}
|
79
|
+
size="xs"
|
80
|
+
>
|
81
|
+
<FormGroup
|
82
|
+
bsClass="form-group"
|
83
|
+
>
|
84
|
+
<FormControl
|
85
|
+
bsClass="form-control"
|
86
|
+
componentClass="input"
|
87
|
+
defaultValue={100}
|
88
|
+
onBlur={[Function]}
|
89
|
+
type="text"
|
90
|
+
/>
|
91
|
+
<HelpBlock
|
92
|
+
bsClass="help-block"
|
93
|
+
>
|
94
|
+
Max 500
|
95
|
+
<div
|
96
|
+
className="validationMessages"
|
97
|
+
/>
|
98
|
+
</HelpBlock>
|
99
|
+
</FormGroup>
|
100
|
+
</Spinner>
|
101
|
+
</td>
|
102
|
+
`;
|
103
|
+
|
104
|
+
exports[`EntitlementsInlineEditFormatter edit mode when available quantities are loaded renders edit field and unlimited message 1`] = `
|
105
|
+
<td
|
106
|
+
className="editable editing"
|
107
|
+
>
|
108
|
+
<Spinner
|
109
|
+
className=""
|
110
|
+
inline={false}
|
111
|
+
inverse={false}
|
112
|
+
loading={false}
|
113
|
+
size="xs"
|
114
|
+
>
|
115
|
+
<FormGroup
|
116
|
+
bsClass="form-group"
|
117
|
+
>
|
118
|
+
<FormControl
|
119
|
+
bsClass="form-control"
|
120
|
+
componentClass="input"
|
121
|
+
defaultValue={100}
|
122
|
+
onBlur={[Function]}
|
123
|
+
type="text"
|
124
|
+
/>
|
125
|
+
<HelpBlock
|
126
|
+
bsClass="help-block"
|
127
|
+
>
|
128
|
+
Unlimited
|
129
|
+
<div
|
130
|
+
className="validationMessages"
|
131
|
+
/>
|
132
|
+
</HelpBlock>
|
133
|
+
</FormGroup>
|
134
|
+
</Spinner>
|
135
|
+
</td>
|
136
|
+
`;
|
137
|
+
|
138
|
+
exports[`EntitlementsInlineEditFormatter edit mode when available quantities are loaded renders validation message 1`] = `
|
139
|
+
<td
|
140
|
+
className="editable editing"
|
141
|
+
>
|
142
|
+
<Spinner
|
143
|
+
className=""
|
144
|
+
inline={false}
|
145
|
+
inverse={false}
|
146
|
+
loading={false}
|
147
|
+
size="xs"
|
148
|
+
>
|
149
|
+
<FormGroup
|
150
|
+
bsClass="form-group"
|
151
|
+
validationState="error"
|
152
|
+
>
|
153
|
+
<FormControl
|
154
|
+
bsClass="form-control"
|
155
|
+
componentClass="input"
|
156
|
+
defaultValue={200}
|
157
|
+
onBlur={[Function]}
|
158
|
+
type="text"
|
159
|
+
/>
|
160
|
+
<HelpBlock
|
161
|
+
bsClass="help-block"
|
162
|
+
>
|
163
|
+
Max 100
|
164
|
+
<div
|
165
|
+
className="validationMessages"
|
166
|
+
>
|
167
|
+
Exceeds available quantity
|
168
|
+
</div>
|
169
|
+
</HelpBlock>
|
170
|
+
</FormGroup>
|
171
|
+
</Spinner>
|
172
|
+
</td>
|
173
|
+
`;
|
174
|
+
|
175
|
+
exports[`EntitlementsInlineEditFormatter edit mode when available quantities failed to load renders just the edit field 1`] = `
|
176
|
+
<td
|
177
|
+
className="editable editing"
|
178
|
+
>
|
179
|
+
<Spinner
|
180
|
+
className=""
|
181
|
+
inline={false}
|
182
|
+
inverse={false}
|
183
|
+
loading={false}
|
184
|
+
size="xs"
|
185
|
+
>
|
186
|
+
<FormGroup
|
187
|
+
bsClass="form-group"
|
188
|
+
>
|
189
|
+
<FormControl
|
190
|
+
bsClass="form-control"
|
191
|
+
componentClass="input"
|
192
|
+
defaultValue={200}
|
193
|
+
onBlur={[Function]}
|
194
|
+
type="text"
|
195
|
+
/>
|
196
|
+
<HelpBlock
|
197
|
+
bsClass="help-block"
|
198
|
+
>
|
199
|
+
<div
|
200
|
+
className="validationMessages"
|
201
|
+
/>
|
202
|
+
</HelpBlock>
|
203
|
+
</FormGroup>
|
204
|
+
</Spinner>
|
205
|
+
</td>
|
206
|
+
`;
|
207
|
+
|
208
|
+
exports[`EntitlementsInlineEditFormatter value mode renders the value 1`] = `
|
209
|
+
<td
|
210
|
+
className="editable"
|
211
|
+
>
|
212
|
+
<div
|
213
|
+
className="input"
|
214
|
+
onClick={[Function]}
|
215
|
+
onKeyPress={[Function]}
|
216
|
+
role="textbox"
|
217
|
+
tabIndex={0}
|
218
|
+
>
|
219
|
+
200
|
220
|
+
</div>
|
221
|
+
</td>
|
222
|
+
`;
|
223
|
+
|
224
|
+
exports[`EntitlementsInlineEditFormatter value mode renders unlimited for -1 1`] = `
|
225
|
+
<td>
|
226
|
+
Unlimited
|
227
|
+
</td>
|
228
|
+
`;
|