-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 content management api #153733
Conversation
return response.map<SavedObject<T>>(simpleSavedObjectToSavedObject); | ||
async find(options: SavedObjectsClientCommonFindArgs) { | ||
console.log('******* find', options); | ||
const results = await this.contentManagemntClient.search<DataViewSearchIn, DataViewSearchOut>({ |
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.
@sebelga I must be doing something wrong here.
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.
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.
Thanks!
export type DataViewCreateIn = CreateIn< | ||
typeof DataViewContentType, | ||
DataViewAttributes, | ||
CreateOptions |
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.
You are explicitely declaring that DataViewCreateIn
takes CreateOptions
. You now have to pass it in saved_objects_client_wrapper.ts L91
return (await this.contentManagemntClient.create<DataViewCreateIn, DataViewCreateOut>({ | ||
contentTypeId: 'index-pattern', | ||
data: attributes, | ||
// this is required, shouldn't be. |
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.
See my comment above
…into data_views_content_mgmt
@@ -14,7 +14,6 @@ | |||
"@kbn/object-versioning", | |||
"@kbn/core-saved-objects-api-server-mocks", | |||
"@kbn/core-saved-objects-api-server", | |||
"@kbn/saved-objects-finder-plugin", |
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.
This was necessary to remove a circular dependency.
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
return savedObjects.client; | ||
}; | ||
|
||
export class DataViewsStorage implements ContentStorage { |
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.
@sebelga This would be my starting point for abstracting ContentStorage for use with Saved Objects. Is there anything in particular that I should keep an eye on regarding the Maps implementation? It currently has versioning code so I'd like to make sure I we're on the same page regarding what the end product should look like.
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.
Overall looks good. You would probably need to add all the BWC logic for up/down transform + validate the inputs/outputs.
You would also need to implement the bulkGet
method.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
perPage: query.limit, | ||
page: query.cursor ? +query.cursor : undefined, | ||
defaultSearchOperator: 'AND', | ||
searchFields: options.searchFields || ['title', 'name'], |
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.
You are exposing searching accross any fields on the database from the UI. It is better to limit what fields can be searched on.
In maps I added an onlyTitle
option to avoid that (https://github.com/elastic/kibana/pull/153304/files#diff-3196f0787529ecacf22f90a6081b048f25eb3cf980b548437da12df2879ccdadR287).
@jughosta You're correct, this isn't quite ready for review. |
I guess this can be closed in favor of #155803? |
thx! |
Summary
Data views implementation of content management api.
This PR includes the changes in #154985 which should be merged first.