Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Vendored
+8
-2
@@ -1,5 +1,11 @@
|
||||
declare namespace Intl {
|
||||
type Key = 'calendar' | 'collation' | 'currency' | 'numberingSystem' | 'timeZone' | 'unit';
|
||||
type Key =
|
||||
| "calendar"
|
||||
| "collation"
|
||||
| "currency"
|
||||
| "numberingSystem"
|
||||
| "timeZone"
|
||||
| "unit";
|
||||
|
||||
function supportedValuesOf(input: Key): string[];
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import type { RootState, AppDispatch } from './store'
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import type { RootState, AppDispatch } from "./store";
|
||||
|
||||
export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
|
||||
export const useAppSelector = useSelector.withTypes<RootState>()
|
||||
export const useAppDispatch = useDispatch.withTypes<AppDispatch>();
|
||||
export const useAppSelector = useSelector.withTypes<RootState>();
|
||||
|
||||
@@ -133,7 +133,9 @@ main {
|
||||
|
||||
/* selected day hover */
|
||||
.react-calendar__tile {
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
transition:
|
||||
background-color 0.3s ease,
|
||||
color 0.3s ease;
|
||||
border: none;
|
||||
background-color: white;
|
||||
width: 12px;
|
||||
|
||||
@@ -31,13 +31,13 @@ import { createSelector } from "@reduxjs/toolkit";
|
||||
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
|
||||
import ClearIcon from "@mui/icons-material/Clear";
|
||||
import AccessTimeIcon from "@mui/icons-material/AccessTime";
|
||||
import LockIcon from '@mui/icons-material/Lock';
|
||||
import LockIcon from "@mui/icons-material/Lock";
|
||||
import { userAttendee } from "../../features/User/userDataTypes";
|
||||
|
||||
const computeStartOfTheWeek = (date: Date): Date => {
|
||||
const startOfWeek = new Date(date);
|
||||
startOfWeek.setDate(date.getDate() - ((date.getDay() + 6) % 7)); // Monday
|
||||
startOfWeek.setHours(0, 0, 0, 0);
|
||||
startOfWeek.setHours(0, 0, 0, 0);
|
||||
return startOfWeek;
|
||||
};
|
||||
|
||||
@@ -204,7 +204,6 @@ export default function CalendarApp() {
|
||||
calendarRef.current?.view.type === "timeGridWeek" ||
|
||||
calendarRef.current?.view.type === undefined
|
||||
) {
|
||||
|
||||
const startOfWeek = computeStartOfTheWeek(selected);
|
||||
|
||||
const endOfWeek = new Date(startOfWeek);
|
||||
@@ -430,7 +429,9 @@ export default function CalendarApp() {
|
||||
if (!calendars[arg.event._def.extendedProps.calId]) return;
|
||||
|
||||
const attendees = event._def.extendedProps.attendee || [];
|
||||
const isPrivate = event._def.extendedProps.class === "PRIVATE" || event._def.extendedProps.class === "CONFIDENTIAL";
|
||||
const isPrivate =
|
||||
event._def.extendedProps.class === "PRIVATE" ||
|
||||
event._def.extendedProps.class === "CONFIDENTIAL";
|
||||
let Icon = null;
|
||||
let titleStyle: React.CSSProperties = {};
|
||||
const ownerEmails = new Set(
|
||||
@@ -461,9 +462,17 @@ export default function CalendarApp() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||
{isPrivate && <LockIcon data-testid="lock-icon" fontSize="small" style={{ marginRight: '4px' }} />}
|
||||
{Icon && <Icon fontSize="small" style={{ marginRight: '4px' }}/>}
|
||||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
{isPrivate && (
|
||||
<LockIcon
|
||||
data-testid="lock-icon"
|
||||
fontSize="small"
|
||||
style={{ marginRight: "4px" }}
|
||||
/>
|
||||
)}
|
||||
{Icon && (
|
||||
<Icon fontSize="small" style={{ marginRight: "4px" }} />
|
||||
)}
|
||||
<span style={titleStyle}>{event.title}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,7 +28,6 @@ function CalendarPopover({
|
||||
const [timeZone, setTimeZone] = useState("");
|
||||
const timezones = Intl.supportedValuesOf?.("timeZone") ?? [];
|
||||
const handleSave = () => {
|
||||
|
||||
dispatch(createCalendar({ name, description, color }));
|
||||
onClose({}, "backdropClick");
|
||||
|
||||
@@ -64,7 +63,11 @@ function CalendarPopover({
|
||||
}}
|
||||
>
|
||||
<Box p={2}>
|
||||
<Typography variant="h6" gutterBottom style={{backgroundColor:color}}>
|
||||
<Typography
|
||||
variant="h6"
|
||||
gutterBottom
|
||||
style={{ backgroundColor: color }}
|
||||
>
|
||||
Create a Calendar
|
||||
</Typography>
|
||||
<TextField
|
||||
|
||||
@@ -58,7 +58,7 @@ export function parseCalendarEvent(
|
||||
case "organizer":
|
||||
event.organizer = {
|
||||
cn: params?.cn ?? "",
|
||||
cal_address: value.replace(/^mailto:/, ""),
|
||||
cal_address: value?.replace(/^mailto:/, ""),
|
||||
};
|
||||
break;
|
||||
case "attendee":
|
||||
|
||||
+5
-5
@@ -1,13 +1,13 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
|
||||
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
font-family:
|
||||
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { ReportHandler } from 'web-vitals';
|
||||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
Reference in New Issue
Block a user