-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enterprise Search] Migrate shared components used in Workplace Searc…
…h Groups (#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 <[email protected]>
- Loading branch information
1 parent
535eb40
commit 6f94bf7
Showing
49 changed files
with
901 additions
and
3 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.../enterprise_search/public/applications/workplace_search/__mocks__/content_sources.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const contentSources = [ | ||
{ | ||
id: '123', | ||
serviceType: 'custom', | ||
searchable: true, | ||
supportedByLicense: true, | ||
status: 'foo', | ||
statusMessage: 'bar', | ||
name: 'source', | ||
documentCount: '123', | ||
isFederatedSource: false, | ||
errorReason: 0, | ||
allowsReauth: true, | ||
boost: 1, | ||
}, | ||
{ | ||
id: '123', | ||
serviceType: 'jira', | ||
searchable: true, | ||
supportedByLicense: true, | ||
status: 'synced', | ||
statusMessage: 'all green', | ||
name: 'Jira', | ||
documentCount: '34234', | ||
isFederatedSource: false, | ||
errorReason: 0, | ||
allowsReauth: true, | ||
boost: 0.5, | ||
}, | ||
]; |
17 changes: 17 additions & 0 deletions
17
...ck/plugins/enterprise_search/public/applications/workplace_search/__mocks__/users.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const users = [ | ||
{ | ||
id: '1z1z', | ||
name: 'John Does', | ||
pictureUrl: 'http://google.cats', | ||
color: '#ededed', | ||
initials: 'JD', | ||
email: '[email protected]', | ||
groupIds: [], | ||
}, | ||
]; |
1 change: 1 addition & 0 deletions
1
...se_search/public/applications/workplace_search/components/shared/assets/box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...ch/public/applications/workplace_search/components/shared/assets/confluence.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...lications/workplace_search/components/shared/assets/connection_illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...earch/public/applications/workplace_search/components/shared/assets/crawler.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...search/public/applications/workplace_search/components/shared/assets/custom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
..._search/public/applications/workplace_search/components/shared/assets/drive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...earch/public/applications/workplace_search/components/shared/assets/dropbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...search/public/applications/workplace_search/components/shared/assets/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
..._search/public/applications/workplace_search/components/shared/assets/gmail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...search/public/applications/workplace_search/components/shared/assets/google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
.../public/applications/workplace_search/components/shared/assets/google_drive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions
53
.../enterprise_search/public/applications/workplace_search/components/shared/assets/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import box from './box.svg'; | ||
import confluence from './confluence.svg'; | ||
import crawler from './crawler.svg'; | ||
import custom from './custom.svg'; | ||
import drive from './drive.svg'; | ||
import dropbox from './dropbox.svg'; | ||
import github from './github.svg'; | ||
import gmail from './gmail.svg'; | ||
import google from './google.svg'; | ||
import googleDrive from './google_drive.svg'; | ||
import jira from './jira.svg'; | ||
import jiraServer from './jira_server.svg'; | ||
import loadingSmall from './loading_small.svg'; | ||
import office365 from './office365.svg'; | ||
import oneDrive from './one_drive.svg'; | ||
import outlook from './outlook.svg'; | ||
import people from './people.svg'; | ||
import salesforce from './salesforce.svg'; | ||
import serviceNow from './service_now.svg'; | ||
import sharePoint from './share_point.svg'; | ||
import slack from './slack.svg'; | ||
import zendesk from './zendesk.svg'; | ||
|
||
export const images = { | ||
box, | ||
confluence, | ||
crawler, | ||
custom, | ||
drive, | ||
dropbox, | ||
github, | ||
gmail, | ||
googleDrive, | ||
google, | ||
jira, | ||
jiraServer, | ||
loadingSmall, | ||
office365, | ||
oneDrive, | ||
outlook, | ||
people, | ||
salesforce, | ||
serviceNow, | ||
sharePoint, | ||
slack, | ||
zendesk, | ||
} as { [key: string]: string }; |
1 change: 1 addition & 0 deletions
1
...e_search/public/applications/workplace_search/components/shared/assets/jira.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...h/public/applications/workplace_search/components/shared/assets/jira_server.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...public/applications/workplace_search/components/shared/assets/loading_small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...rch/public/applications/workplace_search/components/shared/assets/office365.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.