Merge pull request #71 from CPSC319-Winter-term-2/home
bug fix for Schedule Meetings and Call Group
This commit is contained in:
commit
0044435a11
@ -4,6 +4,7 @@ import {
|
||||
Dialog,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
DialogTitle,
|
||||
FormControlLabel,
|
||||
FormGroup,
|
||||
@ -33,6 +34,7 @@ const CallFavouritesDialog: React.FC<Props> = ({
|
||||
const [group, setGroup] = useState<string>("Favorites");
|
||||
const [inputText, setInputText] = useState<string>("");
|
||||
const [checkedUuids, setCheckedUuids] = useState<string[]>([]);
|
||||
const [urlDialog, seturlDialog] = useState({ open: false, url: "" });
|
||||
|
||||
const handleCheck = (uuid: string, checked: boolean) => {
|
||||
if (checked) {
|
||||
@ -58,8 +60,11 @@ const CallFavouritesDialog: React.FC<Props> = ({
|
||||
const auth = useAuth();
|
||||
|
||||
const handleCall = async(e: React.SyntheticEvent) => {
|
||||
const start = new Date().toISOString();
|
||||
let newStart = start.split('.')[0];
|
||||
newStart += start.includes("Z") ? "Z" : "";
|
||||
const newMeeting: NewMeeting ={
|
||||
startTime: new Date().toISOString(),
|
||||
startTime: newStart,
|
||||
duration: 60,
|
||||
topic: "Quick Call to Group",
|
||||
registrantIds: checkedUuids
|
||||
@ -70,10 +75,12 @@ const CallFavouritesDialog: React.FC<Props> = ({
|
||||
);
|
||||
const meeting: DetailedMeeting = response?.data;
|
||||
console.log("create meeting response: " + meeting.startTime + ":" + meeting.duration);
|
||||
seturlDialog({ open: true, url: meeting.joinUrl });
|
||||
handleClose();
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog onClose={handleClose} open={open} fullWidth maxWidth="sm">
|
||||
<DialogTitle>Select who to call:</DialogTitle>
|
||||
<DialogContent>
|
||||
@ -127,6 +134,18 @@ const CallFavouritesDialog: React.FC<Props> = ({
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
<Dialog
|
||||
open={urlDialog.open}
|
||||
onClose={() => {
|
||||
seturlDialog({ open: false, url: "" });
|
||||
}}
|
||||
>
|
||||
<DialogTitle>Join</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText>{urlDialog.url}</DialogContentText>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import {
|
||||
Dialog,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
DialogTitle,
|
||||
FormControlLabel,
|
||||
FormGroup,
|
||||
@ -28,7 +29,7 @@ import {
|
||||
handleClose: () => void;
|
||||
}
|
||||
|
||||
const CallFavouritesDialog: React.FC<Props> = ({
|
||||
const CallScheduledMeetingDialog: React.FC<Props> = ({
|
||||
open,
|
||||
handleClose,
|
||||
}: Props) => {
|
||||
@ -39,6 +40,7 @@ import {
|
||||
const [group, setGroup] = useState<string>("Favorites");
|
||||
const [inputText, setInputText] = useState<string>("");
|
||||
const [checkedUuids, setCheckedUuids] = useState<string[]>([]);
|
||||
const [urlDialog, seturlDialog] = useState({ open: false, url: "" });
|
||||
|
||||
const handleCheck = (uuid: string, checked: boolean) => {
|
||||
if (checked) {
|
||||
@ -69,8 +71,11 @@ import {
|
||||
const auth = useAuth();
|
||||
|
||||
const handleCall = async(e: React.SyntheticEvent) => {
|
||||
const start = meetingStartDate ? meetingStartDate.toISOString() : new Date().toISOString();
|
||||
let newStart = start.split('.')[0];
|
||||
newStart += start.includes("Z") ? "Z" : "";
|
||||
const newMeeting: NewMeeting ={
|
||||
startTime: meetingStartDate ? meetingStartDate.toISOString() : new Date().toISOString(),
|
||||
startTime: newStart,
|
||||
duration: meetingDuration,
|
||||
topic: meetingTopic,
|
||||
registrantIds: checkedUuids
|
||||
@ -81,10 +86,12 @@ import {
|
||||
);
|
||||
const meeting: DetailedMeeting = response?.data;
|
||||
console.log("create meeting response: " + meeting.startTime + ":" + meeting.duration);
|
||||
seturlDialog({ open: true, url: meeting.joinUrl });
|
||||
handleClose();
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Dialog onClose={handleClose} open={open} fullWidth maxWidth="sm">
|
||||
<DialogTitle>Schedule A Meeting</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
@ -172,7 +179,19 @@ import {
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
<Dialog
|
||||
open={urlDialog.open}
|
||||
onClose={() => {
|
||||
seturlDialog({ open: false, url: "" });
|
||||
}}
|
||||
>
|
||||
<DialogTitle>Join</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText>{urlDialog.url}</DialogContentText>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default CallFavouritesDialog;
|
||||
export default CallScheduledMeetingDialog;
|
||||
Reference in New Issue
Block a user