Skip to content

Commit

Permalink
Merge branch 'dev' into post-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
boynextdoor-cze authored Mar 17, 2024
2 parents 66c6acf + 4ff6389 commit 00ec3eb
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/Components/DataPoints/DataPoints.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export async function loader() {
programs = Object.values(programs).flat().filter(program => program.Applicants.length > 0);
const recordIDs = programs.map(program => program.Applicants.map(applicant => applicant + "|" + program.ProgramID)).flat();
let records = Object.values(await getRecordByRecordIDs(recordIDs));
programs = programs.map(program => program.ProgramID);
const programIDs = programs.map(program => program.ProgramID);
records = records.sort((a, b) => {
return programs.indexOf(a.ProgramID) - programs.indexOf(b.ProgramID);
return programIDs.indexOf(a.ProgramID) - programIDs.indexOf(b.ProgramID);
});
return {records};
}
Expand Down
3 changes: 2 additions & 1 deletion src/Components/HowToUse/HowToUse.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import applicant from "../../Assets/imgs/applicant.png";
import newApplicant from "../../Assets/imgs/new-applicant.png";

Check warning on line 13 in src/Components/HowToUse/HowToUse.jsx

View workflow job for this annotation

GitHub Actions / qodana

Unused import

Unused import newApplicant from "../../Assets/imgs/new-applicant.png";
import record from "../../Assets/imgs/record.png";

Check warning on line 14 in src/Components/HowToUse/HowToUse.jsx

View workflow job for this annotation

GitHub Actions / qodana

Unused import

Unused import record from "../../Assets/imgs/record.png";
import program from "../../Assets/imgs/program.png";

Check warning on line 15 in src/Components/HowToUse/HowToUse.jsx

View workflow job for this annotation

GitHub Actions / qodana

Unused import

Unused import program from "../../Assets/imgs/program.png";
import {Link, useLoaderData} from "react-router-dom";
import {Link, useLoaderData, useNavigate} from "react-router-dom";
import {Link as MuiLink} from '@mui/material';
import PersonOutlineIcon from "@mui/icons-material/PersonOutline";
import Grid2 from "@mui/material/Unstable_Grid2";
Expand Down Expand Up @@ -67,6 +67,7 @@ export function GuidanceGrid({Index, TitlePrime, TitleSecond, Content, ButtonLin
function Graduated({loaderData}) {
const applicantIDs = loaderData.metaData.ApplicantIDs;
const [open, setOpen] = useState(false);
const navigate = useNavigate();

Check warning on line 70 in src/Components/HowToUse/HowToUse.jsx

View workflow job for this annotation

GitHub Actions / qodana

Unused local symbol

Unused constant navigate
return (
<Box sx={{display: 'flex', flexDirection: 'column', gap: "2rem", m: '2rem'}}>
<BoldTypography variant="h5">我来这个网站应该干什么?</BoldTypography>
Expand Down
16 changes: 16 additions & 0 deletions src/Components/Modify/Program/AddModifyProgram.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@ export default function AddModifyProgram({type}) {
name="Degree"
label="项目学位"
variant="standard"
InputProps={{
...params.InputProps,
endAdornment: (
<>
{params.InputProps.endAdornment}
<Tooltip

Check notice on line 132 in src/Components/Modify/Program/AddModifyProgram.jsx

View workflow job for this annotation

GitHub Actions / qodana

Unresolved JSX component

Unresolved component Tooltip
title='只填写项目最终学位,但若涉及中间学位授予,请在项目介绍中说明'
arrow
enterTouchDelay={0}
leaveTouchDelay={4000}
>
<HelpOutline/>

Check notice on line 138 in src/Components/Modify/Program/AddModifyProgram.jsx

View workflow job for this annotation

GitHub Actions / qodana

Unresolved JSX component

Unresolved component HelpOutline
</Tooltip>
</>
),
}}
required
/>
}
Expand Down
10 changes: 5 additions & 5 deletions src/Components/Modify/Record/AddModifyRecord.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function action({request}) {
'Semester': semester,
'Status': status,
'TimeLine': {
'Submit': submit,
'Submit': submit.length > 0 ? submit : null,
'Interview': interview.length > 0 ? interview : null,
'Decision': decision.length > 0 ? decision : null,
},
Expand Down Expand Up @@ -274,8 +274,8 @@ export default function AddModifyRecord({type}) {
label="提交申请时间"
name='Submit'
format='YYYY-MM-DD'
slotProps={ { textField: {size: 'small', fullWidth: true, required: true} }}
defaultValue={record ? dayjs(record.TimeLine.Submit.split('T')[0]) : null}
slotProps={ { textField: {size: 'small', fullWidth: true} }}
defaultValue={record ? (record.TimeLine.Submit ? dayjs(record.TimeLine.Submit.split('T')[0]) : null) : null}
/>
</DemoContainer>
</LocalizationProvider>
Expand All @@ -288,7 +288,7 @@ export default function AddModifyRecord({type}) {
name='Interview'
format='YYYY-MM-DD'
slotProps={ { textField: {size: 'small', fullWidth: true} }}
defaultValue={record ? record.TimeLine.Interview ? dayjs(record.TimeLine.Interview.split('T')[0]) : null : null}
defaultValue={record ? (record.TimeLine.Interview ? dayjs(record.TimeLine.Interview.split('T')[0]) : null) : null}
/>
</DemoContainer>
</LocalizationProvider>
Expand All @@ -301,7 +301,7 @@ export default function AddModifyRecord({type}) {
name='Decision'
format='YYYY-MM-DD'
slotProps={ { textField: {size: 'small', fullWidth: true} }}
defaultValue={record ? record.TimeLine.Decision ? dayjs(record.TimeLine.Decision.split('T')[0]) : null : null}
defaultValue={record ? (record.TimeLine.Decision ? dayjs(record.TimeLine.Decision.split('T')[0]) : null) : null}
/>
</DemoContainer>
</LocalizationProvider>
Expand Down
59 changes: 37 additions & 22 deletions src/Components/Profile/ProfileApplicant/ProfileApplicantPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,32 +343,47 @@ function BasicInfoBlock({avatarUrl, contact, applicant, records, editable}) {
editable={editable && isAuth}/>
</ContentCenteredGrid>
</Grid2>
<ContentCenteredGrid xs={12}>
<ContentCenteredGrid xs={12} sx={{gap: Object.entries(contact).length ? 0 : '1rem'}}>
<BoldTypography variant="subtitle1">
联系方式:
</BoldTypography>
<ButtonGroup>
{Object.entries(contact).length ? Object.entries(contact).map(([key, value]) => {
const Icon = contactIcons[key];
if (value === "") {
return null;
}
return (
<Tooltip title={key} key={key} arrow>
<IconButton
onClick={async () => {
await navigator.clipboard.writeText(value)
alert(`已复制${value}到剪贴板!`)
}}
>
{["QQ", "WeChat"].includes(key) ? <FontAwesomeIcon icon={Icon} fontSize='medium'/> :
<Icon/>}
</IconButton>
</Tooltip>
)
}) : "暂无"}
</ButtonGroup>
{Object.entries(contact).length ?
<ButtonGroup>
{Object.entries(contact).map(([key, value]) => {
const Icon = contactIcons[key];
if (value === "") {
return null;
}
return (
<Tooltip title={key} key={key} arrow>
<IconButton
onClick={async () => {
await navigator.clipboard.writeText(value)
alert(`已复制${value}到剪贴板!`)
}}
>
{["QQ", "WeChat"].includes(key) ?
<FontAwesomeIcon icon={Icon} fontSize='medium'/> :
<Icon/>}
</IconButton>
</Tooltip>
)
})}
</ButtonGroup> : "暂无"}
</ContentCenteredGrid>
{/*<ContentCenteredGrid xs={12} sx={{gap: '1rem'}}>*/}
{/* <Typography variant="subtitle1" sx={{fontWeight: 'bold'}}>*/}
{/* 申请材料:*/}
{/* </Typography>*/}
{/* <ButtonGroup>*/}
{/* <Button endIcon={<Download/>} size='small'>*/}
{/* CV*/}
{/* </Button>*/}
{/* <Button endIcon={<Download/>} size='small'>*/}
{/* SoP/PS*/}
{/* </Button>*/}
{/* </ButtonGroup>*/}
{/*</ContentCenteredGrid>*/}
<ContentCenteredGrid xs={12} sx={{gap: '1rem'}}>
<BoldTypography variant="subtitle1">
申请材料:
Expand Down

0 comments on commit 00ec3eb

Please sign in to comment.