[openstreetmap/openstreetmap-website] Integrate human-readable wikidata browser plugin (PR #6127)
Anton Khorev
notifications at github.com
Wed Jul 16 09:55:26 UTC 2025
@AntonKhorev commented on this pull request.
> + if (!entities) return Promise.reject(entities);
+ $btn
+ .closest("tr")
+ .after(
+ items
+ .filter(qid => entities[qid])
+ .map(qid => getLocalizedResponse(entities[qid]))
+ .filter(data => data.label || data.icon || data.description || data.article)
+ .map(data => renderWikidataResponse(data, $btn.siblings(`a[href*="wikidata.org/entity/${data.qid}"]`)))
+ );
+ })
+ .catch(() => $btn.prop("disabled", false));
+ }
+
+ function getLocalizedResponse(entity) {
+ const localizedProperty = (property, langs) => langs.reduce((out, lang) => out ?? entity[property][lang], null);
See my previous comment about `langs`.
`langs` here are either `langs` there or `wikis` there. Are `wikis` `langs`?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6127#pullrequestreview-3024068482
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6127/review/3024068482 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250716/f1ef831a/attachment.htm>
More information about the rails-dev
mailing list