@phila/layerboard 1.1.13 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/node.js.yml +24 -0
- package/README.md +14 -0
- package/package.json +16 -10
- package/src/components/MapPanel.vue +44 -2
- package/src/main.js +18 -1
- package/.travis.yml +0 -27
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: Publish to npmjs
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags:
|
|
9
|
+
- '*'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v1
|
|
18
|
+
- uses: actions/setup-node@v1
|
|
19
|
+
with:
|
|
20
|
+
node-version: 12
|
|
21
|
+
registry-url: https://registry.npmjs.org/
|
|
22
|
+
- run: npm publish --access public
|
|
23
|
+
env:
|
|
24
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/README.md
CHANGED
|
@@ -19,6 +19,20 @@ See the examples [Openmaps](https://openmaps.phila.gov) and [StreetSmartPHL](htt
|
|
|
19
19
|
|
|
20
20
|
## Release Notes
|
|
21
21
|
|
|
22
|
+
### 2.0.1 - 9/9/2022
|
|
23
|
+
|
|
24
|
+
* uses upgraded @phila packages
|
|
25
|
+
* ran package upgrade
|
|
26
|
+
|
|
27
|
+
### 2.0.0 - 7/26/2021
|
|
28
|
+
|
|
29
|
+
* uses @phila packages that use npm for package commands
|
|
30
|
+
* requires using npm for all package commands
|
|
31
|
+
|
|
32
|
+
### 1.1.14 - 10/27/2020
|
|
33
|
+
|
|
34
|
+
* uses github actions for pushing to npmjs, uses vue router
|
|
35
|
+
|
|
22
36
|
### 1.1.13 - 10/7/2020
|
|
23
37
|
|
|
24
38
|
* uses upgraded vue libraries:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phila/layerboard",
|
|
3
3
|
"description": "A Vue.js component for creating an app from an ESRI web map",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"author": "City of Philadelphia <maps@phila.gov>",
|
|
6
6
|
"repository": "https://github.com/cityofphiladelphia/layerboard",
|
|
7
7
|
"license": "MIT",
|
|
@@ -13,20 +13,23 @@
|
|
|
13
13
|
"lintFix": "vue-cli-service lint --fix"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@phila/vue-comps": "
|
|
17
|
-
"@phila/vue-datafetch": "
|
|
18
|
-
"@phila/vue-mapping": "
|
|
19
|
-
"
|
|
16
|
+
"@phila/vue-comps": "3.0.5",
|
|
17
|
+
"@phila/vue-datafetch": "2.2.9",
|
|
18
|
+
"@phila/vue-mapping": "3.1.9",
|
|
19
|
+
"esri-leaflet": "2.3.1",
|
|
20
|
+
"leaflet": "1.5.1",
|
|
21
|
+
"vue": "^2.7.10",
|
|
22
|
+
"vue-router": "^3.6.5",
|
|
20
23
|
"vuex": "^3.1.2"
|
|
21
24
|
},
|
|
22
25
|
"devDependencies": {
|
|
23
|
-
"@vue/cli-plugin-babel": "^4.
|
|
24
|
-
"@vue/cli-plugin-eslint": "^4.
|
|
25
|
-
"@vue/cli-service": "^4.
|
|
26
|
+
"@vue/cli-plugin-babel": "^4.5.19",
|
|
27
|
+
"@vue/cli-plugin-eslint": "^4.5.19",
|
|
28
|
+
"@vue/cli-service": "^4.5.19",
|
|
26
29
|
"babel-eslint": "^10.0.3",
|
|
27
30
|
"eslint": "^6.7.2",
|
|
28
31
|
"eslint-plugin-vue": "^6.0.1",
|
|
29
|
-
"vue-template-compiler": "^2.
|
|
32
|
+
"vue-template-compiler": "^2.7.10",
|
|
30
33
|
"webpack-visualizer-plugin": "^0.1.11"
|
|
31
34
|
},
|
|
32
35
|
"postcss": {
|
|
@@ -38,5 +41,8 @@
|
|
|
38
41
|
"> 1%",
|
|
39
42
|
"last 2 versions",
|
|
40
43
|
"not ie <= 8"
|
|
41
|
-
]
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"yarn": "YARN NO LONGER USED - use npm instead."
|
|
47
|
+
}
|
|
42
48
|
}
|
|
@@ -477,6 +477,7 @@ export default {
|
|
|
477
477
|
return config || {};
|
|
478
478
|
},
|
|
479
479
|
activeTopicLayers() {
|
|
480
|
+
console.log('activeTopicLayers computed');
|
|
480
481
|
if (!this.topics) {
|
|
481
482
|
// if there are no topics, return all layers
|
|
482
483
|
let titles = [];
|
|
@@ -493,15 +494,17 @@ export default {
|
|
|
493
494
|
for (let component of activeTopicConfigComponents) {
|
|
494
495
|
if (component.type === 'checkbox-set' || component.type === 'radio-button-set') {
|
|
495
496
|
topicLayers = component.options.topicLayers;
|
|
497
|
+
// console.log('in activeTopicLayers computed, topicLayers:', topicLayers);
|
|
496
498
|
}
|
|
497
499
|
}
|
|
498
500
|
let topicLayersKeys = [];
|
|
499
|
-
console.log('topicLayers:', topicLayers);
|
|
500
501
|
if (topicLayers) {
|
|
501
502
|
for (let topicLayer of topicLayers) {
|
|
502
|
-
topicLayersKeys.push(topicLayer.title);
|
|
503
|
+
// topicLayersKeys.push(topicLayer.title);
|
|
504
|
+
topicLayersKeys.push(this.evaluateSlot(topicLayer.title));
|
|
503
505
|
}
|
|
504
506
|
}
|
|
507
|
+
// console.log('topicLayers:', topicLayers, 'topicLayersKeys:', topicLayersKeys);
|
|
505
508
|
return topicLayersKeys;
|
|
506
509
|
},
|
|
507
510
|
mapPanelContainerClass() {
|
|
@@ -696,6 +699,45 @@ export default {
|
|
|
696
699
|
// this.handleWindowResize(25);
|
|
697
700
|
},
|
|
698
701
|
methods: {
|
|
702
|
+
evaluateSlot(valOrGetter, transforms = [], nullValue = '') {
|
|
703
|
+
console.log('evaluateSlot is running, this.item:', this.item, 'valOrGetter:', valOrGetter);
|
|
704
|
+
// check for null val/getter
|
|
705
|
+
if (!valOrGetter) {
|
|
706
|
+
return valOrGetter;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
const valOrGetterType = typeof valOrGetter;
|
|
710
|
+
let val;
|
|
711
|
+
|
|
712
|
+
// fn
|
|
713
|
+
if (valOrGetterType === 'function') {
|
|
714
|
+
const state = this.$store.state;
|
|
715
|
+
const controller = this.$controller;
|
|
716
|
+
const getter = valOrGetter;
|
|
717
|
+
|
|
718
|
+
// const getterText = String(getter);
|
|
719
|
+
// const depsRe = /state(\.\w+)+/g;
|
|
720
|
+
// const depsText = getterText.match(depsRe);
|
|
721
|
+
// const deps = depsText.map(eval);
|
|
722
|
+
|
|
723
|
+
const item = this.item;
|
|
724
|
+
// console.log('in evaluateSlot, item:', item);
|
|
725
|
+
|
|
726
|
+
// if this comp is associated with an "item" (generally some object
|
|
727
|
+
// from a list of things, e.g. dor parcels), pass the item itself
|
|
728
|
+
// as well when evaluating
|
|
729
|
+
if (item) {
|
|
730
|
+
val = getter(state, item, controller);
|
|
731
|
+
} else {
|
|
732
|
+
// console.log('evaluateSlot, about to get value');
|
|
733
|
+
val = getter(state);
|
|
734
|
+
// console.log('state:', state, 'val:', val);
|
|
735
|
+
}
|
|
736
|
+
} else {
|
|
737
|
+
val = valOrGetter;
|
|
738
|
+
}
|
|
739
|
+
return val;
|
|
740
|
+
},
|
|
699
741
|
// shouldShowTiledLayer(key) {
|
|
700
742
|
// let value;
|
|
701
743
|
// if (!activeTopicConfig.tiledLayers) {
|
package/src/main.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
\/ \/\/ \/ \/ \/ \/
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
import Vue from 'vue';
|
|
11
12
|
import axios from 'axios';
|
|
12
13
|
import createStore from './store';
|
|
@@ -20,6 +21,8 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
|
20
21
|
|
|
21
22
|
import controllerMixin from '@phila/vue-datafetch/src/controller.js';
|
|
22
23
|
|
|
24
|
+
import Router from 'vue-router';
|
|
25
|
+
|
|
23
26
|
import * as L from 'leaflet';
|
|
24
27
|
import * as esri from 'esri-leaflet';
|
|
25
28
|
L.esri = esri;
|
|
@@ -44,14 +47,27 @@ function initLayerboard(clientConfig, secondFile) {
|
|
|
44
47
|
config = mergeDeep(config, secondFile);
|
|
45
48
|
}
|
|
46
49
|
|
|
50
|
+
config.router.pattern = 'address-and-topic';
|
|
51
|
+
|
|
47
52
|
// make config accessible from each component via this.$config
|
|
48
53
|
Vue.use(configMixin, config);
|
|
49
54
|
|
|
50
55
|
// create store
|
|
51
56
|
const store = createStore(config);
|
|
52
57
|
|
|
58
|
+
Vue.use(Router);
|
|
59
|
+
let router = new Router({
|
|
60
|
+
mode: 'history',
|
|
61
|
+
routes: [
|
|
62
|
+
{
|
|
63
|
+
path: '/:address',
|
|
64
|
+
name: 'address-only',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
|
|
53
69
|
// mix in controller
|
|
54
|
-
Vue.use(controllerMixin, { config, store });
|
|
70
|
+
Vue.use(controllerMixin, { config, store, router });
|
|
55
71
|
|
|
56
72
|
Vue.component('font-awesome-icon', FontAwesomeIcon);
|
|
57
73
|
|
|
@@ -65,6 +81,7 @@ function initLayerboard(clientConfig, secondFile) {
|
|
|
65
81
|
const vm = new Vue({
|
|
66
82
|
el: config.el || '#layerboard',
|
|
67
83
|
render: (h) => h(App),
|
|
84
|
+
router,
|
|
68
85
|
store,
|
|
69
86
|
});
|
|
70
87
|
|
package/.travis.yml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
node_js:
|
|
3
|
-
- node
|
|
4
|
-
before_install:
|
|
5
|
-
- printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FA_AUTH_TOKEN}" >> ~/.npmrc
|
|
6
|
-
script: npm run build
|
|
7
|
-
before_deploy:
|
|
8
|
-
- rm -rf node_modules
|
|
9
|
-
# - source ./.travis/s3_utils.sh
|
|
10
|
-
# - S3_BUCKET=$(get_s3_bucket)
|
|
11
|
-
# - echo "Will push to S3 bucket $S3_BUCKET."
|
|
12
|
-
deploy:
|
|
13
|
-
# - provider: s3
|
|
14
|
-
# access_key_id: $AWS_ACCESS_KEY_ID
|
|
15
|
-
# secret_access_key: $AWS_SECRET_ACCESS_KEY
|
|
16
|
-
# bucket: $S3_BUCKET
|
|
17
|
-
# skip_cleanup: true
|
|
18
|
-
# on:
|
|
19
|
-
# branch: develop
|
|
20
|
-
# TODO add a condition to make sure the bucket exists using `aws s3 ls`
|
|
21
|
-
- provider: npm
|
|
22
|
-
email: "phillypackage@gmail.com"
|
|
23
|
-
api_key: $NPM_AUTH_TOKEN
|
|
24
|
-
skip_cleanup: true
|
|
25
|
-
on:
|
|
26
|
-
tags: true
|
|
27
|
-
env:
|