q works now for creating a insta room

This commit is contained in:
Arjun Patel
2022-01-21 22:54:09 -08:00
parent a897c7a9b4
commit 892d3f7dd4
2 changed files with 230 additions and 204 deletions
-3
View File
@@ -376,9 +376,6 @@ export default function DashboardRoom() {
title={"Press q to create an instant room if you have GSuite."} title={"Press q to create an instant room if you have GSuite."}
> >
<button <button
onClick={() =>
window.open("https://meet.google.com/new", "_blank")
}
className="right-1 rounded-lg py-1 px-2 ml-1 className="right-1 rounded-lg py-1 px-2 ml-1
shadow-md text-center text-white text-sm font-bold" shadow-md text-center text-white text-sm font-bold"
> >
+39 -10
View File
@@ -99,7 +99,6 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
if (hasGSuite) { if (hasGSuite) {
// create google meet link based on the room name without spaces // create google meet link based on the room name without spaces
var slugName = var slugName =
user.firstName + user.firstName +
"-" + "-" +
@@ -252,18 +251,46 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
); );
}; };
function createRoomNow() { async function createRoomNow() {
console.log("creating room"); console.log("creating room");
// reset form for the right values to be in there // reset form for the right values to be in there
// resetForm(); resetForm();
// handleGetAutoGSuiteLink();
// submit form // submit form
// handleSubmit().then(() => { // handleSubmit().then((res) => console.log(res));
// console.log("creating room instantly");
// }); const newRoom = new Room();
// create google meet link based on the room name without spaces
var slugName =
user.firstName + "-" + "room" + moment(new Date()).format("dddddohmma");
slugName = slugName.replace(/\s/g, "-");
const autoLink =
"https://accounts.google.com/AccountChooser/signinchooser?continue=https://g.co/meet/" +
slugName;
newRoom.link = autoLink;
newRoom.status = RoomStatus.empty;
newRoom.membersInRoom = [];
newRoom.approximateDateTime = null;
newRoom.members = [currUser.uid]; // add currUser to the list of "people"
newRoom.type = RoomType.now;
newRoom.name = roomName;
newRoom.createdByUserId = currUser.uid;
newRoom.teamId = team.id;
console.log(newRoom);
handleModalType(ShowModalType.na);
await roomService.createOrUpdateRoom(newRoom);
resetForm();
toast.success("created room");
} }
const keyMap: KeyMap = { const keyMap: KeyMap = {
@@ -278,6 +305,9 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
}; };
return ( return (
<>
<GlobalHotKeys keyMap={keyMap} handlers={handlers} />
<Modal <Modal
title="Room Details" title="Room Details"
centered centered
@@ -285,8 +315,6 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
onOk={handleSubmit} onOk={handleSubmit}
onCancel={handleCloseModal} onCancel={handleCloseModal}
> >
<GlobalHotKeys keyMap={keyMap} handlers={handlers} />
<div className="flex flex-col"> <div className="flex flex-col">
{hasGSuite ? ( {hasGSuite ? (
<span className="flex flex-col items-start"> <span className="flex flex-col items-start">
@@ -499,5 +527,6 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
)} )}
</div> </div>
</Modal> </Modal>
</>
); );
} }