* Add server route and logic listener
* [Misc] Remove 'Set' from 'deleteCurationSet'
- to match createCuration
- IMO, this language isn't necessary if we're splitting up Curations and CurationLogic - the context is fairly evident within a smaller and more modular logic file
* Add CurationQueries component
+ accompanying CurationQueriesLogic & CurationQuery row
* Add CurationCreation view
* Create table pagination helpers
* Update Curations table to use new pagination helpers
* Update Credentials table to use new helpers
+ update to use DEFAULT_META and pass page[size] customization
+ update useEffect to manually call fetchCredentials on current page change
+ update table to pass empty prompt within table (rather than instead of), and add a loading indicator
- update deleteApiKey to re-fetch credentials from API rather than modify the in-memory array (which more correctly handles pagination)
* Update Engines table to use new helpers
Server:
+ update server route to take page[current] (consistent w/ other routes) and page[size]
- remove custom param translation (passing as-is)
- remove ENGINES_PAGE_SIZE constant, basically stored within DEFAULT_META now and page size is passed from client-side
- remove misc header cruft from engines table
EnginesLogic:
- Update http calls to send page[current] & page[size] (same as other files)
- Change individual *Total/*Page vars to store the meta obj coming back from the API (same as other logic files)
- Change on*Load actions to simply pass the API response (update typing to clarify)
- Add new individual enginesLoading/metaEnginesLoading vars so that tables can show individual loading indicators between pagination
- Change dataLoading to a selector (should only show on initial page load, and should use table loading indicators after)
EnginesTable:
- Update props to more closely match EuiBasicTable (items, onChange, add loading) so users can do a simple pass-through
- Reorganize tests so that language block doesn't need its own custom wrapper vars
- Remove empty data test (no longer really testing anything meaningful) and add loading test
EnginesOverview:
- Update to use new helpers, values, props, etc.
- Add new test for onPaginate handlers
* Add new reusable FormattedDateTime helper
* Update Analytics RecentQueriesTable to use helper
* Update CurationsTable to use new helper
- requires adding a utility fn to convert the server-sent string to a Date-parseable string
* Update EnginesTable to use FormattedDateTime
- mostly to standardize/DRY out the FormattedDate display style
- adds a new hasTime flag since the EnginesTable does not display time
* [PR feedback] hasTime -> hideTime
* Initial copy/paste of components
* Add types
* Add constants
* Replace EUI toSentenceCase with lodash startCase
EUI has not updated their types to include this util and no one else in Kibana uses it so falling back to the lodash equivalent
* Update paths
* Fix test
* Fix TypeScript issues
* Remove ability check for non-federated users
* Use Kibana React Router helpers
Also cleaned up shared type import
* Update comments
* Fix failing test
Also added new lines to match other places in Kibana
* Add i18n
* Add tests for smaller components
- AddRoleMappingButton
- DeleteMappingCallout
- RoleSelector
* Fix fallbacks
When trying to achieve coverage it was impossible to create a state that these fallbacks were ever triggered. It’s my assumption that these were added in ent-search to get around TypeScript errors. Added typings instead.
* Add tests for AttributeSelector
* Add mocks and testSubj attrs
* Add tests for RoleMappingsTable
* Fix types
When actually implementing these I found that these types were wrong
* Refactor for better typing
* Remove return type
This was causing a TypeScript error and is not needed
* Rename interface
* Rename more interfaces
* PR feedback
* Add test for radio checked state
* Add false radio assertion to
* Update className
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add unit tests for PrivateSourcesLayout
* Add unit tests for PrivateSources
* Extract groups sentence into separate utility function
* Add test for toSentenceSerial
* Move 'and' constant to WS-level constants file
* Use strings to find components in tests
* Revert "Use strings to find components in tests"
This reverts commit 50caf46b3a.
* Use imports to find components in tests
* Return only the first array element in toSentenceSerial
Convering the entire array with one element to string also works,
but it's less clear.
* Set up Curations routes
* Update EngineRouter/Nav with Curations
* Set up Curations find_or_create API
* [bug] Fix view action not working correctly for "" query
* Add Edit query action
- to call find_or_create curation API & navigate to curation page
+ fix copy string, only just noticed this :doh:
* Add/update unit tests for action column
- Refactor out into a single shared test helper file that both AnalyticsTable and RecentQueriesTable simply calls & runs (instead of copying and pasting the same tests twice into 2 diff files)
- note: test file can't be `.test.tsx` or Jest tries to automatically run it, which we don't want
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Remove "Add a private content source" sidebar link
* Update groupsSentence to cover different number of groups
Different cases:
1 group: You have access to the following sources through the group Default.
2 groups: You have access to the following sources through the groups Default and Engineering. (no comma before 'and')
3+ groups: You have access to the following sources through the groups Default, Marketing, and Engineering. (comma before 'and')
* Create PrivateSourcesLayout as a copy of Layout
In this commit PrivateSourcesLayout is a full copy of Layout.
It's going to be updated in later commits.
* Remove unused code from PrivateSourcesLayout
* Update read-only mode warning copy for end-users
* Move copy to constants file
* Add width styles to new sidebar
Also moved private_sources_layout styles to sources.scss file. Having separate files for that little amount of custom styles is unnecessary.
* Move top-level header to sidebar
* Add missing padding to sidebar
* Replace ViewContentHeader with ContentSection props
* Move variables over the components
* Remove unused classnames
* DRY out privateSourcesTable and privateSourcesEmptyState
by extracting privateSourcesSection that contains common markup.
* DRY out sharedSourcesTable and sharedSourcesEmptyState
by extracting sharedSourcesSection that contains common markup.
* Reorder code blocks inside the file
To match the order the components appear in UI
* Add newline to the groups enumeration sentence
So it looks good with any number of groups
* Update x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/private_sources_layout.tsx
Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Create a copy of the existing overview as mvp
No files were changed here; only a copy
* Update index to point to MVP copy
* Wrap server calls in try/catch
Jest was complaining about this and it’s a good practice to have anyway
* Remove MVP temp EuiPage wrapper
* Add route and link in navigation
* Remove Launch Workplace Search button
This not needed in a post-MVP world. We have had discussions about giving the users the ability to relaunch the legacy app in the beta (pre-8.0) world, but that will be in a callout or some other element.
* Refactor onboarding card to use internal routing
I simplified this by not trying to recreate shared props and typecast them, but just create 2 variable components that fall back to an unclickable button that is disabled in the UI
* Refactor onboarding steps to use internal routing
* Refactor statistic card to use internal routing
* Refactor recent activity to use internal routing
* New CreateEngine view component
* Add CreateEngine to index router
* Add Layout-level components for CreateEngine
* Static create engine view
* Add new POST route for engines API endpoint
* Logic for Create Engine view WIP tests failing
* Fix enterpriseSearchRequestHandler path
* Use setQueuedSuccessMessage after engine has been created
* Use exact path for CREATE_ENGINES_PATH (but EngineRouter logic is still firing??)
* Add TODO note
* Put CreateEngine inside the common App Search Layout
* Fix CreateEngineLogic jest tests
* Move create engine view to /create_engine from /engines/new
* Add Create an Engine button to Engines Overview
* Missing FlashMessages on EngineOverview
* Fix test for CreateEngine route
* Fix strong'd text in santized name note
* Use local constant for Supported Languages
* Disable submit button when name is empty
* Bad conflict fix
* Lint nits
* Improve CreateEngineLogic tests
* Improve EngineOverview tests
* Disable EnginesOverview header responsiveness
* Moving CreateEngine route
* create_engine/CreateEngine -> engine_creation/EngineCreation
* Use static values for tests
* Fixing constants, better casing, better ID names, i18ning dropdown labels
* Removing unused imports
* Fix EngineCreation tests
* Fix Engines EmptyState tests
* Fix EnginesOverview tests
* Lint fixes
* Reset mocks after tests
* Update MockRouter properties
* Revert newline change
* Lint fix
In SchemaErrors, we have an edge case where a user navigates to a non-existent error message state. When migrating I took a stab at passing the custom message to the `flashAPIErrors` helper. It turns out that since we don’t have to parse an error object, we can just set the error message directly
* Add import rules
- newlines between each group
- mocks in test files before everything else
- React before all other externals
* Run --fix on public/applications/workplace_search
* Manually fix errors still present in WS public files
- these appear to be mostly due to jest.mock() or const mixed in with imports, which confuses the autofixer
* Run --fix on public/applications/app_search
+ some manual fixes/tweaks along the way
* Run --fix on public/applications/shared
- some opinionated changes, particularly around IFlashMessages and grouping together types coming from Kibana (src->../../src)
* Run --fix on public/applications/enterprise_search
- mostly straightforward
* Run --fix on public/applications/__mocks__
* Fix remaining top-level public files
- Some opinionated changes (src/core -> ../../src/core) to keep types/mocks together
* Run --fix on server/ files
- same opinionated src->../src changes to keep deps grouped together
- opinionated require->import fetch change in enterprise_esarch_config_api.test.ts
- opinionated [] inclusion of builtins & external imports together (mostly for enterprise_search_request_handler.ts)
* first pass
* migrate more plugins
* migrate yet more plugins
* more oss plugins
* fix test file
* change Plugin signature on the client-side too
* fix test types
* migrate OSS client-side plugins
* migrate OSS client-side test plugins
* migrate xpack client-side plugins
* revert fix attempt on fleet plugin
* fix presentation start signature
* fix yet another signature
* add warnings for server-side async plugins in dev mode
* remove unused import
* fix isPromise
* Add client-side deprecations
* update migration examples
* update generated doc
* fix xpack unit tests
* nit
* (will be reverted) explicitly await for license to be ready in the auth hook
* Revert "(will be reverted) explicitly await for license to be ready in the auth hook"
This reverts commit fdf73feb
* restore await on on promise contracts
* Revert "(will be reverted) explicitly await for license to be ready in the auth hook"
This reverts commit fdf73feb
* Revert "restore await on on promise contracts"
This reverts commit c5f2fe51
* add delay before starting tests in FTR
* update deprecation ts doc
* add explicit contract for monitoring setup
* migrate monitoring plugin to sync
* change plugin timeout to 10sec
* use delay instead of silence
* Add eslint rule for linting unnecessary backticks
This needs to be below the Prettier overrides at the bottom of the file to override Prettier
* Run --fix
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Setup] Split rule that explicitly allows `any` in test/mock files into its own section
- so that the rules we're about to add apply correctly to all files
* Add react/jsx-boolean-value rule
* Run --fix
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Remove comment
Verified that this works as expected
* Replaces usage from SourceLogic to AddSourceLogic
* Remove unused duplicate code
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Update MockRouter to not pass/set a this.payload
- but instead intelligently validate payloads based on the request keys
* Fix relevance tuning API routes to not need a separate mock router for validating query & body
* Update all remaining tests to no longer pass a payload param to MockRouter
* Add routes
Also adds validation for the Kibana way of handling query params
* Add route for oauth params
* Add logic to save oauth redirect query params
* Refactor source added template to keep all logic in logic file
* Add tests for component and logic
* Add optional param to interface
Atlassian flows may also send back an oauth_verifier param that we’ll need. This was added to the server validation, but I forgot to add it to the interface
* Remove failing test
This was not needed for coverage and it appears that the helper doesn’t validate query params so removing it
* Remove index_permissions from account params
* Rename variable
* Update param syntax
* Update account route test
* Refactor params
* Add encodePathParam helper + update components that need it
- Primarily document URLs & analytics queries (which uses generateEnginePath)
* Add useDecodedParams helper + update components that need it
- Documents titles & Analytics queries
* [Misc] Change popout icon to eye
- Feedback from Davey - the pages don't open in a new window, so shouldn't use the popout icon
- Not strictly related but since we're touching these links anyway, I'm shoving it in (sorry)
* Remove document detail decode test
- now handled/tested by useDecodedParams helper
* Add new generateEncodedPath helper
- Should be used in place of generatePath
* Update all instances of generatePath to generateEncodedPath
for consistency across the App Search codebase
* Fix failing tests due to extra encodeURI() done by generatePath
* Add missing branch test for analytics query titles
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add server routes for Workplace Search Security page
* Initial copy/paste of component tree
Also update lodash imports and fix default exports
* Update paths
* Remove conditional and passed in flash messages
This is no longer needed with the Kibana syntax. Flash messages are set globally and only render when present.
* Replace removed ConfirmModal
In Kibana, we use the Eui components directly
* Remove legacy AppView and sidenav
* Clear flash messages globally
* Update server routes
* Replace Rails http with kibana http
* Add setSourceRestriction action to app_logic
It is used in security_logic
* Add missing typings
* Add route and update nav
* Use internal tools for determining license
* Remove Prompt as it doesn't work in Kibana
There is an error that recommends using AppMountParameters.onAppLeave
instead, but it doesn't cover the case where a user navigates
within the app. We'll revisit this problem later.
* Add i18n
Also refactor PrivateSourcesTable to use static i18n strings.
Before we were using 'remote' and 'standard' as both enums and parts of copy, i.e. "Enable {sourceType} private sources".
But with i18n we can no longer do this. So I made a refactoring to separate these concerns. Now 'remote' and 'standard' are only used as enums. What i18n string to show is defined based on isRemote variable.
* Add components unit tests
* Add logic unit tests
* Remove redundant imports
* Use nextTick instead of awaiting for promises
* Update logic tests to use new mockHelpers
* Add new AnalyticsSection component
* Update views that use AnalyticsSection
* [Setup] Update types + final API logic data
- export query types so that new table components can use them
- reorganize type keys by their (upcoming) table column order, remove unused tags from document obj
* [Setup] Migrate InlineTagsList component
- used for tags columns in all tables
* Create basic AnalyticsTable component
- there's a lot of logic separated out into constants.tsx right now, I promise it will make more sense when the one-off tables get added
* Update all views that use AnalyticsTable
+ add 'view all' button links to overview tables
* Add RecentQueriesTable component
- Why is the API for this specific table so different? who knows, but it do be that way
* Update views with RecentQueryTable
* Add QueryClicksTable component to QueryDetails view
* Create AnalyticsSearch bar for queries subpages
* [Polish] Add some space to the bottom of analytics pages
* [Design feedback] Tweak header + search form layout
- Have analytics filter form be on its own row separate from page title
- Change AnalyticsSearch to stretch to full width + add placeholder text + match header gutter + remain one line on mobile
* [PR feedback] Type clarification
* [PR feedback] Clear mocks
* [PR suggestion] File rename
constants.tsx -> shared_columns.tsx
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Enterprise Search] Migrate Kibana plugin to TS project references
Part of #80508
* Add charts and un-comment added ‘features’
Also alphabetize.
* Uncomment recently added security and spaces
* Add last remaining reference
* Add shared typings to cover svgs
* Include package.json for version.ts
* REvery adding package.json to include
This did not fix the issue
* Add correct references
* Create DocLinksService
* Set docLinks on app start
* Update routes modules to use service
* Update component and test to use service
* Remove legacy files
* Add comment
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Add new line
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Refactor test
* Rename class and remove extra route segments
* Update test names
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
* Refactor Cancel button constant to shared
* Add i18n for DisplaySettings section
* Moves more shared constants to correct files
Also fixes duplicate text in ConnectInstance (was left alongside translated text below it)
* Add source overview i18n
* More refactoring of shared constants
* Add i18n to remaining shared sources components
* Fix failing test
* Fix duplicate i18n id
* Remove unused translations
* Add index route for personal dashboard
* Fix links to personal source flow
In ent-search, the base route was /sources so the getSourcesPath helper was not needed. In Kibana, we use the ‘/p’ route to differentiate personal from org so the helper is needed and we pass false as the isOrganization flag
* Remove legacy sidebar text
When I first migrated this, I left the sidebar copy in so that it was not aboandoned before the design pass. After talking with John we decided to just use the copy to the right of the sidebar so this drops that legacy copy.
* Remove constants
* Remove legacy sidebar link
* Revert "Remove legacy sidebar text"
This reverts commit 8c8a3fb63c.
* Revert "Remove constants"
This reverts commit a88723ec90.
* Revert "Remove legacy sidebar link"
This reverts commit 5d08a12a7d.
* Update TODO
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Move shared data to mock
* Change name of mock
Everywhere else we don’t use the “mock” prefix for mocked data so I’m changing here to match.
Also added missing “size” prop from mock.
* Remove unused actions
These were missed on the migration to the new add_source_logic file. All of that logic lives there now
* Add tests for source logic
* REmove resetFlashMessages
This is no longer used as Kibana resets its own. This was removed from the component already.
* Export items for use in tests
* Remove unnecessary condition
It’s literally not possible for this function to receive an empty contentSources parameter. Not sure why this was added. Even if the server sends response with no privateContentSources, the reducer falls back to an empty array.
* Add tests for sources logic
* Fix typo
* Create reusable AnalyticsCards component
* Update EngineOverview to use new AnalyticsCards component
* Update Analytics overview with AnalyticsCards + data
* Update QueryDetail with AnalyticsCards + data
* Update Analytics overview with AnalyticsChart + data
- turns out we do need startDate after all for charts, so I added it back to types
* Update QueryDetail with AnalyticsChart + data
* [Polish] Dash click and no result lines to match standalone UI
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Add getListeners to Kea test helpers
* Update TelemetryLogic to use new getListeners helper
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Remove history params
We already replace the history.push functionality with KibanaLogic.values.navigateToUrl but the history object was still being passed around.
* Add org sources container tests
* Add tests for source router
* Clean up leftover history imports
* Add tests for SourcesRouter
* Quick refactor for cleaner existence check
Optional chaining FTW
* Refactor to simplify setInterval logic
This commit does a refactor to move the logic for polling for status to the logic file. In doing this I realized that we were intializing sources in the SourcesView, when we are actually already initializing sources in the components that use this, which are OrganizationSources and PrivateSources, the top-level containers.
Because of this, I was able to remove the useEffect entireley, as the flash messages are cleared between page transitions in Kibana and the initialization of the sources ahppens in the containers.
* Add tests for SourcesView
* Fix type issue
* [Feedback] Move generateEnginePath to its own standalone helper
- instead of living inside EngineLogic.values
- I forgot Kea lets us do this now!
* Update all components using generateEngineRouter to import helper directly
* Add a generatePath engineName helper to EngineLogic
* Create mockEngineValues reusable mock
* Update routes + EngineNav & EngineRouter to include ENGINE_PATH in all urls
- routes: remove get*Route fns in here as all routes should prefer to use generatePath from EngineLogic moving forward
- EngineRouter - add missing canViewEngineDocuments checks
- Engine tests - import base mock values + update tests to point directly at files to work around the auto mock
* Update AnalyticsRouter to use new routes+generatePath
* Update DocumentDetailLogic to use new generatePath
+ Misc cleanup:
- organize imports by shared > AS specific > docs specific
- move delete-specific const's to directly before they're used, since they're only used in one place
- deconstruct KibanaLogic.values
* Update all components using getEngineRoute to use new generatePath
+ misc import order cleanup - prefer shared > specific groupings
* [PR feedback] Change components that override the engineName param to just use default generatePath
* [PR feedback] Rename instances of EngineLogic's generatePath to generateEnginePath