Skip to content

Commit

Permalink
feat(admin-ui): show uma in coba tab
Browse files Browse the repository at this point in the history
  • Loading branch information
harryandriyan committed Aug 11, 2022
1 parent c0d3676 commit dd23342
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions admin-ui/app/styles/custom/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,8 @@
.badge-dimmed {
background-color: #777;
color: #FFFFFF;
}

.common-link {
color: #2767b3
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { useState } from 'react'
import Box from '@material-ui/core/Box'
import { Link } from 'react-router-dom'
import { Col, Container, FormGroup } from 'Components'
import GluuLabel from 'Routes/Apps/Gluu/GluuLabel'
import GluuSelectRow from 'Routes/Apps/Gluu/GluuSelectRow'
Expand All @@ -10,7 +12,7 @@ import { FormControlLabel, Radio, RadioGroup } from '@material-ui/core'
import GluuTypeAheadForDn from 'Routes/Apps/Gluu/GluuTypeAheadForDn'
const DOC_CATEGORY = 'openid_client'

function ClientCibaParUmaPanel({ client, scripts, formik }) {
function ClientCibaParUmaPanel({ client, umaResources, scripts, formik }) {
const { t } = useTranslation()
const claim_uri_id = 'claim_uri_id'

Expand Down Expand Up @@ -142,6 +144,24 @@ function ClientCibaParUmaPanel({ client, scripts, formik }) {
doc_entry="rptClaimsScripts"
lsize={3}
></GluuTypeAheadForDn>
<FormGroup row>
<GluuLabel label={'Resources'} size={3} />
<Col sm={9}>
{umaResources.length > 0 && umaResources?.map(uma => {
return (
<Box key={uma.id}>
<Box display="flex">
<Box>
<Link to={`/auth-server/client/uma/${uma.id}`} className="common-link">
{uma.id}
</Link>
</Box>
</Box>
</Box>
)
})}
</Col>
</FormGroup>
</Container>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function ClientEditPage({
if (scripts.length < 1) {
dispatch(getScripts(options))
}
console.log('umaResources', umaResources)
if (isEmpty(umaResources)) {
dispatch(getUMAResourcesByClient(clientData?.inum))
}
Expand Down Expand Up @@ -76,6 +77,7 @@ function ClientEditPage({
permissions={permissions}
oidcConfiguration={oidcConfiguration}
customOnSubmit={handleSubmit}
umaResources={umaResources}
/>
</GluuLoader>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function ClientWizardForm({
permissions,
customOnSubmit,
oidcConfiguration,
umaResources,
}) {
const { t } = useTranslation()
const theme = useContext(ThemeContext)
Expand Down Expand Up @@ -423,6 +424,7 @@ function ClientWizardForm({
>
<ClientCibaParUmaPanel
client={client}
umaResources={umaResources}
scripts={scripts}
formik={formik}
/>
Expand Down
1 change: 1 addition & 0 deletions admin-ui/plugins/auth-server/redux/reducers/OIDCReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export default function oidcReducer(state = INIT_STATE, action) {

case GET_UMA_RESOURCES_RESPONSE:
if (action.payload.data) {
console.log('action', action)
return {
...state,
umaResources: action.payload.data,
Expand Down

0 comments on commit dd23342

Please sign in to comment.