forked from MapComplete/MapComplete
Add paper formats to copy shops
This commit is contained in:
parent
4246221e8e
commit
bb23bc0761
3 changed files with 461 additions and 913 deletions
File diff suppressed because it is too large
Load diff
|
@ -113,6 +113,57 @@
|
|||
"email",
|
||||
"phone",
|
||||
"payment-options",
|
||||
{
|
||||
"id": "copyshop-print-sizes",
|
||||
"condition": {
|
||||
"or": [
|
||||
"shop~.*copyshop.*",
|
||||
"shop~.*stationary.*",
|
||||
"service:print=yes"
|
||||
]
|
||||
},
|
||||
"question": {
|
||||
"en": "What paper formats does this shop offer?"
|
||||
},
|
||||
"multiAnswer": true,
|
||||
"mappings": [
|
||||
{
|
||||
"if": "service:print:A4=yes",
|
||||
"then": {
|
||||
"en": "This shop can print on papers of size A4"
|
||||
},
|
||||
"ifnot": "service:print:A4=no"
|
||||
},
|
||||
{
|
||||
"if": "service:print:A3=yes",
|
||||
"then": {
|
||||
"en": "This shop can print on papers of size A3"
|
||||
},
|
||||
"ifnot": "service:print:A3=no"
|
||||
},
|
||||
{
|
||||
"if": "service:print:A2=yes",
|
||||
"then": {
|
||||
"en": "This shop can print on papers of size A2"
|
||||
},
|
||||
"ifnot": "service:print:A2=no"
|
||||
},
|
||||
{
|
||||
"if": "service:print:A1=yes",
|
||||
"then": {
|
||||
"en": "This shop can print on papers of size A1"
|
||||
},
|
||||
"ifnot": "service:print:A1=no"
|
||||
},
|
||||
{
|
||||
"if": "service:print:A0=yes",
|
||||
"then": {
|
||||
"en": "This shop can print on papers of size A0"
|
||||
},
|
||||
"ifnot": "service:print:A0=no"
|
||||
}
|
||||
]
|
||||
},
|
||||
"questions",
|
||||
"reviews"
|
||||
],
|
||||
|
|
|
@ -262,8 +262,12 @@ class LayerOverviewUtils {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
const parsed = JSON.parse(readFileSync(sharedLayerPath, "utf8"))
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(readFileSync(sharedLayerPath, "utf8"))
|
||||
} catch (e) {
|
||||
throw ("Could not parse or read file " + sharedLayerPath)
|
||||
}
|
||||
const context = "While building builtin layer " + sharedLayerPath
|
||||
const fixed = prepLayer.convertStrict(parsed, context)
|
||||
|
||||
|
@ -283,6 +287,7 @@ class LayerOverviewUtils {
|
|||
|
||||
this.writeLayer(fixed)
|
||||
|
||||
|
||||
}
|
||||
|
||||
console.log("Recompiled layers " + recompiledLayers.join(", ") + " and skipped " + skippedLayers.length + " layers")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue