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

Detector details page wrappers fix #387

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
EuiContextMenuPanel,
EuiFlexGroup,
EuiFlexItem,
EuiPanel,
EuiPopover,
EuiSpacer,
EuiTab,
Expand Down Expand Up @@ -328,7 +327,7 @@ export class DetectorDetails extends React.Component<DetectorDetailsProps, Detec
const { selectedTabContent } = this.state;

return (
<EuiPanel>
<>
<EuiFlexGroup>
<EuiFlexItem>
<EuiFlexGroup alignItems="center">
Expand Down Expand Up @@ -360,7 +359,7 @@ export class DetectorDetails extends React.Component<DetectorDetailsProps, Detec
<EuiTabs>{this.renderTabs()}</EuiTabs>
<EuiSpacer size="xl" />
{selectedTabContent}
</EuiPanel>
</>
);
}
}
26 changes: 12 additions & 14 deletions public/pages/Rules/components/RulesTable/RulesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
getRulesTableSearchConfig,
RuleTableItem,
} from '../../utils/helpers';
import { CriteriaWithPagination, EuiInMemoryTable, EuiPanel } from '@elastic/eui';
import { CriteriaWithPagination, EuiInMemoryTable } from '@elastic/eui';

export interface RulesTableProps {
ruleItems: RuleTableItem[];
Expand All @@ -21,18 +21,16 @@ export const RulesTable: React.FC<RulesTableProps> = ({ ruleItems, loading, show
const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 25 });

return (
<EuiPanel>
<EuiInMemoryTable
loading={loading}
items={ruleItems}
columns={getRulesTableColumns(showRuleDetails)}
search={getRulesTableSearchConfig()}
pagination={{ ...pagination, pageSizeOptions: [10, 25, 50] }}
onTableChange={(nextValues: CriteriaWithPagination<any>) =>
setPagination({ pageIndex: nextValues.page.index, pageSize: nextValues.page.size })
}
sorting={true}
/>
</EuiPanel>
<EuiInMemoryTable
loading={loading}
items={ruleItems}
columns={getRulesTableColumns(showRuleDetails)}
search={getRulesTableSearchConfig()}
pagination={{ ...pagination, pageSizeOptions: [10, 25, 50] }}
onTableChange={(nextValues: CriteriaWithPagination<any>) =>
setPagination({ pageIndex: nextValues.page.index, pageSize: nextValues.page.size })
}
sorting={true}
/>
);
};
6 changes: 4 additions & 2 deletions public/pages/Rules/containers/Rules/Rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';
import { ServicesContext } from '../../../../services';
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { RouteComponentProps } from 'react-router-dom';
Expand Down Expand Up @@ -119,7 +119,9 @@ export const Rules: React.FC<RulesProps> = (props) => {
<EuiSpacer size={'m'} />
</EuiFlexItem>
<EuiFlexItem>
<RulesTable loading={loading} ruleItems={ruleItems} showRuleDetails={setFlyoutData} />
<EuiPanel>
amsiglan marked this conversation as resolved.
Show resolved Hide resolved
<RulesTable loading={loading} ruleItems={ruleItems} showRuleDetails={setFlyoutData} />
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
</>
Expand Down