2025-05-10 02:09:06 +02:00
|
|
|
/*!
|
|
|
|
* Copyright (c) 2024 PLANKA Software GmbH
|
|
|
|
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
|
|
|
*/
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
const initializeCore = (
|
2021-06-24 01:05:22 +05:00
|
|
|
user,
|
|
|
|
board,
|
2025-07-04 22:04:11 +02:00
|
|
|
webhooks,
|
2021-06-24 01:05:22 +05:00
|
|
|
users,
|
|
|
|
projects,
|
|
|
|
projectManagers,
|
2025-05-10 02:09:06 +02:00
|
|
|
backgroundImages,
|
|
|
|
baseCustomFieldGroups,
|
2021-06-24 01:05:22 +05:00
|
|
|
boards,
|
|
|
|
boardMemberships,
|
|
|
|
labels,
|
|
|
|
lists,
|
|
|
|
cards,
|
|
|
|
cardMemberships,
|
|
|
|
cardLabels,
|
2025-05-10 02:09:06 +02:00
|
|
|
taskLists,
|
2021-06-24 01:05:22 +05:00
|
|
|
tasks,
|
|
|
|
attachments,
|
2025-05-10 02:09:06 +02:00
|
|
|
customFieldGroups,
|
|
|
|
customFields,
|
|
|
|
customFieldValues,
|
2021-06-24 01:05:22 +05:00
|
|
|
notifications,
|
2025-05-10 02:09:06 +02:00
|
|
|
notificationServices,
|
2021-06-24 01:05:22 +05:00
|
|
|
) => ({
|
|
|
|
type: ActionTypes.CORE_INITIALIZE,
|
|
|
|
payload: {
|
|
|
|
user,
|
|
|
|
board,
|
2025-07-04 22:04:11 +02:00
|
|
|
webhooks,
|
2021-06-24 01:05:22 +05:00
|
|
|
users,
|
|
|
|
projects,
|
|
|
|
projectManagers,
|
2025-05-10 02:09:06 +02:00
|
|
|
backgroundImages,
|
|
|
|
baseCustomFieldGroups,
|
2021-06-24 01:05:22 +05:00
|
|
|
boards,
|
|
|
|
boardMemberships,
|
|
|
|
labels,
|
|
|
|
lists,
|
|
|
|
cards,
|
|
|
|
cardMemberships,
|
|
|
|
cardLabels,
|
2025-05-10 02:09:06 +02:00
|
|
|
taskLists,
|
2021-06-24 01:05:22 +05:00
|
|
|
tasks,
|
|
|
|
attachments,
|
2025-05-10 02:09:06 +02:00
|
|
|
customFieldGroups,
|
|
|
|
customFields,
|
|
|
|
customFieldValues,
|
2021-06-24 01:05:22 +05:00
|
|
|
notifications,
|
2025-05-10 02:09:06 +02:00
|
|
|
notificationServices,
|
2021-06-24 01:05:22 +05:00
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
});
|
2022-08-04 13:31:14 +02:00
|
|
|
|
2023-10-20 22:34:58 +02:00
|
|
|
initializeCore.fetchConfig = (config) => ({
|
|
|
|
type: ActionTypes.CORE_INITIALIZE__CONFIG_FETCH,
|
|
|
|
payload: {
|
|
|
|
config,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
const toggleFavorites = (isEnabled) => ({
|
|
|
|
type: ActionTypes.FAVORITES_TOGGLE,
|
|
|
|
payload: {
|
|
|
|
isEnabled,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const toggleEditMode = (isEnabled) => ({
|
|
|
|
type: ActionTypes.EDIT_MODE_TOGGLE,
|
|
|
|
payload: {
|
|
|
|
isEnabled,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const updateHomeView = (value) => ({
|
|
|
|
type: ActionTypes.HOME_VIEW_UPDATE,
|
2024-04-09 15:12:46 +02:00
|
|
|
payload: {
|
2025-05-10 02:09:06 +02:00
|
|
|
value,
|
2024-04-09 15:12:46 +02:00
|
|
|
},
|
2022-08-04 13:31:14 +02:00
|
|
|
});
|
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
const logout = () => ({
|
|
|
|
type: ActionTypes.LOGOUT,
|
|
|
|
payload: {},
|
|
|
|
});
|
|
|
|
|
2022-09-07 18:39:33 +05:00
|
|
|
logout.invalidateAccessToken = () => ({
|
|
|
|
type: ActionTypes.LOGOUT__ACCESS_TOKEN_INVALIDATE,
|
|
|
|
payload: {},
|
|
|
|
});
|
|
|
|
|
2022-08-04 13:31:14 +02:00
|
|
|
export default {
|
|
|
|
initializeCore,
|
2025-05-10 02:09:06 +02:00
|
|
|
toggleFavorites,
|
|
|
|
toggleEditMode,
|
|
|
|
updateHomeView,
|
2022-08-04 13:31:14 +02:00
|
|
|
logout,
|
|
|
|
};
|