diff --git a/client/src/actions/users.js b/client/src/actions/users.js index 1b2ece4a..1adc0e2b 100644 --- a/client/src/actions/users.js +++ b/client/src/actions/users.js @@ -235,6 +235,58 @@ updateUserAvatar.failure = (id, error) => ({ }, }); +const createUserApiKey = (id) => ({ + type: ActionTypes.USER_API_KEY_CREATE, + payload: { + id, + }, +}); + +createUserApiKey.success = (user, apiKey) => ({ + type: ActionTypes.USER_API_KEY_CREATE__SUCCESS, + payload: { + user, + apiKey, + }, +}); + +createUserApiKey.failure = (id, error) => ({ + type: ActionTypes.USER_API_KEY_CREATE__FAILURE, + payload: { + id, + error, + }, +}); + +const deleteUserApiKey = (id) => ({ + type: ActionTypes.USER_API_KEY_DELETE, + payload: { + id, + }, +}); + +deleteUserApiKey.success = (user) => ({ + type: ActionTypes.USER_API_KEY_DELETE__SUCCESS, + payload: { + user, + }, +}); + +deleteUserApiKey.failure = (id, error) => ({ + type: ActionTypes.USER_API_KEY_DELETE__FAILURE, + payload: { + id, + error, + }, +}); + +const clearUserApiKeyValue = (id) => ({ + type: ActionTypes.USER_API_KEY_VALUE_CLEAR, + payload: { + id, + }, +}); + const deleteUser = (id) => ({ type: ActionTypes.USER_DELETE, payload: { @@ -359,6 +411,9 @@ export default { updateUserUsername, clearUserUsernameUpdateError, updateUserAvatar, + createUserApiKey, + deleteUserApiKey, + clearUserApiKeyValue, deleteUser, handleUserDelete, addUserToCard, diff --git a/client/src/api/users.js b/client/src/api/users.js index 0685f247..4038a560 100755 --- a/client/src/api/users.js +++ b/client/src/api/users.js @@ -33,6 +33,9 @@ const updateUserUsername = (id, data, headers) => const updateUserAvatar = (id, data, headers) => http.post(`/users/${id}/avatar`, data, headers); +const createUserApiKey = (userId, headers) => + socket.post(`/users/${userId}/api-key`, undefined, headers); + const deleteUser = (id, headers) => socket.delete(`/users/${id}`, undefined, headers); export default { @@ -45,5 +48,6 @@ export default { updateUserPassword, updateUserUsername, updateUserAvatar, + createUserApiKey, deleteUser, }; diff --git a/client/src/components/board-memberships/BoardMemberships/ActionsStep.jsx b/client/src/components/board-memberships/BoardMemberships/ActionsStep.jsx index 204a66d3..3ac638ff 100644 --- a/client/src/components/board-memberships/BoardMemberships/ActionsStep.jsx +++ b/client/src/components/board-memberships/BoardMemberships/ActionsStep.jsx @@ -121,7 +121,7 @@ const ActionsStep = React.memo(({ boardMembershipId, title, onBack, onClose }) = )} {user.organization && (
- + {user.organization}
)} diff --git a/client/src/components/common/AdministrationModal/SmtpPane.jsx b/client/src/components/common/AdministrationModal/SmtpPane.jsx index 80d8955a..9db6649f 100644 --- a/client/src/components/common/AdministrationModal/SmtpPane.jsx +++ b/client/src/components/common/AdministrationModal/SmtpPane.jsx @@ -20,7 +20,7 @@ import styles from './SmtpPane.module.scss'; const SmtpPane = React.memo(() => { const config = useSelector(selectors.selectConfig); - const smtpTest = useSelector(selectors.selectSmtpTest); + const smtpTestState = useSelector(selectors.selectSmtpTestState); const dispatch = useDispatch(); const [t] = useTranslation(); @@ -196,14 +196,14 @@ const SmtpPane = React.memo(() => {