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] Fixing console errors #163119

Merged
merged 20 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const SelectSystemPromptComponent: React.FC<Props> = ({
dropdownDisplay: (
<EuiFlexGroup gutterSize="none" key={ADD_NEW_SYSTEM_PROMPT}>
<EuiFlexItem grow={true}>
<EuiButtonEmpty iconType="plus" size="xs" data-test-subj="addSystemPrompt">
<EuiButtonEmpty href="#" iconType="plus" size="xs" data-test-subj="addSystemPrompt">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes:
d2

{i18n.ADD_NEW_SYSTEM_PROMPT}
</EuiButtonEmpty>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const ConnectorSelector: React.FC<Props> = React.memo(
dropdownDisplay: (
<EuiFlexGroup gutterSize="none" key={ADD_NEW_CONNECTOR}>
<EuiFlexItem grow={true}>
<EuiButtonEmpty iconType="plus" size="xs">
<EuiButtonEmpty href="#" iconType="plus" size="xs">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes:
a1

{i18n.ADD_NEW_CONNECTOR}
</EuiButtonEmpty>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import {
EuiCard,
EuiFlexGroup,
EuiFlexItem,
EuiImage,
EuiText,
EuiTitle,
useEuiTheme,
} from '@elastic/eui';
import { EuiCard, EuiFlexGroup, EuiFlexItem, EuiImage, EuiTitle, useEuiTheme } from '@elastic/eui';
import React from 'react';
import { css } from '@emotion/react';
import { withLink } from '../links';
Expand Down Expand Up @@ -96,11 +88,8 @@ export const LandingLinksImageCards: React.FC<LandingLinksImagesProps> = React.m
{isBeta && <BetaBadge text={betaOptions?.text} />}
</div>
}
description={
<EuiText size="s" color="text" css={styles.description}>
{description}
</EuiText>
}
titleElement="span"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes:
c1

description={<span css={styles.description}>{description}</span>}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes:
c2

/>
</EuiFlexItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ export const useTimelineEventsHandler = ({
totalCount: response.totalCount,
updatedAt: Date.now(),
};
setUpdated(newTimelineResponse.updatedAt);
setTotalCount(newTimelineResponse.totalCount);
if (onNextHandler) onNextHandler(newTimelineResponse);
return newTimelineResponse;
});
Expand Down Expand Up @@ -294,19 +292,7 @@ export const useTimelineEventsHandler = ({
asyncSearch();
refetch.current = asyncSearch;
},
[
skip,
data,
setTotalCount,
entityType,
dataViewId,
setUpdated,
addWarning,
startTracking,
dispatch,
id,
prevFilterStatus,
]
[skip, data, entityType, dataViewId, addWarning, startTracking, dispatch, id, prevFilterStatus]
);

useEffect(() => {
Expand Down Expand Up @@ -392,6 +378,13 @@ export const useTimelineEventsHandler = ({
filterStatus,
]);

useEffect(() => {
if (timelineResponse.totalCount > -1) {
setUpdated(timelineResponse.updatedAt);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes:
d1

setTotalCount(timelineResponse.totalCount);
}
}, [setTotalCount, setUpdated, timelineResponse]);

const timelineEventsSearchHandler = useCallback(
(onNextHandler?: OnNextResponseHandler) => {
if (!deepEqual(prevTimelineRequest.current, timelineRequest)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ export const useFieldBrowserOptions: UseFieldBrowserOptions = ({
scopeIdSelector(state, sourcererScope)
);
useEffect(() => {
let ignore = false;
const fetchAndSetDataView = async (dataViewId: string) => {
const aDatView = await dataViews.get(dataViewId);
if (ignore) return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes:
c3

setDataView(aDatView);
};
if (selectedDataViewId != null && !missingPatterns.length) {
fetchAndSetDataView(selectedDataViewId);
}

return () => {
ignore = true;
};
}, [selectedDataViewId, missingPatterns, dataViews]);

const openFieldEditor = useCallback<OpenFieldEditor>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ export const useTimelineEventsHandler = ({
loadPage: wrappedLoadPage,
updatedAt: 0,
});

useEffect(() => {
if (timelineResponse.updatedAt !== 0) {
setUpdated(timelineResponse.updatedAt);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes:
e1a
e1b

}
}, [setUpdated, timelineResponse.updatedAt]);

const { addWarning } = useAppToasts();

const timelineSearch = useCallback(
Expand Down Expand Up @@ -252,7 +259,6 @@ export const useTimelineEventsHandler = ({
totalCount: response.totalCount,
updatedAt: Date.now(),
};
setUpdated(newTimelineResponse.updatedAt);
if (id === TimelineId.active) {
activeTimeline.setExpandedDetail({});
activeTimeline.setPageName(pageName);
Expand Down Expand Up @@ -336,7 +342,6 @@ export const useTimelineEventsHandler = ({
startTracking,
data.search,
dataViewId,
setUpdated,
addWarning,
refetchGrid,
wrappedLoadPage,
Expand Down