Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeOberti committed Dec 17, 2024
1 parent 1119875 commit 2d2b681
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const SessionView: FC = () => {
[openPreviewPanel, eventDetailsIndex, scopeId, telemetry]
);

const openDetails = useCallback(
const openDetailsInPreview = useCallback(
(selectedProcess: Process | null) => {
// We cannot pass the original Process object sent from the SessionView component
// as it contains functions (that should not put into Redux)
Expand Down Expand Up @@ -143,7 +143,8 @@ export const SessionView: FC = () => {
...sessionViewConfig,
isFullScreen: true,
loadAlertDetails: openAlertDetailsPreview,
openDetails: (selectedProcess: Process | null) => openDetails(selectedProcess),
openDetailsInExpandableFlyout: (selectedProcess: Process | null) =>
openDetailsInPreview(selectedProcess),
canReadPolicyManagement,
resetJumpToEntityId: jumpToEntityId,
resetJumpToCursor: jumpToCursor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const expandableFlyoutDocumentsPanels: ExpandableFlyoutProps['registeredPanels']
key: DocumentDetailsSessionViewPanelKey,
component: (props) => (
<SessionViewPanelProvider {...(props as SessionViewPanelProps).params}>
<SessionViewPanel path={props.path as IsolateHostPanelProps['path']} />
<SessionViewPanel path={props.path as SessionViewPanelProps['path']} />
</SessionViewPanelProvider>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,12 @@ export function ProcessTreeNode({
<Nbsp />
<span css={styles.jumpToTop}>
<EuiToolTip title={COLLAPSE_ALL}>
<EuiToolTip title={COLLAPSE_ALL}>
<EuiButtonIcon
size="xs"
iconType="fold"
onClick={handleCollapseProcessTree}
aria-label={COLLAPSE_ALL}
/>
</EuiToolTip>
<EuiButtonIcon
size="xs"
iconType="fold"
onClick={handleCollapseProcessTree}
aria-label={COLLAPSE_ALL}
/>
</EuiToolTip>
</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const SessionView = ({
loadAlertDetails,
canReadPolicyManagement,
trackEvent,
openDetails,
openDetailsInExpandableFlyout,
resetJumpToEntityId,
resetJumpToCursor,
}: SessionViewDeps & { trackEvent: (name: SessionViewTelemetryKey) => void }) => {
Expand Down Expand Up @@ -123,11 +123,11 @@ export const SessionView = ({

// used when SessionView is displayed in the expandable flyout
// This refreshes the detailed panel rendered in the flyout preview panel
if (openDetails) {
openDetails(process);
if (openDetailsInExpandableFlyout) {
openDetailsInExpandableFlyout(process);
}
},
[openDetails]
[openDetailsInExpandableFlyout]
);

const onJumpToEvent = useCallback(
Expand Down Expand Up @@ -287,10 +287,10 @@ export const SessionView = ({
}, [isDetailOpen, trackEvent]);

const toggleDetailPanelInFlyout = useCallback(() => {
if (openDetails) {
openDetails(selectedProcess);
if (openDetailsInExpandableFlyout) {
openDetailsInExpandableFlyout(selectedProcess);
}
}, [openDetails, selectedProcess]);
}, [openDetailsInExpandableFlyout, selectedProcess]);

const onShowAlertDetails = useCallback(
(alertUuid: string) => {
Expand Down Expand Up @@ -501,7 +501,7 @@ export const SessionView = ({
</EuiFlexItem>

<EuiFlexItem grow={false}>
{openDetails ? (
{openDetailsInExpandableFlyout ? (
<EuiButtonIcon onClick={toggleDetailPanelInFlyout} iconType="expand" />
) : (
<EuiButton
Expand All @@ -517,7 +517,7 @@ export const SessionView = ({
</EuiFlexGroup>
</EuiPanel>
<EuiHorizontalRule margin="none" />
{openDetails ? (
{openDetailsInExpandableFlyout ? (
<>
{errorEmptyPrompt}
{processTree}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface SessionViewDeps {
* Allows to open the detailed panel outside of the SessionView component. This is necessary when the session view is rendered in the
* expandable flyout, where the tree and the detailed panel are separated and need to communicate with each other.
*/
openDetails?: (selectedProcess: Process | null) => void;
openDetailsInExpandableFlyout?: (selectedProcess: Process | null) => void;
/**
* Allows to reset the view from an external component. This is necessary when the session view is rendered in the
* expandable flyout, where the tree and the detailed panels are separated and need to communicate with each other.
Expand Down

0 comments on commit 2d2b681

Please sign in to comment.