-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdata.tsx
221 lines (215 loc) · 4.34 KB
/
data.tsx
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
export type User = { name: string; avatarUrl: string };
export type Issue = {
id: string;
userId: string;
title: string;
priority: number;
status: number;
owner: User;
date: string;
};
const users: Record<string, User> = {
chance: {
name: "Chance Strickland",
avatarUrl: "https://github.com/chaance.png",
},
ryan: {
name: "Ryan Florence",
avatarUrl: "https://github.com/ryanflorence.png",
},
};
const defaultIssues: Issue[] = [
{
id: "REM-1",
userId: "chance",
title: "Community stuff [TODO: rename this]",
priority: 0,
status: 1,
},
{
id: "REM-2",
userId: "ryan",
title:
"Provide `matches` to loader/action/meta args [TODO: flesh this out]",
priority: 0,
status: 3,
},
{
id: "REM-3",
userId: "chance",
title: "ci - update RR workflow to comment again",
priority: 1,
status: 3,
},
{
id: "REM-4",
userId: "chance",
title: "Write decision doc on replacing `@remix-run/dev` with `remix`",
priority: 0,
status: 1,
},
{
id: "REM-5",
userId: "chance",
title: "Make a list of new docs/guides that we want to write",
priority: 3,
status: 1,
},
{
id: "REM-6",
userId: "chance",
title: "React Router + Webpack migration guide using BYOC",
priority: 4,
status: 2,
},
{
id: "REM-7",
userId: "ryan",
title: "Fetcher API Updates Decision Doc",
priority: 0,
status: 0,
},
{
id: "REM-8",
userId: "ryan",
title: "Add `createCloudflareDurableObjectSessionStorage`",
priority: 1,
status: 2,
},
{
id: "REM-9",
userId: "ryan",
title: "Add CF workers ESM request handler",
priority: 0,
status: 2,
},
{
id: "REM-10",
userId: "chance",
title: "bring React 18 fixtures/templates in line with indie-stack updates",
priority: 0,
status: 0,
},
{
id: "REM-11",
userId: "chance",
title:
"Back navigation from ErrorBoundary (without `<Scripts>`) does not work properly",
priority: 0,
status: 3,
},
{
id: "REM-12",
userId: "ryan",
title:
"An error in MetaFunction or LinkFunction is not caught by ErrorBoundary",
priority: 0,
status: 0,
},
{
id: "REM-13",
userId: "chance",
title: "Fix rendered href for createHashRouter links",
priority: 2,
status: 4,
},
{
id: "REM-14",
userId: "ryan",
title: "Optional Route Segments Internal RFC",
priority: 0,
status: 4,
},
{
id: "REM-15",
userId: "ryan",
title: "bug: Respect basename in RR useFormAction",
priority: 2,
status: 2,
},
{
id: "REM-16",
userId: "chance",
title: "UMD Build for remix-run/router",
priority: 0,
status: 3,
},
{
id: "REM-17",
userId: "chance",
title: "Bug: Form action for pathless layout routes",
priority: 3,
status: 2,
},
{
id: "REM-18",
userId: "chance",
title: "React Router: Optional Params",
priority: 0,
status: 2,
},
{
id: "REM-19",
userId: "ryan",
title: "RouterProvider unit test refactor",
priority: 0,
status: 3,
},
{
id: "REM-20",
userId: "ryan",
title: "Fetcher API updates Implementation",
priority: 0,
status: 0,
},
{
id: "REM-21",
userId: "ryan",
title: "Move dom utils from react-router to @remix-run/router",
priority: 0,
status: 0,
},
{
id: "REM-22",
userId: "chance",
title: "Add SSR deferred hydration support to RR",
priority: 0,
status: 2,
},
{
id: "REM-23",
userId: "chance",
title: "Hash link handling in react router",
priority: 4,
status: 2,
},
{
id: "REM-24",
userId: "ryan",
title: "Write decision doc on service workers",
priority: 4,
status: 0,
},
].map((issue) => {
return {
...issue,
owner: users[issue.userId],
date: "Oct 10",
};
});
export async function getIssues() {
return defaultIssues;
}
export async function getIssue(id: string) {
return defaultIssues.find((issue) => issue.id === id);
}
export async function updateIssue(id: string, updates: any) {
const issue = defaultIssues.find((issue) => issue.id === id);
if (!issue) return null;
if (updates.priority) {
updates.priority = parseInt(updates.priority, 10);
}
Object.assign(issue, updates);
console.log(issue.priority);
return issue;
}