Skip to content

Commit 676999a

Browse files
committed
Merge remote-tracking branch 'origin' into 290-user_admin
2 parents e20f5dd + d714449 commit 676999a

File tree

8 files changed

+75
-91
lines changed

8 files changed

+75
-91
lines changed

src/client/src/pages/About.js

Lines changed: 60 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,66 @@
11
import React from 'react';
22
import { Container } from '@material-ui/core';
33

4-
export default function About(props){
4+
export default function About(props) {
55
return (
6-
<Container>
7-
<Container style={{"padding":"1em"}}>
8-
<h1><a href="https://phillypaws.org/">
9-
The Philadelphia Animal Welfare Society(PAWS)
10-
</a></h1>
11-
<p>As the city’s largest animal rescue partner and no-kill animal shelter, the <a href="https://phillypaws.org/">Philadelphia
12-
Animal Welfare Society (PAWS)</a> is working to make Philadelphia a place where every healthy and treatable pet is
13-
guaranteed a home. Since inception over 10 years ago, PAWS has rescued and placed 27,000+ animals in adoptive and
14-
foster homes, and has worked to prevent pet homelessness by providing 86,000+ low-cost spay/neuter services and
15-
affordable vet care to 227,000+ clinic patients. PAWS is funded 100% through donations, with 91 cents of every
16-
dollar collected going directly to the animals. Therefore, PAWS’ rescue work (including 3 shelters and all rescue
17-
and animal care programs), administration and development efforts are coordinated by only about 70 staff members
18-
complemented by over 1500 volunteers.</p>
19-
<h2><a href="https://codeforphilly.org/projects/paws_data_pipeline">
20-
The Data Pipeline
21-
</a></h2>
22-
<p>This project seeks to provide PAWS with an easy-to-use and easy-to-support tool to extract data from multiple
23-
source systems, confirm accuracy and appropriateness, clean/validate data where necessary (a data hygiene and
24-
wrangling step), and then load relevant data into one or more repositories to facilitate (1) a highly-accurate and
25-
rich 360-degree view of PAWS constituents (Salesforce is a likely candidate target system; already in use at PAWS)
26-
and (2) flexible ongoing data analysis and insights discovery (e.g. a data lake / data warehouse).</p>
27-
<p>Through all of its operational and service activities, PAWS accumulates data regarding donations, adoptions,
28-
fosters, volunteers, merchandise sales, event attendees (to name a few), each in their own system and/or manual
29-
(Google Sheet) tally. This vital data that can drive insights remains siloed and is usually difficult to extract,
30-
manipulate, and analyze. Taking all of this data, making it readily available, and drawing inferences through
31-
analysis can drive many benefits:</p>
32-
<ul>
33-
<li>PAWS operations can be better informed and use data-driven decisions to guide programs and maximize
34-
effectiveness;<br />
35-
</li>
36-
<li>Supporters can be further engaged by suggesting additional opportunities for involvement based upon pattern
37-
analysis;<br />
38-
</li>
39-
<li>Multi-dimensional supporters can be consistently (and accurately) acknowledged for all the ways they support
40-
PAWS (i.e. a volunteer who donates and also fosters kittens), not to mention opportunities to further tap the
41-
potential of these enthusiastic supporters.</li>
42-
</ul>
43-
<h2 id="code-of-conduct"><a href="https://codeforphilly.org/pages/code_of_conduct">Code of Conduct</a></h2>
44-
<p>This is a Code for Philly project operating under their code of conduct.</p>
45-
<h2 id="project-plan">Project Plan</h2>
46-
<h3 id="phase-1-now---jan-15-2020">Phase 1 (now - Jan 15 2020)</h3>
47-
<p><strong>Goal</strong>: Create a central storage of data where</p>
48-
<ol type="1">
49-
<li>Datasets from top 3 relevant sources can be uploaded as csvs to a central system: a) Donors, b) Volunteers,</li>
50-
</ol>
51-
<ol start="3" type="a">
52-
<li>Adopters</li>
53-
</ol>
54-
<ol start="2" type="1">
55-
<li>All datasets in the central system can be linked to each other on an ongoing basis</li>
56-
<li>Notifications can be sent out to relevant parties when inconsistencies need to be handled by a human</li>
57-
<li>Comprehensive report on a person’s interactions with PAWS can be pulled via a simple UI (must include full known
58-
history)</li>
59-
</ol>
60-
<h3 id="phase-2-jan-15---may-15-2020">Phase 2 (Jan 15 - May 15 2020)</h3>
61-
<p><strong>Goal</strong>: Expand above features to include all relevant datasets and further automate data uploads
62-
Datasets from all other relevant sources can be uploaded as csvs to a central system ( a) Adoption and Foster
63-
applicants, b) Foster Parents, c) Attendees, d) Clinic Clients e) Champions, f) Friends) Where APIs exist, create
64-
automated calls to those APIs to pull data</p>
65-
<h3 id="phase-3-may-15---sept-15-2020">Phase 3 (May 15 - Sept 15 2020)</h3>
66-
<p><strong>Goal</strong>: Create more customizable analytics reports and features (eg noshow rates in clinicHQ)</p>
67-
<h2 id="links">Links</h2>
68-
<p><a href="https://codeforphilly.org/chat?channel=paws_data_pipeline">Slack Channel</a></p>
69-
<p><a href="https://drive.google.com/open?id=1O8oPWLT5oDL8q_Tm4a0Gt8XCYYxEIcjiPJYHm33lXII">Google Drive</a></p>
70-
</Container>
71-
</Container>
6+
<Container>
7+
<Container style={{ "padding": "1em" }}>
8+
<h2>
9+
<a href="https://codeforphilly.org/projects/paws_data_pipeline" target="_blank">
10+
The PAWS Data Pipeline
11+
</a>
12+
</h2>
13+
<p>
14+
The PAWS data pipeline (PDP) is community-driven and developed software that serves the
15+
Philadelphia Animal Welfare Society (PAWS), Philadelphia’s largest animal rescue partner
16+
and no-kill animal shelter. It is a project that began on Nov 24, 2019 and is being built
17+
through a volunteer effort coordinated by Code for Philly. PDP is free and open source
18+
software. The volunteers that have worked on this project come from diverse backgrounds,
19+
but are connected through a shared love for animals and a passion for technology.
20+
</p>
21+
<p>24 individuals and 2 organisations supported and contributed to the PDP between 2019/11/24 and 2021/05/01:</p>
22+
<h3>Developers</h3>
23+
<ul>
24+
<li>Uri Rotem</li>
25+
<li>Cris Simpson</li>
26+
<li>Ben Bucior</li>
27+
<li>Stephen Poserina</li>
28+
<li>Mike Crnkovich</li>
29+
<li>Mike Damert</li>
30+
<li>Dave Salorio</li>
31+
<li>Mike Bailey</li>
32+
<li>Donna St. Louis</li>
33+
<li>Joe Illuminati</li>
34+
<li>Andrew Bishop</li>
35+
<li>Akshat Vas</li>
36+
<li>Dan Kelley</li>
37+
</ul>
38+
<h3>Project managers</h3>
39+
<ul>
40+
<li>JW Truver</li>
41+
<li>Daniel Romero</li>
42+
<li>Eudora Linde</li>
43+
<li>Meg Niman</li>
44+
</ul>
45+
<h3>Project leads</h3>
46+
<ul>
47+
<li>Karla Fettich</li>
48+
<li>Chris Kohl</li>
49+
</ul>
50+
<h3>External collaborators and supporters</h3>
51+
<ul>
52+
<li>Weston Welch</li>
53+
<li>Tan Tan Chen</li>
54+
<li>Faith Benamy</li>
55+
<li>Jesse</li>
56+
<li>Chris Alfano</li>
57+
</ul>
58+
<h3>Organisations providing support</h3>
59+
<ul>
60+
<li>Code for Philly</li>
61+
<li>Linode</li>
62+
</ul>
63+
</Container>
64+
</Container>
7265
);
7366
}

src/client/src/pages/DataView360/View/components/DataTableHeader.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,24 @@ import React from 'react';
22
import {
33
Typography,
44
} from '@material-ui/core';
5-
import { makeStyles, withStyles } from '@material-ui/core/styles';
65
import Grid from "@material-ui/core/Grid";
76

87

9-
const customStyles = makeStyles({
10-
spaceIcon: {
11-
marginTop: 3,
12-
marginRight: 3
13-
},
14-
headerCell: {
15-
fontWeight: "bold"
16-
},
17-
});
18-
198
function DataTableHeader(props) {
20-
const classes = customStyles();
219
const { headerText, emojiIcon } = props;
2210
return (
2311
<Typography variant='h5'>
2412
<Grid container style={{ "margin": "0.5em" }} direction={'row'}>
25-
<Grid item className={classes.spaceIcon}>
26-
{ emojiIcon }
13+
<Grid item style={{ "marginTop": "3", "marginRight": "3" }}>
14+
{emojiIcon}
2715
</Grid>
2816
<Grid item>
29-
{ headerText }
17+
{headerText}
3018
</Grid>
31-
{ props.children }
19+
{props.children}
3220
</Grid>
3321
</Typography>
3422
);
3523
}
3624

37-
export default withStyles(customStyles)(DataTableHeader);
25+
export default DataTableHeader;

src/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
container_name: paws-compose-db
66
ports:
77
- "5432:5432"
8-
image: postgres:11.3-alpine
8+
image: postgres:13.2-alpine
99
volumes:
1010
- postgres:/var/lib/postgresql/data
1111
environment:

src/server/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ RUN chmod +x bin/startServer.sh
4141
# RUN ufw allow 5000
4242
WORKDIR /app
4343

44+
RUN useradd -m pawsapp
45+
USER pawsapp
46+
4447
CMD bin/startServer.sh
4548
#>> start.log 2>&1

src/server/api/admin_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def upload_csv():
3737
finally:
3838
file.close()
3939

40-
return redirect("/")
40+
return redirect(request.origin)
4141

4242

4343
@admin_api.route("/api/listCurrentFiles", methods=["GET"])

src/server/bin/startServer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ echo "SLEEPING.. WAITING FOR DB"; sleep 5; echo "WAKING"; alembic upgrade head;
1111

1212
# --no-reload prevents Flask restart, which usually happens in middle of create_base_users()
1313
#TODO: SECURITY - ensure we are not running in debug mode in production
14-
uwsgi --http-socket :5000 --plugin python38 --module wsgi:app --chdir /app --pythonpath . --processes 2 --threads 4
14+
uwsgi --http-socket :5000 --plugin python38 --module wsgi:app --chdir /app --pythonpath . --processes 2 --threads 4 --master

src/server/pipeline/clean_and_load_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def start(connection, pdp_contacts_df, file_path_list):
1414
result = pd.DataFrame(columns=pdp_contacts_df.columns)
1515
json_rows = pd.DataFrame(columns=["source_type", "source_id", "json"])
16-
manual_matches_df = None
16+
manual_matches_df = pd.DataFrame()
1717

1818
for uploaded_file in file_path_list:
1919
file_path = os.path.join(CURRENT_SOURCE_FILES_PATH, uploaded_file)

src/server/pipeline/match_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ def start(connection, added_or_updated_rows, manual_matches_df):
7272
)
7373
]
7474
#collect other linked ids from manual matches source
75-
if manual_matches_df != None:
75+
if not manual_matches_df.empty:
7676
linked_ids = manual_matches_df[(manual_matches_df[row["source_type"]] == row["source_id"])]
7777
ids = linked_ids.to_dict(orient="records")
78-
for row_dict in enumerate(ids):
78+
for id_num, row_dict in enumerate(ids):
7979
for column, value in row_dict.items():
8080
row_matches = row_matches.append(pdp_contacts[(pdp_contacts["source_type"] == column) & (pdp_contacts["source_id"] == value)])
81-
81+
8282

8383
if row_matches.empty: # new record, no matching rows
8484
max_matching_group += 1

0 commit comments

Comments
 (0)