1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-29 18:19:46 +02:00
planka/client/src/actions/core.js

106 lines
1.7 KiB
JavaScript
Raw Normal View History

/*!
* 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 = (
user,
board,
webhooks,
users,
projects,
projectManagers,
backgroundImages,
baseCustomFieldGroups,
boards,
boardMemberships,
labels,
lists,
cards,
cardMemberships,
cardLabels,
taskLists,
tasks,
attachments,
customFieldGroups,
customFields,
customFieldValues,
notifications,
notificationServices,
) => ({
type: ActionTypes.CORE_INITIALIZE,
payload: {
user,
board,
webhooks,
users,
projects,
projectManagers,
backgroundImages,
baseCustomFieldGroups,
boards,
boardMemberships,
labels,
lists,
cards,
cardMemberships,
cardLabels,
taskLists,
tasks,
attachments,
customFieldGroups,
customFields,
customFieldValues,
notifications,
notificationServices,
},
2019-08-31 04:07:25 +05:00
});
2022-08-04 13:31:14 +02:00
initializeCore.fetchConfig = (config) => ({
type: ActionTypes.CORE_INITIALIZE__CONFIG_FETCH,
payload: {
config,
},
});
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,
payload: {
value,
},
2022-08-04 13:31:14 +02:00
});
const logout = () => ({
type: ActionTypes.LOGOUT,
payload: {},
});
logout.invalidateAccessToken = () => ({
type: ActionTypes.LOGOUT__ACCESS_TOKEN_INVALIDATE,
payload: {},
});
2022-08-04 13:31:14 +02:00
export default {
initializeCore,
toggleFavorites,
toggleEditMode,
updateHomeView,
2022-08-04 13:31:14 +02:00
logout,
};