This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d58566779 fix: In chart gallery thumbnail is rendered in case of no 
example in #16707 (#26415)
6d58566779 is described below

commit 6d585667799d9fdc511c45fe062f54bf0ce9022f
Author: Siva Sathyaseelan <[email protected]>
AuthorDate: Tue Jan 9 00:14:58 2024 +0530

    fix: In chart gallery thumbnail is rendered in case of no example in #16707 
(#26415)
---
 .../components/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 2563dba01c..2d14376516 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')}
             </SectionTitle>
             <Examples>
-              {(selectedVizMetadata?.exampleGallery || []).map(example => (
+              {(selectedVizMetadata?.exampleGallery?.length
+                ? selectedVizMetadata.exampleGallery
+                : [
+                    {
+                      url: selectedVizMetadata?.thumbnail,
+                      caption: selectedVizMetadata?.name,
+                    },
+                  ]
+              ).map(example => (
                 <img
                   key={example.url}
                   src={example.url}

Reply via email to