From 02c9cca682b5184f908df34beaaa736314628d05 Mon Sep 17 00:00:00 2001 From: NaNoMelo Date: Tue, 22 Oct 2024 15:41:34 +0200 Subject: [PATCH] Fix missing current permanency display, delegate slot label config to locales --- counter/schemas.py | 1 + counter/static/webpack/graph-index.ts | 3 +-- package-lock.json | 17 ----------------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/counter/schemas.py b/counter/schemas.py index bdac0da8..13a1b9f7 100644 --- a/counter/schemas.py +++ b/counter/schemas.py @@ -25,4 +25,5 @@ class PermanencyFilterSchema(FilterSchema): start_before: datetime | None = Field(None, q="start__lte") end_after: datetime | None = Field(None, q="end__gte") end_before: datetime | None = Field(None, q="end__lte") + took_place_after: datetime | None = Field(None, q=["start__gte", "end__gte"]) counter: set[int] | None = Field(None, q="counter_id__in") diff --git a/counter/static/webpack/graph-index.ts b/counter/static/webpack/graph-index.ts index 54a7b1f9..6a19a864 100644 --- a/counter/static/webpack/graph-index.ts +++ b/counter/static/webpack/graph-index.ts @@ -34,7 +34,7 @@ async function loadChart(options: ActivityChartConfig) { query: { counter: [options.counterId], // biome-ignore lint/style/useNamingConvention: backend API uses snake_case - end_after: options.startDate.toISOString(), + took_place_after: options.startDate.toISOString(), }, } as PermanencyFetchPermananciesData); @@ -44,7 +44,6 @@ async function loadChart(options: ActivityChartConfig) { plugins: [timeGridPlugin], initialView: "timeGridWeek", locale: options.locale, - slotLabelFormat: { hour: "2-digit", minute: "2-digit", hour12: false }, dayHeaderFormat: { weekday: "long" }, firstDay: 1, views: { timeGrid: { allDaySlot: false } }, diff --git a/package-lock.json b/package-lock.json index d9b81d6b..99b71768 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2345,16 +2345,6 @@ "undici-types": "~6.19.2" } }, - "node_modules/@types/select2": { - "version": "4.0.63", - "resolved": "https://registry.npmjs.org/@types/select2/-/select2-4.0.63.tgz", - "integrity": "sha512-/DXUfPSj3iVTGlRYRYPCFKKSogAGP/j+Z0fIMXbBiBtmmZj0WH7vnfNuckafq9C43KnqPPQW2TI/Rj/vTSGnQQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/jquery": "*" - } - }, "node_modules/@types/sizzle": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", @@ -6140,13 +6130,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/select2": { - "version": "4.1.0-rc.0", - "resolved": "https://registry.npmjs.org/select2/-/select2-4.1.0-rc.0.tgz", - "integrity": "sha512-Hr9TdhyHCZUtwznEH2CBf7967mEM0idtJ5nMtjvk3Up5tPukOLXbHUNmh10oRfeNIhj+3GD3niu+g6sVK+gK0A==", - "license": "MIT" - }, - "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",