diff --git a/.env.development b/.env.development index c8ba448..11640e5 100644 --- a/.env.development +++ b/.env.development @@ -6,5 +6,5 @@ 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.435 +NEXT_PUBLIC_APP_VERSION=1.6.436 NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) \ No newline at end of file diff --git a/.env.production b/.env.production index 50f663f..5913e83 100644 --- a/.env.production +++ b/.env.production @@ -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.435 +NEXT_PUBLIC_APP_VERSION=1.6.436 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4772683..04e511d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.436] – 2025-06-20 + +- Mocks erstellt für API für Entwicklungsumgebung + +--- ## [1.6.435] – 2025-06-20 - auto CHANGELOG.md diff --git a/components/main/analogInputs/AnalogInputsChart.tsx b/components/main/analogInputs/AnalogInputsChart.tsx index 1857dde..7e60116 100644 --- a/components/main/analogInputs/AnalogInputsChart.tsx +++ b/components/main/analogInputs/AnalogInputsChart.tsx @@ -17,7 +17,7 @@ import "chartjs-adapter-date-fns"; import { de } from "date-fns/locale"; import { useSelector, useDispatch } from "react-redux"; import type { RootState, AppDispatch } from "../../../redux/store"; -import { fetchAnalogInputsHistoryThunk } from "../../../redux/thunks/fetchAnalogInputsHistoryThunk"; +import { getAnalogInputsHistoryThunk } from "@/redux/thunks/getAnalogInputsHistoryThunk"; ChartJS.register( LineElement, @@ -41,7 +41,7 @@ export default function AnalogInputsChart({ ); useEffect(() => { - dispatch(fetchAnalogInputsHistoryThunk()); + dispatch(getAnalogInputsHistoryThunk()); }, [dispatch]); if (!selectedId) { diff --git a/package-lock.json b/package-lock.json index c59271d..8e8d750 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.435", + "version": "1.6.436", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.435", + "version": "1.6.436", "dependencies": { "@fontsource/roboto": "^5.1.0", "@iconify-icons/ri": "^1.2.10", diff --git a/package.json b/package.json index 9ee2e1e..3e1bf11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.435", + "version": "1.6.436", "private": true, "scripts": { "dev": "next dev", diff --git a/pages/_app.tsx b/pages/_app.tsx index e122841..c3c2a3e 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -15,7 +15,7 @@ import Footer from "../components/footer/Footer"; import { fetchKueDataThunk } from "../redux/thunks/fetchKueDataThunk"; import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk"; import { fetchAnalogInputsThunk } from "../redux/thunks/fetchAnalogInputsThunk"; -import { fetchAnalogInputsHistoryThunk } from "../redux/thunks/fetchAnalogInputsHistoryThunk"; +import { getAnalogInputsHistoryThunk } from "../redux/thunks/getAnalogInputsHistoryThunk"; import { fetchLast20MessagesThunk } from "../redux/thunks/fetchLast20MessagesThunk"; import { fetchOpcUaSettingsThunk } from "../redux/thunks/fetchOpcUaSettingsThunk"; import { fetchSystemSettingsThunk } from "../redux/thunks/fetchSystemSettingsThunk"; @@ -53,7 +53,7 @@ function AppContent({ Component, pageProps }: AppProps) { } else if (pathname.includes("analogInputs")) { dispatch(fetchAnalogInputsThunk()); } else if (pathname.includes("analogHistory")) { - dispatch(fetchAnalogInputsHistoryThunk()); + dispatch(getAnalogInputsHistoryThunk()); } else if (pathname.includes("dashboard")) { dispatch(fetchLast20MessagesThunk()); } else if (pathname.includes("einstellungen")) { diff --git a/pages/api/cpl/fetchAnalogInputsHistory.ts b/pages/api/cpl/getAnalogInputsHistory.ts similarity index 95% rename from pages/api/cpl/fetchAnalogInputsHistory.ts rename to pages/api/cpl/getAnalogInputsHistory.ts index 9cc1a17..196d8e5 100644 --- a/pages/api/cpl/fetchAnalogInputsHistory.ts +++ b/pages/api/cpl/getAnalogInputsHistory.ts @@ -1,4 +1,4 @@ -// /pages/api/cpl/fetchAnalogInputsHistory.ts +// /pages/api/cpl/getAnalogInputsHistory.ts import path from "path"; import fs from "fs/promises"; diff --git a/redux/slices/analogInputsHistorySlice.ts b/redux/slices/analogInputsHistorySlice.ts index a7797d0..10d62c5 100644 --- a/redux/slices/analogInputsHistorySlice.ts +++ b/redux/slices/analogInputsHistorySlice.ts @@ -1,6 +1,6 @@ // /redux/slices/analogInputsHistorySlice.ts import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { fetchAnalogInputsHistoryThunk } from "../thunks/fetchAnalogInputsHistoryThunk"; +import { getAnalogInputsHistoryThunk } from "../thunks/getAnalogInputsHistoryThunk"; type InputHistoryState = { data: Record; @@ -20,18 +20,18 @@ const analogInputsHistorySlice = createSlice({ reducers: {}, extraReducers: (builder) => { builder - .addCase(fetchAnalogInputsHistoryThunk.pending, (state) => { + .addCase(getAnalogInputsHistoryThunk.pending, (state) => { state.isLoading = true; state.error = null; }) .addCase( - fetchAnalogInputsHistoryThunk.fulfilled, + getAnalogInputsHistoryThunk.fulfilled, (state, action: PayloadAction>) => { state.data = action.payload; state.isLoading = false; } ) - .addCase(fetchAnalogInputsHistoryThunk.rejected, (state, action) => { + .addCase(getAnalogInputsHistoryThunk.rejected, (state, action) => { state.isLoading = false; state.error = action.payload as string; }); diff --git a/redux/slices/tdmChartSlice.ts b/redux/slices/tdmChartSlice.ts index e5ffdcc..98b430c 100644 --- a/redux/slices/tdmChartSlice.ts +++ b/redux/slices/tdmChartSlice.ts @@ -1,6 +1,6 @@ // /redux/slices/tdmChartSlice.ts import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { fetchAllTDMData } from "../thunks/fetchAllTDMThunk"; +import { fetchAllTDMData } from "../thunks/getAllTDMThunk"; import type { TDMEntry } from "../types/tdmEntryTypes"; interface TDMChartState { diff --git a/redux/thunks/fetchAllTDMThunk.ts b/redux/thunks/getAllTDMThunk.ts similarity index 95% rename from redux/thunks/fetchAllTDMThunk.ts rename to redux/thunks/getAllTDMThunk.ts index 4c6c015..fc20a11 100644 --- a/redux/thunks/fetchAllTDMThunk.ts +++ b/redux/thunks/getAllTDMThunk.ts @@ -1,4 +1,4 @@ -// /redux/thunks/fetchAllTDMThunk.ts +// /redux/thunks/getAllTDMThunk.ts import { createAsyncThunk } from "@reduxjs/toolkit"; import { RootState } from "../store"; diff --git a/redux/thunks/fetchAnalogInputsHistoryThunk.ts b/redux/thunks/getAnalogInputsHistoryThunk.ts similarity index 60% rename from redux/thunks/fetchAnalogInputsHistoryThunk.ts rename to redux/thunks/getAnalogInputsHistoryThunk.ts index aaff7da..d5a0528 100644 --- a/redux/thunks/fetchAnalogInputsHistoryThunk.ts +++ b/redux/thunks/getAnalogInputsHistoryThunk.ts @@ -1,8 +1,8 @@ -// /redux/thunks/fetchAnalogInputsHistoryThunk.ts +// /redux/thunks/getAnalogInputsHistoryThunk.ts import { createAsyncThunk } from "@reduxjs/toolkit"; -import { fetchAnalogInputsHistoryService } from "../../services/fetchAnalogInputsHistoryService"; +import { fetchAnalogInputsHistoryService } from "@/services/fetchAnalogInputsHistoryService"; -export const fetchAnalogInputsHistoryThunk = createAsyncThunk( +export const getAnalogInputsHistoryThunk = createAsyncThunk( "analogInputsHistory/fetch", async (_, { rejectWithValue }) => { try { diff --git a/services/fetchAnalogInputsHistoryService.ts b/services/fetchAnalogInputsHistoryService.ts index 5835350..a31e8a1 100644 --- a/services/fetchAnalogInputsHistoryService.ts +++ b/services/fetchAnalogInputsHistoryService.ts @@ -22,7 +22,7 @@ export async function fetchAnalogInputsHistoryService(): Promise< if (isDev) { // ⬇️ ENTWICKLUNG: über API-Handler - const response = await fetch("/api/cpl/fetchAnalogInputsHistory"); + const response = await fetch("/api/cpl/getAnalogInputsHistory"); if (!response.ok) throw new Error("Fehler beim Laden der Mock-Daten"); return await response.json(); }