mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
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:
@@ -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 = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user