Skip to content

Commit

Permalink
[8.x] Preparation for High Contrast Mode, Security domains (#202609) (#…
Browse files Browse the repository at this point in the history
…203493)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Preparation for High Contrast Mode, Security domains
(#202609)](#202609)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tim
Sullivan","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-09T20:03:23Z","message":"Preparation
for High Contrast Mode, Security domains (#202609)\n\n##
Summary\r\n\r\n**Reviewers: Please test the code paths affected by this
PR. See the\r\n\"Risks\" section below.**\r\n\r\nPart of work for
enabling \"high contrast mode\" in Kibana.
See\r\nhttps://github.com//issues/176219.\r\n\r\n**Background:**\r\nKibana
will soon have a user profile setting to allow users to enable\r\n\"high
contrast mode.\" This setting will activate a flag
with\r\n`<EuiProvider>` that causes EUI components to render with
higher\r\ncontrast visual elements. Consumer plugins and packages need
to be\r\nupdated selected places where `<EuiProvider>` is wrapped, to
pass the\r\n`UserProfileService` service dependency from the CoreStart
contract.\r\n\r\n**NOTE:** **EUI currently does not yet support the
high-contrast mode\r\nflag**, but support for that is expected to come
in around 2 weeks.\r\nThese first PRs are simply preparing the code by
wiring up the\r\n`UserProvideService`.\r\n\r\n### Checklist\r\n\r\nCheck
the PR satisfies following conditions. \r\n\r\nReviewers should verify
this PR satisfies this list as well.\r\n\r\n- [X] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [X] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Risks\r\n\r\nDoes this PR introduce any risks? For example, consider
risks like hard\r\nto test bugs, performance regression, potential of
data loss.\r\n\r\nDescribe the risk, its severity, and mitigation for
each identified\r\nrisk. Invite stakeholders and evaluate how to proceed
before merging.\r\n\r\n- [ ] [medium/high] The implementor of this
change did not manually test\r\nthe affected code paths and relied on
type-checking and functional tests\r\nto drive the changes. Code owners
for this PR need to manually test the\r\naffected code paths.\r\n- [ ]
[medium] The `UserProfileService` dependency comes from the\r\nCoreStart
contract. If acquiring the service causes synchronous code to\r\nbecome
asynchronous, check for race conditions or errors in rendering\r\nReact
components. Code owners for this PR need to manually test
the\r\naffected code
paths.","sha":"598d3defd15442766ce1eec5b717f479ea62b5df","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","v9.0.0","backport:prev-minor","v8.18.0"],"title":"Preparation
for High Contrast Mode, Security
domains","number":202609,"url":"https://github.com/elastic/kibana/pull/202609","mergeCommit":{"message":"Preparation
for High Contrast Mode, Security domains (#202609)\n\n##
Summary\r\n\r\n**Reviewers: Please test the code paths affected by this
PR. See the\r\n\"Risks\" section below.**\r\n\r\nPart of work for
enabling \"high contrast mode\" in Kibana.
See\r\nhttps://github.com//issues/176219.\r\n\r\n**Background:**\r\nKibana
will soon have a user profile setting to allow users to enable\r\n\"high
contrast mode.\" This setting will activate a flag
with\r\n`<EuiProvider>` that causes EUI components to render with
higher\r\ncontrast visual elements. Consumer plugins and packages need
to be\r\nupdated selected places where `<EuiProvider>` is wrapped, to
pass the\r\n`UserProfileService` service dependency from the CoreStart
contract.\r\n\r\n**NOTE:** **EUI currently does not yet support the
high-contrast mode\r\nflag**, but support for that is expected to come
in around 2 weeks.\r\nThese first PRs are simply preparing the code by
wiring up the\r\n`UserProvideService`.\r\n\r\n### Checklist\r\n\r\nCheck
the PR satisfies following conditions. \r\n\r\nReviewers should verify
this PR satisfies this list as well.\r\n\r\n- [X] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [X] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Risks\r\n\r\nDoes this PR introduce any risks? For example, consider
risks like hard\r\nto test bugs, performance regression, potential of
data loss.\r\n\r\nDescribe the risk, its severity, and mitigation for
each identified\r\nrisk. Invite stakeholders and evaluate how to proceed
before merging.\r\n\r\n- [ ] [medium/high] The implementor of this
change did not manually test\r\nthe affected code paths and relied on
type-checking and functional tests\r\nto drive the changes. Code owners
for this PR need to manually test the\r\naffected code paths.\r\n- [ ]
[medium] The `UserProfileService` dependency comes from the\r\nCoreStart
contract. If acquiring the service causes synchronous code to\r\nbecome
asynchronous, check for race conditions or errors in rendering\r\nReact
components. Code owners for this PR need to manually test
the\r\naffected code
paths.","sha":"598d3defd15442766ce1eec5b717f479ea62b5df"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202609","number":202609,"mergeCommit":{"message":"Preparation
for High Contrast Mode, Security domains (#202609)\n\n##
Summary\r\n\r\n**Reviewers: Please test the code paths affected by this
PR. See the\r\n\"Risks\" section below.**\r\n\r\nPart of work for
enabling \"high contrast mode\" in Kibana.
See\r\nhttps://github.com//issues/176219.\r\n\r\n**Background:**\r\nKibana
will soon have a user profile setting to allow users to enable\r\n\"high
contrast mode.\" This setting will activate a flag
with\r\n`<EuiProvider>` that causes EUI components to render with
higher\r\ncontrast visual elements. Consumer plugins and packages need
to be\r\nupdated selected places where `<EuiProvider>` is wrapped, to
pass the\r\n`UserProfileService` service dependency from the CoreStart
contract.\r\n\r\n**NOTE:** **EUI currently does not yet support the
high-contrast mode\r\nflag**, but support for that is expected to come
in around 2 weeks.\r\nThese first PRs are simply preparing the code by
wiring up the\r\n`UserProvideService`.\r\n\r\n### Checklist\r\n\r\nCheck
the PR satisfies following conditions. \r\n\r\nReviewers should verify
this PR satisfies this list as well.\r\n\r\n- [X] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [X] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Risks\r\n\r\nDoes this PR introduce any risks? For example, consider
risks like hard\r\nto test bugs, performance regression, potential of
data loss.\r\n\r\nDescribe the risk, its severity, and mitigation for
each identified\r\nrisk. Invite stakeholders and evaluate how to proceed
before merging.\r\n\r\n- [ ] [medium/high] The implementor of this
change did not manually test\r\nthe affected code paths and relied on
type-checking and functional tests\r\nto drive the changes. Code owners
for this PR need to manually test the\r\naffected code paths.\r\n- [ ]
[medium] The `UserProfileService` dependency comes from the\r\nCoreStart
contract. If acquiring the service causes synchronous code to\r\nbecome
asynchronous, check for race conditions or errors in rendering\r\nReact
components. Code owners for this PR need to manually test
the\r\naffected code
paths.","sha":"598d3defd15442766ce1eec5b717f479ea62b5df"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Tim Sullivan <[email protected]>
  • Loading branch information
kibanamachine and tsullivan authored Dec 9, 2024
1 parent bf2a32b commit 2e343ca
Show file tree
Hide file tree
Showing 24 changed files with 61 additions and 20 deletions.
4 changes: 2 additions & 2 deletions packages/kbn-mock-idp-plugin/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const plugin: PluginInitializer<
]);

ReactDOM.render(
<KibanaThemeProvider theme={coreStart.theme}>
<KibanaThemeProvider {...coreStart}>
<KibanaContextProvider services={coreStart}>
<I18nProvider>
<LoginPage />
Expand All @@ -69,7 +69,7 @@ export const plugin: PluginInitializer<
order: 4000 + 1, // Make sure it comes after the user menu
mount: (element: HTMLElement) => {
ReactDOM.render(
<KibanaThemeProvider theme={coreStart.theme}>
<KibanaThemeProvider {...coreStart}>
<KibanaContextProvider services={coreStart}>
<I18nProvider>
<RoleSwitcher />
Expand Down
4 changes: 3 additions & 1 deletion packages/kbn-mock-idp-plugin/public/reload_page_toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import React from 'react';
import type { I18nStart } from '@kbn/core-i18n-browser';
import type { ToastInput } from '@kbn/core-notifications-browser';
import type { ThemeServiceStart } from '@kbn/core-theme-browser';
import type { UserProfileService } from '@kbn/core-user-profile-browser';
import { toMountPoint } from '@kbn/react-kibana-mount';
import type { AuthenticatedUser } from '@kbn/security-plugin-types-common';

Expand All @@ -26,6 +27,7 @@ export const DATA_TEST_SUBJ_PAGE_RELOAD_BUTTON = 'pageReloadButton';
*/
export const createReloadPageToast = (options: {
user: Pick<AuthenticatedUser, 'roles'>;
userProfile: UserProfileService;
theme: ThemeServiceStart;
i18n: I18nStart;
}): ToastInput => {
Expand All @@ -43,7 +45,7 @@ export const createReloadPageToast = (options: {
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>,
{ i18n: options.i18n, theme: options.theme }
options
),
color: 'success',
toastLifeTimeMs: 0x7fffffff, // Do not auto-hide toast since page is in an unknown state
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-mock-idp-plugin/public/role_switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const RoleSwitcher = () => {
services.notifications.toasts.add(
createReloadPageToast({
user: authenticateUserState.value,
userProfile: services.userProfile,
theme: services.theme,
i18n: services.i18n,
})
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-mock-idp-plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"@kbn/mock-idp-utils",
"@kbn/cloud-plugin",
"@kbn/es",
"@kbn/core-user-profile-browser",
]
}
6 changes: 4 additions & 2 deletions packages/kbn-user-profile-components/src/services.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import React, { useContext } from 'react';
import type { I18nStart } from '@kbn/core-i18n-browser';
import type { NotificationsStart, ToastOptions } from '@kbn/core-notifications-browser';
import type { ThemeServiceStart } from '@kbn/core-theme-browser';
import type { UserProfileService } from '@kbn/core-user-profile-browser';
import type { toMountPoint } from '@kbn/react-kibana-mount';

import type { UserProfileAPIClient } from './types';
Expand Down Expand Up @@ -47,6 +48,7 @@ export interface UserProfilesKibanaDependencies {
core: {
notifications: NotificationsStart;
theme: ThemeServiceStart;
userProfile: UserProfileService;
i18n: I18nStart;
};
security: {
Expand All @@ -70,7 +72,7 @@ export const UserProfilesKibanaProvider: FC<PropsWithChildren<UserProfilesKibana
...services
}) => {
const {
core: { notifications, i18n, theme },
core: { notifications, ...startServices },
security: { userProfiles: userProfileApiClient },
toMountPoint: toMountPointUtility,
} = services;
Expand All @@ -86,7 +88,7 @@ export const UserProfilesKibanaProvider: FC<PropsWithChildren<UserProfilesKibana
notifications.toasts.addSuccess(
{
title,
text: text ? toMountPointUtility(text, { i18n, theme }) : undefined,
text: text ? toMountPointUtility(text, startServices) : undefined,
},
toastOptions
);
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-user-profile-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@kbn/react-kibana-mount",
"@kbn/core-i18n-browser",
"@kbn/test-jest-helpers",
"@kbn/core-user-profile-browser",
],
"exclude": [
"target/**/*",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/security/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ export const plugin: PluginInitializer<
> = (initializerContext: PluginInitializerContext) => new SecurityPlugin(initializerContext);

// services needed for rendering React using shared modules
export type StartServices = Pick<CoreStart, 'analytics' | 'i18n' | 'theme'>;
export type StartServices = Pick<CoreStart, 'analytics' | 'i18n' | 'theme' | 'userProfile'>;
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { coreMock, scopedHistoryMock } from '@kbn/core/public/mocks';
import { analyticsServiceMock } from '@kbn/core-analytics-browser-mocks';
import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks';
import { themeServiceMock } from '@kbn/core-theme-browser-mocks';
import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks';
import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks';
import { KibanaFeature } from '@kbn/features-plugin/public';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
Expand Down Expand Up @@ -196,6 +197,8 @@ function getProps({
const analyticsMock = analyticsServiceMock.createAnalyticsServiceStart();
const i18nMock = i18nServiceMock.createStartContract();
const themeMock = themeServiceMock.createStartContract();
const userProfileMock = userProfileServiceMock.createStart();

return {
action,
roleName: role?.name,
Expand All @@ -214,6 +217,7 @@ function getProps({
history: scopedHistoryMock.create(),
spacesApiUi,
buildFlavor,
userProfile: userProfileMock,
theme: themeMock,
i18n: i18nMock,
analytics: analyticsMock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const waitForRender = async (
describe('<RolesGridPage />', () => {
let apiClientMock: jest.Mocked<PublicMethodsOf<RolesAPIClient>>;
let history: ReturnType<typeof scopedHistoryMock.create>;
const { theme, i18n, analytics, notifications } = coreMock.createStart();
const { userProfile, theme, i18n, analytics, notifications } = coreMock.createStart();

beforeEach(() => {
history = scopedHistoryMock.create();
Expand Down Expand Up @@ -93,6 +93,7 @@ describe('<RolesGridPage />', () => {
buildFlavor={'traditional'}
analytics={analytics}
theme={theme}
userProfile={userProfile}
/>
);
const initialIconCount = wrapper.find(EuiIcon).length;
Expand All @@ -115,6 +116,7 @@ describe('<RolesGridPage />', () => {
buildFlavor={'traditional'}
analytics={analytics}
theme={theme}
userProfile={userProfile}
/>
);
const initialIconCount = wrapper.find(EuiIcon).length;
Expand All @@ -139,6 +141,7 @@ describe('<RolesGridPage />', () => {
buildFlavor={'traditional'}
analytics={analytics}
theme={theme}
userProfile={userProfile}
/>
);
await waitForRender(wrapper, (updatedWrapper) => {
Expand All @@ -157,6 +160,7 @@ describe('<RolesGridPage />', () => {
buildFlavor={'traditional'}
analytics={analytics}
theme={theme}
userProfile={userProfile}
/>
);
const initialIconCount = wrapper.find(EuiIcon).length;
Expand Down Expand Up @@ -201,6 +205,7 @@ describe('<RolesGridPage />', () => {
buildFlavor={'traditional'}
analytics={analytics}
theme={theme}
userProfile={userProfile}
/>
);
const initialIconCount = wrapper.find(EuiIcon).length;
Expand Down Expand Up @@ -332,6 +337,7 @@ describe('<RolesGridPage />', () => {
buildFlavor={'traditional'}
analytics={analytics}
theme={theme}
userProfile={userProfile}
/>
);
const initialIconCount = wrapper.find(EuiIcon).length;
Expand Down Expand Up @@ -441,6 +447,7 @@ describe('<RolesGridPage />', () => {
buildFlavor={'traditional'}
analytics={analytics}
theme={theme}
userProfile={userProfile}
readOnly
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ export const RolesGridPage: FC<Props> = ({
readOnly,
buildFlavor,
cloudOrgUrl,
analytics,
theme,
i18n: i18nStart,
...startServices
}) => {
const [roles, setRoles] = useState<Role[]>([]);
const [visibleRoles, setVisibleRoles] = useState<Role[]>([]);
Expand Down Expand Up @@ -409,9 +407,7 @@ export const RolesGridPage: FC<Props> = ({
notifications={notifications}
rolesAPIClient={rolesAPIClient}
buildFlavor={buildFlavor}
theme={theme}
analytics={analytics}
i18n={i18nStart}
{...startServices}
/>
) : null}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {
I18nStart,
MountPoint,
ThemeServiceStart,
UserProfileService,
} from '@kbn/core/public';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
Expand All @@ -37,6 +38,7 @@ interface Deps {
analytics: Pick<AnalyticsServiceStart, 'reportEvent'>;
i18n: I18nStart;
theme: Pick<ThemeServiceStart, 'theme$'>;
userProfile: UserProfileService;
}

export const insecureClusterAlertText = (deps: Deps, onDismiss: (persist: boolean) => void) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {
NotificationsStart,
ThemeServiceStart,
Toast,
UserProfileService,
} from '@kbn/core/public';

import { insecureClusterAlertText, insecureClusterAlertTitle } from './components';
Expand All @@ -33,6 +34,7 @@ interface StartDeps {
analytics: Pick<AnalyticsServiceStart, 'reportEvent'>;
i18n: I18nStart;
theme: Pick<ThemeServiceStart, 'theme$'>;
userProfile: UserProfileService;
}

const DEFAULT_SECURITY_CHECKUP_STATE = Object.freeze<SecurityCheckupState>({
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/security/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@kbn/core-capabilities-server",
"@kbn/core-elasticsearch-server",
"@kbn/core-http-server-utils",
"@kbn/core-user-profile-browser-mocks",
],
"exclude": [
"target/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
overlayServiceMock,
themeServiceMock,
} from '@kbn/core/public/mocks';
import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';

import { EditSpaceContentTab } from './edit_space_content_tab';
Expand All @@ -37,6 +38,7 @@ const http = httpServiceMock.createStartContract();
const notifications = notificationServiceMock.createStartContract();
const overlays = overlayServiceMock.createStartContract();
const theme = themeServiceMock.createStartContract();
const userProfile = userProfileServiceMock.createStart();
const i18n = i18nServiceMock.createStartContract();
const logger = loggingSystemMock.createLogger();

Expand All @@ -62,6 +64,7 @@ const TestComponent: React.FC<React.PropsWithChildren> = ({ children }) => {
getPrivilegesAPIClient={getPrivilegeAPIClient}
getSecurityLicense={getSecurityLicenseMock}
theme={theme}
userProfile={userProfile}
i18n={i18n}
logger={logger}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
themeServiceMock,
} from '@kbn/core/public/mocks';
import { DEFAULT_APP_CATEGORIES } from '@kbn/core-application-common';
import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks';
import { KibanaFeature } from '@kbn/features-plugin/common';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';

Expand All @@ -43,6 +44,7 @@ const reloadWindow = jest.fn();
const http = httpServiceMock.createStartContract();
const notifications = notificationServiceMock.createStartContract();
const overlays = overlayServiceMock.createStartContract();
const userProfile = userProfileServiceMock.createStart();
const theme = themeServiceMock.createStartContract();
const i18n = i18nServiceMock.createStartContract();
const logger = loggingSystemMock.createLogger();
Expand Down Expand Up @@ -83,6 +85,7 @@ describe('EditSpaceSettings', () => {
getIsRoleManagementEnabled={() => Promise.resolve(() => undefined)}
getPrivilegesAPIClient={getPrivilegeAPIClient}
getSecurityLicense={getSecurityLicenseMock}
userProfile={userProfile}
theme={theme}
i18n={i18n}
logger={logger}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
overlayServiceMock,
themeServiceMock,
} from '@kbn/core/public/mocks';
import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';

import { EditSpaceAssignedRolesTab } from './edit_space_roles_tab';
Expand All @@ -34,6 +35,7 @@ const getPrivilegeAPIClient = getPrivilegeAPIClientMock;
const http = httpServiceMock.createStartContract();
const notifications = notificationServiceMock.createStartContract();
const overlays = overlayServiceMock.createStartContract();
const userProfile = userProfileServiceMock.createStart();
const theme = themeServiceMock.createStartContract();
const i18n = i18nServiceMock.createStartContract();
const logger = loggingSystemMock.createLogger();
Expand Down Expand Up @@ -77,6 +79,7 @@ describe('EditSpaceAssignedRolesTab', () => {
getIsRoleManagementEnabled={getIsRoleManagementEnabled}
getPrivilegesAPIClient={getPrivilegeAPIClient}
getSecurityLicense={getSecurityLicenseMock}
userProfile={userProfile}
theme={theme}
i18n={i18n}
logger={logger}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const EditSpaceAssignedRolesTab: FC<Props> = ({ space, features, isReadOn
const {
getUrlForApp,
overlays,
userProfile,
theme,
i18n: i18nStart,
logger,
Expand Down Expand Up @@ -99,7 +100,7 @@ export const EditSpaceAssignedRolesTab: FC<Props> = ({ space, features, isReadOn
}}
/>
</EditSpaceProvider>,
{ theme, i18n: i18nStart }
{ theme, i18n: i18nStart, userProfile }
),
{
size: 'm',
Expand All @@ -117,6 +118,7 @@ export const EditSpaceAssignedRolesTab: FC<Props> = ({ space, features, isReadOn
features,
invokeClient,
getUrlForApp,
userProfile,
theme,
i18nStart,
notifications.toasts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
themeServiceMock,
} from '@kbn/core/public/mocks';
import type { ApplicationStart } from '@kbn/core-application-browser';
import { userProfileServiceMock } from '@kbn/core-user-profile-browser-mocks';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';

import {
Expand All @@ -33,6 +34,7 @@ import { getSecurityLicenseMock } from '../../security_license.mock';
const http = httpServiceMock.createStartContract();
const notifications = notificationServiceMock.createStartContract();
const overlays = overlayServiceMock.createStartContract();
const userProfile = userProfileServiceMock.createStart();
const theme = themeServiceMock.createStartContract();
const i18n = i18nServiceMock.createStartContract();
const logger = loggingSystemMock.createLogger();
Expand All @@ -55,6 +57,7 @@ const SUTProvider = ({
logger,
i18n,
http,
userProfile,
theme,
overlays,
notifications,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ import {
import type { SpacesManager } from '../../../spaces_manager';

export interface EditSpaceProviderRootProps
extends Pick<CoreStart, 'theme' | 'i18n' | 'overlays' | 'http' | 'notifications'> {
extends Pick<
CoreStart,
'userProfile' | 'theme' | 'i18n' | 'overlays' | 'http' | 'notifications'
> {
logger: Logger;
capabilities: ApplicationStart['capabilities'];
getUrlForApp: ApplicationStart['getUrlForApp'];
Expand Down
Loading

0 comments on commit 2e343ca

Please sign in to comment.