-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from COS301-SE-2024/develop
Develop deployment
- Loading branch information
Showing
36 changed files
with
895 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: Cypress E2E Tests | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
branches: [ main , develop] | ||
|
||
jobs: | ||
e2e-tests: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const nextConfig = { | ||
compiler: { | ||
// Remove all console logs | ||
removeConsole: true | ||
} | ||
}; | ||
|
||
export default nextConfig; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
CoVAR-app/src/app/(pages)/dashboard/components/InviteList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'use client'; | ||
import React, { useEffect, useState } from 'react'; | ||
import { Paper, Typography, Box, CircularProgress, List, ListItem, ListItemText } from '@mui/material'; | ||
import { fetchAllInvites } from '@/functions/requests'; | ||
|
||
type Invite = { | ||
invite_id: string; | ||
username: string; | ||
organization_name: string; | ||
invite_status: string; | ||
}; | ||
|
||
const InviteList: React.FC = () => { | ||
const [invites, setInvites] = useState<Invite[]>([]); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
const loadInvites = async () => { | ||
try { | ||
const token = localStorage.getItem('accessToken'); | ||
const allInvites = await fetchAllInvites(token as string); | ||
const pendingInvites = allInvites.filter((invite: Invite) => invite.invite_status === 'pending'); // Filter pending invites | ||
setInvites(pendingInvites); | ||
setLoading(false); | ||
} catch (error) { | ||
console.error('Error fetching invites:', error); | ||
setLoading(false); | ||
} | ||
}; | ||
|
||
loadInvites(); | ||
}, []); | ||
|
||
return ( | ||
<Box sx={{ padding: 2 }}> | ||
<Typography variant="h6" color="text.primary">Pending Invites</Typography> | ||
{loading ? ( | ||
<CircularProgress /> | ||
) : invites.length === 0 ? ( | ||
<Typography>No pending invites at the moment.</Typography> | ||
) : ( | ||
<List | ||
sx={{ | ||
maxHeight: '300px', // Adjust maxHeight as needed | ||
overflowY: 'auto', // Enable vertical scroll when needed | ||
'&::-webkit-scrollbar': { | ||
width: '0.2vw', | ||
}, | ||
'&::-webkit-scrollbar-thumb': { | ||
backgroundColor: 'gray', | ||
borderRadius: '0.4vw', | ||
}, | ||
'&::-webkit-scrollbar-track': { | ||
backgroundColor: 'transparent', | ||
}, | ||
scrollbarWidth: 'thin', | ||
scrollbarColor: 'gray transparent', | ||
}} | ||
> | ||
{invites.map((invite) => ( | ||
<ListItem key={invite.invite_id}> | ||
<ListItemText | ||
primary={`${invite.username} - ${invite.organization_name}`} | ||
secondary={`Status: ${invite.invite_status}`} | ||
/> | ||
</ListItem> | ||
))} | ||
</List> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default InviteList; |
Oops, something went wrong.