Skip to content

Commit

Permalink
feat(admin-ui): fix [object object] on client basic and software panel
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Sep 15, 2022
1 parent 00bb257 commit ee37405
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions admin-ui/app/utils/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ export function getNewColor() {
}
return color
}

export function isEmptyObject(obj){
return JSON.stringify(obj) === '{}';
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ClientBasicPanel = ({
function handleMouseDownClientSecret(event) {
event.preventDefault()
}

console.log("============Client=========== "+ JSON.stringify(client))
return (
<Container>
{client.inum && (
Expand All @@ -93,7 +93,7 @@ const ClientBasicPanel = ({
label="fields.client_name"
name="clientName"
formik={formik}
value={client.clientName || client.displayName}
value={client.displayName}
doc_category={DOC_CATEGORY}
disabled={viewOnly}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { Col, Container, FormGroup } from 'Components'
import GluuInputRow from 'Routes/Apps/Gluu/GluuInputRow'
import GluuTypeAheadWithAdd from 'Routes/Apps/Gluu/GluuTypeAheadWithAdd'
import { useTranslation } from 'react-i18next'
import { isEmptyObject } from 'Utils/Util'
const DOC_CATEGORY = 'openid_client'

const EMPTY = ''
function ClientSoftwarePanel({ client, scripts, formik, viewOnly }) {
const { t } = useTranslation()

Expand All @@ -31,31 +33,31 @@ function ClientSoftwarePanel({ client, scripts, formik, viewOnly }) {
label="fields.clientUri"
name="clientUri"
formik={formik}
value={client.clientUri}
value={isEmptyObject(client.clientUri) ? EMPTY : client.clientUri}
doc_category={DOC_CATEGORY}
disabled={viewOnly}
/>
<GluuInputRow
label="fields.policy_uri"
name="policyUri"
formik={formik}
value={client.policyUri}
value={isEmptyObject(client.policyUri) ? EMPTY : client.policyUri}
doc_category={DOC_CATEGORY}
disabled={viewOnly}
/>
<GluuInputRow
label="fields.logo_uri"
name="logoUri"
formik={formik}
value={client.logoUri}
value={isEmptyObject(client.logoUri) ? EMPTY : client.logoUri}
doc_category={DOC_CATEGORY}
disabled={viewOnly}
/>
<GluuInputRow
label="fields.tosUri"
name="tosUri"
formik={formik}
value={client.tosUri}
value={isEmptyObject(client.tosUri) ? EMPTY : client.tosUri}
doc_category={DOC_CATEGORY}
disabled={viewOnly}
/>
Expand Down

0 comments on commit ee37405

Please sign in to comment.