From 1daab2731ddcb546aeeb14c97dc429941a27836a Mon Sep 17 00:00:00 2001 From: Siva Sathyaseelan <95441117+sivasathyaseeelan@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:14:58 +0530 Subject: [PATCH] fix: In chart gallery thumbnail is rendered in case of no example in #16707 (#26415) (cherry picked from commit 6d585667799d9fdc511c45fe062f54bf0ce9022f) --- .../controls/VizTypeControl/VizTypeGallery.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx index 2563dba01cb7a..2d14376516931 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx @@ -849,10 +849,18 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) { grid-area: examples-header; `} > - {!!selectedVizMetadata?.exampleGallery?.length && t('Examples')} + {t('Examples')} - {(selectedVizMetadata?.exampleGallery || []).map(example => ( + {(selectedVizMetadata?.exampleGallery?.length + ? selectedVizMetadata.exampleGallery + : [ + { + url: selectedVizMetadata?.thumbnail, + caption: selectedVizMetadata?.name, + }, + ] + ).map(example => (