Read icons from qa_errors.json when building data

Also adds support for the following error types:
- Objects mapped as both node/area or way/area
- Power lines that lead to nowhere
- Extra nodes in power lines (which should only go from support to
support to endpoint)
- Power line supports with no power lines
This commit is contained in:
SilentSpike
2019-12-29 19:18:30 +00:00
parent 5afdfc527b
commit d4723ec9e2
6 changed files with 83 additions and 6 deletions

View File

@@ -67,11 +67,8 @@ function buildData() {
let faIcons = {
'fas-i-cursor': {},
'fas-lock': {},
'fas-long-arrow-alt-right': {},
'fas-th-list': {},
'fas-user-cog': {},
'far-clone': {},
'fas-weight-hanging': {}
'fas-user-cog': {}
};
// The Noun Project icons used
@@ -92,7 +89,7 @@ function buildData() {
'dist/data/*',
'svg/fontawesome/*.svg',
]);
readQAErrorIcons(faIcons, tnpIcons);
let categories = generateCategories(tstrings, faIcons, tnpIcons);
let fields = generateFields(tstrings, faIcons, tnpIcons, searchableFieldIDs);
let presets = generatePresets(tstrings, faIcons, tnpIcons, searchableFieldIDs);
@@ -174,6 +171,28 @@ function validate(file, instance, schema) {
}
function readQAErrorIcons(faIcons, tnpIcons) {
const qa = read('data/qa_errors.json');
for (const service in qa.services) {
for (const error in qa.services[service].errorTypes) {
const icon = qa.services[service]
.errorTypes[error]
.icon;
// fontawesome icon, remember for later
if (/^fa[srb]-/.test(icon)) {
faIcons[icon] = {};
}
// noun project icon, remember for later
if (/^tnp-/.test(icon)) {
tnpIcons[icon] = {};
}
}
}
}
function generateCategories(tstrings, faIcons, tnpIcons) {
let categories = {};