Move relation type detection to osm_wikibase (#7932)

This commit is contained in:
Til Schneider
2020-08-29 11:05:07 +02:00
parent d3069a47ae
commit 4dabd79702
3 changed files with 6 additions and 27 deletions
+1 -6
View File
@@ -124,7 +124,6 @@ export default {
// {
// key: 'string',
// value: 'string',
// rtype: 'string',
// langCode: 'string'
// }
//
@@ -133,7 +132,7 @@ export default {
var that = this;
var titles = [];
var result = {};
var rtypeSitelink = params.rtype ? ('Relation:' + params.rtype).replace(/_/g, ' ').trim() : false;
var rtypeSitelink = (params.key === 'type' && params.value) ? ('Relation:' + params.value).replace(/_/g, ' ').trim() : false;
var keySitelink = params.key ? this.toSitelink(params.key) : false;
var tagSitelink = (params.key && params.value) ? this.toSitelink(params.key, params.value) : false;
var localeSitelink;
@@ -242,10 +241,6 @@ export default {
// key: 'string', // required
// value: 'string' // optional
// }
// -or-
// {
// rtype: 'rtype' // relation type (e.g. 'multipolygon')
// }
//
// Get an result object used to display tag documentation
// {
+4 -16
View File
@@ -215,7 +215,6 @@ export function uiSectionRawTagEditor(id, context) {
.merge(itemsEnter)
.sort(function(a, b) { return a.index - b.index; });
var includesRelation = null;
items
.each(function(d) {
var row = d3_select(this);
@@ -226,22 +225,11 @@ export function uiSectionRawTagEditor(id, context) {
bindTypeahead(key, value);
}
var reference;
if (typeof d.value !== 'string') {
reference = uiTagReference({ key: d.key }, context);
} else {
if (includesRelation === null) {
includesRelation = _entityIDs && _entityIDs.some(function(entityID) {
return context.entity(entityID).type === 'relation';
});
}
if (includesRelation && d.key === 'type') {
reference = uiTagReference({ rtype: d.value }, context);
} else {
reference = uiTagReference({ key: d.key, value: d.value }, context);
}
var referenceOptions = { key: d.key };
if (typeof d.value === 'string') {
referenceOptions.value = d.value;
}
var reference = uiTagReference(referenceOptions, context);
if (_state === 'hover') {
reference.showing(false);
+1 -5
View File
@@ -8,17 +8,13 @@ import { services } from '../services';
import { svgIcon } from '../svg/icon';
// Pass `which` object of the form:
// Pass `what` object of the form:
// {
// key: 'string', // required
// value: 'string' // optional
// }
// -or-
// {
// rtype: 'string' // relation type (e.g. 'multipolygon')
// }
// -or-
// {
// qid: 'string' // brand wikidata (e.g. 'Q37158')
// }
//