mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-03 21:48:03 +02:00
Replace getErrors/getWarnings with getIssues/getIssuesBySeverity
The idea here is that the validator will now hold onto lots of issues, but the calling code will only want some small subset of them (edited/everything) (inview/everywhere) and can pass these as options so that we don't need filtering code spread throughtout the app.
This commit is contained in:
@@ -4,14 +4,12 @@ import { svgIcon } from '../svg';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { utilEntityOrMemberSelector } from '../util';
|
||||
|
||||
|
||||
export function uiCommitWarnings(context) {
|
||||
|
||||
function commitWarnings(selection) {
|
||||
|
||||
var issuesBySeverity = {
|
||||
warning: context.validator().getWarnings(),
|
||||
error: context.validator().getErrors()
|
||||
};
|
||||
var issuesBySeverity = context.validator()
|
||||
.getIssuesBySeverity({ what: 'edited', where: 'all' });
|
||||
|
||||
for (var severity in issuesBySeverity) {
|
||||
var issues = issuesBySeverity[severity];
|
||||
@@ -41,7 +39,7 @@ export function uiCommitWarnings(context) {
|
||||
|
||||
|
||||
var items = container.select('ul').selectAll('li')
|
||||
.data(issues, function(d) { return d.id(); });
|
||||
.data(issues, function(d) { return d.id; });
|
||||
|
||||
items.exit()
|
||||
.remove();
|
||||
|
||||
Reference in New Issue
Block a user