-
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
[Discover] Rename internalState to sharedState #157830
Conversation
…-ref HEAD~1..HEAD --fix'
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
useSelector: useDiscoverSharedStateSelector, | ||
} = createStateContainerReactHelpers<ReduxLikeStateContainer<DiscoverSharedState>>(); | ||
|
||
export function getSharedStateContainer() { |
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.
Github seems to think this is a new file, but just the file and functions and types were renamed
@@ -24,7 +24,7 @@ describe('buildStateSubscribe', () => { | |||
appState: stateContainer.appState, | |||
savedSearchState: stateContainer.savedSearchState, | |||
dataState: stateContainer.dataState, | |||
internalState: stateContainer.internalState, | |||
internalState: stateContainer.sharedState, |
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.
internalState: stateContainer.sharedState, | |
sharedState: stateContainer.sharedState, |
Shouldn't it be updated too?
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.
definitely, well apply and align those suggestions 👍 thx
@@ -36,7 +36,7 @@ export const buildStateSubscribe = | |||
}: { | |||
appState: DiscoverAppStateContainer; | |||
dataState: DiscoverDataStateContainer; | |||
internalState: DiscoverInternalStateContainer; | |||
internalState: DiscoverSharedStateContainer; |
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.
And here
@@ -26,7 +26,7 @@ export async function changeDataView( | |||
appState, | |||
}: { | |||
services: DiscoverServices; | |||
internalState: DiscoverInternalStateContainer; | |||
internalState: DiscoverSharedStateContainer; |
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.
And here
@@ -235,7 +225,7 @@ export function getDiscoverStateContainer({ | |||
/** | |||
* Internal State Container, state that's not persisted and not part of the URL | |||
*/ | |||
const internalStateContainer = getInternalStateContainer(); | |||
const internalStateContainer = getSharedStateContainer(); |
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.
Can we rename to sharedStateContainer
for consistency?
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.
definitely!
@@ -324,18 +314,6 @@ export function getDiscoverStateContainer({ | |||
fetchData(); | |||
}; | |||
|
|||
const persistAdHocDataView = async (adHocDataView: DataView) => { |
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.
Where did we move this logic to?
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.
It's no longer necessary because of #154947
We needed to persist a temporary data view before sharing or creating CSVs , now it's possible without
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.
Makes sense. Thanks for explaining!
@@ -26,7 +26,7 @@ import { DiscoverServices } from '../../../build_services'; | |||
interface LoadSavedSearchDeps { | |||
appStateContainer: DiscoverAppStateContainer; | |||
dataStateContainer: DiscoverDataStateContainer; | |||
internalStateContainer: DiscoverInternalStateContainer; | |||
internalStateContainer: DiscoverSharedStateContainer; |
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.
And here
@@ -180,7 +180,7 @@ export const loadAndResolveDataView = async ( | |||
{ | |||
internalStateContainer, | |||
services, | |||
}: { internalStateContainer: DiscoverInternalStateContainer; services: DiscoverServices } | |||
}: { internalStateContainer: DiscoverSharedStateContainer; services: DiscoverServices } |
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.
And here
Splitted out #158225 |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @kertal |
Closing since we discussed in the team, and considered this renaming as to be redundant |
Summary
It's renaming DiscoverInternalStateContainer (and dependencies) to DiscoverSharedStateContainer (it was mentioned by @mattkime that it's misleading, because internalState might indicate it's sort of private ... shared state is better naming IMO)
Checklist