Skip to content

Commit

Permalink
Detector details page wrappers fix (opensearch-project#387)
Browse files Browse the repository at this point in the history
* [FEATURE] Detector must have at least one alert set opensearch-project#288

Signed-off-by: Jovan Cvetkovic <[email protected]>

* [BUG] The detector details shouldn't have a wrapper around the whole page opensearch-project#384

Signed-off-by: Jovan Cvetkovic <[email protected]>

---------

Signed-off-by: Jovan Cvetkovic <[email protected]>
  • Loading branch information
jovancvetkovic3006 authored Jan 31, 2023
1 parent a137a80 commit 67e02f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
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>
<RulesTable loading={loading} ruleItems={ruleItems} showRuleDetails={setFlyoutData} />
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
</>
Expand Down

0 comments on commit 67e02f2

Please sign in to comment.