Skip to content

Commit

Permalink
Merge pull request #88 from agiledev-students-fall2023/anasofia
Browse files Browse the repository at this point in the history
removed login and added css to feedback
  • Loading branch information
r8btx authored Nov 29, 2023
2 parents 2ce6d6f + 9205a3c commit 44126b1
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 310 deletions.
10 changes: 0 additions & 10 deletions back-end/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ const app = express();
const cors = require("cors");
const morgan = require("morgan");
require("dotenv").config({ silent: true });
const jwt = require("jsonwebtoken");
const passport = require("passport");

const jwtStrategy = require("./config/jwt-config.js");
passport.use(jwtStrategy);

app.use(passport.initialize());

const mongoose = require("mongoose");
const User = require("./models/User.js");
const Feedback = require("./models/Feedback.js");

// connect to the database
Expand All @@ -32,10 +24,8 @@ app.use(express.urlencoded({ extended: true }));

app.use(cors({ origin: process.env.FRONT_END_DOMAIN, credentials: true }));

const authenticationRoutes = require("./routes/authentication-routes.js");
const feedbackRoutes = require("./routes/feedback-routes.js");

app.use("/auth", authenticationRoutes());
app.use("/feedback", feedbackRoutes());


Expand Down
38 changes: 0 additions & 38 deletions back-end/config/jwt-config.js

This file was deleted.

63 changes: 0 additions & 63 deletions back-end/models/User.js

This file was deleted.

2 changes: 1 addition & 1 deletion back-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "NYU Shuttle Backend",
"main": "server.js",
"scripts": {
"test": "mocha --timeout 10000000",
"test": "mocha --timeout 2000",
"coverage": "nyc --reporter=html --reporter=text --reporter=lcov --reporter=clover mocha --timeout 10000 --exit",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
Expand Down
106 changes: 0 additions & 106 deletions back-end/routes/authentication-routes.js

This file was deleted.

49 changes: 0 additions & 49 deletions back-end/test/login.test.js

This file was deleted.

39 changes: 0 additions & 39 deletions back-end/test/logout.test.js

This file was deleted.

2 changes: 1 addition & 1 deletion front-end/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function App() {
};

const devTools = (e) => {
if (e.keyCode === 82) {
if ((e.keyCode === 82 && e.metaKey) || (e.keyCode === 82 && e.ctrlKey)){
// R key
console.log('Resetting local storage...');
localStorage.clear();
Expand Down
7 changes: 6 additions & 1 deletion front-end/src/components/settings/FeedbackSupportPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const FeedbackSupportPage = () => {

const handleSubmit = async (e) => {
e.preventDefault();
if (category === "" || feedback === "") {
if (userId == null || category === "" || feedback === "") {
setResponse({});
setErrorMessage("Please fill out all fields");
return;
}
Expand All @@ -32,13 +33,15 @@ const FeedbackSupportPage = () => {
requestData
);
console.log(`Server response: ${JSON.stringify(response.data, null, 0)}`);
setErrorMessage("");
setResponse(response.data);
} catch (err) {
console.log(err);
setErrorMessage(err.message);
} finally {
setCategory("");
setFeedback("");

}
};

Expand All @@ -50,6 +53,8 @@ const FeedbackSupportPage = () => {
<div>
<h1 className="settings-header">Feedback / Support</h1>
</div>
{errorMessage && <div className="error-message">{errorMessage}</div>}
{response.message && <div className="success-message"> Thank you for the feedback!</div>}
<div>
<div className="feedback-item">
<label htmlFor="category" className="feedback-label">
Expand Down
Loading

0 comments on commit 44126b1

Please sign in to comment.