Skip to content

Commit

Permalink
Merge branch 'uat'
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheppner committed Dec 30, 2023
2 parents 88d269e + 3676f70 commit febfa61
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 36 deletions.
7 changes: 5 additions & 2 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 Down Expand Up @@ -38,6 +38,7 @@
"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 Down
4 changes: 3 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ 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)
})

Expand Down
27 changes: 24 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,28 @@ 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";
import CacheBuster, { useCacheBuster } from 'react-cache-buster';
import packageJson from '../package.json';
import LoadingVersionCheck from "./components/Loading/LoadingVersionCheck.jsx";
const { version } = packageJson;

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() {
const isProduction = process.env.NODE_ENV === 'production';
console.log("FROM APP.JS: ", isProduction)
const { checkCacheStatus } = useCacheBuster();



//check if first visit and change code to domain language
if(!localStorage.getItem('visited')) {
Expand Down Expand Up @@ -54,11 +64,19 @@ 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 (
<>
<CacheBuster
currentVersion={version}
isEnabled={isProduction} //If false, the library is disabled.
isVerboseMode={false} //If true, the library writes verbose logs to console.
metaFileDirectory={'.'} //If public assets are hosted somewhere other than root on your server.
>

<ThemeProvider theme={theme}>
<div className="App">
<Suspense
Expand Down Expand Up @@ -86,6 +104,9 @@ if(!localStorage.getItem('visited')) {
</div>
<ModalRoot />
</ThemeProvider>
</CacheBuster>
</>

);
}

Expand Down
8 changes: 6 additions & 2 deletions src/actions/crudActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,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
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: 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
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
17 changes: 9 additions & 8 deletions src/components/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,16 @@ export function Search({
}
}
}

//setting searchPhrase to the value of the search parameter
if (!!range) {
setSearchPhrase(range);
setRegion({ value: range, label: range, type: "range" });
}
if (!!search) {
else if (!!search) {
setSearchPhrase(search);

if (!city && !search.includes(' ')) {
if (city === null && !search.includes(' ')) {
// If a search phrase is given and city is empty and the search term consists only of one word,
// we have to check, if the search term is a valid city_slug.If yes, we will store the search term as city.
cityEntry = allCities.find((e) => e.value == search.toLowerCase()); // find the city object in array "allCities"
Expand All @@ -143,18 +144,18 @@ export function Search({
}
}
}
// state might be useful for future enhancement or new feature related to Klimaticket
if (!!state) {
else if (!!state) {
// state might be useful for future enhancement or new feature related to Klimaticket
setSearchPhrase(state);
setRegion({ value: state, label: state, type: "state" });
}
// country might be useful for future enhancement or new feature related to Klimaticket
if (!!country) {
else if (!!country) {
// country might be useful for future enhancement or new feature related to Klimaticket
setSearchPhrase(country);
setRegion({ value: country, label: country, type: "country" });
}
// type might be useful for future enhancement or new feature related to Klimaticket
if (!!type) {
else if (!!type) {
// type might be useful for future enhancement or new feature related to Klimaticket
setSearchPhrase(type);
setRegion({ value: type, label: type, type: "type" });
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/TourCardContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export default function TourCardContainer({


const _loadTours = async () => {
if(process.env.NODE_ENV != "production"){
console.log("L67 ====////// filterValues :", filterValues);
console.log("L68 ====////// filterValues :", _filter);
}
let city = searchParams.get("city");
let range = searchParams.get("range");
let state = searchParams.get("state");
Expand Down Expand Up @@ -71,7 +73,9 @@ export default function TourCardContainer({
provider: provider,
page: !!pageTours ? Number(pageTours) + 1 : 2,
}).then((res) => {
console.log("L116 >>>> results :",(res));
if(process.env.NODE_ENV != "production"){
console.log("L116 >>>> results :",(res));
}
let retrievedTours = res.data.tours;
if (retrievedTours.length === 0 || retrievedTours.length < 9) {
setHasMore(false);
Expand Down
4 changes: 3 additions & 1 deletion src/utils/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ export const countFilterActive = (searchParams, filter) => {
count++;
}
}
console.log("L267 : FINAL count :",count)
if(process.env.NODE_ENV != "production"){
console.log("L267 : FINAL count :",count)
}
return count;
};

Expand Down
12 changes: 6 additions & 6 deletions src/views/Main/DetailReworked.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ useEffect(() => {
axios.get(`tours/provider/${tour.provider}`)
.then((response) => {
if (response.status === 200) {
console.log("L158 : first response.data", response.data)
if(process.env.NODE_ENV != "production"){
console.log("L158 : first response.data", response.data)
}
return response.data;
}
throw new Error("Network response was not ok.");
Expand All @@ -164,7 +166,9 @@ useEffect(() => {
console.error("Error fetching provider permit status:", error);
});
}
console.log("L172 : providerPermit", providerPermit)
if(process.env.NODE_ENV != "production"){
console.log("L172 : providerPermit", providerPermit)
}
}, [tour]);


Expand Down Expand Up @@ -506,10 +510,6 @@ useEffect(() => {
</span>
</Button>

{/*
Specific social media buttons */}
{(socialMediaDropDownToggle && console.log("L537 socialMediaDropDownToggle :", socialMediaDropDownToggle)) }
{(!!shareLink ? console.log("L538 shareLink :", shareLink != null) : console.log("Falsy shareLink"))}
{socialMediaDropDownToggle && shareLink !== null && (
<div>
<TwitterShareButton
Expand Down
9 changes: 1 addition & 8 deletions src/views/Main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,7 @@ try {

return (
<div>
{/* clg */}
{/*{console.log("directLink L 230:",directLink) }*/}{" "}
{/* {console.log("L280: Main / counter :", counter)} */}
{/* {getPageHeader(directLink)} */}
{/* {getPageHeader({ header: `Zuugle ${t(`${cityLabel}`)}` })} */}
{/* {getPageHeader({ header: `Zuugle ${t(`${getCityLabel(location, allCities)}`)}` })} */}

<Box sx={{ width: "100%" }} className={"search-result-header-container"}>
<Box sx={{ width: "100%" }} className={"search-result-header-container"}>
{!!directLink && (
<Box className={"seo-bar"}>
<Typography
Expand Down
16 changes: 14 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4019,6 +4019,11 @@ commondir@^1.0.1:
resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz"
integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==

compare-versions@^4.1.2:
version "4.1.4"
resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-4.1.4.tgz"
integrity sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==

compressible@~2.0.16:
version "2.0.18"
resolved "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz"
Expand Down Expand Up @@ -9031,7 +9036,7 @@ prompts@^2.0.1, prompts@^2.4.2:
kleur "^3.0.3"
sisteransi "^1.0.5"

prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1, prop-types@>=15.7.2:
version "15.8.1"
resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
Expand Down Expand Up @@ -9131,6 +9136,13 @@ react-app-polyfill@^3.0.0:
regenerator-runtime "^0.13.9"
whatwg-fetch "^3.6.2"

react-cache-buster@^0.1.8:
version "0.1.8"
resolved "https://registry.npmjs.org/react-cache-buster/-/react-cache-buster-0.1.8.tgz"
integrity sha512-N7BMnz2MUC++oXUzcYXsGn0WsIBDe5rRyT8W6O7L32CjcbgnuxhxNjc9T+Y56zdlSdY5nde3PTmZSktFv3V9IQ==
dependencies:
compare-versions "^4.1.2"

react-dev-utils@^12.0.1:
version "12.0.1"
resolved "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz"
Expand Down Expand Up @@ -9414,7 +9426,7 @@ react-transition-group@^4.3.0, react-transition-group@^4.4.5:
loose-envify "^1.4.0"
prop-types "^15.6.2"

"react@^16.3.0 || ^17 || ^18", "react@^16.3.0 || ^17.0.0 || ^18.0.0", "react@^16.6.0 || ^17.0.0 || ^18.0.0", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.0 || ^18.0.0", react@^18.0.0, react@^18.2.0, "react@>= 16", "react@>= 16.8.0", react@>=16.0.0, react@>=16.12.0, react@>=16.3.0, react@>=16.6.0, react@>=16.8, react@>=16.8.0:
"react@^16.3.0 || ^17 || ^18", "react@^16.3.0 || ^17.0.0 || ^18.0.0", "react@^16.6.0 || ^17.0.0 || ^18.0.0", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^17.0.0 || ^18.0.0", react@^18.0.0, react@^18.2.0, "react@>= 16", "react@>= 16.8.0", react@>=16.0.0, react@>=16.12.0, react@>=16.3.0, react@>=16.6.0, react@>=16.8, react@>=16.8.0, react@>=17.0.2:
version "18.2.0"
resolved "https://registry.npmjs.org/react/-/react-18.2.0.tgz"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
Expand Down

0 comments on commit febfa61

Please sign in to comment.