fix KeepRight warnings showing up as "Unknown" issues (close #8925)

This commit is contained in:
Martin Raifer
2022-02-07 10:42:36 +01:00
parent fe15d69b0c
commit 04f77be5bc
3 changed files with 12 additions and 10 deletions
+2
View File
@@ -47,6 +47,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
* Handle indoor features like buildings when checking for crossing ways ([#8944])
#### :bug: Bugfixes
* Fix rendering of KeepRight issues ([#8963])
* Fix KeepRight warnings showing up as "Unknown" issues ([#8925])
#### :rocket: Presets
* Optimize order of values in dropdowns of `access` fields ([#8945])
* Use value of `vehicle` tag as placeholder value of `access` fields for `motor_vehicle` and `bicycle`
@@ -56,6 +57,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
[#8774]: https://github.com/openstreetmap/iD/pull/8774
[#8811]: https://github.com/openstreetmap/iD/issues/8811
[#8925]: https://github.com/openstreetmap/iD/issues/8925
[#8927]: https://github.com/openstreetmap/iD/issues/8927
[#8944]: https://github.com/openstreetmap/iD/issues/8944
[#8945]: https://github.com/openstreetmap/iD/issues/8945
+5 -5
View File
@@ -4,7 +4,7 @@ import {
import { presetManager } from '../presets';
import { modeSelect } from '../modes/select';
import { t } from '../core/localizer';
import { t, localizer } from '../core/localizer';
import { utilDisplayName, utilHighlightEntities, utilEntityRoot } from '../util';
@@ -18,11 +18,11 @@ export function uiKeepRightDetails(context) {
let replacements = d.replacements || {};
replacements.default = unknown; // special key `default` works as a fallback string
let detail = t.html(`QA.keepRight.errorTypes.${itemType}.description`, replacements);
if (detail === unknown.html) {
detail = t.html(`QA.keepRight.errorTypes.${parentIssueType}.description`, replacements);
if (localizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
return t.html(`QA.keepRight.errorTypes.${itemType}.description`, replacements);
} else {
return t.html(`QA.keepRight.errorTypes.${parentIssueType}.description`, replacements);
}
return detail;
}
+5 -5
View File
@@ -1,5 +1,5 @@
import { svgIcon } from '../svg/icon';
import { t } from '../core/localizer';
import { t, localizer } from '../core/localizer';
export function uiKeepRightHeader() {
@@ -12,11 +12,11 @@ export function uiKeepRightHeader() {
let replacements = d.replacements || {};
replacements.default = { html: unknown }; // special key `default` works as a fallback string
let title = t.html(`QA.keepRight.errorTypes.${itemType}.title`, replacements);
if (title === unknown) {
title = t.html(`QA.keepRight.errorTypes.${parentIssueType}.title`, replacements);
if (localizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
return t.html(`QA.keepRight.errorTypes.${itemType}.title`, replacements);
} else {
return t.html(`QA.keepRight.errorTypes.${parentIssueType}.title`, replacements);
}
return title;
}