2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 import { connect } from 'react-redux';
17 import i18n from 'nfvo-utils/i18n/i18n.js';
18 import sortByStringProperty from 'nfvo-utils/sortByStringProperty.js';
19 import EntitlementPoolsActionHelper from './EntitlementPoolsActionHelper.js';
20 import EntitlementPoolsListEditorView, {
21 generateConfirmationMsg
22 } from './EntitlementPoolsListEditorView.jsx';
23 import { actionTypes as globalMoadlActions } from 'nfvo-components/modal/GlobalModalConstants.js';
24 import { SORTING_PROPERTY_NAME } from 'sdc-app/onboarding/licenseModel/LicenseModelConstants.js';
26 const mapStateToProps = ({
27 licenseModel: { entitlementPool, licenseModelEditor }
29 const { entitlementPoolsList } = entitlementPool;
30 const { vendorName } = licenseModelEditor.data;
34 entitlementPoolsList: sortByStringProperty(
41 const mapActionsToProps = (
43 { licenseModelId, version, isReadOnlyMode }
46 onAddEntitlementPoolClick: () =>
47 EntitlementPoolsActionHelper.openEntitlementPoolsEditor(dispatch, {
52 onEditEntitlementPoolClick: entitlementPool =>
53 EntitlementPoolsActionHelper.openEntitlementPoolsEditor(dispatch, {
59 onDeleteEntitlementPool: entitlementPool =>
61 type: globalMoadlActions.GLOBAL_MODAL_WARNING,
63 msg: generateConfirmationMsg(entitlementPool),
64 confirmationButtonText: i18n('Delete'),
65 title: i18n('Delete'),
67 EntitlementPoolsActionHelper.deleteEntitlementPool(
71 entitlementPoolId: entitlementPool.id,
80 export default connect(mapStateToProps, mapActionsToProps)(
81 EntitlementPoolsListEditorView