From 166efa40289c6436e3eb3b4a8092d110725c372b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zbytovsk=C3=BD?= Date: Fri, 27 Oct 2023 18:10:57 +0200 Subject: [PATCH] manyCombo --- .../FeaturePanel/Properties/IdSchemeFields.tsx | 9 +++++++++ src/components/FeaturePanel/Properties/renderValue.tsx | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/FeaturePanel/Properties/IdSchemeFields.tsx b/src/components/FeaturePanel/Properties/IdSchemeFields.tsx index 5863bdfd1..b7e1b23e7 100644 --- a/src/components/FeaturePanel/Properties/IdSchemeFields.tsx +++ b/src/components/FeaturePanel/Properties/IdSchemeFields.tsx @@ -75,6 +75,15 @@ const render = ( )); } + if (field?.type === 'manyCombo') { + return tagsForField.map(({ key, value: value2 }) => ( +
+ {fieldTranslation.options[key]}:{' '} + {renderValue(key, fieldTranslation.options[value2]?.title ?? value2)} +
+ )); + } + if (tagsForField?.length >= 2) { return ( <> diff --git a/src/components/FeaturePanel/Properties/renderValue.tsx b/src/components/FeaturePanel/Properties/renderValue.tsx index 69b643616..01ec4d657 100644 --- a/src/components/FeaturePanel/Properties/renderValue.tsx +++ b/src/components/FeaturePanel/Properties/renderValue.tsx @@ -32,6 +32,12 @@ const getHumanValue = (k, v, featured: boolean) => { if (featured && k === 'wikidata') { return `Wikipedia (wikidata)`; // TODO fetch label from wikidata } + if (v === 'yes') { + return '✓'; + } + if (v === 'no') { + return '✗'; + } return humanValue; }; @@ -40,5 +46,5 @@ export const renderValue = (k, v, featured = false) => { const url = getUrlForTag(k, v); const humanValue = getHumanValue(k, v, featured); - return url ? {slashToOptionalBr(humanValue)} : v; + return url ? {slashToOptionalBr(humanValue)} : humanValue; };