Skip to content

Commit

Permalink
feat(admin-ui): convert boolean dropdowns to switch completed #389
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Aug 29, 2022
1 parent 0dc18d8 commit 8d85657
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
21 changes: 8 additions & 13 deletions admin-ui/app/routes/Apps/Gluu/GluuInlineInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useContext } from 'react'
import GluuLabel from './GluuLabel'
import GluuTooltip from './GluuTooltip'
import GluuToogle from './GluuToogle'
import { useTranslation } from 'react-i18next'
import { Typeahead } from 'react-bootstrap-typeahead'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
Expand Down Expand Up @@ -83,19 +84,13 @@ function GluuInlineInput({
/>
)}
{isBoolean && (
<InputGroup>
<CustomInput
type="select"
onChange={onValueChanged}
data-testid={name}
id={name}
name={name}
defaultValue={value}
>
<option value="false">{t('options.false')}</option>
<option value="true">{t('options.true')}</option>
</CustomInput>
</InputGroup>
<GluuToogle
id={name}
data-testid={name}
name={name}
onChange={onValueChanged}
value={value}
/>
)}
{isArray && (
<Typeahead
Expand Down
2 changes: 1 addition & 1 deletion admin-ui/app/routes/Apps/Gluu/GluuToogle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function GluuToogle({ name, formik, value, handler, disabled }) {
data-testid={name}
defaultChecked={value}
onClick={handler}
onChange={formik.handleChange}
onChange={formik !== undefined ? formik.handleChange : handler}
disabled={disabled}
/>
)
Expand Down

0 comments on commit 8d85657

Please sign in to comment.