-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Data views] Implement persistable state #132959
[Data views] Implement persistable state #132959
Conversation
Pinging @elastic/kibana-app-services (Team:AppServicesSv) |
src/plugins/data_views/common/data_views/persistable_state.test.ts
Outdated
Show resolved
Hide resolved
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.
Need to add to data view service as well.
import { PersistableStateService } from '@kbn/kibana-utils-plugin/common'; | ||
|
||
export const DataViewPersistableStateService: PersistableStateService<DataViewBaseSerializable> = { | ||
inject: (state, references) => { |
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.
As data view spec can contain fields we should call field methods inside each of this.
cc @mattkime @sixstringcode if we don't plan to work on local runtime fields (if local data views can satisfy that requirement for some time) then we don't need to implement persistable state interface for fields.
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.
I believe from my conversation with @mattkime that this is still up in the air, so I'll remove the implementation for fields from this PR.
@@ -34,7 +36,8 @@ export interface IFieldSubTypeNested { | |||
* A base interface for an index pattern field | |||
* @public | |||
*/ | |||
export interface DataViewFieldBase { | |||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions | |||
export type DataViewFieldBase = { |
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.
These changes are necessary for DataViewFieldBase
to meet the SerializableRecord
definition, which is necessary for implementing persistable state. I could also do export interface DataViewFieldBase extends SerializableRecord
but that add unnamed properties to the DataViewFieldBase
spec.
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.
ML changes LGTM
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.
VisEditors type changes LGTM
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.
FF changes lgtm 👍
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.
LGTM
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @lukasolson |
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.
Uptime code owner changes LGTM !!
Friendly reminder: Looks like this PR hasn’t been backported yet. |
2 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
@lukasolson how do I make sure this is working fine? Thanks! |
Summary
Part of #129480.
Implements the
PersistableState
interface for data views. Currently these are a no-op, but this could change in the future.As
PersistableState
interface requiresSerializable
to be implemented, I needed to update some of the types fromDataViewSpec
to properly implementSerializable
. For many types, this was simply a matter of converting from aninterface
to atype
.Checklist
For maintainers