Fix build, regenerate charging station theme

This commit is contained in:
Pieter Vander Vennet 2021-09-06 02:17:28 +02:00
parent d72938ac35
commit 75b9686f48
2 changed files with 124 additions and 124 deletions

View file

@ -190,8 +190,8 @@
"then": "<img style='width:3rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/> <b>Tesla Supercharger</b>" "then": "<img style='width:3rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/> <b>Tesla Supercharger</b>"
} }
] ]
}, },
{ {
"question": { "question": {
"en": "How much plugs of type <b>Schuko wall plug</b> without ground pin (CEE7/4 type F) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/CEE7_4F.svg'/> are available here?" "en": "How much plugs of type <b>Schuko wall plug</b> without ground pin (CEE7/4 type F) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/CEE7_4F.svg'/> are available here?"
}, },
@ -201,8 +201,8 @@
"type": "pnat" "type": "pnat"
}, },
"condition": "socket:schuko~*" "condition": "socket:schuko~*"
}, },
{ {
"question": { "question": {
"en": "How much plugs of type <b>European wall plug</b> with ground pin (CEE7/4 type E) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/TypeE.svg'/> are available here?" "en": "How much plugs of type <b>European wall plug</b> with ground pin (CEE7/4 type E) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/TypeE.svg'/> are available here?"
}, },
@ -212,8 +212,8 @@
"type": "pnat" "type": "pnat"
}, },
"condition": "socket:typee~*" "condition": "socket:typee~*"
}, },
{ {
"question": { "question": {
"en": "How much plugs of type <b>Chademo</b> (type 4) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Chademo_type4.svg'/> are available here?" "en": "How much plugs of type <b>Chademo</b> (type 4) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Chademo_type4.svg'/> are available here?"
}, },
@ -223,8 +223,8 @@
"type": "pnat" "type": "pnat"
}, },
"condition": "socket:chademo~*" "condition": "socket:chademo~*"
}, },
{ {
"question": { "question": {
"en": "How much plugs of type <b>Type 1 with cable</b> (J1772) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Type1_J1772.svg'/> are available here?" "en": "How much plugs of type <b>Type 1 with cable</b> (J1772) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Type1_J1772.svg'/> are available here?"
}, },
@ -234,8 +234,8 @@
"type": "pnat" "type": "pnat"
}, },
"condition": "socket:type1_cable~*" "condition": "socket:type1_cable~*"
}, },
{ {
"question": { "question": {
"en": "How much plugs of type <b>Type 1 <i>without</i> cable</b> (J1772) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Type1_J1772.svg'/> are available here?" "en": "How much plugs of type <b>Type 1 <i>without</i> cable</b> (J1772) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Type1_J1772.svg'/> are available here?"
}, },
@ -245,8 +245,8 @@
"type": "pnat" "type": "pnat"
}, },
"condition": "socket:type1~*" "condition": "socket:type1~*"
}, },
{ {
"question": { "question": {
"en": "How much plugs of type <b>Type 1 CCS</b> (aka Type 1 Combo) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Type1-ccs.svg'/> are available here?" "en": "How much plugs of type <b>Type 1 CCS</b> (aka Type 1 Combo) <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Type1-ccs.svg'/> are available here?"
}, },
@ -256,8 +256,8 @@
"type": "pnat" "type": "pnat"
}, },
"condition": "socket:type1_combo~*" "condition": "socket:type1_combo~*"
}, },
{ {
"question": { "question": {
"en": "How much plugs of type <b>Tesla Supercharger</b> <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/> are available here?" "en": "How much plugs of type <b>Tesla Supercharger</b> <img style='width:1rem; margin-left: 1rem; margin-right: 1rem' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/> are available here?"
}, },
@ -267,7 +267,7 @@
"type": "pnat" "type": "pnat"
}, },
"condition": "socket:tesla_supercharger~*" "condition": "socket:tesla_supercharger~*"
}, },
{ {
"#": "Authentication", "#": "Authentication",
"question": { "question": {

View file

@ -2,8 +2,8 @@ import {readFileSync, writeFileSync} from "fs";
import {Utils} from "../../../Utils"; import {Utils} from "../../../Utils";
// SMall script to output the properties of the types.csv as json to add in the tagRenderingGroup. Should be copied manually // SMall script to output the properties of the types.csv as json to add in the tagRenderingGroup. Should be copied manually
function run() { function run(file, protojson) {
const entries: string[] = Utils.NoNull(readFileSync("types.csv", "utf8").split("\n").map(str => str.trim())) const entries: string[] = Utils.NoNull(readFileSync(file, "utf8").split("\n").map(str => str.trim()))
entries.shift() entries.shift()
const result = [] const result = []
@ -58,13 +58,13 @@ function run() {
const stringified = questions.map(q => JSON.stringify(q, null, " ")) const stringified = questions.map(q => JSON.stringify(q, null, " "))
console.log(stringified) console.log(stringified)
let proto = readFileSync("charging_station.protojson", "utf8") let proto = readFileSync(protojson, "utf8")
proto = proto.replace("$$$", stringified.join(",\n") + ",") proto = proto.replace("$$$", stringified.join(",\n") + ",")
writeFileSync("charging_station.json", proto) writeFileSync("charging_station.json", proto)
} }
try { try {
run() run("types.csv","charging_station.protojson")
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} }