Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Fix header look and feel changes #8090

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React, { memo, useState, useEffect } from 'react';
import { IndexPattern } from 'src/plugins/data/public';
import { useCallback } from 'react';
import { useLocation } from 'react-router-dom';
import { i18n } from '@osd/i18n';
import { useOpenSearchDashboards } from '../../../../../opensearch_dashboards_react/public';
import { getTopNavConfig, getTopNavRightConfig, getTopNavLegacyConfig } from './top_nav';
import { DashboardAppStateContainer, DashboardAppState, DashboardServices } from '../../../types';
Expand Down Expand Up @@ -144,7 +145,12 @@ const TopNav = ({
appName={'dashboard'}
config={showTopNavMenu ? topNavMenu : undefined}
className={isFullScreenMode ? 'osdTopNavMenu-isFullScreen' : undefined}
screenTitle={currentAppState.title}
screenTitle={
currentAppState.title ||
i18n.translate('discover.savedSearch.newTitle', {
defaultMessage: 'New dashboard',
})
}
showSearchBar={showSearchBar && TopNavMenuItemRenderType.IN_PORTAL}
showQueryBar={showQueryBar}
showQueryInput={showQueryInput}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
padding: $euiSizeXXL * 2;
max-width: 400px;
margin-left: $euiSizeS;
margin-top: $euiSizeS;
text-align: center;
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const TopNav = ({ opts, showSaveQuery, isEnhancementsEnabled }: TopNavPro
setScreenTitle(
savedSearch?.title ||
i18n.translate('discover.savedSearch.newTitle', {
defaultMessage: 'Untitled',
defaultMessage: 'New search',
})
);
}, [savedSearch?.title]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class TableListView extends React.Component<TableListViewProps, TableListViewSta
</EuiFlexGroup>
)}

<EuiSpacer size="m" />
{!this.props.showUpdatedUx && <EuiSpacer size="m" />}

{this.renderListingLimitWarning()}
{this.renderFetchError()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React, { useEffect, useState, useRef } from 'react';
import { isEqual } from 'lodash';
import { useParams } from 'react-router-dom';
import { useUnmount } from 'react-use';
import { i18n } from '@osd/i18n';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
import { getLegacyTopNavConfig, getNavActions, getTopNavConfig } from '../utils/get_top_nav_config';
import { VisBuilderServices } from '../../types';
Expand Down Expand Up @@ -151,7 +152,10 @@ export const TopNav = () => {
onSavedQueryIdChange={updateSavedQueryId}
groupActions={showActionsInGroup}
screenTitle={
savedVisBuilderVis?.title.length ? savedVisBuilderVis?.title : 'New visualization'
savedVisBuilderVis?.title ||
i18n.translate('discover.savedSearch.newTitle', {
defaultMessage: 'New visualization',
})
}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export const VisualizeListing = () => {
})}
toastNotifications={toastNotifications}
showUpdatedUx={showUpdatedUx}
paddingSize={showUpdatedUx ? 'm' : 'l'}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ const TopNav = ({
savedQueryId={currentAppState.savedQuery}
onSavedQueryIdChange={stateContainer.transitions.updateSavedQuery}
indexPatterns={indexPatterns}
screenTitle={vis.title.length ?? '' ? vis.title : 'New visualization'}
screenTitle={
vis.title ||
i18n.translate('discover.savedSearch.newTitle', {
defaultMessage: 'New visualization',
})
}
showAutoRefreshOnly={!showDatePicker()}
showDatePicker={showDatePicker()}
showFilterBar={showFilterBar}
Expand Down
Loading