diff --git a/src/app/(dashboard)/assign-zone-project/AffectationsFilter.jsx b/src/app/(dashboard)/assign-zone-project/AffectationsFilter.jsx
index 9d9c2224804cc518671a6e7fa659f59b3d89bbba..0fe90257abd8ec687345b3033229257446c0f713 100644
--- a/src/app/(dashboard)/assign-zone-project/AffectationsFilter.jsx
+++ b/src/app/(dashboard)/assign-zone-project/AffectationsFilter.jsx
@@ -13,7 +13,7 @@ const AffectationsFilter = memo(function Page({ setFilter, filter, zones, projec
// "nom": "weleaf",
// "id": 1
// }
-
+ console.log("filterr", filter)
const handleResetFilters = (event) => {
const value = event.target.value
setFilter({ semaines: [], jours: [], projects: [], zones: [] })
@@ -168,7 +168,7 @@ const AffectationsFilter = memo(function Page({ setFilter, filter, zones, projec
isSearchable={true}
value={filter.zones || ""}
isMulti
- name="jours"
+ name="zones"
onChange={handleZoneChange}
options={zones.map((element) => ({ label: 'Zone:'+ element.nomZone +' - '+ 'Étage:' +element.numeroEtage , value: element.id }))}
styles={
diff --git a/src/app/(dashboard)/assign-zone-project/page.jsx b/src/app/(dashboard)/assign-zone-project/page.jsx
index e7a343c4c6250fde953bf70a2a9b2505e258a558..c9484c0ff1068b79421a715815236496f82448af 100644
--- a/src/app/(dashboard)/assign-zone-project/page.jsx
+++ b/src/app/(dashboard)/assign-zone-project/page.jsx
@@ -39,7 +39,6 @@ const AffectingZoneProject = () => {
await fetchRequest(`/zoaning/distinct-projects-zones/` ,{ method: 'GET' }
)
if (isSuccess) {
- console.log("getDistinctsProjectsAndZones", data)
setProjects(data.projects)
setZones(data.zones)
} else {
@@ -61,7 +60,6 @@ const AffectingZoneProject = () => {
}, [])
-
useEffect(() => {
// this function is to detect if there is a project that is not fully affected and return the corresponding data to use
@@ -251,7 +249,6 @@ const AffectingZoneProject = () => {
}
- console.log("listProjectsAffected", listProjectsAffected)
return (
<>
@@ -277,8 +274,8 @@ const AffectingZoneProject = () => {
|
-
+
+ |
+
+ {(!image) && <>
+
+ >}
+
+
+
+ {(image) && <>
+
+
+
+
+
+
+ {image.name}
+ {Math.round((image.size / (1024 * 1024)) * 100) / 100}Mo
+
+
+ {(isDisplayingImage) &&
+
+ setIsDisplayingImage(false)} className='ml-auto relative bottom-3'>
+
+
+
+ })
+
+
+ }
+
+
+
+ >}
|
diff --git a/src/app/(dashboard)/etage/EtageTableRow.jsx b/src/app/(dashboard)/etage/EtageTableRow.jsx
index ff162b580369800b60cdeb49623f554d924fce04..0cc0af12b1223920ff1f2a5ae24fa82c30988ab1 100644
--- a/src/app/(dashboard)/etage/EtageTableRow.jsx
+++ b/src/app/(dashboard)/etage/EtageTableRow.jsx
@@ -1,3 +1,4 @@
+/* eslint-disable @next/next/no-img-element */
'use client'
import React, { useEffect, useRef, useState } from 'react'
import fetchRequest from '../../lib/fetchRequest'
@@ -8,7 +9,9 @@ import CancelIcon from "@/static/image/svg/cancel.svg"
import CheckIcon from "@/static/image/svg/check.svg"
import { useNotification } from '@/context/NotificationContext'
import ConfirmationModal from '../../ui/ConfirmationModal'
-const EtageTableRow = ({ id, numero, setEtages }) => {
+import CrossIcon from "@/static/image/svg/cancel.svg"
+
+const EtageTableRow = ({ id, numero, setEtages, image }) => {
const [numeroEtage, setNumeroEtage] = useState(numero)
const [loadingStatus, setLoadingStatus] = useState(false)
const { toggleNotification } = useNotification()
@@ -68,11 +71,33 @@ const EtageTableRow = ({ id, numero, setEtages }) => {
document.removeEventListener("click", handleUpdateBlur);
}
}
+ const [isDisplayingImage, setIsDisplayingImage] = useState(false)
+ const viewImage = () => {
+ setIsDisplayingImage(true)
+ }
return (
<>
|
- setNumeroEtage(event.target.value)} defaultValue={numero} type='text' className='w-full border-0 rounded-md px-2 enabled:drop-shadow border-none enabled:bg-gray-100 disabled:bg-transparent duration-100 h-10 outline-none' />
+ setNumeroEtage(event.target.value)} defaultValue={numero} type='text' className='w-full min-w-80 border-0 rounded-md px-2 enabled:drop-shadow border-none enabled:bg-gray-100 disabled:bg-transparent duration-100 h-10 outline-none' />
+ |
+
+ {(isDisplayingImage && image) &&
+
+ setIsDisplayingImage(false)} className='ml-auto relative bottom-3'>
+
+
+
+ 
+
+
+ }
+ {!image &&
+ Aucune image n'est associée à cet étage.
+ }
+ {(image) && }
|
diff --git a/src/app/(dashboard)/etage/page.jsx b/src/app/(dashboard)/etage/page.jsx
index 8deae510305aed6510cf98a804356ea6650668fe..c4dc6c726a9c501f76d55e480dc3723e1625271e 100644
--- a/src/app/(dashboard)/etage/page.jsx
+++ b/src/app/(dashboard)/etage/page.jsx
@@ -47,6 +47,7 @@ const Etage = () => {
| Numéro Étage |
+ Image |
Actions |
{(isCreating) && setIsCreating(false)} appendEtage={appendEtage} />}
diff --git a/src/app/(dashboard)/place/PlacesFilter.jsx b/src/app/(dashboard)/place/PlacesFilter.jsx
index 2c23693535f98767b929ac83f713f8b91d4dbddc..01a903856145191aad8dce8431a88524111e6373 100644
--- a/src/app/(dashboard)/place/PlacesFilter.jsx
+++ b/src/app/(dashboard)/place/PlacesFilter.jsx
@@ -21,16 +21,19 @@ const PlacesFilter = memo(function Page({ setFilter, filter, etages, zones, tabl
const handleResetFilters = () => {
setFilter({ place: "", etage: "", zone: "", tables: [] })
}
-
+ console.log("filter", filter)
+
+ console.log("zones", zones)
+ console.log("etages", etages)
return (
Recherche
-
+
-
+
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/app/(dashboard)/place/page.jsx b/src/app/(dashboard)/place/page.jsx
index 120a0ac121257463e3703e4d3a143408cafbc0ae..08c1014fbc4cb4d318103c60db2fde98dd97f708 100644
--- a/src/app/(dashboard)/place/page.jsx
+++ b/src/app/(dashboard)/place/page.jsx
@@ -19,7 +19,6 @@ const Place = () => {
const [filter, setFilter] = useState({ place: "", etage: "", zone: "", tables: [] });
- console.log(filter)
useEffect(() => {
const getPlaces = async () => {
var tablesIdString = filter.tables.map((element) => element.value).toString()
diff --git a/src/app/(dashboard)/reservation/page.jsx b/src/app/(dashboard)/reservation/page.jsx
index 0b82d13f3fe2d8704a69d36eda7945c42388da87..e75a1b401f35a3080e51f11db15a7e1e7d990ff4 100644
--- a/src/app/(dashboard)/reservation/page.jsx
+++ b/src/app/(dashboard)/reservation/page.jsx
@@ -9,6 +9,7 @@ import PresenceButton from './PresenceButton'
import Cookies from 'js-cookie';
import { decrypt } from '@/app/lib/session';
import ReservationConfirmation from '@/app/ui/ReservationConfirmation'
+import { dateDiffInDays, extractDate } from '@/app/lib/DateHelper'
export const ReservationContext = React.createContext()
@@ -174,10 +175,17 @@ const Reservation = () => {
const currentMonth = new Date().getMonth() + 1
// filter dates from now to 2 weeks later
+
+ // console.log("target date", datesData);
+ // const filteredDatesData = datesData?.filter((element) => {
+ // const date = new Date(element.date)
+ // const month = date.getMonth() + 1
+ // return (month === currentMonth) && (date.getDate() >= new Date().getDate() && date.getDate() <= new Date().getDate() + 14)
+ // })
const filteredDatesData = datesData?.filter((element) => {
- const date = new Date(element.date)
- const month = date.getMonth() + 1
- return (month === currentMonth) && (date.getDate() >= new Date().getDate() && date.getDate() <= new Date().getDate() + 14)
+ const diff = dateDiffInDays(extractDate(new Date()), element.date)
+ return diff >= 0 && diff <= 14
+
})
const selectedZoneData = floors.find((element) => element.id == selectedZone.floorId)?.zones.find((zone) => zone.id === selectedZone.zoneId)
return (
diff --git a/src/app/(dashboard)/table/TablesFilter.jsx b/src/app/(dashboard)/table/TablesFilter.jsx
index 53648ce6a83065f9c625e736258d77af60952eea..df099d97b1a102b3db17eb3b2e57f67ac503bfe6 100644
--- a/src/app/(dashboard)/table/TablesFilter.jsx
+++ b/src/app/(dashboard)/table/TablesFilter.jsx
@@ -25,7 +25,7 @@ const TablesFilter = memo(function Page({ setFilter, filter, etages, zones }) {
-
+
-
+
-
+
| |