summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups
diff options
context:
space:
mode:
authorEinav Weiss Keidar <einavw@amdocs.com>2018-08-13 16:19:46 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2019-02-11 13:50:22 +0000
commit1801b24389baa8e3f7298ff2c41e2512b19c1290 (patch)
treed3d2a15f53aa28698280d609548298d177f9280d /openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups
parentaf8e36eb7f43803bd9cf40e9b46a0c0c8f47c781 (diff)
react 16 upgrade
Issue-ID: SDC-1762 Change-Id: I7701f12fc63bb09f8c985c7c893b984701dcbfab Signed-off-by: Einav Keidar <einavw@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupEditorView.jsx5
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditor.js18
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditorView.jsx47
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.js43
4 files changed, 54 insertions, 59 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupEditorView.jsx
index d80eb9a0ab..2a9af15984 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupEditorView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupEditorView.jsx
@@ -85,7 +85,7 @@ const GeneralTab = ({
</GridItem>
<GridItem colSpan={4}>
<Input
- groupClassName="field-section"
+ groupClassName="field-section no-bottom-margin"
onChange={partNumber =>
onDataChanged({ partNumber }, FG_EDITOR_FORM)
}
@@ -203,7 +203,7 @@ class FeatureGroupEditorView extends React.Component {
licenseKeyGroupsList
} = this.props;
return (
- <div>
+ <div className="license-model-modal feature-group-modal">
{genericFieldInfo && (
<Form
ref="validationForm"
@@ -218,6 +218,7 @@ class FeatureGroupEditorView extends React.Component {
labledButtons={true}
isReadOnlyMode={isReadOnlyMode}
name="feature-group-validation-form"
+ btnClassName="sdc-modal__footer"
className="license-model-form feature-group-form">
<Tabs
activeTab={onTabSelect ? selectedTab : undefined}
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditor.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditor.js
index 8d41b97cf0..fe4eb58b4c 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditor.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditor.js
@@ -26,16 +26,12 @@ import { SORTING_PROPERTY_NAME } from 'sdc-app/onboarding/licenseModel/LicenseMo
export const mapStateToProps = ({
licenseModel: { featureGroup, licenseModelEditor }
}) => {
- const { featureGroupEditor: { data }, featureGroupsList } = featureGroup;
+ const { featureGroupsList } = featureGroup;
const { vendorName, version } = licenseModelEditor.data;
return {
vendorName,
version,
- featureGroupsModal: {
- show: Boolean(data),
- editMode: Boolean(data && data.id)
- },
featureGroupsList: sortByStringProperty(
featureGroupsList,
SORTING_PROPERTY_NAME
@@ -63,13 +59,19 @@ const mapActionsToProps = (dispatch, { licenseModelId }) => {
onAddFeatureGroupClick: actualVersion =>
FeatureGroupsActionHelper.openFeatureGroupsEditor(dispatch, {
licenseModelId,
- version: actualVersion
+ version: actualVersion,
+ isReadOnlyMode: false
}),
- onEditFeatureGroupClick: (featureGroup, actualVersion) =>
+ onEditFeatureGroupClick: (
+ featureGroup,
+ actualVersion,
+ isReadOnlyMode
+ ) =>
FeatureGroupsActionHelper.openFeatureGroupsEditor(dispatch, {
featureGroup,
licenseModelId,
- version: actualVersion
+ version: actualVersion,
+ isReadOnlyMode
})
};
};
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditorView.jsx
index 92468a3b86..63964435f2 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditorView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupListEditorView.jsx
@@ -17,20 +17,13 @@ import React from 'react';
import PropTypes from 'prop-types';
import i18n from 'nfvo-utils/i18n/i18n.js';
-import Modal from 'nfvo-components/modal/Modal.jsx';
import ListEditorView from 'nfvo-components/listEditor/ListEditorView.jsx';
import ListEditorItemView from 'nfvo-components/listEditor/ListEditorItemView.jsx';
-import FeatureGroupEditor from './FeatureGroupEditor.js';
-
class FeatureGroupListEditorView extends React.Component {
static propTypes = {
vendorName: PropTypes.string,
licenseModelId: PropTypes.string.isRequired,
- featureGroupsModal: PropTypes.shape({
- show: PropTypes.bool,
- editMode: PropTypes.bool
- }),
isReadOnlyMode: PropTypes.bool.isRequired,
onAddFeatureGroupClick: PropTypes.func,
onEditFeatureGroupClick: PropTypes.func,
@@ -40,11 +33,7 @@ class FeatureGroupListEditorView extends React.Component {
};
static defaultProps = {
- featureGroupsList: [],
- featureGroupsModal: {
- show: false,
- editMode: false
- }
+ featureGroupsList: []
};
state = {
@@ -52,13 +41,7 @@ class FeatureGroupListEditorView extends React.Component {
};
render() {
- let {
- licenseModelId,
- featureGroupsModal,
- isReadOnlyMode,
- onAddFeatureGroupClick,
- version
- } = this.props;
+ let { isReadOnlyMode, onAddFeatureGroupClick, version } = this.props;
const { localFilter } = this.state;
return (
<div className="license-model-list-editor feature-groups-list-editor">
@@ -77,28 +60,6 @@ class FeatureGroupListEditorView extends React.Component {
)
)}
</ListEditorView>
- {featureGroupsModal.show && (
- <Modal
- show={featureGroupsModal.show}
- bsSize="large"
- animation={true}
- className="onborading-modal license-model-modal feature-group-modal">
- <Modal.Header>
- <Modal.Title>{`${
- featureGroupsModal.editMode
- ? i18n('Edit Feature Group')
- : i18n('Create New Feature Group')
- }`}</Modal.Title>
- </Modal.Header>
- <Modal.Body>
- <FeatureGroupEditor
- version={version}
- licenseModelId={licenseModelId}
- isReadOnlyMode={isReadOnlyMode}
- />
- </Modal.Body>
- </Modal>
- )}
</div>
);
}
@@ -114,7 +75,9 @@ class FeatureGroupListEditorView extends React.Component {
<ListEditorItemView
key={listItem.id}
onDelete={() => this.deleteFeatureGroupItem(listItem, version)}
- onSelect={() => this.editFeatureGroupItem(listItem, version)}
+ onSelect={() =>
+ this.editFeatureGroupItem(listItem, version, isReadOnlyMode)
+ }
className="list-editor-item-view"
isReadOnlyMode={isReadOnlyMode}>
<div className="list-editor-item-view-field">
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.js
index 22e21a613a..c6479a7481 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.js
@@ -1,17 +1,17 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
import Configuration from 'sdc-app/config/Configuration.js';
@@ -19,6 +19,12 @@ import { actionTypes as featureGroupsActionConstants } from './FeatureGroupsCons
import EntitlementPoolsActionHelper from 'sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js';
import LicenseKeyGroupsActionHelper from 'sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsActionHelper.js';
import ItemsHelper from 'sdc-app/common/helpers/ItemsHelper.js';
+import {
+ actionTypes as modalActionTypes,
+ modalSizes
+} from 'nfvo-components/modal/GlobalModalConstants.js';
+import { modalContentMapper } from 'sdc-app/common/modal/ModalContentMapper.js';
+import i18n from 'nfvo-utils/i18n/i18n.js';
function baseUrl(licenseModelId, version) {
const restPrefix = Configuration.get('restPrefix');
@@ -189,7 +195,7 @@ export default {
openFeatureGroupsEditor(
dispatch,
- { featureGroup, licenseModelId, version }
+ { featureGroup, licenseModelId, version, isReadOnlyMode }
) {
return Promise.all([
EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {
@@ -205,6 +211,26 @@ export default {
type: featureGroupsActionConstants.featureGroupsEditor.OPEN,
featureGroup
});
+ dispatch({
+ type: featureGroupsActionConstants.featureGroupsEditor.OPEN,
+ featureGroup
+ });
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_SHOW,
+ data: {
+ modalComponentName: modalContentMapper.FG_EDITOR,
+ modalComponentProps: {
+ version,
+ licenseModelId,
+ isReadOnlyMode,
+ size: modalSizes.LARGE
+ },
+ title:
+ licenseModelId && version && featureGroup
+ ? i18n('Edit Feature Group')
+ : i18n('Create New Feature Group')
+ }
+ });
});
},
@@ -212,5 +238,8 @@ export default {
dispatch({
type: featureGroupsActionConstants.featureGroupsEditor.CLOSE
});
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_CLOSE
+ });
}
};