Skip to content

Commit

Permalink
Merge branch 'release-1.0.32' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
entrotech committed Dec 9, 2020
2 parents e921666 + f1ace2d commit 81018fc
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 70 deletions.
3 changes: 2 additions & 1 deletion app/services/stakeholder-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,14 @@ const insert = async (model) => {
};

const requestAssignment = async (model) => {
const { loginId } = model;
const { loginId, tenantId } = model;
const sql = `with selected_stakeholder as (
select distinct sh.id, sh.modified_date
from stakeholder sh join stakeholder_category sc
on sh.id = sc.stakeholder_id
join category c on sc.category_id = c.id
where sh.verification_status_id = 1
and sh.tenant_id = ${toSqlNumeric(tenantId)}
and c.inactive = false
order by sh.modified_date
limit 1
Expand Down
7 changes: 6 additions & 1 deletion client/package-lock.json

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

3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "food-oasis-client",
"description": "React Client for Food Oasis",
"version": "1.0.31",
"version": "1.0.32",
"author": "Hack for LA",
"license": "GPL-2.0",
"private": true,
Expand Down Expand Up @@ -34,6 +34,7 @@
"react": "^16.13.1",
"react-data-grid": "^6.1.0",
"react-dom": "^16.13.1",
"react-gtm-module": "^2.0.11",
"react-i18next": "^10.13.2",
"react-map-gl": "^5.2.5",
"react-proptypes": "^1.0.0",
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ const useStyles = makeStyles((theme) => ({
menuButton: {
transform: "scale(1.6,1.5)",
minWidth: "0",
backgroundColor: "#FFF",
"&:hover": {
backgroundColor: "#FFF",
opacity: 0.8,
},
[theme.breakpoints.down("xs")]: {
transform: "scale(1.2, 1.2)",
Expand Down
31 changes: 0 additions & 31 deletions client/src/components/Verification/SearchCriteria.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const closeTo = (lat1, lon1, lat2, lon2) => {
};

const SearchCriteria = ({
tenants,
userLatitude,
userLongitude,
categories,
Expand Down Expand Up @@ -134,36 +133,6 @@ const SearchCriteria = ({
<Card className={classes.card}>
<CardContent>
<Grid container spacing={4}>
<Grid item xs={12} sm={6}>
<FormControl variant="outlined" fullWidth>
<FormLabel
id="verification-status-id-label"
className={classes.formLabel}
>
Region
</FormLabel>
<Select
labelId="tenant-id-label"
name="tenantId"
variant="outlined"
size="small"
value={criteria.tenantId}
onChange={setCriterion}
>
<MenuItem key={0} value={0}>
(Any)
</MenuItem>
{tenants
? tenants.map((tenant) => (
<MenuItem key={tenant.id} value={tenant.id}>
{tenant.name}
</MenuItem>
))
: null}
</Select>
</FormControl>
</Grid>

<Grid item xs={12} sm={6}>
<FormControl variant="outlined" fullWidth>
<FormLabel
Expand Down
20 changes: 0 additions & 20 deletions client/src/components/Verification/SearchCriteriaDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function SearchCriteriaDisplay({
defaultCriteria,
criteria,
neighborhoods,
tenants,
categories,
isLoading,
}) {
Expand All @@ -42,7 +41,6 @@ function SearchCriteriaDisplay({

const checkForCriteriaPresent = () => {
if (
criteria.tenantId !== defaultCriteria.tenantId ||
criteria.name !== defaultCriteria.name ||
criteria.placeName !== defaultCriteria.placeName ||
criteria.radius !== defaultCriteria.radius ||
Expand Down Expand Up @@ -85,24 +83,6 @@ function SearchCriteriaDisplay({
const getCriteriaToDisplay = () => {
let criterias = [];

if (criteria.tenantId !== defaultCriteria.tenantId) {
let tenantName = "";

tenants.forEach((tenant) => {
if (tenant.id === criteria.tenantId) {
tenantName = tenant.name;
}
});

criterias.push(
<CriteriaChip
key={"CriteriaChip_Region"}
value={tenantName}
label="Region"
/>
);
}

if (criteria.name !== defaultCriteria.name) {
criterias.push(
<CriteriaChip
Expand Down
8 changes: 1 addition & 7 deletions client/src/components/Verification/VerificationAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import StakeholderGrid from "./VerificationAdminGrid";
import { RotateLoader } from "react-spinners";
import { useOrganizations } from "hooks/useOrganizations";
import { useCategories } from "hooks/useCategories/useCategories";
import { useTenants } from "hooks/useTenants/useTenants";
import { useNeighborhoods } from "hooks/useNeighborhoods/useNeighborhoods";
import {
needsVerification,
Expand Down Expand Up @@ -90,7 +89,6 @@ DialogTitle.propTypes = {
};

const defaultCriteria = {
tenantId: 0,
name: "",
latitude: 34,
longitude: -118,
Expand Down Expand Up @@ -141,8 +139,6 @@ function VerificationAdmin(props) {
error: categoriesError,
} = useCategories();

const { data: tenants, loading: tenantsLoading } = useTenants();

const {
data: neighborhoods,
loading: neighborhoodsLoading,
Expand Down Expand Up @@ -317,9 +313,8 @@ function VerificationAdmin(props) {
defaultCriteria={defaultCriteria}
criteria={criteria}
neighborhoods={neighborhoods}
tenants={tenants}
categories={categories}
isLoading={neighborhoodsLoading || categoriesLoading || tenantsLoading}
isLoading={neighborhoodsLoading || categoriesLoading}
/>
<div className={classes.mainContent}>
<Dialog
Expand All @@ -339,7 +334,6 @@ function VerificationAdmin(props) {
userLatitude={userCoordinates.latitude}
userLongitude={userCoordinates.longitude}
categories={categories && categories.filter((c) => !c.inactive)}
tenants={tenants}
neighborhoods={neighborhoods}
criteria={criteria}
setCriteria={setCriteria}
Expand Down
3 changes: 2 additions & 1 deletion client/src/services/stakeholder-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const toLocalMoment = (ts) => {
};

export const search = async (searchParams) => {
searchParams = searchParams || {};
searchParams = { ...searchParams, tenantId } || { tenantId };
const response = await axios.get(`${baseUrl}`, {
params: searchParams,
});
Expand Down Expand Up @@ -68,6 +68,7 @@ export const put = async (stakeholder) => {
export const requestAssignment = async (loginId) => {
const response = await axios.post(`${baseUrl}/requestAssignment`, {
loginId,
tenantId,
});
return response.data;
};
Expand Down
7 changes: 1 addition & 6 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "foodoasis",
"version": "1.0.31",
"version": "1.0.32",
"author": "Hack for LA",
"description": "Web API Server for Food Oasis",
"main": "server.js",
Expand Down Expand Up @@ -57,7 +57,6 @@
"passport-local": "^1.0.0",
"pg": "^8.0.3",
"pino-noir": "^2.2.1",
"react-gtm-module": "^2.0.11",
"uuid": "^3.3.3"
},
"devDependencies": {
Expand Down

0 comments on commit 81018fc

Please sign in to comment.