diff --git a/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.js b/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.js index fffe7ed59b7c..c67a07d41193 100644 --- a/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.js +++ b/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { PageHeader } from 'react-bootstrap'; -import { YBButton, YBFormInput, YBSegmentedButtonGroup } from '../fields'; +import { YBButton, YBCheckBox, YBFormInput, YBSegmentedButtonGroup } from '../fields'; import YBLogo from '../../YBLogo/YBLogo'; import { browserHistory } from 'react-router'; import { getPromiseState } from '../../../../utils/PromiseUtils'; @@ -45,7 +45,9 @@ class RegisterForm extends Component { confirmPassword: Yup.string() .oneOf([Yup.ref('password'), null], "Passwords don't match") - .required('Password confirm is required') + .required('Password confirm is required'), + + confirmEULA: Yup.bool().oneOf([true], 'Please accept the agreement to continue.') }); const initialValues = { @@ -53,7 +55,8 @@ class RegisterForm extends Component { name: '', email: '', password: '', - confirmPassword: '' + confirmPassword: '', + confirmEULA: false }; return ( @@ -71,7 +74,7 @@ class RegisterForm extends Component { setSubmitting(false); }} > - {({ handleSubmit, isSubmitting }) => ( + {({ handleSubmit, isSubmitting, isValid }) => (
+ />
-
+
+
+ +
I agree to Yugabyte, Inc's End User License Agreement.
+
diff --git a/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.scss b/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.scss index b81a176677c0..2c9e260ff0fb 100644 --- a/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.scss +++ b/managed/ui/src/components/common/forms/RegisterForm/RegisterForm.scss @@ -5,3 +5,44 @@ margin-top: 0px; } } + +.dark-background .confirm-eula { + > label { + margin-right: 6px; + } + + .yb-input-checkbox { + .yb-input-checkbox__inner { + background-color: transparent; + } + + &:hover .yb-input-checkbox__inner { + border: 1px solid #ef5824; + } + + input:checked + .yb-input-checkbox__inner { + border-color: #ef5824; + } + } +} + +.form-register { + &__footer { + margin-top: 20px; + display: flex; + align-items: center; + margin-left: 132px; + + .btn { + margin: 0 0 0 auto; + } + + .confirm-eula { + flex: 0 1 60%; + display: inherit; + + } + } +} + + diff --git a/managed/ui/src/components/common/forms/fields/YBButton.js b/managed/ui/src/components/common/forms/fields/YBButton.js index 842a9ae4918d..8ea2e0937f39 100644 --- a/managed/ui/src/components/common/forms/fields/YBButton.js +++ b/managed/ui/src/components/common/forms/fields/YBButton.js @@ -26,7 +26,7 @@ export default class YBButton extends PureComponent { onClick={this.props.onClick} bsSize={btnSize} bsStyle={btnStyle} - disabled={disabled} + disabled={!!disabled} {...otherProps} > {loading ? ( diff --git a/managed/ui/src/components/common/forms/fields/YBCheckBox.js b/managed/ui/src/components/common/forms/fields/YBCheckBox.js index e109f48e2304..ebb5cf809524 100644 --- a/managed/ui/src/components/common/forms/fields/YBCheckBox.js +++ b/managed/ui/src/components/common/forms/fields/YBCheckBox.js @@ -7,11 +7,14 @@ import { isValidObject } from '../../../../utils/ObjectUtils'; export default class YBCheckBox extends Component { render() { - const { input, label, checkState, onClick, disabled } = this.props; + const { input, field, label, checkState, onClick, disabled } = this.props; const onCheckClick = (event) => { if (input && input.onChange) { input.onChange(event); } + if (field && field.onChange) { + field.onChange(event); + } if (isValidObject(onClick)) { onClick(event); } @@ -23,7 +26,7 @@ export default class YBCheckBox extends Component { className="yb-input-checkbox__input" {...input} type="checkbox" - name={this.props.name} + name={field && field.name} defaultChecked={checkState} id={this.props.id} onClick={onCheckClick} diff --git a/managed/ui/src/components/common/forms/fields/YBFormCheckbox.js b/managed/ui/src/components/common/forms/fields/YBFormCheckbox.js deleted file mode 100644 index 870b8d9064a5..000000000000 --- a/managed/ui/src/components/common/forms/fields/YBFormCheckbox.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) YugaByte, Inc. - -import React, { Component } from 'react'; - -export default class YBFormCheckbox extends Component { - render() { - const { - field: { name, value, onChange, onBlur }, - form: { errors, touched, setFieldValue }, - id, - label, - disabled, - segmented, - isReadOnly, - className, - ...props - } = this.props; - let labelClass = this.props.labelClass || 'checkbox-label'; - if (segmented) labelClass += ' btn' + (id === value ? ' btn-orange' : ' btn-default'); - if (disabled) { - labelClass += ' disabled'; - } - if (isReadOnly) { - labelClass += ' readonly'; - } - const key = name + '_' + id; - return ( - - ); - } -}