diff --git a/admin-ui/plugins/auth-server/components/Clients/ClientCibaParUmaPanel.js b/admin-ui/plugins/auth-server/components/Clients/ClientCibaParUmaPanel.js index 1d53326c8..54301cefb 100644 --- a/admin-ui/plugins/auth-server/components/Clients/ClientCibaParUmaPanel.js +++ b/admin-ui/plugins/auth-server/components/Clients/ClientCibaParUmaPanel.js @@ -23,10 +23,23 @@ import GluuTypeAheadForDn from 'Routes/Apps/Gluu/GluuTypeAheadForDn' import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle' import { deleteUMAResource } from 'Plugins/auth-server/redux/actions/UMAResourceActions' import { setCurrentItem } from 'Plugins/auth-server/redux/actions/ScopeActions' +import { + setCurrentItem as setCurrentItemClient, + viewOnly +} from 'Plugins/auth-server/redux/actions/OIDCActions' import GluuDialog from 'Routes/Apps/Gluu/GluuDialog' const DOC_CATEGORY = 'openid_client' -function ClientCibaParUmaPanel({ client, dispatch, umaResources, scopes, scripts, formik }) { +function ClientCibaParUmaPanel({ client, + clients, + dispatch, + umaResources, + scopes, + scripts, + setCurrentStep, + sequence, + formik, +}) { const { t } = useTranslation() const history = useHistory() const claim_uri_id = 'claim_uri_id' @@ -72,10 +85,12 @@ function ClientCibaParUmaPanel({ client, dispatch, umaResources, scopes, scripts const onDeletionConfirmed = (message) => { const params = { id: selectedUMA.id, - message + action_message: message, + action_data: selectedUMA.id } dispatch(deleteUMAResource(params)) setConfirmModal(false) + setOpen(false) } const handleScopeEdit = (scope) => { @@ -83,6 +98,15 @@ function ClientCibaParUmaPanel({ client, dispatch, umaResources, scopes, scripts return history.push(`/auth-server/scope/edit:${scope.inum}`) } + const handleClientEdit = (inum) => { + const currentClient = clients.find(client => client.inum === inum) + dispatch(setCurrentItemClient(currentClient)) + setOpen(false) + dispatch(viewOnly(true)) + setCurrentStep(sequence[0]) + return history.push(`/auth-server/client/edit:${inum?.substring(0, 4)}`) + } + useEffect(() => { if(!isEmpty(selectedUMA) && !isEmpty(selectedUMA.scopes) && selectedUMA.scopes?.length > 0) { const list = selectedUMA.scopes.map(scope => { @@ -225,7 +249,7 @@ function ClientCibaParUmaPanel({ client, dispatch, umaResources, scopes, scripts size="lg" className="modal-outline-primary" > - setOpen(!open)}> + setOpen(!open)}> UMA Resource Detail @@ -316,9 +340,9 @@ function ClientCibaParUmaPanel({ client, dispatch, umaResources, scopes, scripts return ( - + handleClientEdit(inum)} className="common-link"> {inum} - + )} @@ -358,7 +382,7 @@ function ClientCibaParUmaPanel({ client, dispatch, umaResources, scopes, scripts const mapStateToProps = (state) => { return { - clientData: state.oidcReducer.item, + clients: state.oidcReducer.items, loading: state.oidcReducer.loading, } } diff --git a/admin-ui/plugins/auth-server/components/Clients/ClientListPage.js b/admin-ui/plugins/auth-server/components/Clients/ClientListPage.js index b9b924192..d6b40c089 100644 --- a/admin-ui/plugins/auth-server/components/Clients/ClientListPage.js +++ b/admin-ui/plugins/auth-server/components/Clients/ClientListPage.js @@ -6,6 +6,7 @@ import { connect } from 'react-redux' import { Paper } from '@material-ui/core' import { Card, CardBody, Badge } from 'Components' import { getScopes } from 'Plugins/auth-server/redux/actions/ScopeActions' +import { resetUMAResources } from 'Plugins/auth-server/redux/actions/UMAResourceActions' import GluuDialog from 'Routes/Apps/Gluu/GluuDialog' import ClientDetailPage from '../Clients/ClientDetailPage' import GluuAdvancedSearch from 'Routes/Apps/Gluu/GluuAdvancedSearch' @@ -156,6 +157,10 @@ function ClientListPage({ clients, permissions, scopes, loading, dispatch }) { } }, [haveScopeINUMParam]) + useEffect(() => { + dispatch(resetUMAResources()) + }, []) + function handleOptionsChange(event) { if (event.target.name == 'limit') { memoLimit = event.target.value diff --git a/admin-ui/plugins/auth-server/components/Clients/ClientWizardForm.js b/admin-ui/plugins/auth-server/components/Clients/ClientWizardForm.js index 55d4d452f..d96b339e9 100644 --- a/admin-ui/plugins/auth-server/components/Clients/ClientWizardForm.js +++ b/admin-ui/plugins/auth-server/components/Clients/ClientWizardForm.js @@ -427,6 +427,8 @@ function ClientWizardForm({ umaResources={umaResources} scopes={scopes} scripts={scripts} + setCurrentStep={setCurrentStep} + sequence={sequence} formik={formik} /> {/* ({ @@ -24,3 +25,8 @@ export const deleteUMAResourceResponse = (data) => ({ type: DELETE_UMA_RESOURCE_RESPONSE, payload: { data }, }) + +export const resetUMAResources = () => ({ + type: RESET, + payload: {}, +})