mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Extend data model for validation issues
Add the Issues pane 1. Add a class to represent the validation issue 2. Extend the data model for an validation issue to (1) add a severity level field (useful for identify save-blocking issues later) (2) replace single entity with an array of entities (useful for issues involving multiple entities) (3) add a coordinates field for highlighting the location of the issue on the map (4) add a fixes field for possible automatic fixes 3. Update existing validation modules to use the new data model
This commit is contained in:
committed by
Xiaoming Gao
parent
0d0521c936
commit
07a53fe6ea
@@ -206,14 +206,17 @@ export default {
|
||||
}
|
||||
},
|
||||
// when geometries match and tag matches are present, return a warning...
|
||||
findWarnings: function (entity, graph, warnings) {
|
||||
findIssues: function (entity, graph, issues) {
|
||||
if (this.geometryMatches(entity, graph) && this.matches(entity)) {
|
||||
var type = Object.keys(selector).indexOf('error') > -1 ? 'error' : 'warning';
|
||||
warnings.push({
|
||||
severity: type,
|
||||
message: selector[type],
|
||||
entity: entity
|
||||
});
|
||||
var severity = Object.keys(selector).indexOf('error') > -1
|
||||
? ValidationIssueSeverity.error
|
||||
: ValidationIssueSeverity.warning;
|
||||
issues.push(new validationIssue({
|
||||
type: ValidationIssueType.map_rule_issue,
|
||||
severity: severity,
|
||||
message: selector[severity],
|
||||
entities: [entity],
|
||||
}));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user