From 7fdf733a64670fceefc3ded35cfa581e1c458179 Mon Sep 17 00:00:00 2001 From: Einav Weiss Keidar Date: Tue, 20 Mar 2018 14:45:40 +0200 Subject: Adding Prettier and fixing up eslint version Issue-ID: SDC-1094 Change-Id: Ie83ad95a03899345dd90235daf0323cbe3bc6afd Signed-off-by: Einav Weiss Keidar --- .../licenseAgreement/LicenseAgreementListEditor.js | 82 ++++++++++++++-------- 1 file changed, 52 insertions(+), 30 deletions(-) (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditor.js') 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 72474ecdd3..cba39731b5 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditor.js +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListEditor.js @@ -13,42 +13,64 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ -import {connect} from 'react-redux'; +import { connect } from 'react-redux'; import i18n from 'nfvo-utils/i18n/i18n.js'; import LicenseAgreementActionHelper from './LicenseAgreementActionHelper.js'; import LicenseAgreementListEditorView from './LicenseAgreementListEditorView.jsx'; -import {actionTypes as globalMoadlActions} from 'nfvo-components/modal/GlobalModalConstants.js'; +import { actionTypes as globalMoadlActions } from 'nfvo-components/modal/GlobalModalConstants.js'; -const mapStateToProps = ({licenseModel: {licenseAgreement, licenseModelEditor}}) => { - - let {licenseAgreementList} = licenseAgreement; - let {data} = licenseAgreement.licenseAgreementEditor; - let {vendorName, version} = licenseModelEditor.data; - - return { - vendorName, - version, - licenseAgreementList, - isDisplayModal: Boolean(data), - isModalInEditMode: Boolean(data && data.id) - }; +const mapStateToProps = ({ + licenseModel: { licenseAgreement, licenseModelEditor } +}) => { + let { licenseAgreementList } = licenseAgreement; + let { data } = licenseAgreement.licenseAgreementEditor; + let { vendorName, version } = licenseModelEditor.data; + return { + vendorName, + version, + licenseAgreementList, + isDisplayModal: Boolean(data), + isModalInEditMode: Boolean(data && data.id) + }; }; -const mapActionsToProps = (dispatch, {licenseModelId}) => { - return { - onAddLicenseAgreementClick: (version) => LicenseAgreementActionHelper.openLicenseAgreementEditor(dispatch, {licenseModelId, version}), - onEditLicenseAgreementClick: (licenseAgreement, version) => LicenseAgreementActionHelper.openLicenseAgreementEditor(dispatch, {licenseModelId, licenseAgreement, version}), - onDeleteLicenseAgreement: (licenseAgreement, version) => dispatch({ - type: globalMoadlActions.GLOBAL_MODAL_WARNING, - data:{ - msg: i18n('Are you sure you want to delete "{name}"?', {name: licenseAgreement.name}), - confirmationButtonText: i18n('Delete'), - title: i18n('Delete'), - onConfirmed: ()=>LicenseAgreementActionHelper.deleteLicenseAgreement(dispatch, {licenseModelId, licenseAgreementId: licenseAgreement.id, version}) - } - }) - }; +const mapActionsToProps = (dispatch, { licenseModelId }) => { + return { + onAddLicenseAgreementClick: version => + LicenseAgreementActionHelper.openLicenseAgreementEditor(dispatch, { + licenseModelId, + version + }), + onEditLicenseAgreementClick: (licenseAgreement, version) => + LicenseAgreementActionHelper.openLicenseAgreementEditor(dispatch, { + licenseModelId, + licenseAgreement, + version + }), + onDeleteLicenseAgreement: (licenseAgreement, version) => + dispatch({ + type: globalMoadlActions.GLOBAL_MODAL_WARNING, + data: { + msg: i18n('Are you sure you want to delete "{name}"?', { + name: licenseAgreement.name + }), + confirmationButtonText: i18n('Delete'), + title: i18n('Delete'), + onConfirmed: () => + LicenseAgreementActionHelper.deleteLicenseAgreement( + dispatch, + { + licenseModelId, + licenseAgreementId: licenseAgreement.id, + version + } + ) + } + }) + }; }; -export default connect(mapStateToProps, mapActionsToProps)(LicenseAgreementListEditorView); +export default connect(mapStateToProps, mapActionsToProps)( + LicenseAgreementListEditorView +); -- cgit 1.2.3-korg