Skip to content

Commit 1b1a6ce

Browse files
committed
prettier
1 parent c234068 commit 1b1a6ce

File tree

4 files changed

+76
-71
lines changed

4 files changed

+76
-71
lines changed

src/components/TablePanel.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { Row, Col, Radio, Switch, Input } from 'antd';
1+
import { Row, Col, Radio, Switch, Input, Select } from 'antd';
22
import { t } from 'i18next';
33
import React from 'react';
44
import SwitchablePicker from './datePicker';
55

66
const { Search } = Input;
7+
const { Option } = Select;
78

89
const TablePanel = (props) => {
910
return (
@@ -20,7 +21,6 @@ const TablePanel = (props) => {
2021
<Radio value={'company'}>{t('company')}</Radio>
2122
<Radio value={'repo'}>{t('repo')}</Radio>
2223
<Radio value={'actor'}>{t('developer')}</Radio>
23-
<Radio value={'region2'}>{t('none')}</Radio>
2424
</Radio.Group>
2525
</Col>
2626
<Col>
@@ -35,6 +35,19 @@ const TablePanel = (props) => {
3535
<Radio value={'open_rank'}>{t('influence')}</Radio>
3636
</Radio.Group>
3737
</Col>
38+
<Col>
39+
<span className="myFontColor">{t('source')}</span>
40+
<Select
41+
value={props.source}
42+
onChange={(value) => {
43+
props.setState({ source: value });
44+
}}
45+
>
46+
<Option value="all">All</Option>
47+
<Option value="github">GitHub</Option>
48+
<Option value="gitee">Gitee</Option>
49+
</Select>
50+
</Col>
3851
</Row>
3952
<Row justify="space-between" style={{ minHeight: '50px' }} gutter={10}>
4053
<Col>

src/components/table.js

+57-67
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ const activityColumns = (object, t_month) => [
2323
},
2424
...(object == 'actor'
2525
? [
26-
{
27-
title: t('avatar'),
28-
dataIndex: 'id',
29-
width: '5%',
30-
align: 'center',
31-
render: MyAvatar,
32-
fixed: 'left',
33-
},
34-
]
26+
{
27+
title: t('avatar'),
28+
dataIndex: 'id',
29+
width: '5%',
30+
align: 'center',
31+
render: MyAvatar,
32+
fixed: 'left',
33+
},
34+
]
3535
: []),
3636
{
3737
title: '',
@@ -64,16 +64,16 @@ const activityColumns = (object, t_month) => [
6464
},
6565
...(object == 'repo'
6666
? [
67-
{
68-
title: t('insight_board'),
69-
dataIndex: 'name',
70-
align: 'center',
71-
width: '10%',
72-
render: function (text, row, index) {
73-
return dashboard(text, index, t_month);
67+
{
68+
title: t('insight_board'),
69+
dataIndex: 'name',
70+
align: 'center',
71+
width: '10%',
72+
render: function (text, row, index) {
73+
return dashboard(text, index, t_month);
74+
},
7475
},
75-
},
76-
]
76+
]
7777
: []),
7878
{
7979
title: t('activity'),
@@ -100,15 +100,15 @@ const activityDetailColumns = (object, t_month) => [
100100
},
101101
...(object == 'actor'
102102
? [
103-
{
104-
title: t('avatar'),
105-
dataIndex: 'id',
106-
width: '5%',
107-
align: 'center',
108-
render: MyAvatar,
109-
fixed: 'left',
110-
},
111-
]
103+
{
104+
title: t('avatar'),
105+
dataIndex: 'id',
106+
width: '5%',
107+
align: 'center',
108+
render: MyAvatar,
109+
fixed: 'left',
110+
},
111+
]
112112
: []),
113113
{
114114
title: '',
@@ -141,16 +141,16 @@ const activityDetailColumns = (object, t_month) => [
141141
},
142142
...(object == 'repo'
143143
? [
144-
{
145-
title: t('insight_board'),
146-
dataIndex: 'name',
147-
align: 'center',
148-
width: '10%',
149-
render: function (text, row, index) {
150-
return dashboard(text, index, t_month);
144+
{
145+
title: t('insight_board'),
146+
dataIndex: 'name',
147+
align: 'center',
148+
width: '10%',
149+
render: function (text, row, index) {
150+
return dashboard(text, index, t_month);
151+
},
151152
},
152-
},
153-
]
153+
]
154154
: []),
155155
{
156156
title: t('activity'),
@@ -207,15 +207,15 @@ const open_rankColumns = (object, t_month) => [
207207
},
208208
...(object == 'actor'
209209
? [
210-
{
211-
title: t('avatar'),
212-
dataIndex: 'id',
213-
width: '5%',
214-
align: 'center',
215-
render: MyAvatar,
216-
fixed: 'left',
217-
},
218-
]
210+
{
211+
title: t('avatar'),
212+
dataIndex: 'id',
213+
width: '5%',
214+
align: 'center',
215+
render: MyAvatar,
216+
fixed: 'left',
217+
},
218+
]
219219
: []),
220220
{
221221
title: '',
@@ -248,16 +248,16 @@ const open_rankColumns = (object, t_month) => [
248248
},
249249
...(object == 'repo'
250250
? [
251-
{
252-
title: t('insight_board'),
253-
dataIndex: 'name',
254-
align: 'center',
255-
width: '10%',
256-
render: function (text, row, index) {
257-
return dashboard(text, index, t_month);
251+
{
252+
title: t('insight_board'),
253+
dataIndex: 'name',
254+
align: 'center',
255+
width: '10%',
256+
render: function (text, row, index) {
257+
return dashboard(text, index, t_month);
258+
},
258259
},
259-
},
260-
]
260+
]
261261
: []),
262262
{
263263
title: t('influence'),
@@ -278,19 +278,6 @@ const open_rankColumns = (object, t_month) => [
278278
return PointRender(text, row, index);
279279
},
280280
},
281-
...(object == 'region2'
282-
? [
283-
{
284-
title: t('participants'),
285-
dataIndex: 'name',
286-
align: 'center',
287-
width: '10%',
288-
render: function (text, row, index) {
289-
return dashboard(text, index, t_month);
290-
},
291-
},
292-
]
293-
: []),
294281
];
295282
const solveDate = (year, month) => {
296283
if (year === null && month === null) {
@@ -350,6 +337,7 @@ function MyTable(props) {
350337
year: null, // 字符串格式
351338
month: null, // 整数格式,0表示1月,1表示2月..., null for year type time
352339
type: 'month',
340+
source: 'all',
353341
search: null,
354342
});
355343

@@ -506,6 +494,7 @@ function MyTable(props) {
506494
month,
507495
year,
508496
type,
497+
source,
509498
} = state;
510499
return (
511500
<div className="table">
@@ -518,6 +507,7 @@ function MyTable(props) {
518507
}}
519508
>
520509
<TablePanel
510+
source={source}
521511
type={type}
522512
setState={updateDate}
523513
object={object}

src/locales/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"participants": "Participents",
1616
"loading": "Loading",
1717
"month": "Monthly",
18+
"source": "Source: ",
1819
"year": "Yearly",
1920
"rank": "Rank",
2021
"company": "Company",
@@ -100,4 +101,4 @@
100101
"XSOSIInsightBoard": "The XSOSI Insights Dashboard is used to present various indicators and data related to the XSOSI project. The dashboard displays basic metrics such as the number of participants, current phase, total number of organizations, and total number of projects. Additionally, it presents the latest OpenRank distribution chart for the project, individual OpenRank leaderboard, latest OpenRank leaderboard for the project, and monthly change chart of the overall OpenRank value for the project. Through the XSOSI Insights Dashboard, users can understand the ranking and allowances of contributors, the overall contribution of the project, and encourage more members to actively participate in the project, thus promoting the development and prosperity of open-source projects.",
101102
"OSPOInsightBoard": "The X-lab OSPO Insights Dashboard primarily showcases the activity of X-lab in the open-source domain. The dashboard not only provides basic metrics such as the activity level, new stars, and new issues in X-lab's GitHub open-source projects but also presents detailed data such as OpenDigger metrics breakdown and OpenRank comparisons. Additionally, the dashboard displays data from X-lab's knowledge base on Yuque and its publication record in the open-source field. Through the X-lab OSPO Insights Dashboard, users can gain a comprehensive understanding of X-lab's activity in the open-source domain, thereby promoting collaboration and development with the open-source community."
102103
}
103-
}
104+
}

src/locales/zh.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"region": "地区: ",
1515
"region2": "地区",
1616
"developer": "开发者",
17+
"source": "来源: ",
1718
"participants": "参与人数",
1819
"none": "",
1920
"loading": "加载中",
@@ -102,4 +103,4 @@
102103
"XSOSIInsightBoard": "XSOSI 洞察大屏",
103104
"OSPOInsightBoard": "X-lab OSPO 大屏"
104105
}
105-
}
106+
}

0 commit comments

Comments
 (0)