Fix comment box style, remove unused vars for eslint

This commit is contained in:
Bryan Housel
2019-01-02 15:46:25 -05:00
parent 9557c0204a
commit 4494c3ab9c
6 changed files with 39 additions and 79 deletions
+2 -2
View File
@@ -147,8 +147,8 @@ function parseError(group, idType) {
items.forEach(function(item) {
var match = item.match(/\#(\d+)\((.+)\)?/);
if (match !== null && match.length > 2) {
newList.push(linkEntity('w' + match[1])
+ t('QA.keepRight.errorTypes.231.layer', { layer: match[2] })
newList.push(linkEntity('w' + match[1]) + ' ' +
t('QA.keepRight.errorTypes.231.layer', { layer: match[2] })
);
}
});
+4 -30
View File
@@ -82,39 +82,13 @@ export function svgKeepRight(projection, context, dispatch) {
}
function click(d) {
var service = getService();
if (!service) return;
context.map().centerEase(d.loc);
var selected = service.getSelectedImage();
var selectedImageKey = selected && selected.key;
var imageKey;
// Pick one of the images the sign was detected in,
// preference given to an image already selected.
d.detections.forEach(function(detection) {
if (!imageKey || selectedImageKey === detection.image_key) {
imageKey = detection.image_key;
}
});
service
.selectImage(null, imageKey)
.updateViewer(imageKey, context)
.showViewer();
}
function update() {
var service = getService();
var selectedID = context.selectedNoteID(); // TODO: update with selectedErrorID
var selectedID = context.selectedErrorID();
var data = (service ? service.getErrors(projection) : []);
var visibleData = data; // getVisible(data); // TODO: only show sub-layers that are toggled on
var transform = svgPointTransform(projection);
var kr_errors = layer.selectAll('.kr_error')
.data(visibleData, function(d) { return d.id; });
.data(data, function(d) { return d.id; });
// exit
kr_errors.exit()
@@ -124,8 +98,8 @@ export function svgKeepRight(projection, context, dispatch) {
var kr_errorsEnter = kr_errors.enter()
.append('g')
.attr('class', function(d) {
return 'kr_error kr_error-' + d.id + ' kr_error_type_' + d.error_type; })
.classed('new', function(d) { return d.id < 0; });
return 'kr_error kr_error-' + d.id + ' kr_error_type_' + d.error_type; }
);
kr_errorsEnter
.append('ellipse')
+1 -5
View File
@@ -165,14 +165,10 @@ export function svgNotes(projection, context, dispatch) {
.style('display', enabled ? 'block' : 'none')
.merge(layer);
function dimensions() {
return [window.innerWidth, window.innerHeight];
}
if (enabled) {
if (service && ~~context.map().zoom() >= minZoom) {
editOn();
service.loadNotes(projection, dimensions());
service.loadNotes(projection);
update();
} else {
editOff();
+1 -2
View File
@@ -1,7 +1,6 @@
import { event as d3_event } from 'd3-selection';
import { dataEn } from '../../data';
import { errorTypes } from '../../data/keepRight.json';
import { t } from '../util/locale';
@@ -14,7 +13,7 @@ export function uiKeepRightDetails(context) {
if (!d) return unknown;
var errorType = d.error_type;
var parentErrorType = d.parent_error_type
var parentErrorType = d.parent_error_type;
var et = dataEn.QA.keepRight.errorTypes[errorType];
var pt = dataEn.QA.keepRight.errorTypes[parentErrorType];
+1 -2
View File
@@ -1,5 +1,4 @@
import { dataEn } from '../../data';
import { errorTypes } from '../../data/keepRight.json';
import { svgIcon } from '../svg';
import { t } from '../util/locale';
@@ -13,7 +12,7 @@ export function uiKeepRightHeader() {
if (!d) return unknown;
var errorType = d.error_type;
var parentErrorType = d.parent_error_type
var parentErrorType = d.parent_error_type;
var et = dataEn.QA.keepRight.errorTypes[errorType];
var pt = dataEn.QA.keepRight.errorTypes[parentErrorType];