feat: KVZ Button für User sichtbar wenn aktiviert ist

This commit is contained in:
ISA
2025-09-10 08:42:28 +02:00
parent f43ddccc46
commit 77f14313ae
10 changed files with 219 additions and 27 deletions

View File

@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
NEXT_PUBLIC_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.888
NEXT_PUBLIC_APP_VERSION=1.6.889
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
NEXT_PUBLIC_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.888
NEXT_PUBLIC_APP_VERSION=1.6.889
NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,8 @@
## [1.6.889] 2025-09-10
- feat: DateRangePicker in KVZ für Meldungen
---
## [1.6.888] 2025-09-10
- feat: TDR Meldungen DateRangePicker

View File

@@ -165,7 +165,10 @@ const KVZChartView: React.FC<KVZChartViewProps> = ({
Anzeigen
</button>
</div>
<div className="flex items-center justify-end" style={{ width: "12rem" }}>
<div
className="flex items-center justify-end"
style={{ width: "12rem" }}
>
<FallSensors slotIndex={slotIndex} />
</div>
</div>

View File

@@ -211,8 +211,7 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
//--------------------------------------
return (
<div style={{ width: "100%", height: isFullScreen ? "90%" : "28rem" }}>
<div style={{ width: "100%", height: isFullScreen ? "90%" : "28rem" }}>
{tdrChartData.length === 0 ? (
<div className="flex items-center justify-center h-full text-gray-500 italic">
Keine Daten verfügbar für diesen Slot

View File

@@ -262,7 +262,8 @@ const TDRChartActionBar: React.FC = () => {
"px-3 h-8 cursor-pointer rounded-sm m-0.5 flex items-center justify-start transition-colors text-[13px]";
if (selected)
return `${base} dropdown-option-active font-medium`;
if (active) return `${base} dropdown-option-hover`;
if (active)
return `${base} dropdown-option-hover`;
return `${base}`;
}}
>
@@ -296,7 +297,9 @@ const TDRChartActionBar: React.FC = () => {
<div className="w-2/3 max-w-xl h-3 bg-white/20 rounded overflow-hidden shadow-inner">
<div
className="h-full bg-accent transition-all ease-linear"
style={{ width: `${(tdrProgress / TDR_TOTAL_DURATION) * 100}%` }}
style={{
width: `${(tdrProgress / TDR_TOTAL_DURATION) * 100}%`,
}}
/>
</div>
</div>

View File

@@ -31,7 +31,6 @@ import useKueVersion from "./hooks/useKueVersion";
import useIsoDisplay from "./hooks/useIsoDisplay";
import useLoopDisplay from "./hooks/useLoopDisplay";
import useModulName from "./hooks/useModulName";
import { useAdminAuth } from "../../settingsPageComponents/hooks/useAdminAuth";
//--------handlers----------------
// Keep needed imports
@@ -57,7 +56,8 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
const { kueName } = useSelector((state: RootState) => state.kueDataSlice);
// Admin authentication hook for security - using showModal as true for continuous auth check
const { isAdminLoggedIn } = useAdminAuth(true);
// Admin Auth hook retained (result not currently needed after KVZ visibility change)
// const { isAdminLoggedIn } = useAdminAuth(true);
// Modulname (max 48 Zeichen) vorbereiten
const moduleNameRaw = useMemo(
@@ -277,10 +277,10 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
const isTdrActiveForSlot = tdrActive?.[slotIndex] === 1;
// KVz aktiv Status für diesen Slot prüfen - nur wenn Admin authentifiziert ist, KVz vorhanden ist UND aktiviert ist
// Anpassung: KVZ Button soll sichtbar/benutzbar bleiben, auch wenn Admin sich abmeldet,
// sobald KVZ Präsenz + Aktiv-Flag gesetzt sind. Admin wird nur zum Aktivieren benötigt.
const isKvzActiveForSlot =
kvzPresence?.[slotIndex] === 1 &&
kvzActive?.[slotIndex] === 1 &&
isAdminLoggedIn;
kvzPresence?.[slotIndex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
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"timestamp": "2025-07-31T11:39:22.951Z",
"timestamp": "2025-09-10T06:37:13.443Z",
"description": {
"kvzPresence": "32 Slots: 1=KVZ Gerät vorhanden, 0=nicht vorhanden. Slots 0,2 haben KVZ-Geräte",
"kvzActive": "32 Slots: 1=KVZ aktiviert, 0=deaktiviert. Nur Slot 0 ist aktiviert",

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "cpl-v4",
"version": "1.6.888",
"version": "1.6.889",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cpl-v4",
"version": "1.6.888",
"version": "1.6.889",
"dependencies": {
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",

View File

@@ -1,6 +1,6 @@
{
"name": "cpl-v4",
"version": "1.6.888",
"version": "1.6.889",
"private": true,
"scripts": {
"dev": "next dev -p 3000",