Skip to content

Commit a090dad

Browse files
authored
Merge pull request #1201 from tordans/crossing-refactoring
Crossing refactoring
2 parents c1989ac + b2ad536 commit a090dad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+454
-133
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
steps:
88
- uses: actions/checkout@v3
99
- run: |
10-
notJSONs=`find data/ -type f -not -iname "*.json"`
11-
for f in $notJSONs
10+
disallowedFiles=`find data/ -type f -not -iname "*.json" -not -iname "*.md"`
11+
for f in $disallowedFiles
1212
do
13-
echo "::error file=$f::File $f is not a .json file."
13+
echo "::error file=$f::File $f is not a .json or .md file."
1414
done
15-
if [ ! -z "$notJSONs" ]; then exit 1; fi
15+
if [ ! -z "$disallowedFiles" ]; then exit 1; fi
1616
1717
prettier:
1818
name: Check for code formatting mistakes
@@ -23,7 +23,6 @@ jobs:
2323
with:
2424
node-version-file: '.nvmrc'
2525
- run: npm clean-install
26-
- run: 'for f in `find data/ -type f -not -iname "*.json"`; do echo "::error File $f is not a .json file."; done'
2726
- run: npm run lint
2827

2928
codespell:
@@ -37,4 +36,3 @@ jobs:
3736
skip: ./.git,./dist,./data/deprecated.json,./data/discarded.json
3837
ignore_words_list: "auxilary,casette,cemetary,chancel,discus,extentions,faiway,generat,goverment,guerilla,guyser,kindergarden,ore,pavillion,sculpter,storys,linz,te"
3938
only_warn: 1
40-

data/fields/crossing/markings-BG.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"key": "crossing:markings",
33
"type": "combo",
44
"label": "{crossing/markings}",
5+
"autoSuggestions": false,
56
"stringsCrossReference": "{crossing/markings}",
67
"iconsCrossReference": "{crossing/markings}",
78
"options": [
@@ -15,6 +16,5 @@
1516
"include": [
1617
"BG"
1718
]
18-
},
19-
"autoSuggestions": false
19+
}
2020
}

data/fields/crossing/markings-DE-AT-CH.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"key": "crossing:markings",
33
"type": "combo",
44
"label": "{crossing/markings}",
5+
"autoSuggestions": false,
6+
"stringsCrossReference": "{crossing/markings}",
7+
"iconsCrossReference": "{crossing/markings}",
58
"options": [
69
"zebra",
710
"yes",
@@ -10,9 +13,6 @@
1013
"dashes",
1114
"surface"
1215
],
13-
"autoSuggestions": false,
14-
"iconsCrossReference": "{crossing/markings}",
15-
"stringsCrossReference": "{crossing/markings}",
1616
"locationSet": {
1717
"include": [
1818
"DE",

data/fields/crossing/markings-PL.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
"key": "crossing:markings",
33
"type": "combo",
44
"label": "{crossing/markings}",
5+
"autoSuggestions": false,
6+
"stringsCrossReference": "{crossing/markings}",
7+
"iconsCrossReference": "{crossing/markings}",
58
"options": [
69
"zebra",
710
"dots",
811
"surface",
912
"yes",
1013
"no"
1114
],
12-
"autoSuggestions": false,
13-
"iconsCrossReference": "{crossing/markings}",
14-
"stringsCrossReference": "{crossing/markings}",
1515
"locationSet": {
1616
"include": [
1717
"PL"

data/fields/crossing/markings_yes-BG.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"key": "crossing:markings",
33
"type": "combo",
44
"label": "{crossing/markings}",
5+
"autoSuggestions": false,
6+
"default": "yes",
57
"stringsCrossReference": "{crossing/markings}",
68
"iconsCrossReference": "{crossing/markings}",
7-
"default": "yes",
89
"options": [
910
"zebra",
1011
"no",
@@ -16,6 +17,5 @@
1617
"include": [
1718
"BG"
1819
]
19-
},
20-
"autoSuggestions": false
20+
}
2121
}

data/fields/crossing/markings_yes-DE-AT-CH.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"key": "crossing:markings",
33
"type": "combo",
44
"label": "{crossing/markings}",
5+
"autoSuggestions": false,
6+
"default": "yes",
7+
"stringsCrossReference": "{crossing/markings}",
8+
"iconsCrossReference": "{crossing/markings}",
59
"options": [
610
"zebra",
711
"yes",
@@ -10,15 +14,11 @@
1014
"dashes",
1115
"surface"
1216
],
13-
"autoSuggestions": false,
14-
"iconsCrossReference": "{crossing/markings}",
15-
"stringsCrossReference": "{crossing/markings}",
1617
"locationSet": {
1718
"include": [
1819
"DE",
1920
"AT",
2021
"CH"
2122
]
22-
},
23-
"default": "yes"
23+
}
2424
}

data/fields/crossing/markings_yes-PL.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
"key": "crossing:markings",
33
"type": "combo",
44
"label": "{crossing/markings}",
5+
"autoSuggestions": false,
6+
"default": "yes",
7+
"stringsCrossReference": "{crossing/markings}",
8+
"iconsCrossReference": "{crossing/markings}",
59
"options": [
610
"zebra",
711
"dots",
812
"surface",
913
"yes",
1014
"no"
1115
],
12-
"autoSuggestions": false,
13-
"iconsCrossReference": "{crossing/markings}",
14-
"stringsCrossReference": "{crossing/markings}",
1516
"locationSet": {
1617
"include": [
1718
"PL"
1819
]
19-
},
20-
"default": "yes"
20+
}
2121
}

data/fields/crossing/markings_yes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"key": "crossing:markings",
33
"type": "combo",
44
"label": "{crossing/markings}",
5+
"default": "yes",
56
"stringsCrossReference": "{crossing/markings}",
67
"iconsCrossReference": "{crossing/markings}",
7-
"default": "yes",
88
"locationSet": {
99
"exclude": [
1010
"BG",

data/presets/@templates/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# About `@templates`
2+
3+
Presets in `@templates` are a convention for a _virtual_ presets that are only used from inside other presets.
4+
5+
The only property that really matter for these special presets are the `fields`.
6+
7+
All other properties can be copied from existing template presets and ignored. They are default values that are meant to match all cases where they might be referenced.
8+
9+
## How to use
10+
11+
Inside another preset, reference the template – or any other preset - like `"{@templates/internet_access}"` in `fields` or `moreFields`. This will "copy" all the listed fields from the file `data/presets/@templates/internet_access.json`.
12+
13+
You can only "copy" (template) `fields` to (preset) `fields` and (template) `moreFields` to (preset) `moreFields`.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"moreFields": [
3+
"oneway",
4+
"access",
5+
"segregated"
6+
],
7+
"geometry": [
8+
"line"
9+
],
10+
"tags": {
11+
"@template": "crossing/bicycle_more"
12+
},
13+
"searchable": false,
14+
"locationSet": {
15+
"include": [
16+
"999"
17+
],
18+
"exclude": [
19+
"999"
20+
]
21+
},
22+
"name": "{point}"
23+
}

0 commit comments

Comments
 (0)