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

[Security Solution] Remove deprecated EuiPage usages in EDR Workflows pages #162531

Merged
merged 18 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
0e2874d
[Security Solution] Remove deprecated EuiPage usages in EDR Workflows…
kevinlog Jul 25, 2023
2f74d75
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Jul 25, 2023
cddd297
update
kevinlog Jul 27, 2023
ae62a2c
Merge branch 'task/migrate-deprecated-EuiPage' of github.com:kevinlog…
kevinlog Jul 27, 2023
6fa54b6
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Jul 27, 2023
72462b5
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 27, 2023
bf686c5
Merge branch 'main' into task/migrate-deprecated-EuiPage
kibanamachine Aug 24, 2023
cc19af6
adjustments
kevinlog Aug 24, 2023
aa42c2c
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 24, 2023
d79fdb6
fixes
kevinlog Aug 25, 2023
0874ffa
Merge branch 'task/migrate-deprecated-EuiPage' of github.com:kevinlog…
kevinlog Aug 25, 2023
27493b5
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 25, 2023
27aa20a
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 25, 2023
31309e6
Merge branch 'main' into task/migrate-deprecated-EuiPage
kibanamachine Aug 28, 2023
5aeb882
PR comments
kevinlog Aug 28, 2023
7d26c4d
Merge branch 'task/migrate-deprecated-EuiPage' of github.com:kevinlog…
kevinlog Aug 28, 2023
72cacc0
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 28, 2023
f02efd7
Merge branch 'main' into task/migrate-deprecated-EuiPage
kibanamachine Aug 29, 2023
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
6 changes: 3 additions & 3 deletions x-pack/plugins/security_solution/public/app/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';

import { EuiEmptyPrompt, EuiPageTemplate_Deprecated as EuiPageTemplate } from '@elastic/eui';
import { EuiPageTemplate } from '@elastic/eui';
import { SecuritySolutionPageWrapper } from '../common/components/page_wrapper';

export const NotFoundPage = React.memo(() => (
<SecuritySolutionPageWrapper>
<EuiPageTemplate template="centeredContent">
<EuiEmptyPrompt
<EuiPageTemplate>
<EuiPageTemplate.EmptyPrompt
data-test-subj="notFoundPage"
iconColor="default"
iconType="logoElastic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import React, { memo, useMemo } from 'react';
import type { CommonProps } from '@elastic/eui';
import {
EuiPageHeader,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageContentBody_Deprecated as EuiPageContentBody,
EuiPageSection,
EuiFlexGroup,
EuiFlexItem,
EuiTitle,
Expand Down Expand Up @@ -77,16 +76,9 @@ export const AdministrationListPage: FC<AdministrationListPageProps & CommonProp
<EuiSpacer size="l" />
</>
)}

<EuiPageContent
hasBorder={false}
hasShadow={false}
paddingSize="none"
color="transparent"
borderRadius="none"
>
<EuiPageContentBody restrictWidth={restrictWidth}>{children}</EuiPageContentBody>
</EuiPageContent>
<EuiPageSection paddingSize="none" color="transparent" restrictWidth={restrictWidth}>
{children}
</EuiPageSection>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React, { memo } from 'react';
import { EuiFlexGroup, EuiPageTemplate_Deprecated as EuiPageTemplate } from '@elastic/eui';
import { EuiFlexGroup, EuiPanel, EuiPageTemplate } from '@elastic/eui';
import styled from 'styled-components';

export const StyledEuiFlexGroup = styled(EuiFlexGroup)`
Expand All @@ -22,8 +22,10 @@ export const ManagementEmptyStateWrapper = memo(
'data-test-subj'?: string;
}) => {
return (
<StyledEuiFlexGroup direction="column" alignItems="center" data-test-subj={dataTestSubj}>
<EuiPageTemplate template="centeredContent">{children}</EuiPageTemplate>
<StyledEuiFlexGroup justifyContent="center" direction="column" data-test-subj={dataTestSubj}>
<EuiPageTemplate.Section grow={false} alignment="center">
<EuiPanel color="subdued">{children}</EuiPanel>
</EuiPageTemplate.Section>
</StyledEuiFlexGroup>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
*/

import React, { memo, useCallback } from 'react';
import {
EuiButton,
EuiEmptyPrompt,
EuiPageTemplate_Deprecated as EuiPageTemplate,
EuiLink,
} from '@elastic/eui';
import { EuiButton, EuiLink, EuiPageTemplate } from '@elastic/eui';
import { usePolicyDetailsArtifactsNavigateCallback } from '../../policy_hooks';
import { useGetLinkTo } from './use_policy_artifacts_empty_hooks';
import { useUserPrivileges } from '../../../../../../common/components/user_privileges';
Expand Down Expand Up @@ -54,42 +49,41 @@ export const PolicyArtifactsEmptyUnassigned = memo<CommonProps>(
[navigateCallback]
);
return (
<EuiPageTemplate template="centeredContent">
<EuiEmptyPrompt
iconType="plusInCircle"
data-test-subj="policy-artifacts-empty-unassigned"
title={<h2>{labels.emptyUnassignedTitle}</h2>}
body={
canWriteArtifact
? labels.emptyUnassignedMessage(policyName)
: labels.emptyUnassignedNoPrivilegesMessage(policyName)
}
actions={[
...(canCreateArtifactsByPolicy && canWriteArtifact
? [
<EuiButton
color="primary"
fill
onClick={onClickPrimaryButtonHandler}
data-test-subj="unassigned-assign-artifacts-button"
>
{labels.emptyUnassignedPrimaryActionButtonTitle}
</EuiButton>,
]
: []),
canWriteArtifact ? (
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiLink
onClick={onClickHandler}
href={toRouteUrl}
data-test-subj="unassigned-manage-artifacts-button"
>
{labels.emptyUnassignedSecondaryActionButtonTitle}
</EuiLink>
) : null,
]}
/>
</EuiPageTemplate>
<EuiPageTemplate.EmptyPrompt
iconType="plusInCircle"
data-test-subj="policy-artifacts-empty-unassigned"
color="subdued"
title={<h2>{labels.emptyUnassignedTitle}</h2>}
body={
canWriteArtifact
? labels.emptyUnassignedMessage(policyName)
: labels.emptyUnassignedNoPrivilegesMessage(policyName)
}
actions={[
...(canCreateArtifactsByPolicy && canWriteArtifact
? [
<EuiButton
color="primary"
fill
onClick={onClickPrimaryButtonHandler}
data-test-subj="unassigned-assign-artifacts-button"
>
{labels.emptyUnassignedPrimaryActionButtonTitle}
</EuiButton>,
]
: []),
canWriteArtifact ? (
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiLink
onClick={onClickHandler}
href={toRouteUrl}
data-test-subj="unassigned-manage-artifacts-button"
>
{labels.emptyUnassignedSecondaryActionButtonTitle}
</EuiLink>
) : null,
]}
/>
);
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
*/

import React, { memo } from 'react';
import {
EuiEmptyPrompt,
EuiButton,
EuiPageTemplate_Deprecated as EuiPageTemplate,
} from '@elastic/eui';
import { EuiButton, EuiPageTemplate } from '@elastic/eui';
import { useGetLinkTo } from './use_policy_artifacts_empty_hooks';
import type { POLICY_ARTIFACT_EMPTY_UNEXISTING_LABELS } from './translations';
import type { ArtifactListPageUrlParams } from '../../../../../components/artifact_list_page';
Expand Down Expand Up @@ -43,28 +39,27 @@ export const PolicyArtifactsEmptyUnexisting = memo<CommonProps>(
}
);
return (
<EuiPageTemplate template="centeredContent">
<EuiEmptyPrompt
iconType="plusInCircle"
data-test-subj="policy-artifacts-empty-unexisting"
title={<h2>{labels.emptyUnexistingTitle}</h2>}
body={labels.emptyUnexistingMessage}
actions={
canWriteArtifact ? (
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiButton
color="primary"
fill
onClick={onClickHandler}
href={toRouteUrl}
data-test-subj="unexisting-manage-artifacts-button"
>
{labels.emptyUnexistingPrimaryActionButtonTitle}
</EuiButton>
) : null
}
/>
</EuiPageTemplate>
<EuiPageTemplate.EmptyPrompt
color="subdued"
iconType="plusInCircle"
data-test-subj="policy-artifacts-empty-unexisting"
title={<h2>{labels.emptyUnexistingTitle}</h2>}
body={labels.emptyUnexistingMessage}
actions={
canWriteArtifact ? (
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiButton
color="primary"
fill
onClick={onClickHandler}
href={toRouteUrl}
data-test-subj="unexisting-manage-artifacts-button"
>
{labels.emptyUnexistingPrimaryActionButtonTitle}
</EuiButton>
) : null
}
/>
);
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
EuiSpacer,
EuiLink,
EuiButton,
EuiPageContent_Deprecated as EuiPageContent,
EuiPageSection,
} from '@elastic/eui';
import { useAppUrl } from '../../../../../../common/lib/kibana';
import { APP_UI_ID } from '../../../../../../../common/constants';
Expand Down Expand Up @@ -218,13 +218,7 @@ export const PolicyArtifactsLayout = React.memo<PolicyArtifactsLayoutProps>(
/>
)}
<EuiSpacer size="l" />
<EuiPageContent
hasBorder={false}
hasShadow={false}
paddingSize="none"
color="transparent"
borderRadius="none"
>
<EuiPageSection paddingSize="none" color="transparent">
<PolicyArtifactsList
policy={policyItem}
apiClient={exceptionsListApiClient}
Expand All @@ -235,7 +229,7 @@ export const PolicyArtifactsLayout = React.memo<PolicyArtifactsLayoutProps>(
getPolicyArtifactsPath={getPolicyArtifactsPath}
getArtifactPath={getArtifactPath}
/>
</EuiPageContent>
</EuiPageSection>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
import React, { useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import { useLocation } from 'react-router-dom';
import {
EuiCallOut,
EuiLoadingSpinner,
EuiPageTemplate_Deprecated as EuiPageTemplate,
} from '@elastic/eui';
import { EuiCallOut, EuiLoadingSpinner, EuiPageTemplate } from '@elastic/eui';
import { usePolicyDetailsSelector } from './policy_hooks';
import { policyDetails, agentStatusSummary, apiError } from '../store/policy_details/selectors';
import { AgentsSummary } from './components/agents_summary';
Expand Down Expand Up @@ -78,23 +74,23 @@ export const PolicyDetails = React.memo(() => {
const pageBody: React.ReactNode = useMemo(() => {
if (policyApiError) {
return (
<EuiPageTemplate template="centeredContent">
<EuiPageTemplate.Section grow={false} alignment="center">
<EuiCallOut color="danger" title={policyApiError?.error}>
<span data-test-subj="policyDetailsIdNotFoundMessage">{policyApiError?.message}</span>
</EuiCallOut>
</EuiPageTemplate>
</EuiPageTemplate.Section>
);
}

if (!policyItem) {
return (
<EuiPageTemplate template="centeredContent">
<EuiPageTemplate.Section grow={false} alignment="center">
<EuiLoadingSpinner
className="essentialAnimation"
size="xl"
data-test-subj="policyDetailsLoading"
/>
</EuiPageTemplate>
</EuiPageTemplate.Section>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React, { memo } from 'react';
import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { EuiButton, EuiPageTemplate } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { ManagementEmptyStateWrapper } from '../../../../components/management_empty_state_wrapper';

Expand All @@ -18,7 +18,7 @@ export const EmptyState = memo<{
}>(({ onAdd, isAddDisabled = false, backComponent }) => {
return (
<ManagementEmptyStateWrapper>
<EuiEmptyPrompt
<EuiPageTemplate.EmptyPrompt
ashokaditya marked this conversation as resolved.
Show resolved Hide resolved
data-test-subj="trustedAppEmptyState"
iconType="plusInCircle"
title={
Expand Down
Loading