diff --git a/webstillas/.gitignore b/webstillas/.gitignore index a2cdb7ce9acf241d1c34f5b520faef5e3051382d..dac8e708f644dfc5efa6830f8f6bc6ff417f96cb 100644 --- a/webstillas/.gitignore +++ b/webstillas/.gitignore @@ -23,4 +23,4 @@ yarn-debug.log* yarn-error.log* -/src/firebaseConfig.js +/src/Config/firebaseConfig.js diff --git a/webstillas/src/components/mapPage/marker.png b/webstillas/src/Assets/Images/marker.png similarity index 100% rename from webstillas/src/components/mapPage/marker.png rename to webstillas/src/Assets/Images/marker.png diff --git a/webstillas/src/components/userinformation/profile-png-icon-2.png b/webstillas/src/Assets/Images/profile-png-icon-2.png similarity index 100% rename from webstillas/src/components/userinformation/profile-png-icon-2.png rename to webstillas/src/Assets/Images/profile-png-icon-2.png diff --git a/webstillas/src/components/scaffolding/images/Bunnskrue.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Bunnskrue.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Bunnskrue.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Bunnskrue.jpg diff --git a/webstillas/src/components/scaffolding/images/Diagonalstang.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Diagonalstang.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Diagonalstang.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Diagonalstang.jpg diff --git "a/webstillas/src/components/scaffolding/images/Enr\303\270rsbjelke.jpg" "b/webstillas/src/Assets/Images/scaffoldingImages/Enr\303\270rsbjelke.jpg" similarity index 100% rename from "webstillas/src/components/scaffolding/images/Enr\303\270rsbjelke.jpg" rename to "webstillas/src/Assets/Images/scaffoldingImages/Enr\303\270rsbjelke.jpg" diff --git a/webstillas/src/components/scaffolding/images/Gelender.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Gelender.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Gelender.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Gelender.jpg diff --git a/webstillas/src/components/scaffolding/images/Lengdebjelke.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Lengdebjelke.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Lengdebjelke.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Lengdebjelke.jpg diff --git a/webstillas/src/components/scaffolding/images/Plank.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Plank.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Plank.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Plank.jpg diff --git a/webstillas/src/components/scaffolding/images/Rekkverksramme.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Rekkverksramme.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Rekkverksramme.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Rekkverksramme.jpg diff --git a/webstillas/src/components/scaffolding/images/Spir.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Spir.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Spir.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Spir.jpg diff --git a/webstillas/src/components/scaffolding/images/Stillaslem.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Stillaslem.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Stillaslem.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Stillaslem.jpg diff --git a/webstillas/src/components/scaffolding/images/Trapp.jpg b/webstillas/src/Assets/Images/scaffoldingImages/Trapp.jpg similarity index 100% rename from webstillas/src/components/scaffolding/images/Trapp.jpg rename to webstillas/src/Assets/Images/scaffoldingImages/Trapp.jpg diff --git a/webstillas/src/components/projects/images/scaffoldingimg.jpg b/webstillas/src/Assets/Images/scaffoldingimg.jpg similarity index 100% rename from webstillas/src/components/projects/images/scaffoldingimg.jpg rename to webstillas/src/Assets/Images/scaffoldingimg.jpg diff --git a/webstillas/src/App.css b/webstillas/src/Assets/Styles/App.css similarity index 100% rename from webstillas/src/App.css rename to webstillas/src/Assets/Styles/App.css diff --git a/webstillas/src/components/projects/elements/Modal.css b/webstillas/src/Assets/Styles/Modal.css similarity index 99% rename from webstillas/src/components/projects/elements/Modal.css rename to webstillas/src/Assets/Styles/Modal.css index 9dc167d37654f241f4ba79b73df6e262905eb303..5b694b31e8eaebcf0b3873b0980d4273b15b7687 100644 --- a/webstillas/src/components/projects/elements/Modal.css +++ b/webstillas/src/Assets/Styles/Modal.css @@ -28,7 +28,6 @@ } - .card{ width: 450px; margin-bottom: 20px; diff --git a/webstillas/src/components/scaffolding/elements/Modalscaffolding.css b/webstillas/src/Assets/Styles/Modalscaffolding.css similarity index 100% rename from webstillas/src/components/scaffolding/elements/Modalscaffolding.css rename to webstillas/src/Assets/Styles/Modalscaffolding.css diff --git a/webstillas/src/components/Spinner.css b/webstillas/src/Assets/Styles/Spinner.css similarity index 100% rename from webstillas/src/components/Spinner.css rename to webstillas/src/Assets/Styles/Spinner.css diff --git a/webstillas/src/components/logistics/project/addProject.css b/webstillas/src/Assets/Styles/addProject.css similarity index 100% rename from webstillas/src/components/logistics/project/addProject.css rename to webstillas/src/Assets/Styles/addProject.css diff --git a/webstillas/src/components/logistics/scaffold/addScaffolding.css b/webstillas/src/Assets/Styles/addScaffolding.css similarity index 100% rename from webstillas/src/components/logistics/scaffold/addScaffolding.css rename to webstillas/src/Assets/Styles/addScaffolding.css diff --git a/webstillas/src/components/projects/elements/card.css b/webstillas/src/Assets/Styles/card.css similarity index 100% rename from webstillas/src/components/projects/elements/card.css rename to webstillas/src/Assets/Styles/card.css diff --git a/webstillas/src/firebaselogin.css b/webstillas/src/Assets/Styles/firebaselogin.css similarity index 100% rename from webstillas/src/firebaselogin.css rename to webstillas/src/Assets/Styles/firebaselogin.css diff --git a/webstillas/src/components/logistics/project/map.css b/webstillas/src/Assets/Styles/map.css similarity index 100% rename from webstillas/src/components/logistics/project/map.css rename to webstillas/src/Assets/Styles/map.css diff --git a/webstillas/src/components/mapPage/mapPage.css b/webstillas/src/Assets/Styles/mapPage.css similarity index 100% rename from webstillas/src/components/mapPage/mapPage.css rename to webstillas/src/Assets/Styles/mapPage.css diff --git a/webstillas/src/components/projects/elements/preView.css b/webstillas/src/Assets/Styles/preView.css similarity index 100% rename from webstillas/src/components/projects/elements/preView.css rename to webstillas/src/Assets/Styles/preView.css diff --git a/webstillas/src/components/projects/projects.css b/webstillas/src/Assets/Styles/projects.css similarity index 100% rename from webstillas/src/components/projects/projects.css rename to webstillas/src/Assets/Styles/projects.css diff --git a/webstillas/src/components/scaffolding/scaffolding.css b/webstillas/src/Assets/Styles/scaffolding.css similarity index 100% rename from webstillas/src/components/scaffolding/scaffolding.css rename to webstillas/src/Assets/Styles/scaffolding.css diff --git a/webstillas/src/components/scaffolding/elements/scaffoldingCard.css b/webstillas/src/Assets/Styles/scaffoldingCard.css similarity index 100% rename from webstillas/src/components/scaffolding/elements/scaffoldingCard.css rename to webstillas/src/Assets/Styles/scaffoldingCard.css diff --git a/webstillas/src/components/topBar/topBar.css b/webstillas/src/Assets/Styles/topBar.css similarity index 75% rename from webstillas/src/components/topBar/topBar.css rename to webstillas/src/Assets/Styles/topBar.css index b0a685c7f18912a6eb9f508d77ae624b0db6c3ff..a04ea4eb1cca1f4d09d936adbacb81b18b56bede 100644 --- a/webstillas/src/components/topBar/topBar.css +++ b/webstillas/src/Assets/Styles/topBar.css @@ -6,9 +6,16 @@ .dropdown-toggle-topbar{ height: 70px; width: 150px; + border-style: none; + border-radius: 0; } + +.dropdown-toggle-topbar:hover .button{ + background-color:#d07506; ; +} + .button{ width: 150px; height: 70px; diff --git a/webstillas/src/components/userinformation/userInfo.css b/webstillas/src/Assets/Styles/userInfo.css similarity index 100% rename from webstillas/src/components/userinformation/userInfo.css rename to webstillas/src/Assets/Styles/userInfo.css diff --git a/webstillas/src/context/UserAuthContext.js b/webstillas/src/Config/UserAuthContext.js similarity index 97% rename from webstillas/src/context/UserAuthContext.js rename to webstillas/src/Config/UserAuthContext.js index f4e3fdefa1e5123dc786265bd503119c4f758fc8..f5dc8fe203ce763167327a21a456f8c509b2247a 100644 --- a/webstillas/src/context/UserAuthContext.js +++ b/webstillas/src/Config/UserAuthContext.js @@ -5,12 +5,11 @@ import { onAuthStateChanged, signOut, } from "firebase/auth"; -import { auth } from "../firebase"; +import { auth } from "./firebase"; const userAuthContext = createContext(); //Hentet fra https://github.com/WebDevSimplified/React-Firebase-Auth - /** *Function that handles firebase log in and sign up. * diff --git a/webstillas/src/firebase.js b/webstillas/src/Config/firebase.js similarity index 100% rename from webstillas/src/firebase.js rename to webstillas/src/Config/firebase.js diff --git a/webstillas/src/modelData/constantsFile.js b/webstillas/src/Constants/apiURL.js similarity index 100% rename from webstillas/src/modelData/constantsFile.js rename to webstillas/src/Constants/apiURL.js diff --git a/webstillas/src/components/constants.js b/webstillas/src/Constants/webURL.js similarity index 100% rename from webstillas/src/components/constants.js rename to webstillas/src/Constants/webURL.js diff --git a/webstillas/src/components/projects/tabView/Tab.js b/webstillas/src/Layout/tabView/Tab.js similarity index 100% rename from webstillas/src/components/projects/tabView/Tab.js rename to webstillas/src/Layout/tabView/Tab.js diff --git a/webstillas/src/components/projects/tabView/Tabs.js b/webstillas/src/Layout/tabView/Tabs.js similarity index 100% rename from webstillas/src/components/projects/tabView/Tabs.js rename to webstillas/src/Layout/tabView/Tabs.js diff --git a/webstillas/src/components/topBar/topBar.js b/webstillas/src/Layout/topBar/topBar.js similarity index 89% rename from webstillas/src/components/topBar/topBar.js rename to webstillas/src/Layout/topBar/topBar.js index 1fd3447192e7c905480c4399455eb30df378dd19..3213af42806e1ba2ef4dad6cb0ed900b4bee8cf0 100644 --- a/webstillas/src/components/topBar/topBar.js +++ b/webstillas/src/Layout/topBar/topBar.js @@ -1,21 +1,21 @@ import React from "react"; -import './topBar.css'; +import '../../Assets/Styles/topBar.css'; import { AppBar, Toolbar, Button } from '@material-ui/core'; import {Link} from "react-router-dom"; import {Dropdown } from "react-bootstrap"; import DropdownItem from "react-bootstrap/DropdownItem"; -import {useUserAuth} from "../../context/UserAuthContext"; -import {auth} from "../../firebase" -import {GetCachingData} from "../../modelData/addData"; -import {USER_URL} from "../../modelData/constantsFile"; -import {SpinnerDefault} from "../Spinner"; +import {useUserAuth} from "../../Config/UserAuthContext"; +import {auth} from "../../Config/firebase" +import {GetCachingData} from "../../Middleware/addData"; +import {USER_URL} from "../../Constants/apiURL"; +import {SpinnerDefault} from "../../components/Indicators/Spinner"; import "bootstrap/dist/css/bootstrap.min.css"; -import {ADD_PROJECT_URL, ADD_SCAFFOLDING_URL, MAP_URL, PROJECT_URL, SCAFFOLDING_URL, USERINFO_URL} from "../constants"; +import {ADD_PROJECT_URL, ADD_SCAFFOLDING_URL, MAP_URL, PROJECT_URL, SCAFFOLDING_URL, USERINFO_URL} from "../../Constants/webURL"; import DropdownToggle from "react-bootstrap/DropdownToggle"; import DropdownMenu from "react-bootstrap/DropdownMenu"; -import profileImg from "../userinformation/profile-png-icon-2.png" +import profileImg from "../../Assets/Images/profile-png-icon-2.png" /** Component that will be used as a top bar for the user to navigate throughout the application. diff --git a/webstillas/src/modelData/addData.js b/webstillas/src/Middleware/addData.js similarity index 100% rename from webstillas/src/modelData/addData.js rename to webstillas/src/Middleware/addData.js diff --git a/webstillas/src/modelData/deleteProject.js b/webstillas/src/Middleware/deleteProject.js similarity index 96% rename from webstillas/src/modelData/deleteProject.js rename to webstillas/src/Middleware/deleteProject.js index f461563b6ef3645ffef9b286fb1a4551122d732c..20fc25778a85045366e1fd61325a5370672e02e0 100644 --- a/webstillas/src/modelData/deleteProject.js +++ b/webstillas/src/Middleware/deleteProject.js @@ -1,4 +1,4 @@ -import {BASE_URL} from "./constantsFile" +import {BASE_URL} from "../Constants/apiURL" /** * Function that will send a delete request to an api. diff --git a/webstillas/src/modelData/fetchData.js b/webstillas/src/Middleware/fetchData.js similarity index 95% rename from webstillas/src/modelData/fetchData.js rename to webstillas/src/Middleware/fetchData.js index 76e2709b49dfe49127cf51773df704309e67a3b1..d370a31dcf4272d2cdda217aae20ea58bdc4fd6d 100644 --- a/webstillas/src/modelData/fetchData.js +++ b/webstillas/src/Middleware/fetchData.js @@ -1,4 +1,4 @@ -import {BASE_URL} from "./constantsFile" +import {BASE_URL} from "../Constants/apiURL" /** * Function to fetch data from an api diff --git a/webstillas/src/modelData/postModel.js b/webstillas/src/Middleware/postModel.js similarity index 96% rename from webstillas/src/modelData/postModel.js rename to webstillas/src/Middleware/postModel.js index 4089f85426e4ef40b26bff7acc65d83f4205e6a5..442ca96a66eae887a6ca22ad4c12d063efb6c8a2 100644 --- a/webstillas/src/modelData/postModel.js +++ b/webstillas/src/Middleware/postModel.js @@ -1,4 +1,4 @@ -import {BASE_URL} from "./constantsFile"; +import {BASE_URL} from "../Constants/apiURL"; /** * Function to post data to an api diff --git a/webstillas/src/modelData/putData.js b/webstillas/src/Middleware/putData.js similarity index 96% rename from webstillas/src/modelData/putData.js rename to webstillas/src/Middleware/putData.js index 2b9f3b6272de8a4c53574acc53567c7fe5dc1a90..53f87b7852e20724d8104dd3d04111c4a19e5df2 100644 --- a/webstillas/src/modelData/putData.js +++ b/webstillas/src/Middleware/putData.js @@ -1,4 +1,4 @@ -import {BASE_URL} from "./constantsFile"; +import {BASE_URL} from "../Constants/apiURL"; /** diff --git a/webstillas/src/components/Login.js b/webstillas/src/Pages/Login.js similarity index 92% rename from webstillas/src/components/Login.js rename to webstillas/src/Pages/Login.js index 9ee607a1698ca7a743aaad17efcd6d50f6dd30f9..d773da8897214d9ef0f82dec296c00322fe66465 100644 --- a/webstillas/src/components/Login.js +++ b/webstillas/src/Pages/Login.js @@ -2,9 +2,9 @@ import React, { useState } from "react"; import { Link, useNavigate } from "react-router-dom"; import { Form, Alert } from "react-bootstrap"; import { Button } from "react-bootstrap"; -import { useUserAuth } from "../context/UserAuthContext"; -import {PROJECT_URL, SIGNUP} from "./constants"; -import "../firebaselogin.css" +import { useUserAuth } from "../Config/UserAuthContext"; +import {PROJECT_URL, SIGNUP} from "../Constants/webURL"; +import "../Assets/Styles/firebaselogin.css" /** diff --git a/webstillas/src/components/Signup.js b/webstillas/src/Pages/Signup.js similarity index 94% rename from webstillas/src/components/Signup.js rename to webstillas/src/Pages/Signup.js index 82c52a45108aedba90eaaaabdbae907cd9f4f9f5..8ac81235731fcca1a3323c37959352c22ddb0b81 100644 --- a/webstillas/src/components/Signup.js +++ b/webstillas/src/Pages/Signup.js @@ -2,12 +2,12 @@ import React, {useState} from "react"; import {Link, useNavigate} from "react-router-dom"; import {Form, Alert} from "react-bootstrap"; import {Button} from "react-bootstrap"; -import {useUserAuth} from "../context/UserAuthContext"; -import postModel from "../modelData/postModel"; -import {formatDateToString} from "./projects/projects"; -import {LOGIN} from "./constants"; -import {USER_POST_URL} from "../modelData/constantsFile"; -import "../firebaselogin.css" +import {useUserAuth} from "../Config/UserAuthContext"; +import postModel from "../Middleware/postModel"; +import {formatDateToString} from "./projects"; +import {LOGIN} from "../Constants/webURL"; +import {USER_POST_URL} from "../Constants/apiURL"; +import "../Assets/Styles/firebaselogin.css" /** * Function that will register a new user to the system. diff --git a/webstillas/src/components/logistics/project/map.js b/webstillas/src/Pages/addProjectMap.js similarity index 90% rename from webstillas/src/components/logistics/project/map.js rename to webstillas/src/Pages/addProjectMap.js index 65f9895e75f30f2368f80def5641d57d31501079..00b7d4134262c9418ae49364fda1ada7cef677b3 100644 --- a/webstillas/src/components/logistics/project/map.js +++ b/webstillas/src/Pages/addProjectMap.js @@ -2,15 +2,15 @@ import React, {useState} from "react"; import ReactMapboxGl, {ZoomControl} from "react-mapbox-gl"; import DrawControl from "react-mapbox-gl-draw"; import "@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css"; -import postModel from "../../../modelData/postModel"; -import {MAP_STYLE_V11, PROJECTS_URL} from "../../../modelData/constantsFile"; +import postModel from "../Middleware/postModel"; +import {MAP_STYLE_V11, PROJECTS_URL} from "../Constants/apiURL"; import {useQueryClient} from "react-query"; import polygon from "@mapbox/mapbox-gl-draw/src/feature_types/polygon"; -import "./map.css" -import {MapBoxAPIKey} from "../../../firebaseConfig"; -import {AlertCatch} from "../../error/error"; +import "../Assets/Styles/map.css" +import {MapBoxAPIKey} from "../Config/firebaseConfig"; +import {AlertCatch} from "../components/Indicators/error"; -const Map = ReactMapboxGl({ +const AddProjectMap = ReactMapboxGl({ accessToken: MapBoxAPIKey }); @@ -18,7 +18,7 @@ const Map = ReactMapboxGl({ * Function that will display a map, and allow a user to draw a polygon. * * @param props variables sent from previous view. - * @returns {JSX.Element} Map with draw controllers. + * @returns {JSX.Element} AddProjectMap with draw controllers. */ export function MapClass(props) { //Query client that will manage the caching. @@ -95,7 +95,7 @@ export function MapClass(props) { return ( <div className="App"> <div className={"map"}> - <Map + <AddProjectMap style={MAP_STYLE_V11} containerStyle={{ height: "80vh", @@ -120,7 +120,7 @@ export function MapClass(props) { <ZoomControl position="bottom-right" /> - </Map> + </AddProjectMap> </div> <button className={"confirm-btn"} disabled={!ok || !props.valid} onClick={AddProjectRequest}>Add Project</button> </div> diff --git a/webstillas/src/components/logistics/scaffold/addScaffolding.js b/webstillas/src/Pages/addScaffolding.js similarity index 96% rename from webstillas/src/components/logistics/scaffold/addScaffolding.js rename to webstillas/src/Pages/addScaffolding.js index 3fc4f8f4cc1807456a6b1c17514f710a3c1aebad..89a6e945aa37d82607a26912f418516f283b319b 100644 --- a/webstillas/src/components/logistics/scaffold/addScaffolding.js +++ b/webstillas/src/Pages/addScaffolding.js @@ -1,7 +1,7 @@ import React, {useState} from 'react' -import postModel from "../../../modelData/postModel"; -import {SCAFFOLDING_URL} from "../../../modelData/constantsFile"; -import "./addScaffolding.css" +import postModel from "../Middleware/postModel"; +import {SCAFFOLDING_URL} from "../Constants/apiURL"; +import "../Assets/Styles/addScaffolding.css" import {Alert} from "react-bootstrap"; diff --git a/webstillas/src/components/mapPage/mapPage.js b/webstillas/src/Pages/mapPage.js similarity index 83% rename from webstillas/src/components/mapPage/mapPage.js rename to webstillas/src/Pages/mapPage.js index 6039ff4ada087465aecce745f960c168df3f024d..2a8e2d7d67c5072d29bcbf450bbbd67eaf26e254 100644 --- a/webstillas/src/components/mapPage/mapPage.js +++ b/webstillas/src/Pages/mapPage.js @@ -1,12 +1,12 @@ import React from "react"; -import "./mapPage.css" -import {MAP_STYLE_V11, PROJECTS_WITH_SCAFFOLDING_URL} from "../../modelData/constantsFile"; -import {GetCachingData} from "../../modelData/addData"; +import "../Assets/Styles/mapPage.css" +import {MAP_STYLE_V11, PROJECTS_WITH_SCAFFOLDING_URL} from "../Constants/apiURL"; +import {GetCachingData} from "../Middleware/addData"; import ReactMapboxGl, {ScaleControl, Marker, ZoomControl} from "react-mapbox-gl"; -import {MapBoxAPIKey} from "../../firebaseConfig"; -import img from "./marker.png" -import {InternalServerError} from "../error/error"; -import {SpinnerDefault} from "../Spinner"; +import {MapBoxAPIKey} from "../Config/firebaseConfig"; +import img from "../Assets/Images/marker.png" +import {InternalServerError} from "../components/Indicators/error"; +import {SpinnerDefault} from "../components/Indicators/Spinner"; const Map = ReactMapboxGl({ accessToken: MapBoxAPIKey diff --git a/webstillas/src/components/projects/projects.js b/webstillas/src/Pages/projects.js similarity index 94% rename from webstillas/src/components/projects/projects.js rename to webstillas/src/Pages/projects.js index 577e53cb09a7470bb6150cd72f34fc96a3bfa07b..ef9f8ca68ea8ef093f5d364018196764b225f5eb 100644 --- a/webstillas/src/components/projects/projects.js +++ b/webstillas/src/Pages/projects.js @@ -1,11 +1,11 @@ import React, {useState} from "react"; -import "./projects.css" -import CardElement from './elements/card' +import "../Assets/Styles/projects.css" +import CardElement from '../components/projects/mainProjectCard' import {Route, Routes} from "react-router-dom"; -import {PROJECTS_WITH_SCAFFOLDING_URL} from "../../modelData/constantsFile"; -import {GetCachingData} from "../../modelData/addData"; -import {SpinnerDefault} from "../Spinner"; -import {InternalServerError} from "../error/error"; +import {PROJECTS_WITH_SCAFFOLDING_URL} from "../Constants/apiURL"; +import {GetCachingData} from "../Middleware/addData"; +import {SpinnerDefault} from "../components/Indicators/Spinner"; +import {InternalServerError} from "../components/Indicators/error"; /** @@ -30,7 +30,7 @@ export function Project() { return ( <SpinnerDefault/> ) - } else if (isError) //If an error while fetching data has occurred + } else if (isError) //If an Indicators while fetching data has occurred { return <InternalServerError/> } else { diff --git a/webstillas/src/components/scaffolding/scaffolding.js b/webstillas/src/Pages/scaffolding.js similarity index 94% rename from webstillas/src/components/scaffolding/scaffolding.js rename to webstillas/src/Pages/scaffolding.js index 8b9750bce76a02687e72635cef8181a4a111e8fd..b16ef2a33033e5cbc177d85dd9739be0b7362b46 100644 --- a/webstillas/src/components/scaffolding/scaffolding.js +++ b/webstillas/src/Pages/scaffolding.js @@ -1,10 +1,10 @@ import React from "react"; -import "./scaffolding.css" -import CardElement from "./elements/scaffoldingCard"; -import {PROJECTS_WITH_SCAFFOLDING_URL, SCAFFOLDING_URL, STORAGE_URL} from "../../modelData/constantsFile"; -import {GetCachingData} from "../../modelData/addData"; -import {SpinnerDefault} from "../Spinner"; -import {InternalServerError} from "../error/error"; +import "../Assets/Styles/scaffolding.css" +import CardElement from "../components/scaffolding/scaffoldingCard"; +import {PROJECTS_WITH_SCAFFOLDING_URL, SCAFFOLDING_URL, STORAGE_URL} from "../Constants/apiURL"; +import {GetCachingData} from "../Middleware/addData"; +import {SpinnerDefault} from "../components/Indicators/Spinner"; +import {InternalServerError} from "../components/Indicators/error"; /** Class that will create an overview of the scaffolding parts @@ -152,7 +152,7 @@ export const Scaffolding = () => { //If loading if (LoadingScaffolding || LoadingStorage || LoadingAll) { return <SpinnerDefault /> - } else if(scaffoldingError || storageError || allProjectError) //If loading error + } else if(scaffoldingError || storageError || allProjectError) //If loading Indicators { return <InternalServerError /> } else { //On success diff --git a/webstillas/src/components/userinformation/userInfo.js b/webstillas/src/Pages/userInfo.js similarity index 90% rename from webstillas/src/components/userinformation/userInfo.js rename to webstillas/src/Pages/userInfo.js index 38b23448beb85ae9988d4dbd129ff8ec3d428bfa..4b9588df826234cb4222801707204c7b8826022e 100644 --- a/webstillas/src/components/userinformation/userInfo.js +++ b/webstillas/src/Pages/userInfo.js @@ -1,11 +1,11 @@ import React from "react"; -import { auth } from "../../firebase"; -import {GetCachingData} from "../../modelData/addData"; -import { USER_URL} from "../../modelData/constantsFile"; -import {SpinnerDefault} from "../Spinner"; -import "./userInfo.css" -import profileImg from "./profile-png-icon-2.png" -import {InternalServerError} from "../error/error"; +import { auth } from "../Config/firebase"; +import {GetCachingData} from "../Middleware/addData"; +import { USER_URL} from "../Constants/apiURL"; +import {SpinnerDefault} from "../components/Indicators/Spinner"; +import "../Assets/Styles/userInfo.css" +import profileImg from "../Assets/Images/profile-png-icon-2.png" +import {InternalServerError} from "../components/Indicators/error"; /** @@ -14,8 +14,6 @@ import {InternalServerError} from "../error/error"; * @constructor */ export function UserInfo(){ - //Todo add if error - let isLoadingUser, userData, isErrorUser //If user is authenticated load user data diff --git a/webstillas/src/App.js b/webstillas/src/Routes/App.js similarity index 70% rename from webstillas/src/App.js rename to webstillas/src/Routes/App.js index 5739acddd339bb7e9698dc4310637b283f51d190..567b8eca210a52a59ed964158a01b15025c2ac3a 100644 --- a/webstillas/src/App.js +++ b/webstillas/src/Routes/App.js @@ -1,28 +1,28 @@ -import './App.css'; +import '../Assets/Styles/App.css'; import React from "react"; import {Routes, Route} from "react-router-dom"; -import {Project} from "./components/projects/projects"; -import {MapPage} from "./components/mapPage/mapPage"; -import {Scaffolding} from "./components/scaffolding/scaffolding"; -import TopBar from "./components/topBar/topBar"; -import {PreView} from "./components/projects/elements/preView"; +import {Project} from "../Pages/projects"; +import {MapPage} from "../Pages/mapPage"; +import {Scaffolding} from "../Pages/scaffolding"; +import TopBar from "../Layout/topBar/topBar"; +import {PreViewSite} from "../components/projects/preViewSite"; import {QueryClientProvider, QueryClient} from 'react-query' import {ReactQueryDevtools} from 'react-query/devtools' -import ProtectedRoute from "./components/ProtectedRoute"; -import Login from "./components/Login"; -import Signup from "./components/Signup"; -import {UserAuthContextProvider} from "./context/UserAuthContext"; -import AddProjectFunc from "./components/logistics/project/addProject"; -import AddScaffolding from "./components/logistics/scaffold/addScaffolding"; -import {UserInfo} from "./components/userinformation/userInfo"; -import {NotFound} from "./components/error/error"; +import ProtectedRoute from "./ProtectedRoute"; +import Login from "../Pages/Login"; +import Signup from "../Pages/Signup"; +import {UserAuthContextProvider} from "../Config/UserAuthContext"; +import AddProjectFunc from "../components/addproject/addProject"; +import AddScaffolding from "../Pages/addScaffolding"; +import {UserInfo} from "../Pages/userInfo"; +import {NotFound} from "../components/Indicators/error"; import { ADD_PROJECT_URL, ADD_SCAFFOLDING_URL, LOGIN, MAP_URL, NOTFOUND, PROJECT_URL, PROJECT_URL_ID, SCAFFOLDING_URL, SIGNUP, USERINFO_URL -} from "./components/constants"; +} from "../Constants/webURL"; const queryClient = new QueryClient() @@ -44,7 +44,7 @@ function App() { <Route path={PROJECT_URL} exact={true} element={<ProtectedRoute> <Project/></ProtectedRoute>}/> <Route path={MAP_URL} exact={true} element={<ProtectedRoute> <MapPage/></ProtectedRoute>}/> <Route path={SCAFFOLDING_URL} exact={true} element={<ProtectedRoute> <Scaffolding/></ProtectedRoute>}/> - <Route path={PROJECT_URL_ID} exact={true} element={<ProtectedRoute> <PreView/></ProtectedRoute>}/> + <Route path={PROJECT_URL_ID} exact={true} element={<ProtectedRoute> <PreViewSite/></ProtectedRoute>}/> <Route path={LOGIN} exact={true} element={<Login/>}/> <Route path={SIGNUP} exact={true} element={<Signup/>}/> <Route path={ADD_PROJECT_URL} exact={true} diff --git a/webstillas/src/components/ProtectedRoute.js b/webstillas/src/Routes/ProtectedRoute.js similarity index 89% rename from webstillas/src/components/ProtectedRoute.js rename to webstillas/src/Routes/ProtectedRoute.js index 48fb7ca8ceaf5e740e3231b227efda1bfc174b9d..fec81fa9af1c76c9017e45773c1a981ab64782ca 100644 --- a/webstillas/src/components/ProtectedRoute.js +++ b/webstillas/src/Routes/ProtectedRoute.js @@ -1,6 +1,6 @@ import React from "react"; import { Navigate } from "react-router-dom"; -import { useUserAuth } from "../context/UserAuthContext"; +import { useUserAuth } from "../Config/UserAuthContext"; /** * Function that will check if the user is authenticated, before sending the user to a protected route diff --git a/webstillas/src/components/Spinner.js b/webstillas/src/components/Indicators/Spinner.js similarity index 91% rename from webstillas/src/components/Spinner.js rename to webstillas/src/components/Indicators/Spinner.js index 00c67e4748958add30a4e7af834680dcdfad08d2..9ce4cca4a06b2899351731a65cd43c303581b800 100644 --- a/webstillas/src/components/Spinner.js +++ b/webstillas/src/components/Indicators/Spinner.js @@ -1,6 +1,6 @@ import {Spinner} from "react-bootstrap"; import React from "react"; -import "./Spinner.css" +import "../../Assets/Styles/Spinner.css" /** * Function that will return a spinner diff --git a/webstillas/src/components/error/error.js b/webstillas/src/components/Indicators/error.js similarity index 85% rename from webstillas/src/components/error/error.js rename to webstillas/src/components/Indicators/error.js index 47568b00833878c02bb42b4f32a1bad58d054ef8..da95832803808d126d6e4432f4220f894d31deed 100644 --- a/webstillas/src/components/error/error.js +++ b/webstillas/src/components/Indicators/error.js @@ -10,7 +10,7 @@ export function NotFound() { } /* -Error function that will be displayed if a server error occurs. +Error function that will be displayed if a server Indicators occurs. */ export function InternalServerError() { return ( diff --git a/webstillas/src/components/logistics/project/addProject.js b/webstillas/src/components/addproject/addProject.js similarity index 97% rename from webstillas/src/components/logistics/project/addProject.js rename to webstillas/src/components/addproject/addProject.js index 4c70678befab54d5b74f27b1671eb9cf39858cd6..6a1f342d2c43bb2ed294cbbc9bef25c43c156493 100644 --- a/webstillas/src/components/logistics/project/addProject.js +++ b/webstillas/src/components/addproject/addProject.js @@ -1,10 +1,10 @@ -import React, {useCallback, useRef, useState} from 'react' -import {MapClass} from "./map"; +import React, {useState} from 'react' +import {MapClass} from "../../Pages/addProjectMap"; import MapboxAutocomplete from "react-mapbox-autocomplete"; import 'mapbox-gl/dist/mapbox-gl.css' -import "./addProject.css" +import "../../Assets/Styles/addProject.css" import {Alert} from "react-bootstrap"; -import {MapBoxAPIKey} from "../../../firebaseConfig"; +import {MapBoxAPIKey} from "../../Config/firebaseConfig"; /** @@ -109,7 +109,7 @@ export default function AddProjectFunc() { /** * Function that will validate the customer input - * If input is not valid, then a predefined error message is set. + * If input is not valid, then a predefined Indicators message is set. * * @param fieldName is the object field that is going to be set * @param value is the object value to be set. @@ -139,7 +139,7 @@ export default function AddProjectFunc() { /** * Function to validate date format. - * If input is not valid, then a predefined error message is set. + * If input is not valid, then a predefined Indicators message is set. * * @param fieldName is the object field that is going to be set * @param value is the object value to be set. @@ -161,7 +161,7 @@ export default function AddProjectFunc() { /** * Function to validate projectDetails - * If input is not valid, then a predefined error message is set. + * If input is not valid, then a predefined Indicators message is set. * * @param fieldName is the object field that is going to be set * @param value is the object value to be set. @@ -263,7 +263,6 @@ export default function AddProjectFunc() { } - if (validStreet && validZip && validCounty && validMunicipality) { setValid({ ...valid, diff --git a/webstillas/src/components/error/error.css b/webstillas/src/components/error/error.css deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/webstillas/src/components/logistics/project/FormErrors.js b/webstillas/src/components/logistics/project/FormErrors.js deleted file mode 100644 index cfe04b561aeb239ea1929814731ace5b755bc1ba..0000000000000000000000000000000000000000 --- a/webstillas/src/components/logistics/project/FormErrors.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -export const FormErrors = ({formErrors}) => - <div className='formErrors'> - {Object.keys(formErrors).map((fieldName, i) => { - if(formErrors[fieldName].length > 0){ - return ( - <p key={i}>{fieldName} {formErrors[fieldName]}</p> - ) - } else { - return ''; - } - })} - </div> diff --git a/webstillas/src/components/projects/elements/card.js b/webstillas/src/components/projects/mainProjectCard.js similarity index 95% rename from webstillas/src/components/projects/elements/card.js rename to webstillas/src/components/projects/mainProjectCard.js index d29eb3e0f9d7ea4563c4d383383265e4ee9a47a3..2e642f0c8cf3fd5da2a3c650ee5334ae3c8e9f5d 100644 --- a/webstillas/src/components/projects/elements/card.js +++ b/webstillas/src/components/projects/mainProjectCard.js @@ -1,10 +1,10 @@ import React from 'react' import 'bootstrap/dist/css/bootstrap.min.css'; -import './card.css' -import img from '../images/scaffoldingimg.jpg' +import '../../Assets/Styles/card.css' +import img from '../../Assets/Images/scaffoldingimg.jpg' import {Link} from "react-router-dom"; -import {PROJECTS_URL} from "../../../modelData/constantsFile"; -import deleteModel from "../../../modelData/deleteProject"; +import {PROJECTS_URL} from "../../Constants/apiURL"; +import deleteModel from "../../Middleware/deleteProject"; import {useQueryClient} from "react-query"; import {IconButton} from "@material-ui/core"; import DeleteIcon from "@material-ui/icons/Delete"; diff --git a/webstillas/src/components/projects/elements/preView.js b/webstillas/src/components/projects/preViewSite.js similarity index 91% rename from webstillas/src/components/projects/elements/preView.js rename to webstillas/src/components/projects/preViewSite.js index 84626f76a3389c60b0bb8de28b25e8ca89d4245b..0ff0e7befe02c5b7b8d00c97c362b9316085fa7c 100644 --- a/webstillas/src/components/projects/elements/preView.js +++ b/webstillas/src/components/projects/preViewSite.js @@ -1,19 +1,19 @@ import React from "react"; -import "./preView.css" -import Tabs from "../tabView/Tabs" -import ScaffoldingCardProject from "../../scaffolding/elements/scaffoldingCardProject"; -import InfoModal from "./Modal"; +import "../../Assets/Styles/preView.css" +import Tabs from "../../Layout/tabView/Tabs" +import ScaffoldingCardProject from "../../components/projects/scaffoldingCardProject"; +import InfoModal from "./transferScaffoldingModal"; import { MAP_STYLE_V11, PROJECTS_URL_WITH_ID, WITH_SCAFFOLDING_URL -} from "../../../modelData/constantsFile"; -import img from "./../../mapPage/marker.png" -import {GetCachingData} from "../../../modelData/addData"; -import {SpinnerDefault} from "../../Spinner"; +} from "../../Constants/apiURL"; +import img from "../../Assets/Images/marker.png" +import {GetCachingData} from "../../Middleware/addData"; +import {SpinnerDefault} from "../Indicators/Spinner"; import ReactMapboxGl, {Marker} from "react-mapbox-gl"; -import {MapBoxAPIKey} from "../../../firebaseConfig"; -import {InternalServerError} from "../../error/error"; +import {MapBoxAPIKey} from "../../Config/firebaseConfig"; +import {InternalServerError} from "../Indicators/error"; const Map = ReactMapboxGl({ @@ -154,7 +154,7 @@ function contactInformation(project) { * Function that displays the whole page. * @returns {JSX.Element} */ -export const PreView = () => { +export const PreViewSite = () => { //Fetching the data of specific project. const {isLoading: projectLoad, data, isError } = GetCachingData(["project", getProjectID()], PROJECTS_URL_WITH_ID + getProjectID() + WITH_SCAFFOLDING_URL) diff --git a/webstillas/src/components/scaffolding/elements/scaffoldingCardProject.js b/webstillas/src/components/projects/scaffoldingCardProject.js similarity index 91% rename from webstillas/src/components/scaffolding/elements/scaffoldingCardProject.js rename to webstillas/src/components/projects/scaffoldingCardProject.js index d0c68fc9b9de206335d10cf634cb0fa14569c1f7..676018e480792f49e393ab72dcb317d47bd06ab3 100644 --- a/webstillas/src/components/scaffolding/elements/scaffoldingCardProject.js +++ b/webstillas/src/components/projects/scaffoldingCardProject.js @@ -15,7 +15,7 @@ function ScaffoldingProject(props){ <h3>{props.type.toUpperCase()}</h3> </section> <section className={"image"}> - <img className={"img"} src={require(`../images/${props.type.charAt(0).toUpperCase() + props.type.slice(1)}.jpg`)} alt={""}></img> + <img className={"img"} src={require(`../../Assets/Images/scaffoldingImages/${props.type.charAt(0).toUpperCase() + props.type.slice(1)}.jpg`)} alt={""}></img> </section> <section className={"information-highlights-cta"}> <div className={"information-highlights"}> diff --git a/webstillas/src/components/projects/elements/Modal.js b/webstillas/src/components/projects/transferScaffoldingModal.js similarity index 97% rename from webstillas/src/components/projects/elements/Modal.js rename to webstillas/src/components/projects/transferScaffoldingModal.js index 448cb1e040204703c072d2a1abf2d37a49e7299f..bbd54c2f26a66bf147f4bd2fdc20f304d2b2b5f7 100644 --- a/webstillas/src/components/projects/elements/Modal.js +++ b/webstillas/src/components/projects/transferScaffoldingModal.js @@ -1,16 +1,14 @@ import React, {useState} from "react"; import 'bootstrap/dist/css/bootstrap.min.css'; import {Button, Modal, Spinner} from 'react-bootstrap'; -import putModel from "../../../modelData/putData"; +import putModel from "../../Middleware/putData"; import { PROJECTS_WITH_SCAFFOLDING_URL, TRANSFER_SCAFFOLDING, -} from "../../../modelData/constantsFile"; +} from "../../Constants/apiURL"; import {useQueryClient} from "react-query"; -import "./Modal.css" -import {GetCachingData} from "../../../modelData/addData"; - - +import "../../Assets/Styles/Modal.css" +import {GetCachingData} from "../../Middleware/addData"; //https://ordinarycoders.com/blog/article/react-bootstrap-modal @@ -204,7 +202,7 @@ export default function InfoModalFunc(props) { </section> <section className={"image"}> <img className={"img"} - src={require(`../../scaffolding/images/${e.type.charAt(0).toUpperCase() + e.type.slice(1)}.jpg`)} + src={require(`../../Assets/Images/scaffoldingImages/${e.type.charAt(0).toUpperCase() + e.type.slice(1)}.jpg`)} alt={""}></img> </section> <input diff --git a/webstillas/src/components/scaffolding/elements/ModalScaffolding.js b/webstillas/src/components/scaffolding/projectsModal.js similarity index 94% rename from webstillas/src/components/scaffolding/elements/ModalScaffolding.js rename to webstillas/src/components/scaffolding/projectsModal.js index 26cc744da0c32cb389ea770420964dd85842a966..9d5a2a9e87e41dd2d5a6f75fd3baa00785a0bf83 100644 --- a/webstillas/src/components/scaffolding/elements/ModalScaffolding.js +++ b/webstillas/src/components/scaffolding/projectsModal.js @@ -1,10 +1,10 @@ import React, {useState} from "react"; import {Button, Modal} from "react-bootstrap"; import {Link} from "react-router-dom"; -import {GetCachingData} from "../../../modelData/addData"; -import {PROJECTS_WITH_SCAFFOLDING_URL} from "../../../modelData/constantsFile"; -import "./Modalscaffolding.css" -import img from "../../projects/images/scaffoldingimg.jpg" +import {GetCachingData} from "../../Middleware/addData"; +import {PROJECTS_WITH_SCAFFOLDING_URL} from "../../Constants/apiURL"; +import "../../Assets/Styles/Modalscaffolding.css" +import img from "../../Assets/Images/scaffoldingimg.jpg" /** diff --git a/webstillas/src/components/scaffolding/elements/scaffoldingCard.js b/webstillas/src/components/scaffolding/scaffoldingCard.js similarity index 89% rename from webstillas/src/components/scaffolding/elements/scaffoldingCard.js rename to webstillas/src/components/scaffolding/scaffoldingCard.js index 5781c30881a3ab8d3249994c5067b6d41ff3d4c4..95b06f72b2ff7f87bdf80cc8dcb1774756d4cc0c 100644 --- a/webstillas/src/components/scaffolding/elements/scaffoldingCard.js +++ b/webstillas/src/components/scaffolding/scaffoldingCard.js @@ -1,6 +1,6 @@ import React from 'react' -import './scaffoldingCard.css' -import InfoModal from "./ModalScaffolding"; +import '../../Assets/Styles/scaffoldingCard.css' +import InfoModal from "./projectsModal"; /** @@ -20,7 +20,7 @@ function CardElement(props){ <h3>{props.type.toUpperCase()}</h3> </section> <section className={"image"}> - <img className={"img"} src={require(`../images/${props.type.charAt(0).toUpperCase() + props.type.slice(1)}.jpg`)} alt={""}></img> + <img className={"img"} src={require(`../../Assets/Images/scaffoldingImages/${props.type.charAt(0).toUpperCase() + props.type.slice(1)}.jpg`)} alt={""}></img> </section> <section className={"information-highlights-cta"}> <div className={"information-highlights"}> diff --git a/webstillas/src/index.js b/webstillas/src/index.js index cce6a5274f6cd64f644f5213882636e6ae1a2a35..f724eb95f901c0fe3a92f1cf4413a9ba77728da2 100644 --- a/webstillas/src/index.js +++ b/webstillas/src/index.js @@ -1,6 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import App from './App'; +import App from './Routes/App'; import {BrowserRouter} from "react-router-dom"; ReactDOM.render(