@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/3024068...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev