mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
[Security Solution][Bug] Alert Table raises error when switchting to event rendered view (#151994)
## Summary This PR handles: 1. #151992 [Security Solution] Alert Table raises error when switching to event rendered view. - Issue was related `cellActions` package where changes in columns was not leading to re-calculation of cell actions on those new columns. 3. Minor table width issue - Sometime table is not expanded to the 100% of the container width. ## Before https://user-images.githubusercontent.com/7485038/220914906-dcce7ba1-0318-44fd-a097-df86344f7727.mov ## After ( Resolved Issue 1 & 2) https://user-images.githubusercontent.com/7485038/220921916-fa4b36ad-b8e1-4a8d-ad0d-a778c911bb5b.mov
This commit is contained in:
parent
ee3e5eb66c
commit
1af75fd500
3 changed files with 25 additions and 2 deletions
|
@ -176,5 +176,28 @@ describe('loadActions hooks', () => {
|
||||||
|
|
||||||
expect(result.current.value).toEqual([[actionEnabled], [actionEnabled]]);
|
expect(result.current.value).toEqual([[actionEnabled], [actionEnabled]]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should re-render when contexts is changed', async () => {
|
||||||
|
const { result, rerender, waitForNextUpdate } = renderHook(useBulkLoadActions, {
|
||||||
|
initialProps: [actionContext],
|
||||||
|
});
|
||||||
|
|
||||||
|
await waitForNextUpdate();
|
||||||
|
expect(mockGetActions).toHaveBeenCalledWith(actionContext);
|
||||||
|
|
||||||
|
rerender([actionContext2]);
|
||||||
|
await waitForNextUpdate();
|
||||||
|
expect(mockGetActions).toHaveBeenCalledWith(actionContext2);
|
||||||
|
|
||||||
|
mockGetActions.mockClear();
|
||||||
|
|
||||||
|
rerender([]);
|
||||||
|
await waitForNextUpdate();
|
||||||
|
expect(mockGetActions).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
|
expect(result.current.value).toBeInstanceOf(Array);
|
||||||
|
expect(result.current.value).toHaveLength(0);
|
||||||
|
expect(result.current.loading).toBe(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -66,7 +66,7 @@ export const useBulkLoadActions = (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
[]
|
[contexts]
|
||||||
);
|
);
|
||||||
useThrowError(error);
|
useThrowError(error);
|
||||||
return actionsState;
|
return actionsState;
|
||||||
|
|
|
@ -282,8 +282,8 @@ export const AlertsTableComponent: FC<DetectionEngineAlertTableProps> = ({
|
||||||
id: tableId,
|
id: tableId,
|
||||||
title: i18n.SESSIONS_TITLE,
|
title: i18n.SESSIONS_TITLE,
|
||||||
defaultColumns: finalColumns.map((c) => ({
|
defaultColumns: finalColumns.map((c) => ({
|
||||||
...c,
|
|
||||||
initialWidth: DEFAULT_COLUMN_MIN_WIDTH,
|
initialWidth: DEFAULT_COLUMN_MIN_WIDTH,
|
||||||
|
...c,
|
||||||
})),
|
})),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue