summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/LicenseModelDescriptionEdit.jsx11
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/ListButtons.jsx5
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountItem.jsx3
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountList.js34
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/VendorDataView.js12
5 files changed, 40 insertions, 25 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/LicenseModelDescriptionEdit.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/LicenseModelDescriptionEdit.jsx
index f4d6d4d42c..af759f1206 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/LicenseModelDescriptionEdit.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/LicenseModelDescriptionEdit.jsx
@@ -14,22 +14,23 @@
* permissions and limitations under the License.
*/
import React from 'react';
-import Input from 'nfvo-components/input/validation/Input.jsx';
import i18n from 'nfvo-utils/i18n/i18n.js';
+import Input from 'nfvo-components/input/validation/Input.jsx';
class LicenseModelDescriptionEdit extends React.Component {
render() {
//TODO check if buttons
let {onDataChanged, description, genericFieldInfo} = this.props;
- let saveButtonClassName = (genericFieldInfo.description.isValid) ? 'description-save' : 'description-save disabled';
+ let {isValid, errorText} = genericFieldInfo.description;
+ let saveButtonClassName = isValid ? 'description-save' : 'description-save disabled';
return(
<div className='vendor-description-edit'>
<Input
onChange={description => onDataChanged({description})}
value={description}
- isValid={genericFieldInfo.description.isValid}
- errorText={genericFieldInfo.description.errorText}
+ isValid={isValid}
+ errorText={errorText}
className='description-edit-textarea'
type='textarea'/>
<div className='buttons-row'>
@@ -50,7 +51,7 @@ class LicenseModelDescriptionEdit extends React.Component {
let {onSubmit, data, description} = this.props;
onSubmit({
...data,
- description: description
+ description: description.trim()
});
}
}
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/ListButtons.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/ListButtons.jsx
index f02c82d205..3fcac3c1d8 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/ListButtons.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/ListButtons.jsx
@@ -14,6 +14,7 @@
* permissions and limitations under the License.
*/
import React from 'react';
+import PropTypes from 'prop-types';
import {selectedButton} from '../LicenseModelOverviewConstants.js';
import Tabs from 'sdc-ui/lib/react/Tabs.js';
import Tab from 'sdc-ui/lib/react/Tab.js';
@@ -43,8 +44,8 @@ function ListButtons ({onTabSelect, selectedTab, hasOrphans, hasLicensing}) {
}
ListButtons.propTypes = {
- onTabSelect: React.PropTypes.func,
- selectedInUse: React.PropTypes.bool
+ onTabSelect: PropTypes.func,
+ selectedInUse: PropTypes.bool
};
export default ListButtons;
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountItem.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountItem.jsx
index 6ec84e16ca..50c547e042 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountItem.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountItem.jsx
@@ -24,7 +24,8 @@ function SummaryCountItem ({name, counter, onAdd, onNavigate, isReadOnlyMode})
<span className='item-name' onClick={onNavigate}>{name}</span>
<span className='item-count' onClick={onNavigate} data-test-id={'vlm-summary-vendor-counter-' + name.toLowerCase().replace(/\s/g,'-')}>({counter})</span>
</div>
- <SVGIcon name='plusCircle' disabled={isReadOnlyMode} color='secondary' onClick={onAdd} data-test-id={'vlm-summary-vendor-add-btn-' + name.toLowerCase().replace(/\s/g,'-')}/>
+ <SVGIcon name='plusCircle' disabled={isReadOnlyMode} className={isReadOnlyMode ? 'disabled' : ''}
+ color='secondary' onClick={onAdd} data-test-id={'vlm-summary-vendor-add-btn-' + name.toLowerCase().replace(/\s/g,'-')}/>
</div>
);
}
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountList.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountList.js
index c69a092d23..15b6649543 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountList.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/SummaryCountList.js
@@ -16,9 +16,9 @@
import React from 'react';
import {connect} from 'react-redux';
-import VersionControllerUtils from 'nfvo-components/panel/versionController/VersionControllerUtils.js';
+import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js';
+import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
-import OnboardingActionHelper from '../../../OnboardingActionHelper.js';
import EntitlementPoolsActionHelper from '../../entitlementPools/EntitlementPoolsActionHelper.js';
import LicenseAgreementActionHelper from '../../licenseAgreement/LicenseAgreementActionHelper.js';
import LicenseKeyGroupsActionHelper from '../../licenseKeyGroups/LicenseKeyGroupsActionHelper.js';
@@ -27,27 +27,32 @@ import FeatureGroupsActionHelper from '../../featureGroups/FeatureGroupsActionHe
import {overviewItems} from '../LicenseModelOverviewConstants.js';
import SummaryCountItem from './SummaryCountItem.jsx';
-export const mapStateToProps = ({licenseModel: {licenseModelEditor, licenseAgreement: {licenseAgreementList},
- featureGroup: {featureGroupsList}, entitlementPool: {entitlementPoolsList}, licenseKeyGroup: {licenseKeyGroupsList}}}) => {
+export const mapStateToProps = ({
+ licenseModel: {
+ licenseModelEditor,
+ licenseAgreement: {licenseAgreementList},
+ featureGroup: {featureGroupsList},
+ entitlementPool: {entitlementPoolsList},
+ licenseKeyGroup: {licenseKeyGroupsList}
+ }
+}) => {
let {vendorName, description, id, version} = licenseModelEditor.data;
-
- let isReadOnlyMode = VersionControllerUtils.isReadOnly(licenseModelEditor.data);
-
let counts = [
{name: overviewItems.LICENSE_AGREEMENTS, count: licenseAgreementList.length},
{name: overviewItems.FEATURE_GROUPS, count: featureGroupsList.length},
{name: overviewItems.ENTITLEMENT_POOLS, count: entitlementPoolsList.length},
{name: overviewItems.LICENSE_KEY_GROUPS, count: licenseKeyGroupsList.length},
];
+
return {
vendorName,
licenseModelId: id,
description,
counts,
- isReadOnlyMode,
version
};
+
};
const mapActionsToProps = (dispatch) => {
@@ -71,22 +76,27 @@ const mapActionsToProps = (dispatch) => {
}
},
onNavigateClick: ({name, licenseModelId, version}) => {
+ let screenToNavigate;
switch (name) {
case overviewItems.ENTITLEMENT_POOLS:
- OnboardingActionHelper.navigateToEntitlementPools(dispatch, {licenseModelId, version});
+ screenToNavigate = enums.SCREEN.ENTITLEMENT_POOLS;
break;
case overviewItems.FEATURE_GROUPS:
- OnboardingActionHelper.navigateToFeatureGroups(dispatch, {licenseModelId, version});
+ screenToNavigate = enums.SCREEN.FEATURE_GROUPS;
break;
case overviewItems.LICENSE_AGREEMENTS:
- OnboardingActionHelper.navigateToLicenseAgreements(dispatch, {licenseModelId, version});
+ screenToNavigate = enums.SCREEN.LICENSE_AGREEMENTS;
break;
case overviewItems.LICENSE_KEY_GROUPS:
- OnboardingActionHelper.navigateToLicenseKeyGroups(dispatch, {licenseModelId, version});
+ screenToNavigate = enums.SCREEN.LICENSE_KEY_GROUPS;
break;
default:
break;
}
+ ScreensHelper.loadScreen(dispatch, {
+ screen: screenToNavigate, screenType: screenTypes.LICENSE_MODEL,
+ props: {licenseModelId, version}
+ });
}
};
};
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/VendorDataView.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/VendorDataView.js
index 532ca32f8e..616355de41 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/VendorDataView.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/summary/VendorDataView.js
@@ -23,17 +23,19 @@ import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js';
import licenseModelOverviewActionHelper from '../licenseModelOverviewActionHelper.js';
import LicenseModelActionHelper from '../../LicenseModelActionHelper.js';
import LicenseModelDescriptionEdit from './LicenseModelDescriptionEdit.jsx';
-import VersionControllerUtils from 'nfvo-components/panel/versionController/VersionControllerUtils.js';
import {VLM_DESCRIPTION_FORM} from '../LicenseModelOverviewConstants.js';
-export const mapStateToProps = ({licenseModel: {licenseModelEditor: {data}, licenseModelOverview: {descriptionEditor: {data: descriptionData = {}, genericFieldInfo} }}}) => {
+export const mapStateToProps = ({
+ licenseModel: {
+ licenseModelEditor: {data},
+ licenseModelOverview: {descriptionEditor: {data: descriptionData = {}, genericFieldInfo}}
+ }
+}) => {
let {description} = descriptionData;
- let isReadOnlyMode = VersionControllerUtils.isReadOnly(data);
return {
data,
description,
- genericFieldInfo,
- isReadOnlyMode
+ genericFieldInfo
};
};