-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconstants.ts
47 lines (41 loc) · 1.04 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export const boardNameRegex = /^[a-z](:?[a-z0-9-]{0,61}[a-z0-9])?$/;
const addStoryToType = (type: string, storyId: string): string =>
`${type}-${storyId}`;
export const todo = (storyId: string): string =>
addStoryToType('TODO', storyId);
export const inProgress = (storyId: string): string =>
addStoryToType('IN_PROGRESS', storyId);
export const verify = (storyId: string): string =>
addStoryToType('VERIFY', storyId);
export const done = (storyId: string): string =>
addStoryToType('DONE', storyId);
export const WEBSOCKET_EVENTS = [
{
name: 'ADD_STORY',
uiStoreFunction: 'addStory',
},
{
name: 'UPDATE_STORY',
uiStoreFunction: 'replaceStoryWithNewOne',
},
{
name: 'DELETE_STORY',
uiStoreFunction: 'removeNewStory',
},
{
name: 'ADD_TASK',
uiStoreFunction: 'addTask',
},
{
name: 'UPDATE_TASK',
uiStoreFunction: 'websocketUpdateTask',
},
{
name: 'MOVE_TASK',
uiStoreFunction: 'websocketMoveTask',
},
{
name: 'DELETE_TASK',
uiStoreFunction: 'removeNewTask',
},
];