feat: Add ability to configure and test SMTP via UI

This commit is contained in:
Maksim Eltyshev
2025-09-22 20:35:13 +02:00
parent 3a12bb7457
commit c6f4dcdb70
114 changed files with 2161 additions and 301 deletions
+7 -7
View File
@@ -7,7 +7,7 @@ import ActionTypes from '../constants/ActionTypes';
const initialState = {
isInitializing: true,
config: null,
bootstrap: null,
};
// eslint-disable-next-line default-param-last
@@ -16,13 +16,13 @@ export default (state = initialState, { type, payload }) => {
case ActionTypes.SOCKET_RECONNECT_HANDLE:
return {
...state,
config: payload.config,
bootstrap: payload.bootstrap,
};
case ActionTypes.LOGIN_INITIALIZE:
return {
...state,
isInitializing: false,
config: payload.config,
bootstrap: payload.bootstrap,
};
case ActionTypes.AUTHENTICATE__SUCCESS:
case ActionTypes.WITH_OIDC_AUTHENTICATE__SUCCESS:
@@ -36,16 +36,16 @@ export default (state = initialState, { type, payload }) => {
...state,
isInitializing: false,
};
case ActionTypes.CORE_INITIALIZE__CONFIG_FETCH:
case ActionTypes.CORE_INITIALIZE__BOOTSTRAP_FETCH:
return {
...state,
config: payload.config,
bootstrap: payload.bootstrap,
};
case ActionTypes.USER_UPDATE_HANDLE:
if (payload.config) {
if (payload.bootstrap) {
return {
...state,
config: payload.config,
bootstrap: payload.bootstrap,
};
}
+41 -2
View File
@@ -15,6 +15,7 @@ const initialState = {
isFavoritesEnabled: false,
isEditModeEnabled: false,
modal: null,
config: null,
boardId: null,
cardId: null,
recentCardId: null,
@@ -70,13 +71,30 @@ export default (state = initialState, { type, payload }) => {
...state,
isContentFetching: true,
};
case ActionTypes.CORE_INITIALIZE:
return {
case ActionTypes.SOCKET_RECONNECT_HANDLE:
case ActionTypes.USER_UPDATE_HANDLE:
if (payload.config) {
return {
...state,
config: payload.config,
};
}
return state;
case ActionTypes.CORE_INITIALIZE: {
const nextState = {
...state,
isFavoritesEnabled: payload.user.enableFavoritesByDefault,
homeView: payload.user.defaultHomeView,
projectsOrder: payload.user.defaultProjectsOrder,
};
if (payload.config) {
nextState.config = payload.config;
}
return nextState;
}
case ActionTypes.FAVORITES_TOGGLE:
return {
...state,
@@ -102,6 +120,27 @@ export default (state = initialState, { type, payload }) => {
...state,
modal: payload,
};
case ActionTypes.CONFIG_UPDATE:
return {
...state,
config: {
...state.config,
...payload.data,
},
};
case ActionTypes.CONFIG_UPDATE__SUCCESS:
return {
...state,
config: {
...state.config,
...payload.config,
},
};
case ActionTypes.CONFIG_UPDATE_HANDLE:
return {
...state,
config: payload.config,
};
case ActionTypes.PROJECTS_SEARCH:
return {
...state,
+2
View File
@@ -8,9 +8,11 @@ import { combineReducers } from 'redux';
import authenticateForm from './authenticate-form';
import userCreateForm from './user-create-form';
import projectCreateForm from './project-create-form';
import smtpTest from './smtp-test';
export default combineReducers({
authenticateForm,
userCreateForm,
projectCreateForm,
smtpTest,
});
+35
View File
@@ -0,0 +1,35 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
import ActionTypes from '../../constants/ActionTypes';
const initialState = {
isLoading: false,
logs: null,
error: null,
};
// eslint-disable-next-line default-param-last
export default (state = initialState, { type, payload }) => {
switch (type) {
case ActionTypes.SMTP_CONFIG_TEST:
return {
...state,
isLoading: true,
};
case ActionTypes.SMTP_CONFIG_TEST__SUCCESS:
return {
...initialState,
logs: payload.logs,
};
case ActionTypes.SMTP_CONFIG_TEST__FAILURE:
return {
...initialState,
error: payload.error,
};
default:
return state;
}
};