Skip to content

Commit

Permalink
fix(admin-ui): associated client
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Aug 8, 2022
1 parent dc5bc75 commit e04e99c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion admin-ui/app/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"saml2_uri": "Saml2 URI",
"scope_type": "Scope type",
"umaAuthorizationPolicies": "Authorization Policies",
"umaResourcesScript": "Associated Clients",
"associatedClients": "Associated Clients",
"iconUrl": "Icon URL",
"scopes:": "Scopes",
"scripts": "Scripts",
Expand Down
26 changes: 12 additions & 14 deletions admin-ui/plugins/auth-server/components/Scopes/ScopeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { LIMIT, PATTERN } from 'Plugins/auth-server/common/Constants'
function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
const { t } = useTranslation()
let dynamicScopeScripts = []
let umaResourcesScript = []
let associatedClients = []
let umaAuthorizationPolicies = []

const theme = useContext(ThemeContext)
Expand All @@ -45,7 +45,6 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
const dispatch = useDispatch()
const client = scope.clients || []

const umaResources = useSelector((state) => state.scopeReducer.umaResources)
// const scripts = useSelector((state) => state.customScriptReducer.items)
let claims = []
scripts = scripts || []
Expand All @@ -59,7 +58,7 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
.filter((item) => item.scriptType == 'UMA_RPT_POLICY')
.map((item) => ({ dn: item.dn, name: item.name }))

umaResourcesScript = []
associatedClients = client.map((item) => ({ dn: item.dn, name: item.inum }))

claims = attributes.map((item) => ({ dn: item.dn, name: item.displayName }))

Expand Down Expand Up @@ -141,10 +140,6 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
return history.push(`/auth-server/client/edit:` + client_id.substring(0, 4))
}

useEffect(() => {
console.log('THE SCOPE', scope)
}, [scope])

return (
<Container>
<Formik
Expand Down Expand Up @@ -373,20 +368,20 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
</Accordion>
<Accordion className="mb-2 b-primary" initialOpen>
<Accordion.Header className="text-primary">
{t('fields.umaResourcesScript').toUpperCase()}
{t('fields.associatedClients').toUpperCase()}
</Accordion.Header>
<Accordion.Body>
<FormGroup row> </FormGroup>
<GluuTypeAheadForDn
name="umaResourcesScript"
label="fields.umaResourcesScript"
name="associatedClients"
label="fields.associatedClients"
formik={formik}
value={getMapping(
scope.umaResourcesScript,
umaResourcesScript,
scope.associatedClients,
associatedClients,
)}
disabled={scope.inum ? true : false}
options={umaResourcesScript}
options={associatedClients}
doc_category={SCOPE}
/>
</Accordion.Body>
Expand Down Expand Up @@ -455,7 +450,10 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
</Accordion>
)}
<FormGroup row></FormGroup>
{!showSpontaneousPanel && <GluuCommitFooter saveHandler={toggle} />}
{!showSpontaneousPanel && !showUmaPanel && (
<GluuCommitFooter saveHandler={toggle} />
)}

<GluuCommitDialog
handler={toggle}
modal={modal}
Expand Down

0 comments on commit e04e99c

Please sign in to comment.