From 8de93871d76b2d10a0f11ba86c8b7ccbaacb9e4c Mon Sep 17 00:00:00 2001 From: Geido <60598000+geido@users.noreply.github.com> Date: Fri, 10 Dec 2021 18:25:40 +0200 Subject: [PATCH] Fix flacky header (#17690) --- .../src/components/EditableTitle/index.tsx | 19 ++++++++++++++++++- .../src/dashboard/components/Header/index.jsx | 11 ++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/superset-frontend/src/components/EditableTitle/index.tsx b/superset-frontend/src/components/EditableTitle/index.tsx index 8cb41fdf81..c5350416ca 100644 --- a/superset-frontend/src/components/EditableTitle/index.tsx +++ b/superset-frontend/src/components/EditableTitle/index.tsx @@ -18,8 +18,9 @@ */ import React, { useEffect, useState, useRef } from 'react'; import cx from 'classnames'; -import { t } from '@superset-ui/core'; +import { styled, t } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; +import CertifiedIcon from '../CertifiedIcon'; export interface EditableTitleProps { canEdit?: boolean; @@ -34,8 +35,14 @@ export interface EditableTitleProps { title?: string; defaultTitle?: string; placeholder?: string; + certifiedBy?: string; + certificationDetails?: string; } +const StyledCertifiedIcon = styled(CertifiedIcon)` + vertical-align: middle; +`; + export default function EditableTitle({ canEdit = false, editing = false, @@ -48,6 +55,8 @@ export default function EditableTitle({ title = '', defaultTitle = '', placeholder = '', + certifiedBy, + certificationDetails, }: EditableTitleProps) { const [isEditing, setIsEditing] = useState(editing); const [currentTitle, setCurrentTitle] = useState(title); @@ -222,6 +231,14 @@ export default function EditableTitle({ )} style={style} > + {certifiedBy && ( + <> + {' '} + + )} {titleComponent} ); diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index cf913afd46..de7be7e1c3 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -22,7 +22,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { styled, t } from '@superset-ui/core'; import ButtonGroup from 'src/components/ButtonGroup'; -import CertifiedIcon from 'src/components/CertifiedIcon'; import { LOG_ACTIONS_PERIODIC_RENDER_DASHBOARD, @@ -515,19 +514,13 @@ class Header extends React.PureComponent { data-test-id={`${dashboardInfo.id}`} >
- {dashboardInfo.certified_by && ( - <> - {' '} - - )}