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

Merging node 16 and Ember 3.28 upgrades to master #359

Merged
merged 9 commits into from
Jul 28, 2023
Merged
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
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
22 changes: 22 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
tests/*
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
60 changes: 43 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
'use strict';

module.exports = {
globals: {
server: true,
},
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true
}
legacyDecorators: true,
},
},
plugins: [
'ember'
'ember',
],
extends: [
'eslint:recommended',
'airbnb-base',
'plugin:ember-best-practices/recommended'
'plugin:ember-best-practices/recommended',
],
env: {
browser: true
browser: true,
},
rules: {
'import/no-extraneous-dependencies': 0,
Expand All @@ -28,31 +33,52 @@ module.exports = {
'space-before-function-paren': 0,
'prefer-arrow-callback': 0,
'no-underscore-dangle': 0,
'camelcase': 0,
camelcase: 0,
'max-len': 0,
'array-callback-return': 0,
'react/prefer-stateless-function': 0,
'class-methods-use-this': 0,
'no-param-reassign': 0,
'ember/avoid-leaking-state-in-ember-objects': 0,
'ember-best-practices/require-dependent-keys': 0,
'react/sort-comp': 0
'class-methods-use-this': 0,
'ember/no-jquery': 'warn',
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'ember-cli-build.js',
'.template-lintrc.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
'lib/*/index.js',
'server/**/*.js',
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
ecmaVersion: 2017,
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
env: {
browser: false,
node: true
}
}
]
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
},
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: "\U0001F41B Bug report"
about: Create a report to help us improve the code

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: "\U0001F680 Feature Request"
about: Suggest an idea

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 16.x
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- name: build
Expand Down
30 changes: 17 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

.DS_Store

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.log*
yarn-error.log
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log
.DS_Store

# symlink
blueprints

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

.env
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.22.1
16.20.0
7 changes: 5 additions & 2 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* eslint-env node */
'use strict';

module.exports = {
extends: 'recommended'
extends: 'recommended',
rules: {
'no-curly-component-invocation': 'warn',
'no-inline-styles': 'warn',
},
};
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ Changes Proposed:
- Refactor of existing code

Closes #{issue number(s)}

- [ ] Documentation has been created/updated to reflect changes in this PR
- [ ] Tests have been written to prevent regressions or breaking changes
83 changes: 6 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@ The City Map is the official adopted map of the city. It shows the location, dim

![image](https://user-images.githubusercontent.com/409279/38562480-b1a12a7c-3ca8-11e8-91b1-2c4ee3286130.png)

## How we work

[NYC Planning Labs](https://planninglabs.nyc) takes on a single project at a time, working closely with our customers from concept to delivery in a matter of weeks. We conduct regular maintenance between larger projects.

## How you can help

In the spirit of free software, everyone is encouraged to help improve this project. Here are some ways you can contribute.

- Comment on or clarify [issues](https://github.com/NYCPlanning/labs-citymap/issues)
- Report [bugs](https://github.com/NYCPlanning/labs-citymap/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
- Suggest new features
- Write or edit documentation
- Write code (no patch is too small)
- Fix typos
- Add comments
- Clean up code
- Add new features

**[Read more about contributing.](CONTRIBUTING.md)**

## Requirements

Expand Down Expand Up @@ -53,71 +34,19 @@ If you are also running Layers API locally and want to use that, you can specify
ENV.host = 'http://localhost:3000';
```

or

```
yarn start:local-api
```

## Architecture

Streets is an [Ember.js](https://www.emberjs.com/) single page application (SPA). The frontend handles routing, web mapping, layout, and user interactions, and communicates with various APIs for content and data.

### Models, Layers, and Mutability
In this mapping iteration, we use models to manage individual layer and layer-group state. A layer group is a collection of layers, with a single visibility state. If a layer group's visibility is toggled off, that state is delegated to its related layers. These models allow for developers to reference a layer model from anywhere and manipulate its state, including layers' paint, layout, and filter states. These three properties are part of the MapboxGL Style Specification.

Here are some examples of how to correctly override state:

#### Toggle visibility
```javascript
import { copy } from '@ember/object/internals';
import { set } from '@ember/object';

// ...
changeVisibility() {
const visible = this.get('visible');
const visibility = (visible ? 'visible' : 'none');
const layout = copy(this.get('layout'));

if (layout) {
set(layout, 'visibility', visibility);
this.set('layout', layout);
}
}
// ...
```

#### Change visibility
```javascript
import { copy } from '@ember/object/internals';
import { set } from '@ember/object';

// ...
changeVisibility() {
const visible = this.get('visible');
const visibility = (visible ? 'visible' : 'none');
const layout = copy(this.get('layout'));

if (layout) {
set(layout, 'visibility', visibility);
this.set('layout', layout);
}
}
// ...
```

#### Change paint
Paint must be changed with a full replacement of the object.
```javascript
const record = $E.store.peekRecord('layer', 'citymap-amendments-fill')
record.set('paint', { 'fill-color':'pink' });
```

#### Change filtering
For now, we need to use a helper method for this because updates aren't being triggered correctly yet.

```javascript
layerModelInstance.setFilter(['all', ['>=', 'effective', 100]]);
```

#### Map Styling

To style the map in development, we use [Maputnik Dev Server](https://github.com/NYCPlanning/labs-maputnik-dev-server). Check the `README` of maputnik-dev-server for the commands necessary to style the current map.

## Backend services

Carto is the primary backend resource, which provides a PostGIS database, Map Tiler, and JSON/GeoJSON data API. All of the data represented in the app starts out as a PostGIS table in Carto.
Expand Down
Loading
Loading