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

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

commit 333b18db5a9b3ae436d2acb46f489c0a3dc12fb6
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)
    
    (cherry picked from commit 6d585667799d9fdc511c45fe062f54bf0ce9022f)
---
 .../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 90b7856b05..5ae545e2ae 100644
--- 
a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
+++ 
b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx
@@ -848,10 +848,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
                   src={example.url}
                   alt={example.caption}

Reply via email to