-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] [Sourcerer] Store and type cleanup #116640
[Security Solution] [Sourcerer] Store and type cleanup #116640
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
x-pack/plugins/security_solution/public/common/components/url_state/test_dependencies.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/containers/sourcerer/index.tsx
Outdated
Show resolved
Hide resolved
showResults: indicesExist || defaultDataView.title.includes(`${signalIndexNameSourcerer}`), | ||
}), | ||
const isSignalIndexNeedsInit = useMemo( | ||
() => !indicesExist && !defaultDataView.title.includes(`${signalIndexNameSourcerer}`), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signalIndexNameSourcerer seems could be null, although I guess defaultDataView.title could never includes null
string, it just a bit weird to covert null to string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes its for a type reason, cant check if a string includes null
@@ -74,7 +86,8 @@ export const useInitSourcerer = ( | |||
signalIndexName != null && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please give me an example of how it happen in UI between Line86-90?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I renamed signalIndexNameSelector
to signalIndexNameSourcerer
so maybe that will help.
if the signal index is not loading, the signalIndexName
is defined in useSignalIndex, but the signalIndexNameSourcerer
has not been defined. This can happen the first time signal index is created. We also check to make sure that the Timeline sourcerer isn't already initiated and that default exists. Does that help?
if (
!loadingSignalIndex &&
signalIndexName != null &&
signalIndexNameSourcerer == null &&
(activeTimeline == null || activeTimeline.savedObjectId == null) &&
initialTimelineSourcerer.current &&
defaultDataView.id.length > 0
)
💔 Build FailedFailed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Let's merge this into
elastic:sourcerer_kip_as
to make life easier, double bug fixing is not ideal.Closes https://github.com/elastic/security-team/issues/1730
sourcererScopes
tokibanaDataViews
useSourcererScope
=> now renamed touseSourcererDataView
which combines the redux state of thesourcererScope
and its correspondingkibanaDataView
to get the activeSourcererDataView
IIndexPattern
type toDataViewBase