Fix code issues
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Pierre HUBERT 2024-06-22 22:31:11 +02:00
parent 22eeffce24
commit be9a278c11
7 changed files with 18 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import {
import React from "react";
import { ServerApi } from "../../api/ServerApi";
import { NewCalendarURL } from "../../api/accommodations/AccommodationsCalendarURLApi";
import { checkConstraint } from "../../utils/from_utils";
import { checkConstraint } from "../../utils/form_utils";
import { useAccommodations } from "../../widgets/accommodations/BaseAccommodationsRoute";
import { PropEdit } from "../../widgets/forms/PropEdit";
import { PropSelect } from "../../widgets/forms/PropSelect";

View File

@ -9,7 +9,7 @@ import {
import React from "react";
import { ServerApi } from "../../api/ServerApi";
import { UpdateAccommodation } from "../../api/accommodations/AccommodationListApi";
import { checkConstraint } from "../../utils/from_utils";
import { checkConstraint } from "../../utils/form_utils";
import { PropCheckbox } from "../../widgets/forms/PropCheckbox";
import { PropEdit } from "../../widgets/forms/PropEdit";
import { PropColorPicker } from "../../widgets/forms/PropColorPicker";

View File

@ -560,10 +560,14 @@ export function AccommodationsReservationsRoute(): React.ReactElement {
</Menu>
</>
)}
{user.user.id === activeEvent?.reservation.user_id && (
<>
<Tooltip title="Modifier les dates de réservation" arrow>
<IconButton
disabled={
!activeEvent.accommodation.open_to_reservations
}
onClick={() =>
changeReservation(activeEvent?.reservation)
}

View File

@ -3,6 +3,7 @@ import CheckIcon from "@mui/icons-material/Check";
import CloseIcon from "@mui/icons-material/Close";
import HouseIcon from "@mui/icons-material/House";
import {
Alert,
Button,
Card,
CardActions,
@ -310,10 +311,16 @@ function AccommodationsCalURLsCard(): React.ReactElement {
</Typography>
<Typography>
Vous pouvez, si vous le souhaitez, importer dans votre application de
calendrier le planning de réservation des logement. Pour ce faire, il
calendrier le planning de réservation des logements. Pour ce faire, il
vous suffit de créer une URL de calendrier.
</Typography>
<Alert severity="info">
Les calendriers créés ici ne sont visible que par vous. Vous ne pouvez
pas manipuler les calendriers créés par les autres membres de la
famille.
</Alert>
<Button
startIcon={<AddIcon />}
variant="outlined"

View File

@ -15,7 +15,7 @@ export function checkConstraint(
return `Veuillez indiquer au moins ${constraint.min} caractères !`;
if (value.length > constraint.max)
return `Veuillez indiquer au maximum ${constraint.min} caractères !`;
return `Veuillez indiquer au maximum ${constraint.max} caractères !`;
return undefined;
}

View File

@ -9,7 +9,7 @@ export function CopyToClipboard(
const copy = () => {
navigator.clipboard.writeText(p.content);
snackbar(`${p.content} copied to clipboard.`);
snackbar(`${p.content} a été copié dans le presse papier.`);
};
return (

View File

@ -151,6 +151,8 @@ pub async fn anonymous_access(req: web::Path<AnonymousAccessURL>) -> HttpResult
cal.events.push(event);
}
// TODO : update last used of calendar, if required
Ok(HttpResponse::Ok()
.content_type("text/calendar")
.body(cal.generate()))