Skip to content

Commit 11aff28

Browse files
committed
根据tc39/dataset的schema修正
1 parent 74293d9 commit 11aff28

File tree

2 files changed

+36
-38
lines changed

2 files changed

+36
-38
lines changed

source/model/Proposal.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@ import { service } from './service';
55
export interface Proposal {
66
stage: number;
77
name: string;
8-
link?: string;
9-
authors?: string[];
10-
champions?: string[];
11-
meeting?: string;
8+
url: string;
9+
authors: string[];
10+
champions: string[];
1211
tests?: string;
13-
meeting_at?: string;
14-
created_at?: string;
12+
'has-specification': boolean;
13+
notes?: { date: string, url: string }[];
14+
// created_at?: string;
1515
pushed_at?: string;
1616
tags: string[];
17+
rationale?: string;
1718
edition?: number;
18-
repo?: string;
19-
owner?: string;
20-
forks_count?: number;
19+
id?: string;
20+
// repo?: string;
21+
// owner?: string;
22+
// forks_count?: number;
2123
open_issues_count?: number;
2224
stargazers_count?: number;
23-
subscribers_count?: number;
24-
watchers_count?: number;
25+
// subscribers_count?: number;
26+
// watchers_count?: number;
2527
}
2628

2729
export type ProposalSortKey =

source/page/Proposal.tsx

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
7979
)}
8080
onClick={() => (proposal.sortKey = 'name')}
8181
>
82-
名称
82+
提案名称
8383
</th>
84-
<th>作者</th>
85-
<th>责编</th>
84+
<th>作者(Author)</th>
85+
<th>责编(Champion)</th>
8686
<th
8787
className={classNames(
8888
'user-select-none',
@@ -111,7 +111,7 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
111111
)}
112112
onClick={() => (proposal.sortKey = 'meeting_at')}
113113
>
114-
最近更新
114+
最近会议记录
115115
</th>
116116
</TableRow>
117117
);
@@ -143,22 +143,24 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
143143
}
144144
}
145145

146+
renderNotes(notes: { date: string, url: string }[]) {
147+
return notes.map(({ date, url }) => (
148+
<a href={url}>{formatDate(date, 'YYYY年M月D日')}</a>
149+
))
150+
}
151+
146152
renderRow = ({
147153
stage,
148-
link,
154+
url,
149155
name,
150156
authors,
151157
champions,
152158
stargazers_count,
153159
open_issues_count,
154160
tests,
155-
meeting,
156-
meeting_at,
157-
pushed_at
161+
notes,
162+
// pushed_at,
158163
}: Proposal) => {
159-
const updated_at = meeting_at || pushed_at;
160-
const updated = updated_at && formatDate(updated_at, 'YYYY 年 M 月');
161-
162164
return (
163165
<TableRow>
164166
<td>
@@ -170,12 +172,12 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
170172
filter="stage"
171173
value={stage}
172174
>
173-
{stage < 0 ? 'Inactive' : `Stage ${stage}`}
175+
{stage < 0 ? '非活跃' : `阶段${stage}`}
174176
</FilterLink>
175177
</td>
176178
<td>
177-
{link ? (
178-
<a className="stretched-link" target="_blank" href={link}>
179+
{url ? (
180+
<a className="stretched-link" target="_blank" href={url}>
179181
{name}
180182
</a>
181183
) : (
@@ -189,7 +191,7 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
189191
<a
190192
className="stretched-link"
191193
target="_blank"
192-
href={link + '/stargazers'}
194+
href={url + '/stargazers'}
193195
>
194196
{stargazers_count}
195197
</a>
@@ -200,7 +202,7 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
200202
<a
201203
className="stretched-link"
202204
target="_blank"
203-
href={link + '/issues'}
205+
href={url + '/issues'}
204206
>
205207
{open_issues_count}
206208
</a>
@@ -218,13 +220,7 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
218220
)}
219221
</td>
220222
<td className="text-nowrap">
221-
{meeting ? (
222-
<a className="stretched-link" target="_blank" href={meeting}>
223-
{updated}
224-
</a>
225-
) : (
226-
updated
227-
)}
223+
{notes && this.renderNotes(notes)}
228224
</td>
229225
</TableRow>
230226
);
@@ -236,10 +232,10 @@ export class ProposalPage extends mixin<ProposalPageProps>() {
236232
stage != null
237233
? list.filter(item => item.stage === stage)
238234
: author
239-
? list.filter(({ authors }) => authors?.includes(author))
240-
: champion
241-
? list.filter(({ champions }) => champions?.includes(champion))
242-
: list;
235+
? list.filter(({ authors }) => authors?.includes(author))
236+
: champion
237+
? list.filter(({ champions }) => champions?.includes(champion))
238+
: list;
243239

244240
return (
245241
<>

0 commit comments

Comments
 (0)