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

Sandbox... #1094

Draft
wants to merge 38 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
20db119
Add missing dev dependency, fix dependency lint
allthesignals Jun 28, 2022
e1cfdf1
Specificy node version with .nvmrc
allthesignals Jun 30, 2022
297ad77
Disable husky
allthesignals Jun 30, 2022
89a8717
3.12
allthesignals Jul 5, 2022
9484de2
Temporarily allow dep lint versions
allthesignals Jul 5, 2022
7a9bf4e
Remove lint-staged as it’s incompatible with current node
allthesignals Jul 5, 2022
60f357b
3.13
allthesignals Jul 5, 2022
cf6d9dc
3.13: Upgrade fixable dependencies
allthesignals Jul 6, 2022
81f4ee3
Remove y18n dep and resolution
allthesignals Jul 6, 2022
4ee3945
3.14
allthesignals Jul 6, 2022
276be15
3.15 WIP (Broken bookmarks)
allthesignals Jul 6, 2022
c845a0f
Bump node version for CI
allthesignals Jul 6, 2022
8e09d11
Bump node version for CI
allthesignals Jul 6, 2022
ec8c6bd
3.15: Manual testing working
allthesignals Jul 6, 2022
72dbd79
Adds error message to view
allthesignals Jul 6, 2022
080b085
Swap out star with correct syntax
allthesignals Jul 6, 2022
99eca6a
Fix model id testing issue with bookmarks and other records
allthesignals Jul 7, 2022
1a24ca3
3.16
allthesignals Jul 7, 2022
c141711
Re-add ember-fetch
allthesignals Jul 7, 2022
0827fb0
3.19
allthesignals Jul 7, 2022
2601943
Merge branch 'mg/escape-dependency-hell-3.19' into mg/escape-dependen…
allthesignals Jul 7, 2022
f27e084
Debug CI: Drop unused Percy assertions
allthesignals Jul 7, 2022
b64b83a
Debug GH Actions CI
allthesignals Jul 7, 2022
ffbc4ba
Remove unused travis file
allthesignals Jul 7, 2022
f0bb7f6
Use supported syntax; rename underscore filename
allthesignals Jul 7, 2022
0540408
Rename run helper; GH action configuration fixed
allthesignals Jul 12, 2022
002a960
Update map stub
allthesignals Jul 12, 2022
2ebfc5d
Switch to MacOS
allthesignals Jul 12, 2022
3ee7df0
Bump nvmrc
allthesignals Jul 12, 2022
26c4564
Use did-render modifier to trigger load behavior
allthesignals Jul 12, 2022
264cb00
Confirm issue with waiters
allthesignals Jul 13, 2022
fa8fa47
Throw error if map doesn’t load
allthesignals Jul 13, 2022
ccbc72e
Switch to NYCPlanning-hosted dependency
allthesignals Sep 2, 2022
bd69b0d
Use single version of node
allthesignals Jan 14, 2023
ded53fa
Merge branch 'develop' into mg/escape-dependency-hell
allthesignals Jan 14, 2023
501f439
Bump versions and align node
allthesignals Jan 14, 2023
b6021a5
Test
allthesignals Jan 14, 2023
fb82e79
prebuild for the same command
allthesignals Jan 14, 2023
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
18 changes: 13 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
legacyDecorators: true
}
},
parser: 'babel-eslint',
plugins: [
'ember'
],
Expand Down Expand Up @@ -53,12 +55,18 @@ module.exports = {
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
env: {
browser: false,
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'
}
}
]
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ on:
jobs:
test:
name: Tests
runs-on: ubuntu-latest
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 10.x
node-version: 12.x
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
run: yarn ember build -prod
- name: test
run: yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ development.env
/package.json.ember-try

.eslintcache
.yalc
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/pre-commit

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.19.3
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'octane'
};
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions app/adapters/lot.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const LotColumnsSQL = [

export const cartoQueryTemplate = function(id) {
return `SELECT ${LotColumnsSQL.join(',')},
/* id:${id} */
st_x(st_centroid(the_geom)) as lon, st_y(st_centroid(the_geom)) as lat,
the_geom, bbl AS id FROM dcp_mappluto WHERE bbl=${id}`;
};
Expand Down
15 changes: 6 additions & 9 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Application from '@ember/application';
import Ember from 'ember';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import * as Sentry from '@sentry/browser';
import * as Integrations from '@sentry/integrations';
import defineModifier from 'ember-concurrency-retryable/define-modifier';
import Resolver from './resolver';
import config from './config/environment';

if (config.environment === 'production' || config.environment === 'staging') {
Expand All @@ -20,11 +19,11 @@ if (config.environment === 'production' || config.environment === 'staging') {
// see: https://github.com/maxfierke/ember-concurrency-retryable/issues/5
defineModifier();

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver,
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

// temporary fix due to importing registerWaiter
// see: https://github.com/emberjs/ember.js/issues/15670
Expand All @@ -41,5 +40,3 @@ if (typeof Ember.Test === 'undefined') {
Ember.MODEL_FACTORY_INJECTIONS = true;

loadInitializers(App, config.modulePrefix);

export default App;
120 changes: 120 additions & 0 deletions app/components/labs-map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import mapboxGlMap from 'ember-mapbox-gl/components/mapbox-gl';
import { assign } from '@ember/polyfills';
import { get } from '@ember/object';
import { computed, action } from '@ember/object';
import layout from '../templates/components/labs-map';

const highlightedCircleFeatureLayer = {
id: 'highlighted-feature-circle',
source: 'hovered-feature',
type: 'circle',
paint: {
'circle-color': 'rgba(255, 255, 255, 0.65)',
'circle-opacity': 1,
'circle-radius': {
stops: [
[16, 3],
[17, 6],
],
},
'circle-stroke-opacity': 0.8,
'circle-stroke-color': '#ffff00',
'circle-stroke-width': 2.5,
'circle-pitch-scale': 'map',
},
};


const highlightedLineFeatureLayer = {
id: 'highlighted-feature-line',
source: 'hovered-feature',
type: 'line',
paint: {
'line-color': '#ffff00',
'line-opacity': 0.3,
'line-width': {
stops: [
[8, 4],
[11, 7],
],
},
},
};

/**
Extends `mapbox-gl` component to yield `labs-layers` contextual component. Allows passage of layer-groups.

```js
// routes/application.js
import Route from '@ember/routing/route';

export default class ApplicationRoute extends Route {
async model() {
return this.store.query('layer-group');
}
}

```
```handlebars
{{!-- routes/application.hbs --}}
{{labs-map layerGroups=model}}
```

@class LabsMapComponent
@public
*/
export default class LabsMap extends mapboxGlMap {
init(...args) {
super.init(...args);

// if layerGroups are passed to the map, use the style from that
if (this.get('layerGroups')) {
const {
meta: {
mapboxStyle
}
} = this.get('layerGroups') || {};

if (mapboxStyle) assign(get(this, 'initOptions') || {}, { style: mapboxStyle });
}
}

layout = layout;

@computed('hoveredFeature')
get hoveredFeatureSource() {
const feature = this.get('hoveredFeature');

return {
type: 'geojson',
data: feature,
};
}

hoveredFeature = null;
highlightedCircleFeatureLayer = highlightedCircleFeatureLayer;
highlightedLineFeatureLayer = highlightedLineFeatureLayer;

/**
Collection of layer-group models (see: [DS.RecordArray](https://emberjs.com/api/ember-data/release/classes/DS.RecordArray)).
Allows optional `meta` object with a `mapboxStyle` property which is passed to the mapbox-gl instance.
@argument layerGroups
@type DS.RecordArray
*/
layerGroups = null;

@action
handleError(e) {
throw e;
}

@action
_onLoad(map) {
// add source for highlighted-feature
map
.addSource('hovered-feature', this.get('hoveredFeatureSource'));

map.addLayer(this.highlightedLineFeatureLayer);
map.addLayer(this.highlightedCircleFeatureLayer);
}
}
10 changes: 4 additions & 6 deletions app/components/mapbox/basic-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ import { registerWaiter, unregisterWaiter } from '@ember/test';
*/
@tagName('')
export default class MapboxBasicMapComponent extends Component {
init(...args) {
super.init(...args);

registerWaiter(this._mapIsLoaded);
}

// used internally for testing. tells the test suite
// to wait until the map has loaded before proceeding
@action
Expand All @@ -42,6 +36,10 @@ export default class MapboxBasicMapComponent extends Component {
this.mapLoaded(this.mapInstance);
}

didInsertElement() {
registerWaiter(this._mapIsLoaded);
}

willDestroyElement() {
unregisterWaiter(this._mapIsLoaded);
}
Expand Down
7 changes: 7 additions & 0 deletions app/helpers/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { helper } from '@ember/component/helper';

export function run([object, func, ...args]) {
object[func](...args);
}

export default helper(run);
3 changes: 0 additions & 3 deletions app/resolver.js

This file was deleted.

10 changes: 4 additions & 6 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import trackPage from './mixins/track-page';

const Router = EmberRouter.extend(trackPage, {
location: config.locationType,
rootURL: config.rootURL,
});
export default class Router extends EmberRouter.extend(trackPage) {
location = config.locationType;
rootURL = config.rootURL;
}

Router.map(function () {// eslint-disable-line
// supplementary navigation routes
Expand Down Expand Up @@ -39,5 +39,3 @@ Router.map(function () {// eslint-disable-line
this.route('legacy-redirects', { path: '/zma/:id' });
this.route('legacy-redirects', { path: '/lot/:boro/:block/:lot' });
});

export default Router;
12 changes: 10 additions & 2 deletions app/templates/bookmarks.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
{{/link-to}}
</div>
<div class="content-area cell large-5 large-cell-block-y xxlarge-4 bookmarks">
{{#if (await bookmarksSettled)}}
{{#each-in (group-by "recordType.content" model) as |key values|}}
{{#if (await this.bookmarksSettled)}}
{{#each-in (group-by "recordType.content" this.model) as |key values|}}

{{!--
Should be one of:
commercial-overlay
Expand All @@ -25,6 +26,13 @@
{{/each-in}}
{{/if}}

{{#if (is-rejected this.bookmarksSettled)}}
Something went wrong:

<br/>
{{get (promise-rejected-reason this.bookmarksSettled) 'message'}}.
{{/if}}

{{#unless model.length}}
<div class="no-bookmarks">
<div class="align-self-middle large-text-center">
Expand Down
Empty file.
Loading