Skip to content

Commit

Permalink
Merge pull request #168 from MasonM/remove-temporary-covid
Browse files Browse the repository at this point in the history
Remove references to temporary COVID restrictions
  • Loading branch information
MasonM authored Apr 1, 2024
2 parents 1e91a12 + f0b144b commit 9aa97a9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 37 deletions.
15 changes: 4 additions & 11 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function makeGenderQuery(gender) {
function makeSQL(requestType, category, gender) {
let SQL = `
SELECT
o.organization_id, o.organization_name, o.website, o.phone_number, o.org_address, o.org_description, o.schedule, o.gender, o.kids, o.last_update, o.active, o.zipcode, o.contact_name, o.contact_email, o.contact_phone, o.contact_title, o.sponsorship, o.sponsorship_email, o.distribution, o.distribution_email, o.tempcovid, o.id_req, join1.category_names
o.organization_id, o.organization_name, o.website, o.phone_number, o.org_address, o.org_description, o.schedule, o.gender, o.kids, o.last_update, o.active, o.zipcode, o.contact_name, o.contact_email, o.contact_phone, o.contact_title, o.sponsorship, o.sponsorship_email, o.distribution, o.distribution_email, o.id_req, join1.category_names
FROM organization o
INNER JOIN (
SELECT oxc1.organization_id, oxc1.active, array_agg(join2.category_name) AS category_names
Expand Down Expand Up @@ -566,7 +566,6 @@ let organization_id,
sponsorship_email,
sponsorship,
zipcode,
tempcovid,
print_locations;

// Identify which categories should be removed to the org to category mapping and which should be added
Expand Down Expand Up @@ -619,7 +618,6 @@ function parseForm(req) {
phone_number = replaceChar(req.body.phone_number);
org_address = replaceChar(req.body.org_address);
org_description = replaceChar(req.body.org_description);
tempcovid = replaceChar(req.body.tempcovid);
schedule = req.body.schedule;
gender = req.body.gender;
timestamp = req.body.timestamp;
Expand Down Expand Up @@ -699,9 +697,7 @@ app.put("/admin/editconfirmation", isAuthenticated, function (req, res) {
sponsorship_email +
"', zipcode=" +
zipcode +
", tempcovid='" +
tempcovid +
"' WHERE organization_id=" +
" WHERE organization_id=" +
organization_id +
" RETURNING organization_name;";

Expand Down Expand Up @@ -820,7 +816,7 @@ app.put("/admin/addconfirmation", isAuthenticated, function (req, res) {
parseForm(req);

let mainSQL =
"INSERT INTO organization (organization_name, website, phone_number, org_address, org_description, schedule, gender, last_update, contact_name, contact_title, contact_email, contact_phone, id_req, distribution, distribution_email, sponsorship_email, sponsorship, zipcode, tempcovid, active) VALUES('" +
"INSERT INTO organization (organization_name, website, phone_number, org_address, org_description, schedule, gender, last_update, contact_name, contact_title, contact_email, contact_phone, id_req, distribution, distribution_email, sponsorship_email, sponsorship, zipcode, active) VALUES('" +
organization_name +
"', '" +
website +
Expand Down Expand Up @@ -856,9 +852,7 @@ app.put("/admin/addconfirmation", isAuthenticated, function (req, res) {
sponsorship +
"', " +
zipcode +
", '" +
tempcovid +
"', 't');";
", 't');";

// Create SQL query for adding categories
let cats = req.body.category;
Expand Down Expand Up @@ -924,7 +918,6 @@ app.get("/admin/organization/csv", isAuthenticated, function (req, res) {
o.org_description_es,
o.org_address_es,
o.schedule_es,
o.tempcovid,
ARRAY_AGG(c.category_name) AS categories
FROM organization o
LEFT JOIN organization_x_category oxc ON (oxc.organization_id = o.organization_id)
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('SERVER METHODS', function() {
describe('makeSQL', function() {
const baseQuery = `
SELECT
o.organization_id, o.organization_name, o.website, o.phone_number, o.org_address, o.org_description, o.schedule, o.gender, o.kids, o.last_update, o.active, o.zipcode, o.contact_name, o.contact_email, o.contact_phone, o.contact_title, o.sponsorship, o.sponsorship_email, o.distribution, o.distribution_email, o.tempcovid, o.id_req, join1.category_names
o.organization_id, o.organization_name, o.website, o.phone_number, o.org_address, o.org_description, o.schedule, o.gender, o.kids, o.last_update, o.active, o.zipcode, o.contact_name, o.contact_email, o.contact_phone, o.contact_title, o.sponsorship, o.sponsorship_email, o.distribution, o.distribution_email, o.id_req, join1.category_names
FROM organization o
INNER JOIN (
SELECT oxc1.organization_id, oxc1.active, array_agg(join2.category_name) AS category_names
Expand Down
8 changes: 0 additions & 8 deletions views/pages/auth/addnew-detail.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@
<textarea name="org_description_es" type="text" class="bigger"></textarea>
</label>
</fieldset>
<fieldset>
<label>
<span>
Temporary COVID-19 Restrictions
</span>
<textarea name="tempcovid" type="text" class="bigger"></textarea>
</label>
</fieldset>
<fieldset>
<label>
<span>Genders Served</span>
Expand Down
11 changes: 2 additions & 9 deletions views/pages/auth/edit-details.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
value=<%= organization.zipcode %>></input>
</label>
</fieldset>
<p class="script hidden">We understand that your hours have likely changed due to COVID. We will ask about those changes a bit later. For now, we want to confirm your normal hours of operation. What hours are you open for people to walk in during normal times?</p>
<p class="script hidden">What hours are you open for people to walk in during normal times?</p>
<fieldset>
<label>
<span>Hours</span>
Expand All @@ -105,7 +105,7 @@
<p class="script hidden">Your agency description should be a brief, simple summary of the services someone can
access when they come to your agency. Do not list services that are not available for homeless and
low-income individuals. I will read your agency description, and then you can let me know if anything needs
to be updated or changed. We have a separate field for temporary COVID related changes to your services. This primary description should reflect your normal operations.
to be updated or changed.
<br><span class="emphasis">Read description and category options below. Please note that this field should not change significantly. If significant changes are made, please note on your spreadsheet.</span><br>
</p>
<fieldset>
Expand All @@ -121,13 +121,6 @@
class="bigger"><%= organization.org_description_es %></textarea>
</label>
</fieldset>
<fieldset>
<label>
<span>Temporary COVID-19 Restrictions</span>
<textarea name="tempcovid" type="text"
class="bigger"><%= organization.tempcovid %></textarea>
</label>
</fieldset>
<fieldset>
<label>
<span>Genders Served</span>
Expand Down
8 changes: 0 additions & 8 deletions views/pages/detail.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@
<%= organization.org_description %>
</p>
</div>
<div class="label">Temporary COVID-19 Restrictions |</div>
<div class="content" id="last-content">
<i class="fas fa-chevron-circle-down desc-button desc-button-on fa-lg" aria-hidden="true"
title="Show description"></i>
<p class="desc hidden">
<%= organization.tempcovid %>
</p>
</div>
<p class="cat hidden">
<%= organization.category_names %>
</p>
Expand Down

0 comments on commit 9aa97a9

Please sign in to comment.