Skip to content

Commit

Permalink
fix(admin-ui): remove resources api
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Aug 5, 2022
1 parent 61cd1bd commit dc5bc75
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 139 deletions.
24 changes: 3 additions & 21 deletions admin-ui/plugins/auth-server/components/Scopes/ScopeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
Badge,
} from 'Components'
import {
searchClients,
viewOnly,
setCurrentItem,
} from 'Plugins/auth-server/redux/actions/OIDCActions'
Expand All @@ -32,7 +31,6 @@ import { SCOPE } from 'Utils/ApiResources'
import { useTranslation } from 'react-i18next'
import { ThemeContext } from 'Context/theme/themeContext'
import { LIMIT, PATTERN } from 'Plugins/auth-server/common/Constants'
import { getUMAResources } from '../../redux/actions/ScopeActions'

function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
const { t } = useTranslation()
Expand All @@ -45,7 +43,8 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
const history = useHistory()
const spontaneousClientScopes = scope.attributes.spontaneousClientScopes || []
const dispatch = useDispatch()
const client = useSelector((state) => state.oidcReducer.items)
const client = scope.clients || []

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

umaResourcesScript = umaResources.map((item) => ({
dn: item.dn,
name: item.id,
}))

useEffect(() => {
dispatch(getUMAResources({ pattern: 'scope' }))
}, [])
umaResourcesScript = []

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

Expand All @@ -84,16 +76,6 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
)
const [showUmaPanel, handleShowUmaPanel] = useState(scope.scopeType === 'uma')

useEffect(() => {
if (showSpontaneousPanel) {
dispatch(
searchClients({
action_data: makeOptions(1, scope.attributes.spontaneousClientId),
}),
)
}
}, [showClaimsPanel])

const makeOptions = (limit, client_id) => {
let obj = {}
obj[LIMIT] = limit
Expand Down
2 changes: 0 additions & 2 deletions admin-ui/plugins/auth-server/plugin-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import jsonSaga from './redux/sagas/JsonConfigSaga'
import jwksSaga from './redux/sagas/JwksSaga'
import acrSaga from './redux/sagas/AcrsSaga'
import loggingSaga from './redux/sagas/LoggingSaga'
import umaResourceSaga from './redux/sagas/UMAResourcesSaga'

import {
ACR_READ,
Expand Down Expand Up @@ -144,7 +143,6 @@ const pluginMetadata = {
jwksSaga(),
acrSaga(),
loggingSaga(),
umaResourceSaga(),
],
}

Expand Down
10 changes: 0 additions & 10 deletions admin-ui/plugins/auth-server/redux/actions/ScopeActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {
GET_SCOPE_BY_PATTERN,
GET_SCOPE_BY_PATTERN_RESPONSE,
SEARCH_SCOPES,
GET_UMA_RESOURCES,
GET_UMA_RESOURCES_RESPONSE,
} from './types'

export const getScopes = (action) => ({
Expand Down Expand Up @@ -86,11 +84,3 @@ export const setCurrentItem = (item) => ({
type: SET_ITEM,
payload: { item },
})
export const getUMAResources = (item) => ({
type: GET_UMA_RESOURCES,
payload: { item },
})
export const getUMAResourcesResponse = (data) => ({
type: GET_UMA_RESOURCES_RESPONSE,
payload: { data },
})
2 changes: 0 additions & 2 deletions admin-ui/plugins/auth-server/redux/actions/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export const RESET = 'RESET'
export const SET_ITEM = 'SET_ITEM'
export const USERINFO_REQUEST = 'USERINFO_REQUEST'
export const USERINFO_RESPONSE = 'USERINFO_RESPONSE'
export const GET_UMA_RESOURCES = 'GET_UMA_RESOURCES'
export const GET_UMA_RESOURCES_RESPONSE = 'GET_UMA_RESOURCES_RESPONSE'

// scopes
export const GET_SCOPES = 'GET_SCOPES'
Expand Down
21 changes: 0 additions & 21 deletions admin-ui/plugins/auth-server/redux/api/UMAResourcesApi.js

This file was deleted.

8 changes: 0 additions & 8 deletions admin-ui/plugins/auth-server/redux/reducers/ScopeReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
GET_SCOPE_BY_PATTERN,
GET_SCOPE_BY_PATTERN_RESPONSE,
SEARCH_SCOPES,
GET_UMA_RESOURCES_RESPONSE,
} from '../actions/types'
import reducerRegistry from 'Redux/reducers/ReducerRegistry'
const INIT_STATE = {
Expand All @@ -23,7 +22,6 @@ const INIT_STATE = {
loading: false,
saveOperationFlag: false,
errorInSaveOperationFlag: false,
umaResources: [],
}

const reducerName = 'scopeReducer'
Expand All @@ -44,12 +42,6 @@ export default function scopeReducer(state = INIT_STATE, action) {
} else {
return handleDefault()
}
case GET_UMA_RESOURCES_RESPONSE:
return {
...state,
umaResources: action.payload.data,
loading: false,
}
case GET_SCOPE_BY_INUM:
return handleLoading()
case GET_SCOPE_BY_INUM_RESPONSE:
Expand Down
75 changes: 0 additions & 75 deletions admin-ui/plugins/auth-server/redux/sagas/UMAResourcesSaga.js

This file was deleted.

0 comments on commit dc5bc75

Please sign in to comment.