mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Search] Fix user name in welcome banner (#166814)
## Summary This fixes an issue with the welcome banner in Search.
This commit is contained in:
parent
4327248030
commit
af9271557f
7 changed files with 15 additions and 15 deletions
|
@ -61,7 +61,7 @@ export const mockKibanaValues = {
|
|||
setDocTitle: jest.fn(),
|
||||
share: sharePluginMock.createStartContract(),
|
||||
uiSettings: uiSettingsServiceMock.createStartContract(),
|
||||
userProfile: {},
|
||||
user: {},
|
||||
};
|
||||
|
||||
jest.mock('../../shared/kibana', () => ({
|
||||
|
|
|
@ -117,8 +117,8 @@ export const ProductCard: React.FC<ProductCardProps> = ({
|
|||
gutterSize="m"
|
||||
data-test-subj="productCard-rightPanelItems"
|
||||
>
|
||||
{rightPanelItems.map((rightPanelItem) => {
|
||||
return <EuiFlexItem>{rightPanelItem}</EuiFlexItem>;
|
||||
{rightPanelItems.map((rightPanelItem, id) => {
|
||||
return <EuiFlexItem key={id}>{rightPanelItem}</EuiFlexItem>;
|
||||
})}
|
||||
</EuiFlexGroup>
|
||||
</EuiFlexItem>
|
||||
|
|
|
@ -40,7 +40,7 @@ import { IngestionSelector } from './ingestion_selector';
|
|||
import './product_selector.scss';
|
||||
|
||||
export const ProductSelector: React.FC = () => {
|
||||
const { config, userProfile } = useValues(KibanaLogic);
|
||||
const { config, user } = useValues(KibanaLogic);
|
||||
const { errorConnectingMessage } = useValues(HttpLogic);
|
||||
|
||||
const showErrorConnecting = !!(config.host && errorConnectingMessage);
|
||||
|
@ -53,7 +53,7 @@ export const ProductSelector: React.FC = () => {
|
|||
<TrialCallout />
|
||||
<EuiPageTemplate.Section alignment="top" className="entSearchProductSelectorHeader">
|
||||
<EuiText color="ghost">
|
||||
<WelcomeBanner userProfile={userProfile} image={headerImage} showDescription={false} />
|
||||
<WelcomeBanner user={user || undefined} image={headerImage} showDescription={false} />
|
||||
</EuiText>
|
||||
</EuiPageTemplate.Section>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ describe('renderApp', () => {
|
|||
licensing: licensingMock.createStart(),
|
||||
security: securityMock.createStart(),
|
||||
share: sharePluginMock.createStartContract(),
|
||||
userProfile: { user: {} },
|
||||
user: {},
|
||||
},
|
||||
} as any;
|
||||
const pluginData = {
|
||||
|
|
|
@ -66,7 +66,7 @@ export const renderApp = (
|
|||
const { history } = params;
|
||||
const { application, chrome, http, uiSettings } = core;
|
||||
const { capabilities, navigateToUrl } = application;
|
||||
const { charts, cloud, guidedOnboarding, lens, security, share, userProfile } = plugins;
|
||||
const { charts, cloud, guidedOnboarding, lens, security, share, user } = plugins;
|
||||
|
||||
const entCloudHost = getCloudEnterpriseSearchHost(plugins.cloud);
|
||||
externalUrl.enterpriseSearchUrl = publicUrl || entCloudHost || config.host || '';
|
||||
|
@ -108,7 +108,7 @@ export const renderApp = (
|
|||
setDocTitle: chrome.docTitle.change,
|
||||
share,
|
||||
uiSettings,
|
||||
userProfile,
|
||||
user,
|
||||
});
|
||||
const unmountLicensingLogic = mountLicensingLogic({
|
||||
canManageLicense: core.application.capabilities.management?.stack?.license_management,
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public';
|
||||
import { LensPublicStart } from '@kbn/lens-plugin/public';
|
||||
import { GetUserProfileResponse, UserProfileData } from '@kbn/security-plugin/common';
|
||||
import { AuthenticatedUser } from '@kbn/security-plugin/common';
|
||||
import { SecurityPluginStart } from '@kbn/security-plugin/public';
|
||||
import { SharePluginStart } from '@kbn/share-plugin/public';
|
||||
|
||||
|
@ -54,7 +54,7 @@ interface KibanaLogicProps {
|
|||
setDocTitle(title: string): void;
|
||||
share: SharePluginStart;
|
||||
uiSettings: IUiSettingsClient;
|
||||
userProfile: GetUserProfileResponse<UserProfileData>;
|
||||
user: AuthenticatedUser | null;
|
||||
}
|
||||
|
||||
export interface KibanaValues extends Omit<KibanaLogicProps, 'cloud'> {
|
||||
|
@ -95,7 +95,7 @@ export const KibanaLogic = kea<MakeLogicType<KibanaValues>>({
|
|||
setDocTitle: [props.setDocTitle, {}],
|
||||
share: [props.share, {}],
|
||||
uiSettings: [props.uiSettings, {}],
|
||||
userProfile: [props.userProfile, {}],
|
||||
user: [props.user, {}],
|
||||
}),
|
||||
selectors: ({ selectors }) => ({
|
||||
isCloud: [() => [selectors.cloud], (cloud?: Partial<CloudSetup>) => !!cloud?.isCloudEnabled],
|
||||
|
|
|
@ -22,7 +22,7 @@ import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/publi
|
|||
import type { HomePublicPluginSetup } from '@kbn/home-plugin/public';
|
||||
import { LensPublicStart } from '@kbn/lens-plugin/public';
|
||||
import { LicensingPluginStart } from '@kbn/licensing-plugin/public';
|
||||
import { GetUserProfileResponse, UserProfileData } from '@kbn/security-plugin/common';
|
||||
import { AuthenticatedUser } from '@kbn/security-plugin/common';
|
||||
import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public';
|
||||
import { SharePluginStart } from '@kbn/share-plugin/public';
|
||||
|
||||
|
@ -66,7 +66,7 @@ export interface PluginsStart {
|
|||
licensing: LicensingPluginStart;
|
||||
security: SecurityPluginStart;
|
||||
share: SharePluginStart;
|
||||
userProfile: GetUserProfileResponse<UserProfileData>;
|
||||
user: AuthenticatedUser;
|
||||
}
|
||||
|
||||
export class EnterpriseSearchPlugin implements Plugin {
|
||||
|
@ -102,8 +102,8 @@ export class EnterpriseSearchPlugin implements Plugin {
|
|||
cloudSetup && (pluginsStart as PluginsStart).cloud
|
||||
? { ...cloudSetup, ...(pluginsStart as PluginsStart).cloud }
|
||||
: undefined;
|
||||
const userProfile = await (pluginsStart as PluginsStart).security.userProfiles.getCurrent();
|
||||
const plugins = { ...pluginsStart, cloud, userProfile } as PluginsStart;
|
||||
const user = (await (pluginsStart as PluginsStart).security.authc.getCurrentUser()) || null;
|
||||
const plugins = { ...pluginsStart, cloud, user } as PluginsStart;
|
||||
|
||||
coreStart.chrome
|
||||
.getChromeStyle$()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue