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

Pre release updates #645

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.22.1
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You will need the following things properly installed on your computer.
## Local development

- Clone this repo `git clone https://github.com/NYCPlanning/labs-community-profiles.git`
- Install Dependencies `npm install`
- Install Dependencies `yarn`
- Start the server `ember s`
- Point your browser to `http://localhost:4200`

Expand Down Expand Up @@ -96,6 +96,8 @@ A Proxy API that pulls data for a community district using ZAP's odata API, crea
Add `dokku` remote: `git remote add dokku dokku@{dokkudomain}:communityprofiles`
Deploy with dokku: `git push dokku master`

NOTE: When making updates in the app that are dependent on a data update, be sure to check the Data Update Playbook for further instructions. Read through this update process before running the labs-layers-api python script or promoting changes to develop and production.

## Contact us

You can find us on Twitter at [@nycplanninglabs](https://twitter.com/nycplanninglabs), or comment on issues and we'll follow up as soon as we can. If you'd like to send an email, use [[email protected]](mailto:[email protected])
Expand Down
17 changes: 13 additions & 4 deletions app/components/zap-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default Component.extend({
projects: computed('district', function() {
const zapAcronym = this.get('district.zapAcronym');

const URL = `https://zap-api.planninglabs.nyc/projects?community-districts[]=${zapAcronym}&dcp_publicstatus[]=Filed&dcp_publicstatus[]=In Public Review&page=1`;
const URL = `https://zap-api-production.herokuapp.com/projects?community-districts[]=${zapAcronym}&dcp_publicstatus[]=Noticed&dcp_publicstatus[]=Filed&dcp_publicstatus[]=In Public Review&page=1`;

return fetch(URL)
.then(res => res.json())
Expand All @@ -21,13 +21,22 @@ export default Component.extend({
const applicant = project.attributes.applicants.split(';')[0];
project.attributes.applicant = applicant; // eslint-disable-line
} else {
project.attributes.applicant = 'Unknown Applicant'
project.attributes.applicant = 'Unknown Applicant';
}
});

const projectsUnderscored = projects.map(project => ({
dcp_publicstatus: project.attributes['dcp-publicstatus'],
dcp_name: project.attributes['dcp-name'],
dcp_projectname: project.attributes['dcp-projectname'],
dcp_ulurp_nonulurp: project.attributes['dcp-ulurp-nonulurp'],
applicant: project.attributes.applicant,
}));

return {
filed: projects.filter(d => d.attributes.dcp_publicstatus_simp === 'Filed'),
inPublicReview: projects.filter(d => d.attributes.dcp_publicstatus_simp === 'In Public Review'),
noticed: projectsUnderscored.filter(d => d.dcp_publicstatus === 'Noticed'),
filed: projectsUnderscored.filter(d => d.dcp_publicstatus === 'Filed'),
inPublicReview: projectsUnderscored.filter(d => d.dcp_publicstatus === 'In Public Review'),
};
});
}),
Expand Down
10 changes: 9 additions & 1 deletion app/models/district.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ const acronymCrosswalk = {
'Staten Island': 'SI',
};

const zapAcronymCrosswalk = {
Bronx: 'X',
Brooklyn: 'K',
Manhattan: 'M',
Queens: 'Q',
'Staten Island': 'R',
};

export default DS.Model.extend({
borocd: DS.attr('number'),
boro: DS.attr('string'),
Expand All @@ -22,7 +30,7 @@ export default DS.Model.extend({
return `${acronym}${cd}`;
}),
zapAcronym: computed('boro', function() {
const acronym = acronymCrosswalk[this.get('boro')];
const acronym = zapAcronymCrosswalk[this.get('boro')];
const cd = numeral(this.get('cd')).format('00');
return `${acronym}${cd}`;
}),
Expand Down
20 changes: 10 additions & 10 deletions app/styles/layouts/_l-default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ html, body {
}

@include breakpoint(90em) {
@include xy-cell-static($size:4, $gutter-output:true, $gutters:40px);
@include xy-cell($size:4, $gutter-output:true, $gutters:40px);
}
}
}
Expand All @@ -190,32 +190,32 @@ html, body {
@include xy-gutters($callout-padding*2, margin, right left, true);

.indicator-cell--stat {
@include xy-cell-static(7, true, $callout-padding*2);
@include xy-cell(7, true, $callout-padding*2);
@include breakpoint(large) {
@include xy-cell-static(4, true, $callout-padding*2);
@include xy-cell(4, true, $callout-padding*2);
}
@include breakpoint(xlarge) {
@include xy-cell-static(6, true, $callout-padding*2);
@include xy-cell(6, true, $callout-padding*2);
}
}

.indicator-cell--borocity {
@include xy-cell-static(5, true, $callout-padding*2);
@include xy-cell(5, true, $callout-padding*2);
@include breakpoint(large) {
@include xy-cell-static(3, true, $callout-padding*2);
@include xy-cell(3, true, $callout-padding*2);
}
@include breakpoint(xlarge) {
@include xy-cell-static(6, true, $callout-padding*2);
@include xy-cell(6, true, $callout-padding*2);
}
}

.indicator-cell--chart {
@include xy-cell-static(12, true, $callout-padding*2);
@include xy-cell(12, true, $callout-padding*2);
@include breakpoint(large) {
@include xy-cell-static(5, true, $callout-padding*2);
@include xy-cell(5, true, $callout-padding*2);
}
@include breakpoint(xlarge) {
@include xy-cell-static(12, true, $callout-padding*2);
@include xy-cell(12, true, $callout-padding*2);
}
}
}
Expand Down
22 changes: 18 additions & 4 deletions app/templates/components/zap-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@
{{#with (await projects) as |resolvedProjects|}}
{{#if resolvedProjects}}

<h6>Noticed Applications</h6>
{{#if resolvedProjects.noticed.length}}
<ul class="no-bullet xlarge-2-column">
{{#each resolvedProjects.noticed as |project|}}
<li class="list-item-padded">
<a href = "https://zap.planning.nyc.gov/projects/{{project.dcp_name}}" target="_blank">{{fa-icon "external-link"}}&nbsp;<strong>{{if project.dcp_projectname project.dcp_projectname "No Name"}}</strong></a>
<small class="list--link-meta">{{project.applicant}} | {{project.dcp_ulurp_nonulurp}}</small>
</li>
{{/each}}
</ul>
{{else}}
<p class="text-center" style="padding: 60px 0;">No noticed applications.</p>
{{/if}}

<h6>Filed Applications</h6>
{{#if resolvedProjects.filed.length}}
<ul class="no-bullet xlarge-2-column">
{{#each resolvedProjects.filed as |project|}}
<li class="list-item-padded">
<a href = "https://zap.planning.nyc.gov/projects/{{project.attributes.dcp_name}}" target="_blank">{{fa-icon "external-link"}}&nbsp;<strong>{{if project.attributes.dcp_projectname project.attributes.dcp_projectname "No Name"}}</strong></a>
<small class="list--link-meta">{{project.attributes.applicant}} | {{project.attributes.dcp_ulurp_nonulurp}}</small>
<a href = "https://zap.planning.nyc.gov/projects/{{project.dcp_name}}" target="_blank">{{fa-icon "external-link"}}&nbsp;<strong>{{if project.dcp_projectname project.dcp_projectname "No Name"}}</strong></a>
<small class="list--link-meta">{{project.applicant}} | {{project.dcp_ulurp_nonulurp}}</small>
</li>
{{/each}}
</ul>
Expand All @@ -21,8 +35,8 @@
<ul class="no-bullet xlarge-2-column">
{{#each resolvedProjects.inPublicReview as |project|}}
<li class="list-item-padded">
<a href = "https://zap.planning.nyc.gov/projects/{{project.attributes.dcp_name}}" target="_blank">{{fa-icon "external-link"}}&nbsp;<strong>{{if project.attributes.dcp_projectname project.attributes.dcp_projectname "No Name"}}</strong></a>
<small class="list--link-meta">{{project.attributes.applicant}} | {{project.attributes.dcp_ulurp_nonulurp}}</small>
<a href = "https://zap.planning.nyc.gov/projects/{{project.dcp_name}}" target="_blank">{{fa-icon "external-link"}}&nbsp;<strong>{{if project.dcp_projectname project.dcp_projectname "No Name"}}</strong></a>
<small class="list--link-meta">{{project.applicant}} | {{project.dcp_ulurp_nonulurp}}</small>
</li>
{{/each}}
</ul>
Expand Down
12 changes: 8 additions & 4 deletions app/templates/profile.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,14 @@
<div class="cell medium-5 xlarge-4">
<h4 class="subsection-header"><strong>Download the Data</strong></h4>
<div class="callout">
<a class="button small hollow expanded" href={{dataprofileDownload}}>{{fa-icon "download"}}&nbsp;<strong>Indicators Data</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="/data/cd_profile_data_dictionary.csv">{{fa-icon "download"}}&nbsp;<strong>Indicators Data Dictionary</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="https://planninglabs.carto.com/api/v2/sql?format=shp&q=SELECT a.the_geom_webmercator, a.the_geom, a.facname, a.facdomain, b.borocd FROM facdb a INNER JOIN community_districts b ON ST_Contains(b.the_geom, a.the_geom) WHERE b.borocd={{model.borocd}}&filename={{model.boro}}-{{model.cd}}-facilities.shp">{{fa-icon "download"}}&nbsp;<strong>Facilities Data</strong> <small>(Shapefile)</small></a>
<a class="button small hollow expanded" href="https://planninglabs.carto.com/api/v2/sql?format=SHP&q=SELECT a.the_geom_webmercator, a.the_geom, a.landuse, b.description, a.address, c.borocd FROM mappluto a LEFT JOIN support_landuse_lookup b ON a.landuse::integer = b.code INNER JOIN community_districts c ON ST_Intersects(a.the_geom, c.the_geom) WHERE c.borocd={{model.borocd}}&filename={{model.boro}}-{{model.cd}}-pluto.shp">{{fa-icon "download"}}&nbsp;<strong>PLUTO Data</strong> <small>(Shapefile)</small></a>
<a class="button small hollow expanded" href="https://edm-publishing.nyc3.digitaloceanspaces.com/db-community-profiles/latest/output/cd_demo_age_gender.csv" download="cd_demo_age_gender.csv">{{fa-icon "download"}}&nbsp;<strong>Demographic: Age & Gender</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="https://edm-publishing.nyc3.digitaloceanspaces.com/db-community-profiles/latest/output/cd_demo_race_economics.csv" download="cd_demo_race_economics.csv">{{fa-icon "download"}}&nbsp;<strong>Demographic: Other Indicators</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="https://edm-publishing.nyc3.digitaloceanspaces.com/db-community-profiles/latest/output/cd_built_environment.csv" download="cd_built_environment.csv">{{fa-icon "download"}}&nbsp;<strong>Built Environment: Land Use, Facilities, etc.</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="https://edm-publishing.nyc3.digitaloceanspaces.com/db-community-profiles/latest/output/cd_floodplain.csv" download="cd_floodplain.csv">{{fa-icon "download"}}&nbsp;<strong>Floodplain Indicators</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="https://edm-publishing.nyc3.digitaloceanspaces.com/db-community-profiles/latest/output/cd_administrative.csv" download="cd_administrative.csv">{{fa-icon "download"}}&nbsp;<strong>Community District Info</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="https://edm-publishing.nyc3.digitaloceanspaces.com/db-community-profiles/latest/output/boro_cd_attributes.csv" download="boro_cd_attributes.csv">{{fa-icon "download"}}&nbsp;<strong>Borough Indicators</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="https://edm-publishing.nyc3.digitaloceanspaces.com/db-community-profiles/latest/output/city_cd_attributes.csv" download="city_cd_attributes.csv">{{fa-icon "download"}}&nbsp;<strong>Citywide Indicators</strong> <small>(CSV)</small></a>
<a class="button small hollow expanded" href="/data/cd_profile_datadictionary.csv" download="cd_profile_datadictionary.csv">{{fa-icon "download"}}&nbsp;<strong>Data Dictionary</strong> <small>(CSV)</small></a>
</div>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"node-fetch": "^1.7.2"
},
"engines": {
"node": "^8.11.3",
"npm": "5.3.0"
"node": "^12.22.1",
"npm": "6.14.12"
},
"private": true,
"dependencies": {
Expand All @@ -91,5 +91,8 @@
"bower": "^1.8.8",
"ember-decorators": "^1.3.2",
"numeral": "^2.0.6"
},
"resolutions": {
"handlebars": "4.7.7"
}
}
Loading