|
@@ -1,14 +1,20 @@
|
|
1
|
+export const SET = 'Set'
|
|
2
|
+export const UPDATE = 'Update'
|
|
3
|
+export const ADD = 'Add'
|
|
4
|
+export const REMOVE = 'Remove'
|
|
5
|
+
|
1
|
6
|
export const TIMEZONE = 'Timezone'
|
2
|
|
-export const setTimezone = timezone => ({ type: `Set/${TIMEZONE}`, timezone })
|
|
7
|
+export const setTimezone = timezone => ({ type: `${SET}/${TIMEZONE}`, timezone })
|
3
|
8
|
|
4
|
9
|
export const FLASH_MESSAGE = 'FlashMessage'
|
5
|
10
|
export const newFlashMessage = (msgText = '', msgType = 'info', msgDelay = 5000) => dispatch => {
|
6
|
11
|
msgDelay !== 0 && window.setTimeout(() => dispatch(removeFlashMessage(msgText)), msgDelay)
|
7
|
12
|
return dispatch(addFlashMessage({message: msgText, type: msgType}))
|
8
|
13
|
}
|
9
|
|
-export const addFlashMessage = msg => ({ type: `Add/${FLASH_MESSAGE}`, msg })
|
10
|
|
-export const removeFlashMessage = msg => ({ type: `Remove/${FLASH_MESSAGE}`, msg })
|
|
14
|
+export const addFlashMessage = msg => ({ type: `${ADD}/${FLASH_MESSAGE}`, msg })
|
|
15
|
+export const removeFlashMessage = msg => ({ type: `${REMOVE}/${FLASH_MESSAGE}`, msg })
|
11
|
16
|
|
|
17
|
+export const USER = 'User'
|
12
|
18
|
export const USER_LOGIN = 'User/Login'
|
13
|
19
|
export const USER_LOGOUT = 'User/Logout'
|
14
|
20
|
export const USER_DATA = 'User/Data'
|
|
@@ -16,30 +22,30 @@ export const USER_ROLE = 'User/Role'
|
16
|
22
|
export const USER_CONNECTED = 'User/Connected'
|
17
|
23
|
export const USER_DISCONNECTED = 'User/Disconnected'
|
18
|
24
|
export const USER_LANG = 'User/Lang'
|
19
|
|
-export const setUserConnected = user => ({ type: `Set/${USER_CONNECTED}`, user })
|
20
|
|
-export const setUserDisconnected = () => ({ type: `Set/${USER_DISCONNECTED}` })
|
21
|
|
-export const updateUserData = userData => ({ type: `Update/${USER_DATA}`, data: userData })
|
22
|
|
-export const setUserRole = userRole => ({ type: `Set/${USER_ROLE}`, userRole }) // this actually update workspaceList state
|
23
|
|
-export const setUserLang = lang => ({ type: `Set/${USER_LANG}`, lang })
|
|
25
|
+export const setUserConnected = user => ({ type: `${SET}/${USER}/Connected`, user })
|
|
26
|
+export const setUserDisconnected = () => ({ type: `${SET}/${USER}/Disconnected` })
|
|
27
|
+export const updateUserData = userData => ({ type: `${UPDATE}/${USER}/Data`, data: userData })
|
|
28
|
+export const setUserRole = userRole => ({ type: `${SET}/${USER}/Role`, userRole }) // this actually update workspaceList state
|
|
29
|
+export const setUserLang = lang => ({ type: `${SET}/${USER}/Lang`, lang })
|
24
|
30
|
export const updateUserWorkspaceSubscriptionNotif = (workspaceId, subscriptionNotif) =>
|
25
|
|
- ({ type: `Update/${USER_ROLE}/SubscriptionNotif`, workspaceId, subscriptionNotif })
|
|
31
|
+ ({ type: `${UPDATE}/${USER_ROLE}/SubscriptionNotif`, workspaceId, subscriptionNotif })
|
26
|
32
|
|
27
|
33
|
export const WORKSPACE = 'Workspace'
|
28
|
|
-export const setWorkspaceContent = (workspaceContent, filterStr = '') => ({ type: `Set/${WORKSPACE}/Content`, workspaceContent, filterStr })
|
29
|
|
-export const updateWorkspaceFilter = filterList => ({ type: `Update/${WORKSPACE}/Filter`, filterList })
|
|
34
|
+export const setWorkspaceContent = (workspaceContent, filterStr = '') => ({ type: `${SET}/${WORKSPACE}/Content`, workspaceContent, filterStr })
|
|
35
|
+export const updateWorkspaceFilter = filterList => ({ type: `${UPDATE}/${WORKSPACE}/Filter`, filterList })
|
30
|
36
|
|
31
|
37
|
export const FOLDER = 'Folder'
|
32
|
|
-export const setFolderData = (folderId, content) => ({ type: `Set/${WORKSPACE}/${FOLDER}/Content`, folderId, content })
|
|
38
|
+export const setFolderData = (folderId, content) => ({ type: `${SET}/${WORKSPACE}/${FOLDER}/Content`, folderId, content })
|
33
|
39
|
|
34
|
40
|
export const WORKSPACE_LIST = 'WorkspaceList'
|
35
|
|
-export const updateWorkspaceListData = workspaceList => ({ type: `Update/${WORKSPACE_LIST}`, workspaceList })
|
36
|
|
-export const setWorkspaceListIsOpenInSidebar = (workspaceId, isOpenInSidebar) => ({ type: `Set/${WORKSPACE_LIST}/isOpenInSidebar`, workspaceId, isOpenInSidebar })
|
|
41
|
+export const updateWorkspaceListData = workspaceList => ({ type: `${UPDATE}/${WORKSPACE_LIST}`, workspaceList })
|
|
42
|
+export const setWorkspaceListIsOpenInSidebar = (workspaceId, isOpenInSidebar) => ({ type: `${SET}/${WORKSPACE_LIST}/isOpenInSidebar`, workspaceId, isOpenInSidebar })
|
37
|
43
|
|
38
|
44
|
export const APP_LIST = 'App/List'
|
39
|
|
-export const setAppList = appList => ({ type: `Set/${APP_LIST}`, appList })
|
|
45
|
+export const setAppList = appList => ({ type: `${SET}/${APP_LIST}`, appList })
|
40
|
46
|
|
41
|
47
|
export const CONTENT_TYPE_LIST = 'ContentType/List'
|
42
|
|
-export const setContentTypeList = contentTypeList => ({ type: `Set/${CONTENT_TYPE_LIST}`, contentTypeList })
|
|
48
|
+export const setContentTypeList = contentTypeList => ({ type: `${SET}/${CONTENT_TYPE_LIST}`, contentTypeList })
|
43
|
49
|
|
44
|
50
|
export const LANG = 'Lang'
|
45
|
|
-export const updateLangList = langList => ({ type: `Update/${LANG}`, langList })
|
|
51
|
+export const updateLangList = langList => ({ type: `${UPDATE}/${LANG}`, langList })
|