diff --git a/frontend/package.json b/frontend/package.json index e134cf99ed..ddede7c6ff 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "unleash-frontend", "description": "unleash your features", - "version": "3.14.0", + "version": "3.14.1", "keywords": [ "unleash", "feature toggle", diff --git a/frontend/src/page/admin/api/api-key-list.jsx b/frontend/src/page/admin/api/api-key-list.jsx index 582a4acdca..755f51404e 100644 --- a/frontend/src/page/admin/api/api-key-list.jsx +++ b/frontend/src/page/admin/api/api-key-list.jsx @@ -9,8 +9,7 @@ import ApiHowTo from './api-howto'; function ApiKeyList({ location, fetchApiKeys, removeKey, addKey, keys, hasPermission }) { const deleteKey = async key => { - const shouldDelte = confirm('Are you sure?'); - if (shouldDelte) { + if (confirm('Are you sure?')) { await removeKey(key); } }; @@ -44,14 +43,14 @@ function ApiKeyList({ location, fetchApiKeys, removeKey, addKey, keys, hasPermis {keys.map(item => ( - + - {formatFullDateTimeWithLocale(item.created, location.locale)} + {formatFullDateTimeWithLocale(item.createdAt, location.locale)} {item.username} - {item.priviliges[0]} + {item.type} - + {hasPermission('ADMIN') ? ( @@ -59,7 +58,7 @@ function ApiKeyList({ location, fetchApiKeys, removeKey, addKey, keys, hasPermis href="" onClick={e => { e.preventDefault(); - deleteKey(item.key); + deleteKey(item.secret); }} > @@ -82,7 +81,7 @@ ApiKeyList.propTypes = { fetchApiKeys: PropTypes.func.isRequired, removeKey: PropTypes.func.isRequired, addKey: PropTypes.func.isRequired, - keys: PropTypes.object.isRequired, + keys: PropTypes.array.isRequired, hasPermission: PropTypes.func.isRequired, }; diff --git a/frontend/src/store/e-api-admin/actions.js b/frontend/src/store/e-api-admin/actions.js index a278e43cd8..2135ae8f36 100644 --- a/frontend/src/store/e-api-admin/actions.js +++ b/frontend/src/store/e-api-admin/actions.js @@ -17,17 +17,17 @@ export function fetchApiKeys() { .then(value => dispatch({ type: RECIEVE_KEYS, - keys: value, + tokens: value.tokens, }) ) .catch(dispatchAndThrow(dispatch, ERROR_FETCH_KEYS)); } -export function removeKey(key) { +export function removeKey(secret) { return dispatch => api - .remove(key) - .then(() => dispatch({ type: REMOVE_KEY, key })) + .remove(secret) + .then(() => dispatch({ type: REMOVE_KEY, secret })) .catch(dispatchAndThrow(dispatch, REMOVE_KEY)); } diff --git a/frontend/src/store/e-api-admin/index.js b/frontend/src/store/e-api-admin/index.js index 5f06ff29bd..8a526b23cf 100644 --- a/frontend/src/store/e-api-admin/index.js +++ b/frontend/src/store/e-api-admin/index.js @@ -4,11 +4,11 @@ import { RECIEVE_KEYS, ADD_KEY, REMOVE_KEY } from './actions'; const store = (state = new List(), action) => { switch (action.type) { case RECIEVE_KEYS: - return new List(action.keys); + return new List(action.tokens); case ADD_KEY: return state.push(action.token); case REMOVE_KEY: - return state.filter(v => v.key !== action.key); + return state.filter(v => v.secret !== action.secret); default: return state; }