Skip to content

Commit

Permalink
fix(admin-ui): resolve all bugs displayed for admin-ui #308
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Nov 16, 2021
1 parent d4643c0 commit d400154
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 76 deletions.
13 changes: 1 addition & 12 deletions plugins/auth-server/redux/reducers/AcrReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const INIT_STATE = {
loading: true,
}

const reducerName = 'acrReducer';
const reducerName = 'acrReducer'

export default function acrReducer(state = INIT_STATE, action) {
switch (action.type) {
Expand All @@ -27,11 +27,6 @@ export default function acrReducer(state = INIT_STATE, action) {
acrs: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case PUT_ACRS:
Expand All @@ -46,16 +41,10 @@ export default function acrReducer(state = INIT_STATE, action) {
acrs: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}
default:
return {
...state,
}
}
}

11 changes: 1 addition & 10 deletions plugins/auth-server/redux/reducers/JsonConfigReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ export default function jsonConfigReducer(state = INIT_STATE, action) {
configuration: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case PATCH_JSON_CONFIG:
Expand All @@ -45,15 +40,11 @@ export default function jsonConfigReducer(state = INIT_STATE, action) {
configuration: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}
default:
return {
...state,
loading: false,
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions plugins/auth-server/redux/reducers/JwksReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ export default function jwksReducer(state = INIT_STATE, action) {
jwks: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}
case RESET:
return {
Expand All @@ -37,6 +32,7 @@ export default function jwksReducer(state = INIT_STATE, action) {
default:
return {
...state,
loading: false,
}
}
}
Expand Down
17 changes: 4 additions & 13 deletions plugins/auth-server/redux/reducers/LoggingReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
PUT_LOGGING_RESPONSE,
RESET,
} from '../actions/types'
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry';
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry'
const INIT_STATE = {
logging: {},
loading: false,
}

const reducerName = 'loggingReducer';
const reducerName = 'loggingReducer'

export default function loggingReducer(state = INIT_STATE, action) {
switch (action.type) {
Expand All @@ -27,11 +27,6 @@ export default function loggingReducer(state = INIT_STATE, action) {
logging: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}
case PUT_LOGGING:
return {
Expand All @@ -45,11 +40,6 @@ export default function loggingReducer(state = INIT_STATE, action) {
logging: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case RESET:
Expand All @@ -61,7 +51,8 @@ export default function loggingReducer(state = INIT_STATE, action) {
default:
return {
...state,
loading: false,
}
}
}
reducerRegistry.register(reducerName, loggingReducer);
reducerRegistry.register(reducerName, loggingReducer)
40 changes: 4 additions & 36 deletions plugins/auth-server/redux/reducers/ScopeReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import {
GET_SCOPE_BY_PATTERN_RESPONSE,
SEARCH_SCOPES,
} from '../actions/types'
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry';
import reducerRegistry from '../../../../app/redux/reducers/ReducerRegistry'
const INIT_STATE = {
items: [],
item: {},
loading: false,
}

const reducerName = 'scopeReducer';
const reducerName = 'scopeReducer'

export default function scopeReducer(state = INIT_STATE, action) {
switch (action.type) {
Expand All @@ -43,13 +43,7 @@ export default function scopeReducer(state = INIT_STATE, action) {
items: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case GET_SCOPE_BY_INUM:
return {
...state,
Expand All @@ -62,13 +56,7 @@ export default function scopeReducer(state = INIT_STATE, action) {
item: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case GET_SCOPE_BY_PATTERN:
return {
...state,
Expand All @@ -81,11 +69,6 @@ export default function scopeReducer(state = INIT_STATE, action) {
item: action.payload.data,
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case ADD_SCOPE:
Expand All @@ -100,11 +83,6 @@ export default function scopeReducer(state = INIT_STATE, action) {
items: [...state.items],
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case EDIT_SCOPE:
Expand All @@ -120,13 +98,7 @@ export default function scopeReducer(state = INIT_STATE, action) {
items: [...state.items],
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case DELETE_SCOPE:
return {
...state,
Expand All @@ -139,11 +111,6 @@ export default function scopeReducer(state = INIT_STATE, action) {
items: state.items.filter((i) => i.inum !== action.payload.data),
loading: false,
}
} else {
return {
...state,
loading: false,
}
}

case SET_ITEM:
Expand All @@ -161,7 +128,8 @@ export default function scopeReducer(state = INIT_STATE, action) {
default:
return {
...state,
loading: false,
}
}
}
reducerRegistry.register(reducerName, scopeReducer);
reducerRegistry.register(reducerName, scopeReducer)

0 comments on commit d400154

Please sign in to comment.