Skip to content

Commit

Permalink
Fix styles for "You do not have permission" screen (#129715)
Browse files Browse the repository at this point in the history
* Fix styles for "You do not have permission" screen

* .

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
thomheymann and kibanamachine authored Apr 11, 2022
1 parent b822275 commit b5dae38
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import querystring from 'querystring';
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { renderToString } from 'react-dom/server';
import type { Observable, Subscription } from 'rxjs';

import type {
Expand Down Expand Up @@ -178,7 +178,7 @@ export class AuthorizationService {
http.registerOnPreResponse((request, preResponse, toolkit) => {
if (preResponse.statusCode === 403 && canRedirectRequest(request)) {
const next = `${http.basePath.get(request)}${request.url.pathname}${request.url.search}`;
const body = renderToStaticMarkup(
const body = renderToString(
<ResetSessionPage
buildNumber={buildNumber}
basePath={http.basePath}
Expand Down
33 changes: 16 additions & 17 deletions x-pack/plugins/security/server/prompt_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
* 2.0.
*/

// @ts-expect-error no definitions in component folder
import { EuiEmptyPrompt } from '@elastic/eui/lib/components/empty_prompt';
import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent, EuiProvider } from '@elastic/eui';
// @ts-expect-error no definitions in component folder
import { icon as EuiIconAlert } from '@elastic/eui/lib/components/icon/assets/alert';
// @ts-expect-error no definitions in component folder
import { appendIconComponentCache } from '@elastic/eui/lib/components/icon/icon';
// @ts-expect-error no definitions in component folder
import { EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui/lib/components/page';
import type { ReactNode } from 'react';
import React from 'react';

Expand Down Expand Up @@ -77,19 +74,21 @@ export function PromptPage({
</head>
<body>
<I18nProvider>
<EuiPage paddingSize="none" style={{ minHeight: '100vh' }} data-test-subj="promptPage">
<EuiPageBody>
<EuiPageContent verticalPosition="center" horizontalPosition="center">
<EuiEmptyPrompt
iconType="alert"
iconColor="danger"
title={<h2>{title}</h2>}
body={body}
actions={actions}
/>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
<EuiProvider colorMode="light">
<EuiPage paddingSize="none" style={{ minHeight: '100vh' }} data-test-subj="promptPage">
<EuiPageBody>
<EuiPageContent verticalPosition="center" horizontalPosition="center">
<EuiEmptyPrompt
iconType="alert"
iconColor="danger"
title={<h2>{title}</h2>}
body={body}
actions={actions}
/>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
</EuiProvider>
</I18nProvider>
</body>
</html>
Expand Down

0 comments on commit b5dae38

Please sign in to comment.