Skip to content

Commit

Permalink
Merge branch 'uat' into dependabot/npm_and_yarn/uat/testing-library/r…
Browse files Browse the repository at this point in the history
…eact-14.1.2
  • Loading branch information
martinheppner authored Jan 13, 2024
2 parents f73679f + b8f163d commit 9d2154a
Show file tree
Hide file tree
Showing 27 changed files with 525 additions and 378 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
target-branch: "uat"
10 changes: 10 additions & 0 deletions .github/workflows/deploy2prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ jobs:
run: npm install
- name: Run build task
run: npm run build
- name: executing remote ssh command to backup app
uses: appleboy/[email protected]
with:
host: ${{ secrets.PROD_REMOTE_HOST }}
username: ${{ secrets.PROD_REMOTE_USER }}
key: ${{ secrets.PROD_SSH_PRIVATE_KEY }}
port: ${{ secrets.PROD_REMOTE_PORT }}
script: |
rm -r /root/suchseite/app-backup/
cp -r /root/suchseite/app/ /root/suchseite/app-backup/
- name: Deploy to Server
uses: easingthemes/ssh-deploy@main
with:
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"url": "https://github.com/bahnzumberg/zuugle-suchseite/issues/",
"email": "[email protected]"
},
"version": "2.0.0",
"version": "2.0.1",
"private": true,
"dependencies": {
"@alwaysmeticulous/recorder-loader": "^2.79.0",
Expand All @@ -15,29 +15,30 @@
"@jonkoops/matomo-tracker-react": "^0.7.0",
"@mui/icons-material": "^5.14.15",
"@mui/lab": "^5.0.0-alpha.71",
"@mui/material": "^5.4.3",
"@mui/material": "^5.15.3",
"@mui/x-date-pickers": "^6.17.0",
"@react-leaflet/core": "^2.1.0",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.4.3",
"@testing-library/user-event": "^14.5.2",
"again": "0.0.1",
"ajv": "^8.12.0",
"axios": "^1.6.0",
"axios": "^1.6.2",
"buffer": "^6.0.3",
"downshift": "^8.2.2",
"express-rate-limit": "^7.1.4",
"fast-memoize": "^2.5.2",
"gpxparser": "^3.0.0",
"history": "^5.3.0",
"i18next": "^22.4.15",
"i18next-browser-languagedetector": "^7.0.1",
"i18next-browser-languagedetector": "^7.2.0",
"i18next-http-backend": "^2.2.0",
"js-file-download": "^0.4.12",
"leaflet": "^1.9.3",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"react": "^18.2.0",
"react-cache-buster": "^0.1.8",
"react-dom": "^18.2.0",
"react-file-download": "^0.3.5",
"react-full-screen": "^1.1.0",
Expand All @@ -62,8 +63,10 @@
"@types/react": "^18.0.0"
},
"scripts": {
"generate-meta-tag": "node ./node_modules/react-cache-buster/dist/generate-meta-tag.js",
"start": "webpack serve --mode development --port 3000 --open --hot --progress --host localhost --static .",
"build": "webpack --config webpack.config_prod.js",
"build": "npm run generate-meta-tag && npm run build-app",
"build-app": "webpack --config webpack.config_prod.js",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand All @@ -76,9 +79,9 @@
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
"@babel/preset-react": "^7.16.7",
"@babel/preset-react": "^7.23.3",
"@svgr/plugin-svgo": "^8.1.0",
"@svgr/webpack": "^7.0.0",
"@svgr/webpack": "^8.1.0",
"babel-loader": "^9.1.2",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
Expand Down
6 changes: 4 additions & 2 deletions server/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { rateLimit } from 'express-rate-limit'; // added "type": "module" in package.json
var express = require('express'),
path = require('path'),
compression = require('compression'),
Expand All @@ -8,12 +9,13 @@ const app = express();

app.set('trust proxy', 1 /* number of proxies between user and server */)
app.get('/ip', (request, response) => {
console.log("L11 Server.js request.ip: ", request.ip);
if(process.env.NODE_ENV != "production"){
console.log("L11 Server.js request.ip: ", request.ip);
}
response.send(request.ip)
})


import { rateLimit } from 'express-rate-limit'; // added "type": "module" in package.json

const limiter = rateLimit({
windowMs: 1 * 60 * 1000, // 15 minutes
Expand Down
19 changes: 19 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -1656,3 +1656,22 @@ top:250px; */
background-color: #3390b2;
border-color: #b29d33;
} */

.custom-h4-link {
font-size: 22px; /* Equivalent to h4 in Material-UI */
font-weight: 600; /* Equivalent to h4 in Material-UI */
line-height: 1.235rem; /* Adjust as needed */
/* Other styles specific to your use case */
text-decoration: none;
color: rgb(16, 16, 16);
/* Add any other styles that match the h4 variant */
}

.custom-h5-link {
font-size: 14px;
color: rgb(73, 146, 255);
font-weight: 700;
text-transform: uppercase;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
line-height: 1.334;
}
101 changes: 52 additions & 49 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@ import { lazy, Suspense } from "react";
import CircularProgress from "@mui/material/CircularProgress";
import DetailReworked from "./views/Main/DetailReworked";
import Search from "./components/Search/Search";
import i18next from "i18next";
import { getTopLevelDomain } from "./utils/globals";

const Main = lazy(() => import("./views/Main/Main"));
const About = lazy(() => import("./views/Pages/About"));
const Impressum = lazy(() => import("./views/Pages/Impressum"));
const Privacy = lazy(() => import("./views/Pages/Privacy"));
// import { tryLoadAndStartRecorder } from '@alwaysmeticulous/recorder-loader';
import i18next from "i18next";
import { getTopLevelDomain } from "./utils/globals";




function App() {
//check if first visit and change code to domain language
if(!localStorage.getItem('visited')) {

//check if first visit and change code to domain language
if(!localStorage.getItem('visited')) {
let domain = getTopLevelDomain();

let domain = getTopLevelDomain();
//switch to domain language
switch (domain) {
case 'si':
i18next.changeLanguage('sl');
break;
case 'fr':
i18next.changeLanguage('fr');
break;
case 'it':
i18next.changeLanguage('it');
break;
default:
i18next.changeLanguage('de');
break;
}

//switch to domain language
switch (domain) {
case 'si':
i18next.changeLanguage('sl');
break;
case 'fr':
i18next.changeLanguage('fr');
break;
case 'it':
i18next.changeLanguage('it');
break;
default:
i18next.changeLanguage('de');
break;
localStorage.setItem('visited',true);
}

localStorage.setItem('visited',true);
}

// Matomo tracking
var _mtm = window._mtm = window._mtm || [];
React.useEffect(() => {
Expand All @@ -54,38 +54,41 @@ if(!localStorage.getItem('visited')) {
g.async=true; g.src='https://stats.bahnzumberg.at/js/container_ANAXmMKf.js'; s.parentNode.insertBefore(g,s);
let language = i18next.resolvedLanguage;
_mtm.push({'language': language});
}, []);
});



return (
<ThemeProvider theme={theme}>
<div className="App">
<Suspense
fallback={
<div style={{ height: "100%", width: "100%", padding: "20px" }}>
<CircularProgress />
</div>
}
>
<Routes>
<Route path="/" element={<Start />} />
<Route path="/total" element={<Start />} />
<Route path="/suche" element={<Main />} />
<Route path="/about" element={<About />} />
<Route path="/tour" element={<DetailReworked />} />
<Route path="/provider/:provider" element={<DetailReworked />} />
<Route path="/imprint" element={<Impressum />} />
<Route path="/privacy" element={<Privacy />} />
<Route path="/:city" element={<Main />} />
<Route path="/searchPhrases" element={<Search />} />
<>
<ThemeProvider theme={theme}>
<div className="App">
<Suspense
fallback={
<div style={{ height: "100%", width: "100%", padding: "20px" }}>
<CircularProgress />
</div>
}
>
<Routes>
<Route path="/" element={<Start />} />
<Route path="/total" element={<Start />} />
<Route path="/suche" element={<Main />} />
<Route path="/about" element={<About />} />
<Route path="/tour" element={<DetailReworked />} />
<Route path="/provider/:provider" element={<DetailReworked />} />
<Route path="/imprint" element={<Impressum />} />
<Route path="/privacy" element={<Privacy />} />
<Route path="/:city" element={<Main />} />
<Route path="/searchPhrases" element={<Search />} />

<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Suspense>
</div>
<ModalRoot />
</ThemeProvider>
</>

<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Suspense>
</div>
<ModalRoot />
</ThemeProvider>
);
}

Expand Down
19 changes: 15 additions & 4 deletions src/actions/crudActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
NO_DATA_AVAILABLE,
NO_TOURS_AVAILABLE,
} from "./types";
import { consoleLog } from "../utils/globals";

export async function loadFile(
dispatch,
Expand All @@ -29,9 +30,15 @@ export async function loadFile(
};
}
try {
//when clicking "pdf" button on detail page.
console.log("L 33 crudActions / loadFile : route :", route);//example: "tours/1971/pdf"
console.log("L 34 crudActions / loadFile : data :", data, true);//example: {id: 1971, connection_id: 957752, connection_return_id: 957752, connection_return_ids: Array(1), connectionDate: '2024-01-11T00:00:00+01:00'}
console.log("L 36 crudActions / loadFile : responseType :", responseType); //'buffer'

let res = await axios.get(route, {
data: {},
// data: data,
// data: {},
data: data,
// responseType: 'arraybuffer',
responseType: responseType,
params: params,
timeout: 60000,
Expand Down Expand Up @@ -257,11 +264,15 @@ export function generateShareLink(provider, hashedUrl, date, city) {
city: city,
})
.then((res) => {
console.log("L281 crudActions / generateShareLink res.data :", res.data);
if(process.env.NODE_ENV !== "production"){
console.log("L281 crudActions / generateShareLink res.data :", res.data);
}
return res.data;
})
.catch((err) => {
console.log("L285 crudActions / generateShareLink err.response.data :", err.response);
if(process.env.NODE_ENV !== "production"){
console.log("L285 crudActions / generateShareLink err.response.data :", err.response);
}
return err.response;
});
}
Expand Down
1 change: 1 addition & 0 deletions src/actions/fileActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function loadGPX(url, responseType = "buffer") {
return axios.get(url, {
data: {},
timeout: 60000,
responseType: responseType,
}).then(res => {
return res;
})
Expand Down
4 changes: 3 additions & 1 deletion src/actions/tourActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ export const loadTourPdf = (data) => async (dispatch, getState) => {
);
return response;
} catch (error) {
console.log("L94, tourActions Error: " + error.message);
if(process.env.NODE_ENV != "production"){
console.log("L94, tourActions Error: " + error.message);
}
throw error;
}
};
Expand Down
4 changes: 1 addition & 3 deletions src/components/EndOfList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import React from "react"
//marked for deletion
function EndOfList() {
return (
<p style={{ textAlign: "center" , color: "blue"}}>
<b> End of List</b>
</p>
<p> </p>
)
}

Expand Down
4 changes: 3 additions & 1 deletion src/components/Filter/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ function Filter({filter, doSubmit, resetFilter, searchParams, loadFilter, isLoad


const submit = () => {
console.log("L288 traverse value : ", traverse)
if(process.env.NODE_ENV != "production"){
console.log("L288 traverse value : ", traverse)
}
const filterValues = {
//coordinates: coordinates, //Füg den Wert in die URL ein
coordinatesSouthWest: coordinatesSouthWest,
Expand Down
4 changes: 3 additions & 1 deletion src/components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default function Footer({}){
<Typography id="yearSpan" sx={{marginLeft: "10px", color: "#4992FF"}}>© {`${currentYear}`} Zuugle</Typography>
</Grid>
<Grid item xs md={3}>
<Typography sx={{marginLeft: "10px", textDecoration: "underline"}} className={"cursor-link"} onClick={() => window.open(`https://www.bahnzumberg.at`)}>Bahn zum Berg</Typography>
<a href="https://www.bahnzumberg.at" target="_blank" rel='noreferrer'>
<Typography sx={{marginLeft: "10px", textDecoration: "underline"}} className={"cursor-link"} >Bahn zum Berg</Typography>
</a>
</Grid>
<Grid item xs >
<Typography sx={{marginLeft: "10px", textDecoration: "underline"}} className={"cursor-link"} onClick= {() => window.open(`${window.location.protocol}//${window.location.host}/privacy`)}>
Expand Down
9 changes: 9 additions & 0 deletions src/components/Loading/LoadingVersionCheck.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

function LoadingVersionCheck() {
return (
<div> version check in progress ...</div>
)
}

export default LoadingVersionCheck
1 change: 0 additions & 1 deletion src/components/ResultBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default function ResultBar({total, showModal, hideModal, filter, filterAc

// console.log("Total in ResultBar: " + total);
const [searchParams, setSearchParams] = useSearchParams();
const [order, setOrder] = React.useState("relevanz");
const [mapView, setMapView] = React.useState(false);
const [provider, setProvider] = React.useState("provider");

Expand Down
1 change: 0 additions & 1 deletion src/components/Search/CityResultList.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ export function CityResultList({
//wenn startseite lade touren
if (!!_city && !!_city.value) {
loadFavouriteTours({
sort: "relevanz",
city: _city.value,
limit: 10,
ranges: true,
Expand Down
Loading

0 comments on commit 9d2154a

Please sign in to comment.