[#384] added visio join button (#403)

* [#384] added visio join button
This commit is contained in:
Camille Moussu
2025-12-11 11:42:07 +01:00
committed by GitHub
parent e8b1b72901
commit a4b4f6d11c
5 changed files with 73 additions and 49 deletions
+69 -49
View File
@@ -1,7 +1,8 @@
import ArrowBackIcon from "@mui/icons-material/ArrowBack"; import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import RepeatIcon from "@mui/icons-material/Repeat"; import RepeatIcon from "@mui/icons-material/Repeat";
import SquareRoundedIcon from "@mui/icons-material/SquareRounded"; import SquareRoundedIcon from "@mui/icons-material/SquareRounded";
import { Box, IconButton, Stack, Typography } from "@mui/material"; import VideocamIcon from "@mui/icons-material/Videocam";
import { Box, Button, IconButton, Stack, Typography } from "@mui/material";
import CircularProgress from "@mui/material/CircularProgress"; import CircularProgress from "@mui/material/CircularProgress";
import { useI18n } from "twake-i18n"; import { useI18n } from "twake-i18n";
import { useState } from "react"; import { useState } from "react";
@@ -184,12 +185,8 @@ function ResultItem({
<> <>
<Box <Box
sx={{ sx={{
display: "grid", display: "flex",
gridTemplateColumns: { flexDirection: "row",
xs: "1fr",
sm: "90px 120px 35px 1fr",
md: "90px 120px 35px 1fr 150px 250px 1fr",
},
gap: 2, gap: 2,
p: 3, p: 3,
borderTop: "1px solid #F3F6F9", borderTop: "1px solid #F3F6F9",
@@ -201,7 +198,7 @@ function ResultItem({
}} }}
onClick={() => handleOpenResult(eventData)} onClick={() => handleOpenResult(eventData)}
> >
<Typography sx={styles.M3BodyLarge}> <Typography sx={{ ...styles.M3BodyLarge, minWidth: "90px" }}>
{startDate.toLocaleDateString(t("locale"), { {startDate.toLocaleDateString(t("locale"), {
day: "2-digit", day: "2-digit",
month: "short", month: "short",
@@ -218,49 +215,50 @@ function ResultItem({
</> </>
)} )}
</Typography> </Typography>
<Typography sx={styles.M3BodyMedium1}> {!eventData.data.allDay && (
{!eventData.data.allDay && ( <Typography sx={{ ...styles.M3BodyMedium1, minWidth: "120px" }}>
<> {startDate.toLocaleTimeString(t("locale"), {
{startDate.toLocaleTimeString(t("locale"), { hour: "2-digit",
hour: "2-digit", minute: "2-digit",
minute: "2-digit", timeZone,
timeZone, })}
})} -
- {endDate.toLocaleTimeString(t("locale"), {
{endDate.toLocaleTimeString(t("locale"), { hour: "2-digit",
hour: "2-digit", minute: "2-digit",
minute: "2-digit", timeZone,
timeZone, })}
})} </Typography>
</> )}
)}
</Typography>
<SquareRoundedIcon <SquareRoundedIcon
style={{ style={{
color: calendarColor ?? "#3788D8", color: calendarColor ?? "#3788D8",
width: 24, width: 24,
height: 24, height: 24,
flexShrink: 0,
}} }}
/> />
<Box display="flex" flexDirection="row" gap={1}> <Box display="flex" flexDirection="row" gap={1} sx={{ minWidth: 0 }}>
<Typography sx={styles.M3BodyLarge}> <Typography sx={styles.M3BodyLarge}>
{eventData.data.summary || t("event.untitled")} {eventData.data.summary || t("event.untitled")}
</Typography> </Typography>
{eventData.data.isRecurrentMaster && <RepeatIcon />} {eventData.data.isRecurrentMaster && <RepeatIcon />}
</Box> </Box>
<Typography {(eventData.data.organizer?.cn || eventData.data.organizer?.email) && (
sx={{ <Typography
...styles.M3BodyMedium1, sx={{
whiteSpace: "nowrap", ...styles.M3BodyMedium1,
overflow: "hidden", whiteSpace: "nowrap",
textOverflow: "ellipsis", overflow: "hidden",
}} textOverflow: "ellipsis",
> minWidth: "150px",
{eventData.data.organizer?.cn || maxWidth: "150px",
eventData.data.organizer?.email || }}
""} >
</Typography> {eventData.data.organizer.cn || eventData.data.organizer.email}
</Typography>
)}
{eventData.data?.location && ( {eventData.data?.location && (
<Typography <Typography
sx={{ sx={{
@@ -268,21 +266,43 @@ function ResultItem({
whiteSpace: "nowrap", whiteSpace: "nowrap",
overflow: "hidden", overflow: "hidden",
textOverflow: "ellipsis", textOverflow: "ellipsis",
minWidth: "150px",
maxWidth: "250px",
}} }}
> >
{eventData.data?.location ?? ""} {eventData.data.location}
</Typography> </Typography>
)} )}
<Typography {eventData.data?.description && (
sx={{ <Typography
...styles.M3BodyMedium3, sx={{
whiteSpace: "nowrap", ...styles.M3BodyMedium3,
overflow: "hidden", whiteSpace: "nowrap",
textOverflow: "ellipsis", overflow: "hidden",
}} textOverflow: "ellipsis",
> flex: 1,
{eventData.data?.description?.replace(/\n/g, " ") ?? ""} minWidth: 0,
</Typography> }}
>
{eventData.data.description.replace(/\n/g, " ")}
</Typography>
)}
{eventData.data["x-openpaas-videoconference"] && (
<Button
startIcon={<VideocamIcon />}
sx={{ flexShrink: 0, ml: "auto" }}
onClick={(e) => {
e.stopPropagation();
window.open(
eventData.data["x-openpaas-videoconference"],
"_blank",
"noopener,noreferrer"
);
}}
>
{t("eventPreview.joinVideoShort")}
</Button>
)}
</Box> </Box>
{calendar && calendar.events[eventData.data.uid] && ( {calendar && calendar.events[eventData.data.uid] && (
<EventPreviewModal <EventPreviewModal
+1
View File
@@ -246,6 +246,7 @@
"showMore": "Show more", "showMore": "Show more",
"showLess": "Show less", "showLess": "Show less",
"joinVideo": "Join the video conference", "joinVideo": "Join the video conference",
"joinVideoShort": "Join",
"guests": "%{count} guests", "guests": "%{count} guests",
"yesCount": "%{count} yes", "yesCount": "%{count} yes",
"maybeCount": "%{count} maybe", "maybeCount": "%{count} maybe",
+1
View File
@@ -246,6 +246,7 @@
"showMore": "Afficher plus", "showMore": "Afficher plus",
"showLess": "Afficher moins", "showLess": "Afficher moins",
"joinVideo": "Rejoindre la visioconférence", "joinVideo": "Rejoindre la visioconférence",
"joinVideoShort": "Rejoindre",
"guests": "%{count} participants", "guests": "%{count} participants",
"yesCount": "%{count} oui", "yesCount": "%{count} oui",
"maybeCount": "%{count} peut-être", "maybeCount": "%{count} peut-être",
+1
View File
@@ -246,6 +246,7 @@
"showMore": "Показать больше", "showMore": "Показать больше",
"showLess": "Показать меньше", "showLess": "Показать меньше",
"joinVideo": "Присоединиться к видеоконференции", "joinVideo": "Присоединиться к видеоконференции",
"joinVideoShort": "Присоединиться",
"guests": "%{count} гостей", "guests": "%{count} гостей",
"yesCount": "%{count} да", "yesCount": "%{count} да",
"maybeCount": "%{count} может быть", "maybeCount": "%{count} может быть",
+1
View File
@@ -246,6 +246,7 @@
"showMore": "Xem thêm", "showMore": "Xem thêm",
"showLess": "Thu gọn", "showLess": "Thu gọn",
"joinVideo": "Tham gia cuộc họp video", "joinVideo": "Tham gia cuộc họp video",
"joinVideoShort": "Tham gia",
"guests": "%{count} khách", "guests": "%{count} khách",
"yesCount": "%{count} đồng ý", "yesCount": "%{count} đồng ý",
"maybeCount": "%{count} có thể", "maybeCount": "%{count} có thể",