diff options
author | Einav Weiss Keidar <einavw@amdocs.com> | 2018-08-13 16:19:46 +0300 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2019-02-11 13:50:22 +0000 |
commit | 1801b24389baa8e3f7298ff2c41e2512b19c1290 (patch) | |
tree | d3d2a15f53aa28698280d609548298d177f9280d /openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorView.jsx | |
parent | af8e36eb7f43803bd9cf40e9b46a0c0c8f47c781 (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/licenseKeyGroups/LicenseKeyGroupsEditorView.jsx')
-rw-r--r-- | openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorView.jsx | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorView.jsx index 8f21722ca6..219f2dcd1e 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorView.jsx @@ -39,6 +39,21 @@ import { import LicenseKeyGroupFormContent from './components/FormContent.jsx'; import ModalButtons from 'sdc-app/onboarding/licenseModel/components/ModalButtons.jsx'; +const TabButton = props => { + const { onClick, disabled, className } = props; + const dataTestId = props['data-test-id']; + return ( + <div + className={className} + onClick={disabled ? undefined : onClick} + data-test-id={dataTestId} + role="tab" + disabled={disabled}> + {props.children} + </div> + ); +}; + const LicenseKeyGroupPropType = PropTypes.shape({ id: PropTypes.string, name: PropTypes.string, @@ -94,7 +109,7 @@ class LicenseKeyGroupsEditorView extends React.Component { let { selectedTab } = this.state; const isTabsDisabled = !data.id || !this.props.isFormValid; return ( - <div className="license-keygroup-editor"> + <div className="license-keygroup-editor license-model-modal license-key-groups-modal"> <Tabs type="menu" activeTab={selectedTab} @@ -187,23 +202,29 @@ class LicenseKeyGroupsEditorView extends React.Component { )} </Tab> {selectedTab !== tabIds.GENERAL ? ( - <Button - className="add-limit-button" + <TabButton tabId={tabIds.ADD_LIMIT_BUTTON} - btnType="link" - iconName="plus" disabled={ - this.state.selectedLimit || isReadOnlyMode - }> - {i18n('Add Limit')} - </Button> + !!this.state.selectedLimit || isReadOnlyMode + } + data-test-id="add-limits-tab" + className="add-limit-button"> + <Button + btnType="link" + iconName="plus" + disabled={ + !!this.state.selectedLimit || isReadOnlyMode + }> + {i18n('Add Limit')} + </Button> + </TabButton> ) : ( - <div key="empty_lm_tab_key" /> + <TabButton key="empty_lm_tab_key" /> ) // Render empty div to not break tabs } </Tabs> <ModalButtons - className="license-key-group-editor-buttons" + className="sdc-modal__footer" selectedLimit={this.state.selectedLimit} isFormValid={this.props.isFormValid} isReadOnlyMode={isReadOnlyMode} |