* Add i18n for AddSourceList
* Add i18n for AvailableSourcesList
* Replace all instances of interal Link
This was missed during the migration. We need to use the components we wrap Eui components with internally.
Also fixes some imports that were unnecessarily going up one level and back down for imports.
* Add i18n for ConfigCompleted
* Add i18n for ConfigDocsLinks
* Add i18n for ConfigurationIntro
* Add i18n for ConfigureCustom
* Add i18n for ConfigureOauth
* Add i18n for ConfiguredSourcesList
* Add i18n for ReAuthenticate
* Add i18n for shared field labels
Also includea shared SourceConfigFields
* Add i18n for SaveConfig
* Add i18n for SaveCustom
* Add i18n for SourceFeatures
* Add i18n for ConnectInstance
* Fix duplicate i18n ID
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Set queued message instead of immediate message
After being redirected from an oauth configuration, a redirect occurs to show the flash message. A queued message is needed here because the message is lost before the redirect happens otherwise
* Don’t pass empty query params
The kibana server didn’t like the empty param so this commit removes it
Before:
/status?
After
/status
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial copy/paste of component tree
Only does linting changes and:
- lodash imports
- Replace unescaped apostrophes with '
- Fix ternary function call to if block:
if (isAdding) {
actions.onSchemaSetFormErrors(errors);
} else {
actions.onSchemaSetError({ flashMessages: { error: errors } });
}
* Remove local flash messages from component
* Update paths
- Adds getReindexJobRoute method to routes
- Repalces legacy Rails routes helper with hard-coded paths
* Add types and constants
* Update paths
* Replace local flash message logic with gobal
* Update with newly added types
Added here: https://github.com/elastic/kibana/pull/84822
* Update server routes
* Replace Rails http with kibana http
* Set percentage to 0 when updating
Without this, the IndexingStatus never shows.
* Fix route paths
* Fix server route validation
The empty object was breaking the UI since `schema.object({})` is actually an empty object. This is more explicit and correct.
* Add i18n
* Make sure i18n key is unique
* Lint
* Fix schema errors button
When migrated, the button was wrapping the link and it should be the other way around. This caused a blue link color.
* Remove redundant true value
* TIL EuiButtonTo
* Move schema types to shared
We use the Schema types in Workplace Search as well, so moving these to shared. Also, we have a component called IndexingStatus so reverting to the prefixed IIndexingStatus interface name
* Fix misspelled interface
* Add IndexingStatusLogic
* Replace IndexingStatusFetcher with logic
* Refactor out unnecessary conditional
onComplete is not optional so these if blocks can be consolidated
* Misc styling - destructuring and typing
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Misc styling - imports
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Remove div
* Refactor test
* Replace method with string for statusPath
In ent-search, we use Rails helpers to generate paths. These were in the form of routes.whateverPath(). We passed these method to the IndexingStatus component to generate the app-specific rotues in the shared component.
In Kibana, we will not have these generators and should instead pass the path strings directly
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Add react-motion package
This is needed to animate the loading progress bar in the Enterprise Search schema views
* Add shared interface
* Migrate IndexingStatusContent component
This is a straight copy/paste with only linting changes and tests added
* Migrate IndexingStatusErrors component
This is a copy/paste with linting changes and tests added. Also changed out the Link component to our EuiLinkTo component for internal routing
* Migrate IndexingStatus component
This is a straight copy/paste with only linting changes and tests added
* Migrate IndexingStatusFetcher component
This is a copy/paste with some modifications. The http/axios code has been removed in favor of the HTTPLogic in Kibana.
This is a WIP that I am merging to master until I can get it working in the UI. Without either Schema component in the UIs for App Search or Workplace Search this is only a POC. Will not backport until this is verified working and have written tests.
* Add i18n
* Revert "Add react-motion package"
This reverts commit 92db929d2a.
* Remove motion dependency
* Update copy
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Refactor per code review
- Remove stui classes
- Inline status
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* SavedObjectsRepository.incrementCounter supports array of fields
* Fix TS errors
* Fix failing test
* Ensure all the remarks make it into our documentation
* SavedObjectsRepository.incrementCounter initialize option
* Move usage collection-specific docs out of repository into usage collection plugins readme
* Update api docs
* Polish generated docs
* Migrate shared Schema components
These components were not changed, with the exception of lint fixes and TypeScript changes (adding types). The only exceptions are:
1. The `formatFieldName` in `SchemaAddFieldModal`. In `ent-search`, this was a shared util, but since it was not used anywhere else, I just added the method as a function in this component.
2. The `IFieldCoercionErrors` interface is only used here so I did not add it to the shared types file and instead jut added it to this component.
* Use EuiLinkTo instead of Link
* Add unit tests
* Better test for `hideName`
Coverage was fine but wasn’t actually testing correctly
* Add i18n
* FIx test that didn’t pass eslint
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial copy/paste of components
Changes for pre-commit hooks were:
- Linting
- Lodash imports
- Fixed warnings for `jsx-a11y/mouse-events-have-key-events` with stubbed onFocus and onBlue events with FIXME comments
* Add server routes
* Remove reference to shared lib
This one-liner appears only once in ent-search so adding it here in the logic file`
* Fix paths
* Add types and fix TypeScript issues
* Replace FlashMessages with global component
* More explicit Result type
* Remove routes/http in favor of HttpLogic
* Fix server routes
`urlFieldIsLinkable` was missing and `detailFields` can either be an object or an array of objects
* Add base styles
These were ported from ent-search. Decided to use spacers where some global styles were missing.
* Kibana prefers underscores in URLs
Was only going to do display-settings and result-details but decided to YOLO all of them
* Fix broken routes
Didn’t have a way to test these when created
* Get context from global state
No need to do this in 2 places now. There was a race condition where the default logic value for `isOrganization` was set to `false` We don’t need a useEffect call here because the value is synchronous and has no side effects. Calling the method directly fixes the race condition.
* Add the ‘path’ to the logic files for easier debugging
* Add SourceSubNav component
* Flip routes to match new convention
It was decided by Product that instead of keying off of `/org` to determine context, that we would now flip it where we key of provate with `/p`.
This means that /sources is now organization where before it was personal
* Convert routers to use children instead of props
This aligns with App Search and allows for easier telemtry and breadcrumbs
* Add breadcrumbs and basic telemetry
* Add in and refactor subnavigation
As a part of this commit, the approach for rendering subnavs was refactored to align with App Search.
There was a bug where some components weren’t rendering properly because the SourceLogic and GroupsLogic files were never unmounting. The reason for this is the subnav components use their respective logic files to get the IDs needed for rendering the subnav links. That is, SourceSubNav would call SourceLogic to get the ID to render the links and would stay rendered for the duration of the user’s time in the app. The result is that users would leave the source details page and navigate to add a new source and the logic file would never reset to a loading state and the UI would break.
The fix was to borrow from the pattern App Search uses and pass the subnavs as props. Because App Search only uses a single engines subnav, they only needed one prop. We use multiple props for each subnav.
Also, the subnav should not be rendered on the root routes (/sources, /p/sources, and /groups) so conditionals were added to only render the subnavs when not on those root routes.
* Add FlashMessages
* Fix some failed tests
Missed this in first commit
* Update SourceIcon to use EuiIcon
Before this change, the legacy styles were not ported over. This gives a uniform size for both wrapped and unwrapped icons. The icons are a bit smaller on the add source page but Eui has lowered it’s largest size ‘xxl’ and we would need to write manual overrides. IMO the change is not significant enough to override.
* Fix broken icons
* Replace legacy div with component
The eui.css file in ent-search is no longer up to date with current EUI and this was broken. The best fix was to use the component that renders as expected
* Add base styles for Sources
More in a future PR but this makes the majority of things look correct.
* Cleanup
Fix some type errors and rename constants
* Couple more failing tests
We have multiple `Layouts` now with the new subnavs
* Fix prepare routes
Like the first commit, missed these when porting over routes with no UI.
* Clean up the desgin of the source connect screen
The columns were way off in Kibana
* Remove ORG_PATH const
No longer needed since ‘/org’ is gone
* Add cloud plugin detection
* Add cloud plugin value to KibanaLogic
* [Setup] DRY out Setup Guide title const
* [Misc] Rename shared SetupGuide to SetupGuideLayout for explicitness
- So we're not renaming it anyway when importing it per-product
- From a previous piece of PR feedback
* [Misc cleanup] Fix non-versioned Workplace Search documentation link
* [Setup] Pull out versioned Cloud/Enterprise Search doc links to shared/
* Add new Cloud setup instructions
* Update SetupGuideLayout to deliver either cloud or self-managed instructions
* Adds a column for engine language to the engines table.
* Handle Meta Engines and Universal language types
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial copy/paste of components
No changes other than linting and the removal of the underscore.toSentenceSerial method in favor of the following:
new Intl.ListFormat().format(groups)
which does the same thing
* Redo groups sentence with more accepted solution
Turns out the previos commit’s solution is not widely accepted:
https://caniuse.com/?search=ListFormat
* Add placeholders for future components
Schema and DisplaySettings are Custom Source components that will be added later. These are stubs so the containers will render.
* Update component paths
* Remove AppView, SidebarNavigation and FlashMessages
Sidebar copy and breadcrumbs will be recreated at the top level in a separate PR
* Use Kibana’s hasPlatinumLicense over minimumPlatinumLicense
Also renames fpAccount to account, as it’s called in Kibana
* Fix typings
* Move sidebar content temporarily to top of page
This is temporary as noted by comments
* Fix missing images
* Fix routes
Had the base route and not the status route in the fetchSourceStatuses method
* Clean up last Sidebar with temp copy placement
This is so that CI will pass and we can get this merged in and do the actual wiring up of everything in a separate PR.
* Remove unused links
For CI to pass. Will add back in future PR
* Minify SVG illustration
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Initial copy/paste of components
Changes for pre-commit hooks were:
- Linting
- Lodash imports
- remove `any` type in favor of React.ReactNode
- Move setState to top of component
* Add image
* Update component paths
* Remove reference to ConfirmModal
Since all the legacy component does it wrap the EUI component we decided to drop it.
Legacy:
https://github.com/elastic/ent-search/blob/master/app/javascript/shared/components/ConfirmModal/ConfirmModal.tsx
* Remove local flash messages in favor of global flash messages
* Various type fixes
* Fix image location
* Initial copy/paste of components
Changes for pre-commit hooks were:
- Linting
- Lodash imports
- changed enum names in add_source because there were collistions with component names. So SaveConfig becomes SaveConfigStep because there is a component by the same name
- replaced apostrophe’s with ‘'’ per lint rule
Finally, the linter didn’t like this expression:
asOauthRedirect ? onOauthFormSubmit() : onCredentialsFormSubmit();
… so I changed it to:
const onSubmit = hasOauthRedirect
? onOauthFormSubmit
: onCredentialsFormSubmit;
onSubmit();
* Add route helper
* Remove AppView, Sidebar navigation and FlashMessages
Sidebar copy and breadcrumbs will be recreated at the top level in a separate PR
* Update component paths
* Use Kibana’s hasPlatinumLicense over minimumPlatinumLicense
* Various TypeScript lint fixes
* Fix index paths
* Remove in-page breadcrumbs and move sidebar copy
In Kibana, breadcrumbs will be at the top-level and not in the view
Also, we have no sidebar with contextual copy. The Figma designs call for this copy to be above the main content. For now I am placing this in the existing ViewContentHeader component.
This will be slightly broken because of the structure of ViewContentHeader but that is expected for now since it cannot be rendered in the browser yet to fix
* Temporarily add parseQueryParams
This is a placeholder until https://github.com/elastic/kibana/pull/83750 lands
* Remove optional from isOrganization
Looks like the value is always passed
* Remove ‘!!’
* [Enterprise Search] Add parseQueryParams helper
This PR migrates part of the ent-search queryParams util, `parseQueryParams` for use in Workplace Search.
`setQueryParams` was no a part of this PR because it is only used one time in App Search and a better alternative might be available for that use-case
* Remove mock
* Actually test functionality of query-string
* Add test for array
* Better test name
* Removing circular dependency between spaces and security
* Apply suggestions from code review
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
* Tests refactor
- Reorganize top level describes into 3 space-based blocks into based on spaces:
- space disabled
- spaces plugin unavailable
- space enabled (most previous tests go under this new block) with new beforeEach
- wrote new tests for uncovered lines 58, 66-69
* Review1: address PR feedback
* changing fake requests for alerts/actions
* Fixing tests
* fixing more tests
* Additional testing and refactoring
* Apply suggestions from code review
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
* Review 2: Address feedback
* Make ESLint happy again
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
* Set up Overview file
* Finish Overview page logic, stub out empty/metric views
* Stub in basic empty engine overview
- Minus document creation button & API code example
* Stub out EngineOverviewMetrics and unavailable empty prompt
* Stub out EngineOverMetrics components (stats, charts, logs)
* [Refactor] Pull out some document creation i18n strings to constants
- They're repeated/reused by the DocumentCreationPopover component
* PR feedback: Drop the regex
* PR feedback: RecentLogs -> RecentApiLogs
* PR feedback: Copy
* PR feedback: Copy, sentence-casing
* I forgot to rebase against my own PR :dead_inside:
* Set up Overview file
* Finish Overview page logic, stub out empty/metric views
* Stub in basic empty engine overview
- Minus document creation button & API code example
* Stub out EngineOverviewMetrics and unavailable empty prompt
* Stub out EngineOverMetrics components (stats, charts, logs)
* [Refactor] Pull out some document creation i18n strings to constants
- They're repeated/reused by the DocumentCreationPopover component
* PR feedback: Drop the regex
* PR feedback: RecentLogs -> RecentApiLogs
* PR feedback: Copy
* PR feedback: Copy, sentence-casing
* Move source icons into subfolder
* Copy over new icons
* Update SourceIcon to account for full bleed images
* Remove unused file
* Fix broken icon path
* Rename EUI React Router components
- Instead of bogarting the EUI component names, use EuiLinkTo instead of EuiLink
Other misc renaming
- eui_link.tsx to eui_components.tsx for clearer file name
- EuiReactRouterHelper to ReactRouterHelper, to make the distinction between EUI and React Router clearer (in theory you could use this helper for non-EUI components)
- other misc type renaming
* Update simple instances of previous EUI RR components to Eui*To
* Clean up complex/renamed instances of Eui*To
(hopefully much more straightforward now)
- unfortunately side_nav requires an eslint disable
* Initial copy/paste of source logic
Only changed lodash imports and import order for linting
* Add types and route
* Update paths and typings
Renamed IMeta -> Meta
Used object instead of IObject
* Remove internal flash messages in favor of globals
- All instances of flashAPIErrors(e) are only placeholders until the later commit removing axios.
- buttonLoading was set to false when the error flash messages were set. For now I added a `setButtonNotLoading` action to do this manually in a finally block. This will be refactored once axios is removed.
- SourcesLogic is no longer needed because we set a queued flash message instead of trying to set it in SourcesLogic, which no longer has local flash messages
* Add return types to callback definitions
* Update routes
According to the API info getSourceReConnectData is supposed to send the source ID and not the service type. In the template, we are actually sending the ID but the logic file parameterizes it as serviceType. This is fixed here.
Usage: https://github.com/elastic/ent-search/blob/master/app/javascript/workplace_search/ContentSources/components/AddSource/ReAuthenticate.tsx#L38
* Replace axios with HttpLogic
Also removes using history in favor of KibanaLogic’s navigateToUrl
* Fix incorrect type
This selector is actually an array of strings
* Create GenericObject to satisfy TypeScript
Previously in `ent-search`, we had a generic `IObject` interface that we could use on keyed objects. It was not migrated over since it uses `any` and Kibana has a generic `object` type we can use in most situations. However, when we are checking for keys in our code, `object` does not work. This commit is an attempt at making a generic interface we can use.
* More strict object typing
Removes GenericObject from last commit and adds stricter local typing
* Add i18n
Also added for already-merged SourcesLogic
* Move button loading action to finally block
* Move route strings to inline
* Copy and paste sources logic
This is simply a copy & paste of the sources_logic file from ent-search. The only changes were adding the comment at the top and changing how lodash imports, per linting requirements
* Add types
The “I” prefix has been removed, per agreed-upon standard
* Add type declaration to staticSourceData
Yay TypeScript 🙄
* Update route path
For all other routes, we use the account/org syntax. For this one, I missed it and forgot to add ‘account’ for the route path. This fixes it
* Update SourcesLogic to work with Kibana
- Remove routes/http in favor of HttpLogic
- Remove local flash messages in favor of global messages
- Update paths to imports
- Remove "I"s from interface names
- Varions type fixes
* Add regex check to determine whether url is org
As a part of the Kibana migration, we are switching the URL structure to put the prefix on the personal dashboard. In ent-search, org routes were prefixed with `/org`. In Kibana the prefix switches to non-org routes and they will be prefixed with`/p`
* Add isOrganization boolean to logic
* Add types and missing routes
Salesforce Sandbox routes had been added since the routes were migrated.
* Migrate source_data
This is a direct port from `ent-search` with no changes other than linting.
* Adds i18n to strings in sourceData
Shared items were extracted to constants. Others were done inline
* Fix typo
* Another typo
* Rename ONE_DIVE
* Rename SERVICE_NOW
* Remove redundant variable
* Rename SHARE_POINT
* Update routes to remove hyphens
* Add basic Loading component
- for pages with shifting layouts or where skeletal loading doesn't make sense
* Move Loading to shared components
* Update WS to use new shared Loading component
* Fix for non-Layout WS Overview page
* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_router.tsx
Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
* Fix CURRENT_MAJOR_VERSION for use in Elastic docs links
- Was previously just sending (e.g.) "7". instead of "7.9"
* Add App Search DOCS_PREFIX constant
- follow WS's example
* Update all App Search doc links to use prefixed URLs
- except for Enterprise Search setup guide, which should be updated to use a shared URL at some point in any case
* [Workplace Search] Consolidate groups routes
This PR consolidates all of the groups route resgistration functions into a single export so that the `registerWorkplaceSearchRoutes` function only has to call the top-level routes
* Remove redundant test
* [Workplace Search] Add routes for Sources