Skip to content

Commit

Permalink
fix(admin-ui): problem in saving some fields #211
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Sep 15, 2021
1 parent 6d81d28 commit b545af8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 43 deletions.
52 changes: 24 additions & 28 deletions plugins/auth-server/components/Clients/ClientAdvancedPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GluuTypeAheadForDn from '../../../../app/routes/Apps/Gluu/GluuTypeAheadFo
import GluuSelectRow from '../../../../app/routes/Apps/Gluu/GluuSelectRow'
import GluuTypeAheadWithAdd from '../../../../app/routes/Apps/Gluu/GluuTypeAheadWithAdd'
import Toggle from 'react-toggle'
import GluuToogle from '../../../../app/routes/Apps/Gluu/GluuToogle'
import { useTranslation } from 'react-i18next'

function ClientAdvancedPanel({ client, scripts, formik }) {
Expand Down Expand Up @@ -60,54 +61,49 @@ function ClientAdvancedPanel({ client, scripts, formik }) {
<FormGroup row>
<GluuLabel label="fields.accessTokenAsJwt" size={3} />
<Col sm={1}>
<Input
<GluuToogle
id="accessTokenAsJwt"
name="accessTokenAsJwt"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={client.accessTokenAsJwt}
formik={formik}
value={client.accessTokenAsJwt}
/>
</Col>
<GluuLabel label="fields.requireAuthTime" size={3} />
<Col sm={1}>
<Input
<GluuLabel label="fields.requireAuthTime" size={2} />
<Col sm={2}>
<GluuToogle
id="requireAuthTime"
name="requireAuthTime"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={client.requireAuthTime}
formik={formik}
value={client.requireAuthTime}
/>
</Col>
<GluuLabel label="fields.rptAsJwt" size={3} />
<Col sm={1}>
<Input
<GluuLabel label="fields.rptAsJwt" size={2} />
<Col sm={2}>
<GluuToogle
id="rptAsJwt"
name="rptAsJwt"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={client.rptAsJwt}
formik={formik}
value={client.rptAsJwt}
/>
</Col>
</FormGroup>
<FormGroup row>
<GluuLabel label="fields.includeClaimsInIdToken" size={3} />
<Col sm={1}>
<Input
<GluuLabel label="fields.includeClaimsInIdToken" size={2} />
<Col sm={2}>
<GluuToogle
id="includeClaimsInIdToken"
name="includeClaimsInIdToken"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={client.includeClaimsInIdToken}
formik={formik}
value={client.includeClaimsInIdToken}
/>
</Col>
<GluuLabel label="fields.frontChannelLogoutSessionRequired" size={3} />
<Col sm={1}>
<Input
<GluuLabel label="fields.frontChannelLogoutSessionRequired" size={2} />
<Col sm={2}>
<GluuToogle
id="frontChannelLogoutSessionRequired"
name="frontChannelLogoutSessionRequired"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={client.frontChannelLogoutSessionRequired}
formik={formik}
value={client.frontChannelLogoutSessionRequired}
/>
</Col>
</FormGroup>
Expand Down
22 changes: 10 additions & 12 deletions plugins/auth-server/components/Clients/ClientBasicPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
InputGroup,
CustomInput,
} from '../../../../app/components'
import GluuToogle from '../../../../app/routes/Apps/Gluu/GluuToogle'
import GluuLabel from '../../../../app/routes/Apps/Gluu/GluuLabel'
import GluuTypeAhead from '../../../../app/routes/Apps/Gluu/GluuTypeAhead'
import GluuTypeAheadForDn from '../../../../app/routes/Apps/Gluu/GluuTypeAheadForDn'
Expand Down Expand Up @@ -263,32 +264,29 @@ const ClientBasicPanel = ({ client, scopes, formik }) => {
<FormGroup row>
<GluuLabel label="fields.persist_client_authorizations" size={3} />
<Col sm={1}>
<Input
<GluuToogle
id="persistClientAuthorizations"
name="persistClientAuthorizations"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={client.persistClientAuthorizations}
formik={formik}
value={client.persistClientAuthorizations}
/>
</Col>
<GluuLabel label="fields.is_active" size={3} />
<Col sm={1}>
<Input
<GluuToogle
id="disabled"
name="disabled"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={!client.disabled}
formik={formik}
value={!client.disabled}
/>
</Col>
<GluuLabel label="fields.is_trusted_client" size={3} />
<Col sm={1}>
<Input
<GluuToogle
id="trustedClient"
name="trustedClient"
onChange={formik.handleChange}
type="checkbox"
defaultChecked={client.trustedClient}
formik={formik}
value={client.trustedClient}
/>
</Col>
</FormGroup>
Expand Down
6 changes: 3 additions & 3 deletions plugins/auth-server/components/Clients/ClientEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ function ClientEditPage({
const history = useHistory()
function handleSubmit(data) {
if (data) {
buildPayload(userAction, data.action_message, data)
dispatch(editClient(userAction))
history.push('/auth-server/clients')
buildPayload(userAction, data.action_message, data)
dispatch(editClient(userAction))
history.push('/auth-server/clients')
}
}
return (
Expand Down

0 comments on commit b545af8

Please sign in to comment.