Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.1 #24

Merged
merged 10 commits into from
Jan 2, 2021
144 changes: 88 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/core": "^4.11.2",
"@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
Expand All @@ -22,7 +22,8 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.1"
"react-scripts": "^4.0.1",
"react-virtualized": "^9.22.3"
},
"scripts": {
"start:client": "react-scripts start",
Expand Down
4 changes: 2 additions & 2 deletions src/components/admin/WorkorderCreate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment, useState } from "react";
import WorkorderEditor from "../root/WorkorderEditor";

const WorkorderAdd = ({ currentUserProfile }) => {
const WorkorderAdd = ({ currentProfile }) => {
const [workorder, setWorkorder] = useState();

const updateWorkorderField = (e) => {
Expand All @@ -13,7 +13,7 @@ const WorkorderAdd = ({ currentUserProfile }) => {
const addRecord = async (e) => {
e.preventDefault();
try {
const userId = currentUserProfile.id;
const userId = currentProfile.id;
const { brand, model, colour } = workorder;
const response = await fetch(`/api/workorder/create/${userId}`, {
method: "POST",
Expand Down
6 changes: 3 additions & 3 deletions src/components/root/MainContentSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import AdvertHero from "./AdvertHero";
import AuthContainer from "../../backend/authorization/AuthContainer";

function MainContentSection({ loginClick }) {
const [currentUserProfile] = useContext(UserContext);
const [currentProfile] = useContext(UserContext);

let content;
if (loginClick) {
if (currentUserProfile) {
if (currentProfile) {
content = (
<div className="mainContentSection">
<section id="sidebar__wrapper">
Expand All @@ -26,7 +26,7 @@ function MainContentSection({ loginClick }) {
{/* prettier-ignore */}
<Switch>
<Route path="/home" render={() => <Home />} />
<Route path="/profile" render={() => <Profile currentUserProfile={currentUserProfile} />} />
<Route path="/profile" render={() => <Profile currentProfile={currentProfile} />} />
<Route path="/workorder" render={() => <Workorder />} />
<Route path="/settings" render={() => <Settings />} />
</Switch>
Expand Down
4 changes: 2 additions & 2 deletions src/components/root/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { UserContext } from "../../backend/authorization/UserContext";
// TODO - IF user is ADMIN show everything

const Profile = () => {
const [impersonator] = useContext(ImpersonatorContext);
const [admin] = useContext(ImpersonatorContext);
const [currentProfile, setCurrentProfile] = useContext(UserContext);
const [searchOrAdd, setSearchOrAdd] = useState(null);

Expand All @@ -23,7 +23,7 @@ const Profile = () => {
};

let content;
if (impersonator) {
if (admin) {
if (!currentProfile._id) {
content = (
<Fragment>
Expand Down
Loading