-
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
[Enterprise Search] Migrate shared components used in Workplace Search Groups #76345
[Enterprise Search] Migrate shared components used in Workplace Search Groups #76345
Conversation
We need a way to format routes using parametrized routes in Workplace Search. We used to the `react-router-named-routes` library, but it is 5 years old has has no typings. I extracted the function we needed into a util.
For the 7.9 Kibana MVP, we used a temporary function to generate this route. Aligning this component to use the helper other parts of the app will use after migration.
Various types and constants migrated for use in groups component
Also adds a mock for contentSources. For now the array only has one item needed for this test, but in future tests, more sources will be added to that array.
This was closed by accident |
Uses Object.entries instead of for…in. This is more modern and allows for 100% test coverage. Also removed `toString()` as `encodeURIComponent()` seems to automatically cast to string
We’re not returning anything so map is not needed
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.
Looks great! I don't have many comments.
...s/enterprise_search/public/applications/workplace_search/components/shared/assets/custom.svg
Outdated
Show resolved
Hide resolved
...ch/public/applications/workplace_search/components/shared/assets/connection_illustration.svg
Outdated
Show resolved
Hide resolved
...ck/plugins/enterprise_search/public/applications/shared/react_router_helpers/format_route.ts
Outdated
Show resolved
Hide resolved
...ns/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.tsx
Outdated
Show resolved
Hide resolved
...rise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx
Show resolved
Hide resolved
Unike formatRoute, generatePath adds the trailing slash automatically
@elasticmachine merge upstream |
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.
💯
💚 Build SucceededBuild metricsasync chunks size
History
To update your PR or re-run it, just comment with: |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…h Groups (elastic#76345) * Add shared images and export file * Migrate SourceIcon component * Add util to format routes We need a way to format routes using parametrized routes in Workplace Search. We used to the `react-router-named-routes` library, but it is 5 years old has has no typings. I extracted the function we needed into a util. * Update recent_activity to use formatRoute For the 7.9 Kibana MVP, we used a temporary function to generate this route. Aligning this component to use the helper other parts of the app will use after migration. * Add types and constants Various types and constants migrated for use in groups component * Migrate SourceRow component Also adds a mock for contentSources. For now the array only has one item needed for this test, but in future tests, more sources will be added to that array. * Migrate SourcesTable component * Migrate TablePaginationBar component * Migrate UserIcon component * Migrate UserRow component * Refactor format_route Uses Object.entries instead of for…in. This is more modern and allows for 100% test coverage. Also removed `toString()` as `encodeURIComponent()` seems to automatically cast to string * Remove unused import * Use forEach instead of map We’re not returning anything so map is not needed * Minify images * Remove formatRoute in favor of generatePath Unike formatRoute, generatePath adds the trailing slash automatically * Stop renaming methods Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…h Groups (#76345) (#76817) * Add shared images and export file * Migrate SourceIcon component * Add util to format routes We need a way to format routes using parametrized routes in Workplace Search. We used to the `react-router-named-routes` library, but it is 5 years old has has no typings. I extracted the function we needed into a util. * Update recent_activity to use formatRoute For the 7.9 Kibana MVP, we used a temporary function to generate this route. Aligning this component to use the helper other parts of the app will use after migration. * Add types and constants Various types and constants migrated for use in groups component * Migrate SourceRow component Also adds a mock for contentSources. For now the array only has one item needed for this test, but in future tests, more sources will be added to that array. * Migrate SourcesTable component * Migrate TablePaginationBar component * Migrate UserIcon component * Migrate UserRow component * Refactor format_route Uses Object.entries instead of for…in. This is more modern and allows for 100% test coverage. Also removed `toString()` as `encodeURIComponent()` seems to automatically cast to string * Remove unused import * Use forEach instead of map We’re not returning anything so map is not needed * Minify images * Remove formatRoute in favor of generatePath Unike formatRoute, generatePath adds the trailing slash automatically * Stop renaming methods Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR migrates the shared components that are needed for the migration of the Workplace Search Groups section of the admin dashboard to Kibana.
The following components are being migrated as a part of this PR:
As a part of this PR, the types and constants used by Workplace Search were ported over.
These components were migrated with no changes to the logic and tests were added.
In addition, the main functionality we were using from react-router-named-routes has been dropped in favor of React Router's generatePath. The reasoning behind this is that the plugin has no TypeScript support and has not been updated in years.
Any styles that are needed for the components will be included in the main Groups migration PR.
Checklist
Delete any items that are not applicable to this PR.
For maintainers