Skip to content

Commit bcc40c9

Browse files
authored
Merge pull request #104 from OpenSIST/dev
Optimize datapoints table and prepare for posts
2 parents 8ad1769 + bb261f9 commit bcc40c9

33 files changed

Lines changed: 1720 additions & 569 deletions

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
"@testing-library/react": "13.4.0",
2121
"@testing-library/user-event": "13.5.0",
2222
"ajv": "6.12.6",
23+
"antd": "^5.26.3",
2324
"babel-plugin-macros": "3.1.0",
2425
"buffer": "6.0.3",
2526
"cm6-theme-basic-dark": "0.2.0",
2627
"d3": "^7.9.0",
2728
"dayjs": "1.11.10",
2829
"localforage": "1.10.0",
30+
"lodash": "^4.17.21",
2931
"match-sorter": "6.3.1",
3032
"postal-mime": "2.0.2",
3133
"primereact": "10.5.1",
@@ -36,6 +38,7 @@
3638
"react-draggable": "4.4.6",
3739
"react-hook-form": "7.50.1",
3840
"react-markdown": "9.0.1",
41+
"react-quill": "^2.0.0",
3942
"react-router-dom": "6.21.1",
4043
"react-scripts": "5.0.1",
4144
"react-select": "5.8.0",

public/TableDark.css

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@
10821082
overflow: hidden;
10831083
display: flex;
10841084
align-items: center;
1085+
border-bottom: 1px solid #2a2a2a;
10851086
}
10861087

10871088
.p-dropdown-item-group {
@@ -9421,16 +9422,52 @@
94219422

94229423
.p-rowgroup-header {
94239424
background-color: #3b3b3b;
9425+
border-bottom: 1px solid #2a2a2a;
94249426
}
94259427

94269428
.p-datatable-thead > tr > th {
94279429
background: #313131;
94289430
}
94299431

94309432
.p-datatable-header {
9431-
background-color: #313131;
9433+
background-color: #2b2b2b;
94329434
}
94339435

94349436
.p-dropdown-item:hover {
9435-
background-color: #3d3d3d;
9436-
}
9437+
background-color: #2f3033;
9438+
}
9439+
9440+
.chip-plain {
9441+
color: white;
9442+
background-color: #414041;
9443+
}
9444+
9445+
.chip-status-admit-green {
9446+
color: white;
9447+
background-color: #5cc754;
9448+
}
9449+
9450+
.chip-status-reject-red {
9451+
color: white;
9452+
background-color: #e54757;
9453+
}
9454+
9455+
.chip-status-waitlist-grey {
9456+
color: white;
9457+
background-color: #414041;
9458+
}
9459+
9460+
.chip-status-defer-orange {
9461+
color: white;
9462+
background-color: #ec9727;
9463+
}
9464+
9465+
.chip-semester-fall-orange {
9466+
color: white;
9467+
background-color: #eb7f2b;
9468+
}
9469+
9470+
.chip-semester-spring-cyan {
9471+
color: white;
9472+
background-color: #51b991;
9473+
}

public/TableLight.css

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@
10821082
overflow: hidden;
10831083
display: flex;
10841084
align-items: center;
1085+
border-bottom: 1px solid #e0e0e0;
10851086
}
10861087

10871088
.p-dropdown-item-group {
@@ -9421,16 +9422,53 @@
94219422

94229423
.p-rowgroup-header {
94239424
background-color: #f1f0f0;
9425+
border-bottom: 1px solid #e0e0e0;
94249426
}
94259427

94269428
.p-datatable-thead > tr > th {
94279429
background: #e3e3e3;
94289430
}
94299431

94309432
.p-datatable-header {
9431-
background-color: #efefef;
9433+
background-color: #dfdfdf;
94329434
}
94339435

94349436
.p-dropdown-item:hover {
9435-
background-color: #999999;
9436-
}
9437+
background-color: #efefef;
9438+
}
9439+
9440+
/* Color for self-made Chips */
9441+
.chip-plain {
9442+
color: black;
9443+
background-color: #ebebeb;
9444+
}
9445+
9446+
.chip-status-admit-green {
9447+
color: white;
9448+
background-color: #59bc54;
9449+
}
9450+
9451+
.chip-status-reject-red {
9452+
color: white;
9453+
background-color: #e5414e;
9454+
}
9455+
9456+
.chip-status-waitlist-grey {
9457+
color: black;
9458+
background-color: #eaeaea;
9459+
}
9460+
9461+
.chip-status-defer-orange {
9462+
color: white;
9463+
background-color: #eb9223;
9464+
}
9465+
9466+
.chip-semester-fall-orange {
9467+
color: white;
9468+
background-color: #eb7f2b;
9469+
}
9470+
9471+
.chip-semester-spring-cyan {
9472+
color: white;
9473+
background-color: #51b991;
9474+
}

src/APIs/APIs.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,21 @@ export const GET_METADATA = ROOT + "api/user/get_metadata";
2828
export const GET_AVATAR = ROOT + "api/user/get_avatar";
2929
export const TOGGLE_NICKNAME = ROOT + "api/my/toggle_nickname";
3030
export const UPDATE_CONTACT = ROOT + "api/user/update_contact";
31-
export const POST_LIST = ROOT + "api/list/posts";
32-
export const GET_POST_CONTENT = ROOT + "api/query/post_content";
33-
export const REMOVE_POST = ROOT + "api/mutating/remove_post";
34-
export const ADD_POST = ROOT + "api/mutating/new_post";
35-
export const MODIFY_POST = ROOT + "api/mutating/modify_post";
31+
32+
export const FILE_LIST = ROOT + "api/list/files";
33+
export const GET_FILE_CONTENT = ROOT + "api/query/file_content";
34+
export const REMOVE_FILE = ROOT + "api/mutating/remove_file";
35+
export const ADD_FILE = ROOT + "api/mutating/new_file";
36+
export const MODIFY_FILE = ROOT + "api/mutating/modify_file";
37+
3638
export const COLLECT_PROGRAM = ROOT + "api/user/collect_program";
37-
export const UNCOLLECT_PROGRAM = ROOT + "api/user/un_collect_program";
39+
export const UNCOLLECT_PROGRAM = ROOT + "api/user/un_collect_program";
40+
41+
// --- New Post/Comment API Endpoints ---
42+
export const CREATE_POST_API = ROOT + "api/post/create_post";
43+
export const CREATE_COMMENT_API = ROOT + "api/post/create_comment";
44+
export const MODIFY_CONTENT_API = ROOT + "api/post/modify_content";
45+
export const TOGGLE_LIKE_API = ROOT + "api/post/toggle_like";
46+
export const LIST_POSTS_API = ROOT + "api/post/list_posts";
47+
export const GET_CONTENT_API = ROOT + "api/post/get_content";
48+
export const DELETE_CONTENT_API = ROOT + "api/post/delete_content";

src/Components/AboutUs/AboutUs.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function AboutUs() {
1515
id: 'cze',
1616
name: '迟择恩 - 前端开发',
1717
major: '2020级CS本科生',
18-
hyperlink: 'https://www.harrychi.com'
18+
hyperlink: 'https://www.linkedin.com/in/zeen-chi-230333238/'
1919
},
2020
{
2121
id: 'lbn',
@@ -27,13 +27,13 @@ export function AboutUs() {
2727
id: 'cst',
2828
name: '陈溯汀 - 后端开发',
2929
major: '2020级CS本科生',
30-
hyperlink: 'https://github.com/caoster'
30+
hyperlink: 'https://sutingchen.dev'
3131
},
3232
{
3333
id: 'frm',
3434
name: '范润铭 - 设计师',
3535
major: '2021级创艺本科生',
36-
hyperlink: 'https://github.com/Fan-runming'
36+
hyperlink: 'https://eva.fan'
3737
},
3838
{
3939
id: 'zbm',

src/Components/DataPoints/DataPoints.css

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.DataPointsContent {
22
width: 100%;
3-
margin: 10px;
3+
margin-top: 10px;
44
overflow-x: auto;
55
user-select: text;
66
height: calc(100% - 20px);
@@ -9,6 +9,106 @@
99
position: relative;
1010
}
1111

12+
/* 数据网格容器样式 */
13+
.data-grid-container {
14+
display: flex;
15+
flex-direction: column;
16+
position: relative;
17+
width: 100%;
18+
height: 100%;
19+
}
20+
21+
.filter-container-wrapper {
22+
padding: 8px;
23+
}
24+
25+
/* 优化每个过滤器元素的宽度和样式 */
26+
.filter-container > .MuiTextField-root,
27+
.filter-container > .MuiFormControl-root {
28+
min-width: 160px;
29+
flex: 1;
30+
margin: 0;
31+
}
32+
33+
.filter-container .MuiOutlinedInput-root {
34+
border-radius: 8px;
35+
transition: all 0.2s ease;
36+
}
37+
38+
.filter-container .MuiOutlinedInput-root:hover {
39+
background-color: rgba(128, 128, 128, 0.05);
40+
}
41+
42+
/* 搜索结果指示器 */
43+
.search-results-indicator {
44+
background-color: rgba(128, 128, 128, 0.08);
45+
padding: 6px 16px;
46+
border-radius: 8px;
47+
margin: 6px;
48+
display: flex;
49+
align-items: center;
50+
justify-content: center;
51+
animation: fadeIn 0.3s ease;
52+
}
53+
54+
/* 响应式布局 */
55+
@media (max-width: 1024px) {
56+
.filter-container {
57+
gap: 12px;
58+
}
59+
60+
.filter-container > .MuiTextField-root,
61+
.filter-container > .MuiFormControl-root {
62+
min-width: 140px;
63+
}
64+
}
65+
66+
@media (max-width: 768px) {
67+
.DataPointsContent {
68+
margin: 5px;
69+
height: calc(100% - 10px);
70+
}
71+
72+
.filter-container {
73+
flex-direction: column;
74+
align-items: stretch;
75+
gap: 10px;
76+
}
77+
78+
.filter-container > * {
79+
width: 100% !important;
80+
min-width: unset !important;
81+
}
82+
83+
.advanced-search-filter.expanded {
84+
max-height: 400px !important;
85+
overflow-y: auto;
86+
}
87+
88+
/* Mobile styles for the usage guidance component */
89+
.MuiPaper-root ol {
90+
padding-left: 16px;
91+
font-size: 14px;
92+
margin-bottom: 0;
93+
}
94+
95+
.MuiPaper-root li {
96+
margin-bottom: 8px;
97+
}
98+
99+
/* Smaller margins for mobile usage guidance panel */
100+
.MuiBox-root .MuiPaper-root {
101+
margin: 0 !important;
102+
max-width: 100%;
103+
overflow-y: auto;
104+
}
105+
106+
/* Ensure floating action buttons don't overlap important content */
107+
form .MuiFab-root {
108+
z-index: 1060 !important; /* Match the z-index with the close button */
109+
}
110+
}
111+
12112
.DataTableStyle {
13113
display: flex;
14114
flex-direction: column;
@@ -18,6 +118,11 @@
18118
overflow-x: auto;
19119
}
20120

121+
/* 专门为项目页面内的表格添加样式 */
122+
.p-datatable-wrapper {
123+
overflow: auto;
124+
}
125+
21126
.DataTableStyle * {
22127
transition: none;
23128
}
@@ -133,4 +238,29 @@
133238

134239
.p-dropdown-panel .p-dropdown-items .p-dropdown-item {
135240
padding: 5px 1rem 5px 1rem;
136-
}
241+
}
242+
243+
.group-header {
244+
height: 40px;
245+
padding-top: 10px;
246+
}
247+
248+
@media (max-width: 1024px) {
249+
.group-header {
250+
height: 25px;
251+
padding-top: 6px;
252+
}
253+
}
254+
255+
.refresh-button {
256+
position: fixed;
257+
z-index: 20;
258+
bottom: 40px;
259+
right: 20px;
260+
}
261+
262+
@media (max-width: 768px) {
263+
bottom: 20px;
264+
right: 16px;
265+
transform: scale(0.9);
266+
}

0 commit comments

Comments
 (0)