details
-
- 1. Start a terminal app, such as Terminal on OSX or the Git Bash shell on Windows.
- 1. Create a src directory in the user's home directory and go in it
- ```
- cd && mkdir src && cd src
- ```
- 1. Clone the repository
- ```
- git clone https://github.com/hackforla/food-oasis
- ```
-
-
-1. Change to the food-oasis directory:
- ```
- cd food-oasis
- ```
-1. Install the node server npm depedencies:
- ```
- npm install
- ```
-1. Obtain the `.env` file from the project tech team and place it in this directory. It contains private info (i.e., the production database connection string) that we cannot put in this public GitHub repo.
-1. Change to the client directory:
- ```
- cd client
- ```
-1. Install the client (React) dependencies:
- ```
- npm install
- ```
-
-## To Run the React/Node Application
-
-1. Run `npm start` from the food-oasis directory to start the node server.
-1. Open a separate command shell and set the directory to the /client subdirectory, then `npm start` again to start the client application and open a browser pointing to it.
+
+## Contributing
+
+[Contributing to Food Oasis](/contributing.md)
## Features
diff --git a/app/controllers/stakeholder-controller.js b/app/controllers/stakeholder-controller.js
index a712a68ab..902e3942f 100644
--- a/app/controllers/stakeholder-controller.js
+++ b/app/controllers/stakeholder-controller.js
@@ -2,11 +2,11 @@ const stakeholderService = require("../services/stakeholder-service");
const search = (req, res) => {
let categoryIds = req.query.categoryIds;
- if (!categoryIds) {
- categoryIds = ["1", "2", "3", "4", "5", "6"];
- } else if (typeof categoryIds == "string") {
- categoryIds = [categoryIds];
- }
+ // if (!categoryIds) {
+ // categoryIds = ["1", "2", "3", "4", "5", "6"];
+ // } else if (typeof categoryIds == "string") {
+ // categoryIds = [categoryIds];
+ // }
const params = { ...req.query, categoryIds };
stakeholderService
.search(params)
diff --git a/app/services/stakeholder-service.js b/app/services/stakeholder-service.js
index a655eaca8..1fc89afff 100644
--- a/app/services/stakeholder-service.js
+++ b/app/services/stakeholder-service.js
@@ -38,9 +38,11 @@ const search = async ({
claimedLoginId,
verificationStatusId,
}) => {
- const categoryClause = `(select sc.stakeholder_id
+ const categoryClause = categoryIds
+ ? `(select sc.stakeholder_id
from stakeholder_category sc
- where sc.category_id in (${categoryIds.join(",")}))`;
+ where sc.category_id in (${categoryIds.join(",")}))`
+ : "";
const nameClause = "'%" + name.replace(/'/g, "''") + "%'";
const sql = `
select s.id, s.name, s.address_1, s.address_2, s.city, s.state, s.zip,
diff --git a/client/src/components/Search.js b/client/src/components/Search.js
index a99296c65..939bc7c5c 100644
--- a/client/src/components/Search.js
+++ b/client/src/components/Search.js
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import React, { useState, useEffect } from "react";
import PropTypes from "prop-types";
import Downshift from "downshift";
import { MenuItem, TextField, Paper } from "@material-ui/core";
@@ -19,7 +19,6 @@ const useStyles = makeStyles(() => ({
width: "100%",
},
address: {
- width: "31em",
backgroundColor: "#fff",
borderRadius: "4px 0 0 4px",
height: 41,
@@ -46,6 +45,20 @@ export default function Search(props) {
const { mapboxResults, fetchMapboxResults } = useMapboxGeocoder();
+ const initialWidth = window.innerWidth > 600 ? true : false;
+ const [isWindowSixHundredOrLess, switchAddressWidth] = useState(initialWidth);
+ useEffect(() => {
+ const changeAddressWidth = () => {
+ window.innerWidth > 600
+ ? switchAddressWidth(true)
+ : switchAddressWidth(false);
+ };
+
+ window.addEventListener("resize", changeAddressWidth);
+
+ return () => window.removeEventListener("resize", changeAddressWidth);
+ });
+
const handleInputChange = (event) => {
setSelectedPlace(event.target.value);
if (!event.target.value) {
@@ -92,6 +105,7 @@ export default function Search(props) {
},
...InputProps,
}}
+ style={{ width: isWindowSixHundredOrLess ? "31em" : "82vw" }}
/>
);
};
diff --git a/client/src/components/Verification/VerificationAdmin.js b/client/src/components/Verification/VerificationAdmin.js
index b400a42c6..12a281bd3 100644
--- a/client/src/components/Verification/VerificationAdmin.js
+++ b/client/src/components/Verification/VerificationAdmin.js
@@ -139,12 +139,12 @@ function VerificationAdmin(props) {
useEffect(() => {
const criteriaString = localStorage.getItem(CRITERIA_TOKEN);
let initialCriteria = JSON.parse(criteriaString);
- initialCriteria.verificationStatusId = 0;
if (!initialCriteria) {
initialCriteria = {
...defaultCriteria,
latitude: userCoordinates.latitude,
longitude: userCoordinates.longitude,
+ verificationStatusId: 0,
};
}
setCriteria(initialCriteria);
diff --git a/contributing.md b/contributing.md
new file mode 100644
index 000000000..c62c77126
--- /dev/null
+++ b/contributing.md
@@ -0,0 +1,276 @@
+# Contributing to the Food Oasis Project
+
+If you are not going to do hands-on development, you can simply experiment
+with the test version of the application at