-
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] Enable tags for saved searches #136162
[Discover] Enable tags for saved searches #136162
Conversation
49738da
to
1eb25c4
Compare
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 look great from Discover side ❤️ , don't see a reason why not moving forward here. Only thing I was wondering, if it would make sense to give the tags column less width than the name column, since the name is more significant and high likely longer than the tags ... however ... I might be wrong .. it's also fine the way it's currently handled 👍
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.
Let me start by saying that the team is quite excited to have the tagging feature (finally) be implemented on a new SO type. Thanks a lot for taking a shot at this!
Now, I have multiple remarks:
1. new taggable type registration
There are some missing steps that needs to be done to fully integrate with SOT, as described in x-pack/plugins/saved_objects_tagging/README.md
:
- Add the new SO type to the list of taggable types
export const taggableTypes = ['dashboard', 'visualization', 'map', 'lens']; |
- Update the SOT telemetry collector schema to add the new type
kibana/x-pack/plugins/saved_objects_tagging/server/usage/schema.ts
Lines 20 to 25 in 3730dd0
types: { | |
dashboard: perTypeSchema, | |
lens: perTypeSchema, | |
visualization: perTypeSchema, | |
map: perTypeSchema, | |
}, |
- Add read-access to the
tag
SO type to your feature's capabilities
See
kibana/x-pack/plugins/saved_objects_tagging/README.md
Lines 12 to 14 in 446390d
In order to be able to fetch the tags assigned to an object, the user must have read permission | |
for the `tag` saved object type. Which is why all features relying on SO tagging must update | |
their capabilities. |
Also, having a FTR suite to cover the integration for the new type would be amazing, e.g
kibana/x-pack/test/saved_object_tagging/functional/tests/dashboard_integration.ts
Line 40 in dc78287
describe('dashboard integration', () => { |
2. Integration with the SO finder component
I have no objection adding tagging support to the SO finder component, overall I think it would be a valuable addition.
The thing that bothers me more is the explicit, cyclic dependency it introduces between the savedObjects
and savedObjectTaggingOss
plugin (see comments). Let's discuss it, but overall the only viable option I see to break this dependency is to have the finder component be extracted out of the savedObjects
plugin. That way, this new plugin (and later, package) would be able to depend on both SO
and SOT
to properly break this cyclic dependency.
Please tell me what you think.
src/plugins/discover/public/services/saved_searches/save_saved_searches.ts
Outdated
Show resolved
Hide resolved
src/plugins/saved_objects/public/finder/saved_object_finder.tsx
Outdated
Show resolved
Hide resolved
@sebelga @lukeelmers @clintandrewhall, @davismcphee pinged our #content-management channel on this one. It feels to me that tags are very much aligned with content management and shared UX and it'd be great to have a consistent implementation here. We want to move more towards a standard schema so that any SO can simply plug into all of the amazing new things we're going to build. Is there a chance one of you, or someone on your team, can provide some feedback on the implementation? |
Hey @davismcphee I spoke with @ghudgins about this briefly. As long as tags are implemented the same as other saved objects, I view the addition to the SO flyout as an iterative improvement from the product perspective. It looks like @pgayvallet has added some comments on the implementation. As long as any of his concerns are addressed, I'm +1 on the product side. Thanks for reaching out, there's definitely overlap with content management but this feels additive to me 👍 |
c2de1f3
to
f867704
Compare
09e6d14
to
3024e20
Compare
4026e8a
to
95473af
Compare
…-ref HEAD~1..HEAD --fix'
src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx
Show resolved
Hide resolved
src/plugins/saved_search/public/services/saved_searches/get_saved_searches.ts
Outdated
Show resolved
Hide resolved
src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx
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.
Done the Code review, and added obervations, no blocking stuff in sigh, tested manually locally, works as expected in Discover 👍 Will add a final review round once relevant changes is are addressed, and open questions about Codeownership are clarified!
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. Thanks again for wiring the tagging feature to searches!
A few nits and comments, feel free to ignore any or all of them.
src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx
Outdated
Show resolved
Hide resolved
src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx
Outdated
Show resolved
Hide resolved
src/plugins/saved_objects_finder/public/finder/saved_object_finder.tsx
Outdated
Show resolved
Hide resolved
export { SavedObjectFinder } from './finder'; | ||
|
||
export const plugin = () => new SavedObjectsFinderPublicPlugin(); |
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.
A perfect example of a 'fake' plugin that could be migrated to a package once its dependencies are.
@@ -25,5 +25,6 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) { | |||
loadTestFile(require.resolve('./dashboard_integration')); | |||
loadTestFile(require.resolve('./feature_control')); | |||
loadTestFile(require.resolve('./maps_integration')); | |||
loadTestFile(require.resolve('./discover_integration')); |
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 for this
.../test/saved_object_tagging/api_integration/security_and_spaces/apis/_get_assignable_types.ts
Show resolved
Hide resolved
- Type imports cleanup - Added loading indicator for saved object finder - Changed `savedObjectsPlugin.settings.getListingLimit()` to `uiSettings.get(LISTING_LIMIT_SETTING)` - Removed old saved object finder comment - Removed tag changes from transform plugin - Change code owners of saved_objects_finder to Data Discovery
Thanks for all the feedback! PR has been updated based on the suggestions and should be good to review @kertal. |
…om/davismcphee/kibana into discover-feature-saved-search-tags
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @davismcphee |
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 👍 , great work Davis, had another look, all comments resolved. Tested locally, works as expected! Hurray for tagging in Discover!
* [Discover] Add initial support for tags to saved search modal * [Discover] Add tags to savedSearch types * [Discover] Finish initial support for adding tags to saved searches * [Discover] Start to convert saved object finder to a table in order to support tags * [Discover] Add support for displaying saved search tags in open search flyout * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * [Discover] Continue support for tags in saved object finder * [Discover] Clean up saved object finder * [Discover] Finish initial support for tags in saved object finder * [Discover] Update SimpleSavedObject constructor to SimpleSavedObjectImpl * [Discover] Remove orig files * [Discover] Saved search tag type registration and telemetry * [Discover] Create new saved_objects_finder plugin * [Discover] Continue work creating saved_objects_finder plugin * [Discover] Revert some changes in saved_objects * [Discover] Revert some changes in saved_objects again * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * [Discover] Update saved_objects_finder i18n keys * [Discover] Update docs * [Discover] Add plugins to saved_object_finder and fix broken types * [Discover] Finish creating saved_objects_finder plugin and use it in Discover * [Discover] Update SavedObjectFinderProps type export, and update x-pack telemetry * [Discover] Fix broken jest tests * [Discover] Update saved_objects_finder API * [Discover] Remove unused translations * [Discover] Fix issue with initial saved object finder fetch * [Discover] Fix some of the saved object finder jest tests * [Discover] Clean up finder after merge * [Discover] Fixing saved_object_finder.tsx * [Discover] Add savedObjectsTaggingOss reference to saved_search plugin * [Discover] Fix broken open_search_panel test * [Discover] Removed allowed types from saved object finder * [Discover] Removing type column when there's only one saved object type, and adjusting column widths * [Discover] Fix issue where visible types were entirely removed, fixed pageSizeOptions * [Discover] Add showFilter to open_search_panel's saved_objects_finder, fallback to all available types when no type filter is applied to saved_objects_finder, hide type column and filter button when there is only one type in metadata list * [Discover] Fix remaining saved_object_finder Jest tests * [Discover] Update snapshot * [Discover] Fix failing functional tests * [Discover] Add tagging Jest tests for saved_objects_finder * [Discover] Fix small bugs in saved_object_finder, update Jest tests, add functional tests for Discover saved search tagging * [Discover] Removed unused variable in functional test * [Discover] Update Discover Jest tests with tagging tests * [Discover] Remove translations * [Discover] Updating saved_objects_finder to use static export vs preconfigured component, adding lazy load support * [Discover] Move saved_object_finder service deps to a 'services' prop, fix broken open_search_panel Jest test * [Discover] Fix broken Jest test * [Discover] Fix broken Jest test from merge * [Discover] Fix discover tags integration test description * - Updated tags prop to be `string | undefined` - Type imports cleanup - Added loading indicator for saved object finder - Changed `savedObjectsPlugin.settings.getListingLimit()` to `uiSettings.get(LISTING_LIMIT_SETTING)` - Removed old saved object finder comment - Removed tag changes from transform plugin - Change code owners of saved_objects_finder to Data Discovery * [Discover] Fixed LISTING_LIMIT_SETTING import * [Discover] Revert tags saving change that introduced a bug * [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' * [Discover] Try again to fix LISTING_LIMIT_SETTINGS import * [Discover] Fix failing snapshot Co-authored-by: kibanamachine <[email protected]>
Summary
This PR adds support for tagging saved searches in Discover. Users can add tags to new or existing searches through the save modal, and a new saved object finder component with support for filtering by tags was added to the open search flyout.
A-la-carte deployment: https://davismcphee-pr-136162-discover-feature-saved-search-tags.kbndev.co
Resolves #117832.
Notes
Examples
Save modal:
The new finder is based on the Saved Objects screen in Stack Management, so a screenshot for reference:
With no filters:
With tag filters:
Discover's flyout only supports saved searches, but the new finder supports multiple types of saved objects, and will only show the type column and filter if there are multiple types configured:
Mobile view:
Checklist
For maintainers