dosubot[bot] commented on issue #30188:
URL: https://github.com/apache/superset/issues/30188#issuecomment-2337058431

   <!-- Greeting -->
   Hey @nemccarthy! I'm here to help you with any bugs or questions you have 
regarding Superset. Let's squash those bugs together!
   
   <!-- Answer -->
   I found a similar unsolved discussion that might be relevant to your issue: 
[Embedded dashboard: hide edit chart title 
link](https://github.com/apache/superset/discussions/25436), which was last 
updated on 2024-09-04 
<sup>[[1]](https://github.com/apache/superset/discussions/25436)</sup>.
   
   To hide the username and last modified timestamp in the dashboard header for 
the embedded use case in Superset version 4.1.0rc2, you need to modify the 
`titlePanelAdditionalItems` array in the `render` method of the `Header` 
component. Specifically, you should remove the `MetadataBar` component from 
this array.
   
   Here is the relevant part of the code with the `MetadataBar` component 
removed:
   
   ```jsx
   return (
     <div
       css={headerContainerStyle}
       data-test="dashboard-header-container"
       data-test-id={dashboardInfo.id}
       className="dashboard-header-container"
     >
       <PageHeaderWithActions
         editableTitleProps={{
           title: dashboardTitle,
           canEdit: userCanEdit && editMode,
           onSave: this.handleChangeText,
           placeholder: t('Add the name of the dashboard'),
           label: t('Dashboard title'),
           showTooltip: false,
         }}
         certificatiedBadgeProps={{
           certifiedBy: dashboardInfo.certified_by,
           details: dashboardInfo.certification_details,
         }}
         faveStarProps={{
           itemId: dashboardInfo.id,
           fetchFaveStar: this.props.fetchFaveStar,
           saveFaveStar: this.props.saveFaveStar,
           isStarred: this.props.isStarred,
           showTooltip: true,
         }}
         titlePanelAdditionalItems={[
           !editMode && (
             <PublishedStatus
               dashboardId={dashboardInfo.id}
               isPublished={isPublished}
               savePublished={this.props.savePublished}
               canEdit={userCanEdit}
               canSave={userCanSaveAs}
               visible={!editMode}
             />
           ),
           // Remove the MetadataBar component to hide username and last 
modified timestamp
         ]}
         rightPanelAdditionalItems={
           <div className="button-container">
             {userCanSaveAs && (
               <div
                 className="button-container"
                 data-test="dashboard-edit-actions"
               >
                 {editMode && (
                   <div css={actionButtonsStyle}>
                     <div className="undoRedo">
                       <Tooltip
                         id="dashboard-undo-tooltip"
                         title={t('Undo the action')}
                       >
                         <StyledUndoRedoButton
                           type="text"
                           disabled={undoLength < 1}
                           onClick={undoLength && onUndo}
                         >
                           <Icons.Undo
                             css={[
                               undoRedoStyle,
                               this.state.emphasizeUndo && undoRedoEmphasized,
                               undoLength < 1 && undoRedoDisabled,
                             ]}
                             data-test="undo-action"
                             iconSize="xl"
                           />
                         </StyledUndoRedoButton>
                       </Tooltip>
                       <Tooltip
                         id="dashboard-redo-tooltip"
                         title={t('Redo the action')}
                       >
                         <StyledUndoRedoButton
                           type="text"
                           disabled={redoLength < 1}
                           onClick={redoLength && onRedo}
                         >
                           <Icons.Redo
                             css={[
                               undoRedoStyle,
                               this.state.emphasizeRedo && undoRedoEmphasized,
                               redoLength < 1 && undoRedoDisabled,
                             ]}
                             data-test="redo-action"
                             iconSize="xl"
                           />
                         </StyledUndoRedoButton>
                       </Tooltip>
                     </div>
                     <Button
                       css={discardBtnStyle}
                       buttonSize="small"
                       onClick={this.constructor.discardChanges}
                       buttonStyle="default"
                       data-test="discard-changes-button"
                       aria-label={t('Discard')}
                     >
                       {t('Discard')}
                     </Button>
                     <Button
                       css={saveBtnStyle}
                       buttonSize="small"
                       disabled={!hasUnsavedChanges}
                       buttonStyle="primary"
                       onClick={this.overwriteDashboard}
                       data-test="header-save-button"
                       aria-label={t('Save')}
                     >
                       {t('Save')}
                     </Button>
                   </div>
                 )}
               </div>
             )}
             {editMode ? (
               <UndoRedoKeyListeners
                 onUndo={this.handleCtrlZ}
                 onRedo={this.handleCtrlY}
               />
             ) : (
               <div css={actionButtonsStyle}>
                 {NavExtension && <NavExtension />}
                 {userCanEdit && (
                   <Button
                     buttonStyle="secondary"
                     onClick={this.toggleEditMode}
                     data-test="edit-dashboard-button"
                     className="action-button"
                     css={editButtonStyle}
                     aria-label={t('Edit dashboard')}
                   >
                     {t('Edit dashboard')}
                   </Button>
                 )}
               </div>
             )}
           </div>
         }
         menuDropdownProps={{
           getPopupContainer: triggerNode =>
             triggerNode.closest('.header-with-actions'),
           visible: this.state.isDropdownVisible,
           onVisibleChange: this.setIsDropdownVisible,
         }}
         additionalActionsMenu={
           <ConnectedHeaderActionsDropdown
             addSuccessToast={this.props.addSuccessToast}
             addDangerToast={this.props.addDangerToast}
             dashboardId={dashboardInfo.id}
             dashboardTitle={dashboardTitle}
             dashboardInfo={dashboardInfo}
             dataMask={dataMask}
             layout={layout}
             expandedSlices={expandedSlices}
             customCss={customCss}
             colorNamespace={colorNamespace}
             colorScheme={colorScheme}
             onSave={onSave}
             onChange={onChange}
             forceRefreshAllCharts={this.forceRefresh}
             startPeriodicRender={this.startPeriodicRender}
             refreshFrequency={refreshFrequency}
             shouldPersistRefreshFrequency={shouldPersistRefreshFrequency}
             setRefreshFrequency={setRefreshFrequency}
             updateCss={updateCss}
             editMode={editMode}
             hasUnsavedChanges={hasUnsavedChanges}
             userCanEdit={userCanEdit}
             userCanShare={userCanShare}
             userCanSave={userCanSaveAs}
             userCanCurate={userCanCurate}
             isLoading={isLoading}
             showPropertiesModal={this.showPropertiesModal}
             manageEmbedded={this.showEmbedModal}
             refreshLimit={refreshLimit}
             refreshWarning={refreshWarning}
             lastModifiedTime={lastModifiedTime}
             isDropdownVisible={this.state.isDropdownVisible}
             setIsDropdownVisible={this.setIsDropdownVisible}
             logEvent={logEvent}
           />
         }
         showFaveStar={user?.userId && dashboardInfo?.id}
         showTitlePanelItems
       />
       {this.state.showingPropertiesModal && (
         <PropertiesModal
           dashboardId={dashboardInfo.id}
           dashboardInfo={dashboardInfo}
           dashboardTitle={dashboardTitle}
           show={this.state.showingPropertiesModal}
           onHide={this.hidePropertiesModal}
           colorScheme={this.props.colorScheme}
           onSubmit={handleOnPropertiesChange}
           onlyApply
         />
       )}
       {userCanCurate && (
         <DashboardEmbedModal
           show={this.state.showingEmbedModal}
           onHide={this.hideEmbedModal}
           dashboardId={dashboardInfo.id}
         />
       )}
       <Global
         styles={css`
           .ant-menu-vertical {
             border-right: none;
           }
         `}
       />
     </div>
   );
   ```
   
   By removing the `MetadataBar` component, the username and last modified 
timestamp will no longer be displayed in the dashboard header 
<sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/src/dashboard/components/Header/index.jsx)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to