react 16 upgrade
Issue-ID: SDC-1762
Change-Id: I7701f12fc63bb09f8c985c7c893b984701dcbfab
Signed-off-by: Einav Keidar <einavw@amdocs.com>
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
index feceba5..036aaaa 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
@@ -1,23 +1,29 @@
-/*!
- * 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';
import { actionTypes as licenseAgreementActionTypes } from './LicenseAgreementConstants.js';
import FeatureGroupsActionHelper from 'sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.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');
@@ -103,7 +109,7 @@
openLicenseAgreementEditor(
dispatch,
- { licenseModelId, licenseAgreement, version }
+ { licenseModelId, licenseAgreement, version, isReadOnlyMode }
) {
FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {
licenseModelId,
@@ -113,12 +119,31 @@
type: licenseAgreementActionTypes.licenseAgreementEditor.OPEN,
licenseAgreement
});
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_SHOW,
+ data: {
+ modalComponentName: modalContentMapper.LA_EDITOR,
+ modalComponentProps: {
+ version,
+ licenseModelId,
+ isReadOnlyMode,
+ size: modalSizes.LARGE
+ },
+ title:
+ licenseModelId && version && licenseAgreement
+ ? i18n('Edit License Agreement')
+ : i18n('Create New License Agreement')
+ }
+ });
},
closeLicenseAgreementEditor(dispatch) {
dispatch({
type: licenseAgreementActionTypes.licenseAgreementEditor.CLOSE
});
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_CLOSE
+ });
},
async saveLicenseAgreement(
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorView.jsx
index b2ebc1e..b54c080 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorView.jsx
@@ -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 React from 'react';
import PropTypes from 'prop-types';
@@ -77,7 +77,12 @@
isMultiSelect={false}
onEnumChange={licenseTerm =>
onDataChanged(
- { licenseTerm: { choice: licenseTerm, other: '' } },
+ {
+ licenseTerm: {
+ choice: licenseTerm,
+ other: ''
+ }
+ },
LA_EDITOR_FORM
)
}
@@ -163,7 +168,7 @@
genericFieldInfo
} = this.props;
return (
- <div>
+ <div className="license-model-modal license-agreement-modal">
{genericFieldInfo && (
<Form
ref="validationForm"
@@ -177,7 +182,8 @@
onValidateForm={() =>
this.props.onValidateForm(LA_EDITOR_FORM)
}
- className="license-model-form license-agreement-form">
+ className="license-model-form license-agreement-form"
+ btnClassName="sdc-modal__footer">
<Tabs
activeTab={onTabSelect ? selectedTab : undefined}
onTabClick={onTabSelect}
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditor.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditor.js
index fcb83b4..6151ad7 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditor.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditor.js
@@ -25,7 +25,6 @@
licenseModel: { licenseAgreement, licenseModelEditor }
}) => {
let { licenseAgreementList } = licenseAgreement;
- let { data } = licenseAgreement.licenseAgreementEditor;
let { vendorName, version } = licenseModelEditor.data;
return {
@@ -34,9 +33,7 @@
licenseAgreementList: sortByStringProperty(
licenseAgreementList,
SORTING_PROPERTY_NAME
- ),
- isDisplayModal: Boolean(data),
- isModalInEditMode: Boolean(data && data.id)
+ )
};
};
@@ -45,13 +42,19 @@
onAddLicenseAgreementClick: version =>
LicenseAgreementActionHelper.openLicenseAgreementEditor(dispatch, {
licenseModelId,
- version
+ version,
+ isReadOnlyMode: false
}),
- onEditLicenseAgreementClick: (licenseAgreement, version) =>
+ onEditLicenseAgreementClick: (
+ licenseAgreement,
+ version,
+ isReadOnlyMode
+ ) =>
LicenseAgreementActionHelper.openLicenseAgreementEditor(dispatch, {
licenseModelId,
licenseAgreement,
- version
+ version,
+ isReadOnlyMode
}),
onDeleteLicenseAgreement: (licenseAgreement, version) =>
dispatch({
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditorView.jsx
index acec1e0..b6ef7cf 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditorView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditorView.jsx
@@ -1,26 +1,24 @@
-/*!
- * 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 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 LicenseAgreementEditor from './LicenseAgreementEditor.js';
import { extractValue } from './LicenseAgreementConstants';
class LicenseAgreementListEditorView extends React.Component {
@@ -45,13 +43,7 @@
};
render() {
- const {
- licenseModelId,
- isReadOnlyMode,
- isDisplayModal,
- isModalInEditMode,
- version
- } = this.props;
+ const { isReadOnlyMode, version } = this.props;
const { onAddLicenseAgreementClick } = this.props;
const { localFilter } = this.state;
@@ -72,28 +64,6 @@
)
)}
</ListEditorView>
- <Modal
- show={isDisplayModal}
- bsSize="large"
- animation={true}
- className="onborading-modal license-model-modal license-agreement-modal">
- <Modal.Header>
- <Modal.Title>{`${
- isModalInEditMode
- ? i18n('Edit License Agreement')
- : i18n('Create New License Agreement')
- }`}</Modal.Title>
- </Modal.Header>
- <Modal.Body>
- {isDisplayModal && (
- <LicenseAgreementEditor
- version={version}
- licenseModelId={licenseModelId}
- isReadOnlyMode={isReadOnlyMode}
- />
- )}
- </Modal.Body>
- </Modal>
</div>
);
}
@@ -133,7 +103,11 @@
<ListEditorItemView
key={id}
onSelect={() =>
- onEditLicenseAgreementClick(licenseAgreement, version)
+ onEditLicenseAgreementClick(
+ licenseAgreement,
+ version,
+ isReadOnlyMode
+ )
}
onDelete={() =>
onDeleteLicenseAgreement(licenseAgreement, version)