Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,980 changes: 1,107 additions & 5,873 deletions client/package-lock.json

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"format": "prettier --write ./**/**/*.{tsx,css,ts,md} --config ./.prettierrc"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/icons-material": "^5.15.8",
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5.15.19",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mui/icons-material": "^7.3.7",
"@mui/lab": "^7.0.1-beta.21",
"@mui/material": "^7.3.7",
"@mui/x-charts": "^7.6.1",
"@mui/x-date-pickers": "^7.6.1",
"@react-oauth/google": "^0.12.1",
Expand All @@ -27,8 +27,8 @@
"axios": "^1.6.7",
"dayjs": "^1.11.11",
"prettier": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-icons": "^5.0.1",
"react-markdown": "^10.1.0",
"react-router-dom": "^6.22.0",
Expand All @@ -39,8 +39,8 @@
"@eslint/js": "^9.30.1",
"@tanstack/eslint-plugin-query": "^5.91.4",
"@types/node": "^20.19.9",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@types/react": "^19.2.10",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^4.6.0",
"eslint": "^9.30.1",
"eslint-plugin-react-hooks": "^5.2.0",
Expand All @@ -49,5 +49,6 @@
"typescript": "~5.8.3",
"typescript-eslint": "^8.35.1",
"vite": "^7.0.4"
}
},
"overrides": {}
}
13 changes: 7 additions & 6 deletions client/src/features/dashboard/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ const DashboardPage = () => {
}

if (isError && error instanceof Error) {
<Box width="50%" margin="auto" marginTop="2rem">
return <ErrorBox errorMessage={error.message} />;
</Box>;
return <ErrorBox errorMessage={error.message} />;
return (
<Box width="50%" margin="auto" marginTop="2rem">
<ErrorBox errorMessage={error.message} />;
</Box>
);
}

return (
<Container fixed>
<Container fixed sx={{ bgcolor: 'background.default', minHeight: '100vh' }}>
<Box my={3} display="flex" alignItems="start" justifyContent="start" p={2}>
<Stack direction="row" spacing={3}>
<LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale="nl">
Expand All @@ -56,7 +57,7 @@ const DashboardPage = () => {
</Button>
</Stack>
</Box>
{data && <DashboardPieChart chartData={data}></DashboardPieChart>}
{data && <DashboardPieChart chartData={data} />}
</Container>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const DashboardPieChart = ({ chartData }: DashboardPieChartProps) => {
<PieChart
series={[
{
arcLabel: (item) => `${item.percent}%`,
arcLabel: (item) => `${(item as unknown as ChartData).percent}%`,
arcLabelMinAngle: 45,
data: pie as MakeOptional<PieValueType, 'id'>[],
},
Expand Down
37 changes: 30 additions & 7 deletions client/src/features/search/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,42 @@ const SearchPage = () => {
}, []);

return (
<div className="App">
<div className="search-bar-container">
<Box sx={{ display: 'flex' }}>
<img src={HYFLogo} alt="HYF logo" className="hyf-logo-img" />
</Box>
<Box
sx={{
minHeight: '100vh',
bgcolor: 'background.default',
color: '#333',
}}
>
<Box
sx={{
paddingTop: '20vh',
minWidth: '200px',
width: '40%',
margin: 'auto',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Box
component="img"
src={HYFLogo}
alt="HYF logo"
sx={{
height: '70px',
padding: '10px',
marginBottom: '50px',
}}
/>
<SearchBar onTextChange={handleTextChange} />
{isError && error instanceof Error ? (
<ErrorBox errorMessage={error.message} />
) : (
searchString && <SearchResultsList isLoading={isLoading} data={data || []} />
)}
</div>
</div>
</Box>
</Box>
);
};

Expand Down
17 changes: 11 additions & 6 deletions client/src/features/search/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,22 @@ const SearchBar = ({ onTextChange }: SearchBarProps) => {
<Box sx={{ display: 'flex', width: 1 }}>
<TextField
variant="outlined"
sx={{
backgroundColor: 'background.dark',
}}
placeholder="Search trainee..."
fullWidth
autoFocus
autoComplete="off"
onChange={(e) => handleChange(e.target.value)}
InputProps={{
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
</InputAdornment>
),
slotProps={{
input: {
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
</InputAdornment>
),
},
}}
/>
</Box>
Expand Down
8 changes: 6 additions & 2 deletions client/src/features/search/components/SearchResultsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ const SearchResultsList = ({ isLoading, data }: SearchResultsListProps) => {
to={trainee.profilePath}
style={{
textDecoration: 'none',
color: 'inherit',
width: '100%',
}}
>
<ListItemButton key={trainee.id}>
<ListItemButton
key={trainee.id}
sx={{
color: 'text.primary',
}}
>
<ListItemIcon>
<Avatar src={trainee.thumbnail ?? ''} sx={{ width: 32, height: 32 }} variant="rounded"></Avatar>
</ListItemIcon>
Expand Down
158 changes: 86 additions & 72 deletions client/src/features/trainee-profile/contact/ContactInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,22 @@ const ContactInfo = () => {
label="Email"
type="email"
value={editedFields.email || ''}
InputProps={{
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.email && (
<Link href={'mailto:' + editedFields.email}>
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
}}
InputLabelProps={{
shrink: true,
slotProps={{
input: {
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.email && (
<Link href={'mailto:' + editedFields.email}>
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
},
inputLabel: {
shrink: true,
},
}}
variant={isEditing ? 'outlined' : 'standard'}
onChange={handleTextChange}
Expand Down Expand Up @@ -94,20 +96,22 @@ const ContactInfo = () => {
type="text"
placeholder="Format: UXXXXXXXXXX"
value={editedFields.slackId || ''}
InputProps={{
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.slackId && (
<Link href={`slack://user?team=T0EJTUQ87&id=${editedFields.slackId}`}>
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
}}
InputLabelProps={{
shrink: true,
slotProps={{
input: {
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.slackId && (
<Link href={`slack://user?team=T0EJTUQ87&id=${editedFields.slackId}`}>
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
},
inputLabel: {
shrink: true,
},
}}
variant={isEditing ? 'outlined' : 'standard'}
onChange={handleTextChange}
Expand Down Expand Up @@ -139,11 +143,13 @@ const ContactInfo = () => {
label="Phone"
type="tel"
value={editedFields.phone || ''}
InputProps={{
readOnly: isEditing ? false : true,
}}
InputLabelProps={{
shrink: true,
slotProps={{
input: {
readOnly: isEditing ? false : true,
},
inputLabel: {
shrink: true,
},
}}
variant={isEditing ? 'outlined' : 'standard'}
onChange={handleTextChange}
Expand Down Expand Up @@ -173,20 +179,22 @@ const ContactInfo = () => {
label="Github Handle"
type="text"
value={editedFields.githubHandle || ''}
InputProps={{
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.githubHandle && (
<Link href={'https://github.com/' + editedFields.githubHandle} target="_blank">
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
}}
InputLabelProps={{
shrink: true,
slotProps={{
input: {
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.githubHandle && (
<Link href={'https://github.com/' + editedFields.githubHandle} target="_blank">
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
},
inputLabel: {
shrink: true,
},
}}
variant={isEditing ? 'outlined' : 'standard'}
onChange={handleTextChange}
Expand Down Expand Up @@ -219,28 +227,30 @@ const ContactInfo = () => {
label="Linkedin"
type="url"
value={editedFields.linkedin || ''}
InputProps={{
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.linkedin && (
<Link href={editedFields.linkedin} target="_blank">
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
}}
InputLabelProps={{
shrink: true,
slotProps={{
input: {
readOnly: isEditing ? false : true,
endAdornment: (
<InputAdornment position="start">
{!isEditing && editedFields.linkedin && (
<Link href={editedFields.linkedin} target="_blank">
<LinkIcon sx={{ color: 'action.active' }} />
</Link>
)}
</InputAdornment>
),
},
inputLabel: {
shrink: true,
},
}}
variant={isEditing ? 'outlined' : 'standard'}
onChange={handleTextChange}
/>
</FormControl>
</Box>

<Typography variant="h6" color="black" padding="5px" width="100%">
<Typography variant="h6" padding="5px" width="100%">
Emergency contact
</Typography>

Expand Down Expand Up @@ -268,11 +278,13 @@ const ContactInfo = () => {
label="Emergency Contact"
type="text"
value={editedFields.emergencyContactName || ''}
InputProps={{
readOnly: isEditing ? false : true,
}}
InputLabelProps={{
shrink: true,
slotProps={{
input: {
readOnly: isEditing ? false : true,
},
inputLabel: {
shrink: true,
},
}}
variant={isEditing ? 'outlined' : 'standard'}
onChange={handleTextChange}
Expand Down Expand Up @@ -304,11 +316,13 @@ const ContactInfo = () => {
label="Emergency Contact Phone Number"
type="tel"
value={editedFields.emergencyContactPhoneNum || ''}
InputProps={{
readOnly: isEditing ? false : true,
}}
InputLabelProps={{
shrink: true,
slotProps={{
input: {
readOnly: isEditing ? false : true,
},
inputLabel: {
shrink: true,
},
}}
variant={isEditing ? 'outlined' : 'standard'}
onChange={handleTextChange}
Expand Down
Loading