Commit graph

524 commits

Author SHA1 Message Date
Constance d655c05ef0
[Enterprise Search] Add beta notification (#103535)
* Set up new BetaNotification component

* Update shared page template to append new beta notification item to side nav

NOTE: I'm mutating the array because:
- returning a new instance leads to a lot of really annoying type errors
- the side nav's we're getting are entirely static with predictable items & and always come from us anyway
- this is eventually going to get removed, and I'm optimizing for easy-to-remove code

* Add beta notification to error connecting state

- to help users/SDH cases where users cannot connect at all

* Fix type error

- sideNav itself can be undefined but not `sideNav.items`
2021-06-28 17:12:55 -04:00
Byron Hulcher 043a2e2fe8
[App Search] New Precision Slider for Relevance Tuning (#103015)
* Precision is now a required param for search settings

* Made RelevanceTuningLogic aware of precision param

* New PrecisionSlider component

* Add PrecisionSlider to RelevanceTuning

* Fix types in test

* Fix imports for PrecisionSlider

* Slight panel and text adjustments.

* Comment out docs link

* Add commented out test for docs

* Can we just all agree not to talk about this commit

* Restore docs link

* Fix docs link again

* Clean-up step description logic

* Test for documentation link

* Moving the spacer to align titles.

* Missing test for updatePrecision

* Fix CSS for step description

* Remove containing EuiPanel

* Improve screen reader experience

Co-authored-by: Davey Holler <daveyholler@hey.com>
2021-06-28 14:50:32 -04:00
Jonathan Budzenski 3f0197e323 Revert "[Enterprise Search] Add beta notification (#103429)"
This reverts commit 60d1ef9f92.
2021-06-28 13:35:10 -05:00
Constance d1c3183ca7
Update jest.sh file to strip leading './' dir (#103507) 2021-06-28 14:21:54 -04:00
Constance 60d1ef9f92
[Enterprise Search] Add beta notification (#103429)
* Set up new BetaNotification component

* Update shared page template to append new beta notification item to side nav

NOTE: I'm mutating the array because:
- returning a new instance leads to a lot of really annoying type errors
- the side nav's we're getting are entirely static with predictable items & and always come from us anyway
- this is eventually going to get removed, and I'm optimizing for easy-to-remove code

* Add beta notification to error connecting state

- to help users/SDH cases where users cannot connect at all
2021-06-28 10:55:53 -07:00
Constance 84e1b01ceb
Result settings: Fix restore defaults copy (#103413)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 08:39:27 -07:00
Constance 45dfaac75f
[Enterprise Search] Test coverage pass (#103406)
* Do not collect code coverage on test_helpers

Note:  some test helpers are no longer being used but might be some day - e.g., shallowWithIntl will be used on the beta badge

* Fix uncovered type line

- since we're not iterating over productNames, no need for it to be an array - it can be written more clearly in string union format

* Fix branch coverage on index.tsx

- Since KibanaLogic is setting `|| {}` fallbacks in any case, I've opted to remove them in this file and let fallbacks be handled there

- Fixed typing to make it clear plugins can be undefined (i.e., disabled/optional, etc) in props + reorganize w/ comments

- KibanaValues requires an Omit to override props types

* Crawler DomainsTable test coverage/improvements

- Fix test failing locally due to timezones by increasing the timezone offset

- Cover missing branch line by adding a domain with no `lastCrawl`

- Remove unnecessary extra beforeEach with dupe re-shallow/mounts

- move getTable helper to its most relevant block (it's not being used in the generic column content checks, only in the actions column suite)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-27 21:45:39 -07:00
Constance d339479e09
[App Search] Success toast polish pass (#103410)
* Fix toasts rerendering/resetting between page navigations + z-index issues

- note: I opted to delete the `<Callouts>` component in favor of just reverting it to the old `<FlashMessages>`, now that FlashMessages is no longer responsible for toasts

* Update engine creation success messages
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Update engine deletion success message
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Update source engines add/delete success messages
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Update crawler domain delete message
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Update API key create/update/delete sucess messages
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Update curations delete success message
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Update results settings success message
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Update relevance tuning success/reset messages
- to use a toast (+ toast message) instead of a callout
- update copy to match EUI guidelines

* Update document deletion success message
- to use a toast instead of a callout (+ split additional text)
- update copy to match EUI guidelines

* Update role mappings create/update/delete success messages
- to use a toast instead of a callout
- update copy to match EUI guidelines

* Run i18n_check --fix

- per localization team guidelines - strings that have been changed should get deleted/scheduled to be re-translated

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 00:28:21 -04:00
Constance 084336a2d8
Role mappings: remove deprecated reset copy (#103411)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 00:28:02 -04:00
Scotty Bollinger 3838bfd34a
[Enterprise Search] Add notices for deactivated users and SMTP callout (#103285)
* Port #3904 to Kibana

https://github.com/elastic/ent-search/pull/3904

* DRY out logic interfaces

Should have done this long ago

* Port #3920 to Kibana

https://github.com/elastic/ent-search/pull/3920

* Lint fixes

* Remove error state from form

We already did this for the users flyout. Basically changes the dirty state of the form from an error state to just showing “Required”. i18n had not been translated yet for `ATTRIBUTE_VALUE_ERROR`

* Add loading states

* Remove manual disabling of button

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Remove manual disabling of other button

* Lint fixes

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-06-24 19:53:03 -04:00
Constance 803d0fa57b
[Enterprise Search] Final KibanaPageTemplate cleanup (#103355)
* [AS] Delete AppSearchNav and EngineNav

* [WS] Delete WorkplaceSearchNav

* [Shared] Delete custom Layout & SideNav components
2021-06-24 19:02:48 -04:00
Constance 60086a9aac
Fix Engine Overview not properly stretching to full page height (#103337)
- Caused by the wrapping <div> around the child views - removing that div and moving the `data-test-subj` hooks to the individual views fixes the issue
2021-06-24 16:30:02 -04:00
Scotty Bollinger 0857e620c7
[Workplace Search] Remove isFederatedAuth checks to expose user features (#103278)
* Remove isFederated from main app and routes

* Expose all overview cards that were hidden for federated auth

* Expose all user features that were hidden for groups

* Remove remaining isFederatedAuth references

* Lint fixes

* Add modified test back for Workplace Search

* Remove extraCell

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Remove brackets

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Update test name

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-06-24 15:59:10 -04:00
Constance fb3e8f4498
[Enterprise Search] Product 404 polish pass (#103198)
* Refactor NotFound component

- shared NotFound becomes NotFoundPrompt - returns only an EuiEmptyPrompt, and individual products/plugins are in charge of their own layout, rather than NotFound doing a bunch of arduous switch handling (also closer to how errorConnecting is a component set per-plugin)

- This is both due to the recent page template refactor and the fact that WS has extra complex logic of needing to switch between its kibana layout and personal dashboard layout

- logos are still hosted in shared/ since they need extra custom CSS to work correctly sizing wise and in dark mode. I renamed its folder from `assets`->`logos` for extra clarity

* [AS] Update current AS routers using NotFound

+ update EngineRouter to use NotFound

* [WS] Update app router

- Handle errorConnecting at the topmost level, instead of in WorkplaceSearchConfigured (to simplify various logic/expectations & match App Search)

- Simplify isOrganization check to use `useRouteMatch` instead of a regex

- Use new NotFound component
- Add NotFound component for the personal dashboard router

* [WS] Improve Source 404 UX

- Add NotFound to SourceRouter + add breadcrumbs for organization views

- When an actual source ID 404s, fix blanket redirect to a dashboard aware redirect - personal dashboard 404s should send the user back to personal sources, not organization sources
+ add a flash message error (similar to how App Search behaves for engine 404s)
+ harden error status checks (gracefully allow for non-http errors to fall back flashAPIErrors

* [WS] Improve Settings 404 UX

- This was the only remaining WS route I found that either did not have a 404 or a fallback to some overview page, so I tweaked the redirect order for a graceful redirect (vs a blank page)

* Fix settings router test

* Move away from custom product logos to OOTB Enterprise Search logo

Keeping it simple, etc. RIP in peace fancy logos

* [PR feedback] toContain over stringContaining
2021-06-24 15:43:26 -04:00
Kuldeep M 67d4c3184e
[Workplace Search] source connection panel content vertical alignment (#103225)
* fix 1786 source connection panel vertical alignment

* Update x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configured_sources_list.tsx

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-06-24 15:10:22 -04:00
Anton Dosov be1c5bbd72
Don't import react-intl directly to reduce bundle sizes (#102497) 2021-06-24 16:52:55 +02:00
Scotty Bollinger a50d94908c
[Enterprise Search] Add User management feature (#103173)
* Rename method to close both flyouts

This is shared with the forthcoming user flyouts

closeRoleMappingFlyout -> closeUsersAndRolesFlyout

* Add logic for elasticsearch users and single user role mappings

* Add logic for various form states

- Showing and hiding flyouts
- Select and text input values
- User created state to turn flyout into a success message state

* Add User server routes

* Add logic for saving a user

* Add User components

* Add User list and User flyout to RoleMappings view

* Fix path

* Rename things

- Users & roles -> Users and roles
- roleId -> roleMappingId (matches other places in code)
- also added a missing prop to the actions col

* Set default group when modal closed

The UI sets the default group on page load but did not cover the case where the user has chosen a group in a previous interaction and the closed the flyout. This commit adds a method that resets that state when the flyout is closed

Part of porting of https://github.com/elastic/ent-search/pull/3865

Specifically:
a4131b95da

* Adds tooltip for external attribute

This was missed from the design

Part of porting of https://github.com/elastic/ent-search/pull/3865

Specifically:
03aa349cab

* Fix invitations link

* Fix incorrect role type

Role-> RoleTypes
🤷🏽‍♀️

* Add EuiPortal to Flyout

Wasn’t needed in ent-search; already done for RomeMappingFlyout. Hide whitespace changes plskthx

* Auth provider deprecation warning in mapping UI

Since we're moving fully into Kibana, we're losing our concept of auth providers. In 8.0, role mappings the specify an auth provider will no
longer work, so this adds a small deprecation warning in the role mappings table.

https://github.com/elastic/ent-search/pull/3885

* Email is no longer required

After a slack discussion, it was determined that email should be optional.

This commit also fixes another instance of the App Search role type being wrong.

* Existing users’ usernames should not be editable

* Use EuiLink instead of anchor

* Add validation tests

* Change URL for users_and_roles

Need to change folder and file names but will punt until after 7.14FF

I did throw in updating the logic file path

* Remove unused import

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-24 07:57:49 -05:00
Constance 91ca373000
Convert our full page Loading component to an Enterprise Search logo (#103189)
- while keeping our component-level LoadingOverlay to a spinner
2021-06-24 01:11:17 -04:00
Constance 023b163ae0
[App Search] Refactor empty engine polling to EngineLogic (#103041)
* Set up isEngineEmpty and isEngineSchemaEmpty selectors

+ update selector tests with mock engines to just an `engine` var (I saw Jason do this down below for `searchKey` and liked it, so I copied it)
+ update Documents & Search UI pages to new selectors

* Update EngineOverview to use isEngineEmpty + remove polling

- Per Casey, polling is primarily only needed to dynamically update from empty state to non-empty state, which we're going to handle at the engine level in the next commit

* Add empty engine polling behavior

- Now that both Engines Overview, Documents, and Search UI views have empty states that are hooked up to EngineLogic, this poll will update all of the above pages automatically when a new document comes in!

* [Misc UI polish] Add (+) icon to Index documents button

- to match other create page header buttons

* [PR feedback] Test improvements

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
2021-06-24 01:04:08 -04:00
Jason Stoltzfus da7cdb67b7
[App Search] Fixed Documents view for Editor and Analyst roles (#103113)
* Updated search-ui version

1.6.0 adds the ability to authenticate without a search key, which
we need for this fix.

* Updated Documents page to not use a search key

This change updates the page to rely on basic authentication rather
than a search key.

As part of that, we needed to create a proxy endpoint for search-ui
to post to, rather than going directly to the ent-search API.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-24 01:02:46 -04:00
Greg Thompson 136d361703
Upgrade EUI to v34.3.0 (#101334)
* eui to v34.1.0

* styled-components types

* src snapshot updates

* x-pack snapshot updates

* eui to v34.2.0

* styled-components todo

* src snapshot updates

* x-pack snapshot updates

* jest test updates

* collapsible_nav

* Hard-code global nav width for bottom bar’s (for now)

* Update to eui v34.3.0

* flyout unmock

* src flyout snapshots

* remove duplicate euioverlaymask

* xpack flyout snapshots

* remove unused import

* sidenavprops

* attr updates

* trial: flyout ownfocus

* remove unused

* graph selector

* jest

* jest

* flyout ownFocus

* saved objects flyout

* console welcome flyout

* timeline flyout

* clean up

* visible

* colorpicker data-test-subj

* selectors

* selector

* ts

* selector

* snapshot

* Fix `use_security_solution_navigation` TS error

* cypress

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
2021-06-23 15:10:34 -05:00
Scotty Bollinger 2366683209
[Enterprise Search] Add shared Users components and enable RBAC functionality (#102826)
* Add RolesEmptyPrompt component

* Move constants to shared

Will be used in next commit so DRYing them out here

* Add UserAddedInfo component

* Add UsersEmptyPrompt component

* Add UserInvitationCallout component

* Add some shared types

* Add UserSelector component

* Fix imports from a previous commit

Refactored these to shared but missed updating the implementation. See e2d3ec2ca4aba3cb6f7e8e2d2d2da96aa6bedf1b

* Add UsersHeading component

* Add UserFlyout component

* Update UsersAndRolesRowActions with confirm modal

Design calls for using a custom call out instead of window.confirm

* Add pagination size and fix type

- email can be null on bult-in elasticsearch users

* Add UsersTable component

* Remove window.confirm from logic files

The UsersAndRolesRowActions component now uses an EUI prompt for this. Whitespace changes should be hidden for this commit

* Add routes for enabling RBAC

* Update App Search routes

https://github.com/elastic/ent-search/pull/3862

added the ‘/as’ prefix to App Search role mappings routes

* Add logic for enabling role-based access

* Pass docsLink as a prop to the heading component

* Add empty states to mappings landing pages

* Fix a couple of missed i18ns

* Remove unused translations

* Remove EuiOverlayMask

This was needed in ent-search because it uses an older EUI. The newer confirm modal has its own overlay

* Update RoleMappingsTable to use new design

Previously, we showed all engines/groups in the table but the new design calls for a truncated list with additional items so [‘foo’, ‘bar’, ‘baz’]  would display as “foo, bar + 1”

This is already in place for the users table

* Lint fix

* Another lint fix

* Fix test name

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* Move test

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
2021-06-23 15:43:17 -04:00
Constance 391d0eca27
[App Search] Remove external "Launch App Search" button (#100815)
* Remove markup

* Remove i18n translations

* Remove telemetry metric
2021-06-23 14:30:36 -04:00
Constance 045a32b054
[Enterprise Search] Support active nav links that have both subnav & non-subnav child routes (#103036)
* Update generateNavlink to take an `items` subNav and use it to determine isSelected

+ change getNavLinkActive to early returns
+ tweak tests for readability

* Update WS nav Sources link
- to show active on creation routes but not on single source routes

* Update AS nav Engines link
- should eventually show active on creation routes but not on single engine routes

* Update AS engine creation routing
- so that it correctly shows as a child route of the Engines link

+ update breadcrumbs
2021-06-23 10:22:04 -07:00
Constance 01ac8d2d69
[App Search] Convert Synonyms page to new page template (#102828)
* Convert Synonyms page to new page template

* Update empty state for new page template

- Remove EuiPanel wrapper - KibanaPageTemplate does that automatically for us

- Include SynonymModal, required for header create button to work as expected

* Update router

* [UI polish] Proposed page description copy from Davey

- see 9807bf249a

* [UI polish] Add plus icon to create button

- To match other create buttons across app
2021-06-22 19:50:13 -07:00
Constance e582549500
[App Search] Convert Curations pages to new page template (#102835)
* Update CurationRouter

- Remove breadcrumbs set in router (will get set by page template)
- Set up a curation breadcrumb helper for DRYness
- Remove NotFound route - curation ID 404 handling will be used instead

* Convert Curations page to new page template
+ move Empty State from table to top level

* Convert Curation creation page to new page template

* Convert single Curation page to new page template

+ remove breadcrumb prop

* Update router

* [Polish] Copy changes from Davey

- see https://github.com/elastic/kibana/pull/101958/files

- Per https://elastic.github.io/eui/#/guidelines/writing we shouldn't be using "new", so I removed that also

* [UI polish] Add plus icon to create button

- To match other create buttons across app
2021-06-22 17:35:00 -07:00
Constance cf12c031cf
[App Search] Migrate Source Engines & Crawler pages to new page template (#102848)
* Convert meta engines Source Engines view to new page template

* Convert CrawlerLanding to new page template

* Convert CrawlerOverview to new page template

* Update routers

* Misc Source Engines UI polish

- move away from color=secondary, EUI is eventually deprecating it
- add (+) icon to match other views

* Fix bad merge conflict
2021-06-22 17:25:39 -07:00
Constance 0548f98708
[App Search][Polish] API Logs empty state (#102998)
* Re-add noItemsMessage to ApiLogsTable

- Primarily for Engine Overview use - totally forgot about this 🤦

* Tweak API logs empty state copy

- after discussing w/ Davey
2021-06-22 17:46:47 -04:00
Constance e580d5a1e2
[App Search] Convert Result Settings & Relevance Tuning pages to new page template (#102845)
* Convert Result Settings page to new page template

+ remove wrapper around empty state (auto handled by new page template)
+ update tests w/ new test helpers

* Convert Relevance Tuning page to new page template

- Remove old relevance_tuning_layout (which handled breadcrumbs, page header, flash messages, and callouts) in favor of simply using the new templtate + callouts (yay DRYing)

- Remove panel wrapper around empty state (handled by new page template)

* Update router

* [Polish] Spacing & icon polish from Davey

see https://github.com/elastic/kibana/pull/101958/files
2021-06-22 14:43:54 -07:00
Constance b386ce149a
[App Search] Convert Schema pages to new page template (#102846)
* Convert Schema page to new page template

+ update empty state - remove panel wrapper, add create schema field modal

* Convert ReindexJob view to new page template

+ remove breadcrumb prop

* Convert Meta Engine Schema view to new page template

* Update routers

* [Polish] Misc Davey Schema UI tweaks

- see https://github.com/elastic/kibana/pull/101958/files

+ change color away from secondary, since that's going away in EUI at some point

* [UX] Fix SchemaAddFieldModal stuttering on first new schema field add

- With the new template, transitioning from the empty state to the filled schema state causes the modal to stutter due to the component rerender

- Changing the page to not instantly react/update `hasSchema` when local schema state changes but instead to wait for the server call to finish and for cachedSchema to update fixes the UX problem

* [UI polish] Revert button color change per Davey's feedback
2021-06-22 12:27:27 -07:00
Constance f422cbdcf1
[App Search] Convert API Logs page to new page template + empty state polish (#102820)
* Convert API Logs noItemsMessage to its own empty state prompt

- Will be used by new page template

* Convert API Logs view to new page template

+ use new empty state
+ add tests clarifying loading UX

* Update router

* Fix i18n ID
2021-06-22 11:40:10 -07:00
Constance 84d999d747
[App Search] Convert Search UI view to new page template + minor UI polish (#102813)
* Convert Search UI view to use new page template

+ update tests TODO

* [UX polish] Add empty state to Search UI view

- On a totally new engine, all pages except this one* had an empty state, so per Davey's recommendations I whipped up a new empty state for this page

* Overview has a custom 'empty' state, analytics does not have an empty state

* Update router

* Fix bad merge conflict resolution

* [Polish] Copy feedback proposed by Davey

- see cbc3706223
2021-06-22 09:01:25 -07:00
Constance 00a9f84951
[App Search] Convert Analytics views to new page template (#102851)
* Convert AnalyticsHeader to AnalyticsFilters

- it's basically the same component as before, but without the title section/log retention tooltip, since the header/title will be handled by the new page template

* Update AnalyticsLayout to use new page template

+ add new test_helper for header children

* Update breadcrumb behavior

- Set analytic breadcrumbs in AnalyticsLayout rather than AnalyticsRouter

- Update individual views to pass breadcrumbs (consistent with new page template API)

* Update router
2021-06-22 08:40:58 -07:00
Constance 138bd0df30
[Workplace Search] Convert Sources pages to new page template (+ personal dashboard) (#102592)
* Refactor PersonalDashboardLayout to more closely match new page template

- Remove references to enterpriseSearchLayout CSS (which will be removed in an upcoming PR)

- Prefer to lean more heavily on default EuiPage props/CSS/etc.

- Handle conditional sidebar logic in this layout rather than passing it in as a prop

- Update props & DRY concerns to more closely match WorkplaceSearchPageTemplate
  - e.g. isLoading & pageChrome (mostly for document titles)
  - make FlashMessage and readOnlyMode work OOTB w/o props)

* Convert Source subnav to EuiSideNav format

+ update PrivateSourcesSidebar to use EuiSIdeNav

* Update routers

- removing wrapping layouts, flash messages, chrome/telemetry

* Refactor SourceRouter into shared layout component

- Remove license callout, page header, and page chrome/telemetry

- NOTE: The early page isLoading behavior (lines 51-) is required to prevent a flash of a completely empty page (instead of preserving the layout/side nav while loading). We cannot let the page fall through to the route because some routes are conditionally rendered based on isCustomSource.

- FWIW: App Search has a similar isLoading early return with its Engine sub nav, and also a similar AnalyticsLayout for DRYing out repeated concerns/UI elements within Analytics subroutes.

* Convert all single source views to new page template

- Mostly removing isLoading tests
- NOTE: Schema page could *possibly* use the new isEmptyState/emptyState page template props, but would need some layout reshuffling

* Convert Add Source pages to conditional page templates

- Opted to give these pages their own conditional layout logic - this could possibly be DRY'd out

- There is possibly extra cleanup here on this file that could have been done (e.g. empty state, titles, etc.) in light of the new templates - but I didn't want to spend extra time here and went with creating as few diffs as possible

* Convert separate Organization Sources & Private Sources views to new page templates

+ fix Link to EuiButtonTo on Organization Sources view

* Update Account Settings with personal layout + write tests

+ add related KibanaLogic branch coverage

* [UX feedback] Do not render page headers while loading on Overview & Sources pages

* [PR feedback] Breadcrumb errors/fallbacks

* [Proposal] Update schema errors routing to better work with nav/breadcrumbs

- `exact` is required to make the parent schemas/ not gobble schema/{errorId}

- added bonus breadcrumb for nicer schema navigation UX

- No tests need to update AFAICT

* Ignore Typescript error on soon-to-come EUI prop
2021-06-21 20:42:16 -04:00
Constance 3673019906
[App Search] Convert Documents views to new page template + minor UI polish (#102807)
* Convert Documents view to new page template

* [UI polish] Move empty state to top-level instead of showing full UI

- per Davey's previous approval

* [UX polish] Show loading indicator on initial documents page load

* Convert single Document detail view to new page template

* Update router
2021-06-21 14:37:24 -07:00
Constance f2ca7fcb96
[App Search] Convert Settings & Credentials pages to new page template (#102671)
* Convert Settings to new page template

+ add missing ability check around route

* Convert Credentials to new page template

+ add missing ability check around route

* [Tests refactor] DRY out repeated ability tests to a helper

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-21 17:05:18 -04:00
Constance 6dc996229c
[App Search] Engines Overview polish pass (#102778)
* Split up engines vs. meta engines into separate panels

- per Davey's feedback from earlier UI passes

* DRY out manual header/spacing to reusable DataPanel component

+ update DataPanel icon typing to not error when passed a custom icon/svg

- kudos again to Davey for the component

* Typography tweaks

- Update DataPanel component to accept a custom titleSize (to maintain previous UI/sizing)

- Fix meta engines empty prompt title heading to follow heading levels + tweak sizing to not be larger than panel heading

* Set up new license CTA button for upcoming meta engines CTA

falls back to a documentation link! so fancy

* Update Enterprise Search Overview to use new license button

* Add new Meta Engines license upgrade CTA

- Reuse some copy from Meta Engines creation view
- Reuse DataPanel so visuals stay consistent + it looks similar to CTA on Enterprise Search Overview
- Update DataPanel to allow buttons to be responsive + conditionally load spacer between header & children

* Improve responsiveness of app when platinum license changes

Previously, routes/apps were going off the static data passed from the server which was only initialized once on page load. hasPlatinumLicense however changes dynamically and in real-time, removing the need for a hard page refresh.

I could have replaced all `canManageMetaEngine` flags with `isPlatinum && canManageEngines`, but I thought baking license checks into the main ability would be more scalable and potentially open the way to other license-based flags also being dynamic.

* [PR feedback] Typos in test names

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* Fix failing test

Missed updating the heading level

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
2021-06-21 16:49:14 -04:00
Constance 1f2de03941
[App Search] Convert Engine subnav and Engine Overview pages to new page template (#102679)
* Update routers

- To facilitate this being broken up into multiple PRs, non-migrated views still get a wrapping layout

* Set up Engine subnav in EuiSideNav format

+ tweak CSS for new label - heads up that this will break the old nav, but will disappear as the pages get converted

* Convert Engine Overview pages to new page template

* [PR feedback] Code comment explaining side nav icon reorder

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-21 11:59:52 -07:00
Constance ceaf9f6242
Convert EuiCards to non-shadowed defaults to avoid nested panel/shadows (#102680)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-21 10:33:22 -07:00
Scotty Bollinger 49271f30d0
[Workplace Search] Replace library interface with EUI (#102758)
One of the Workplace Search components was using the 'react-beautiful-dnd' typing for it’s component. This PR relpaces it with the EUI equivalent.
2021-06-21 13:14:42 -04:00
Constance 79b0949d34
[App Search] Convert Engines overview & engine creation to new page template (#102677)
* Convert Engine Creation page to new page template

+ simplify EuiForm/form to 1 level of nesting

* Convert Meta Engine Creation page to new page template

* Initial conversion of Engines overview to new page template

* Engines Overview: simplify loading & empty state to use new page template props

* Engines Overview: simplify header

- now that the header/actions, chrome/telemetry, & empty state etc. are all DRY'd out by the template, there's no need for a separate header component
- we can simply dry out the header action, which will shortly be removed with the 7.14 launch

- note: for empty state changes: mostly indenting, the new template automatically creates a subdued panel for us in empty state so no need to include one manually

* Fix broken test mocks

I definitely should not have been importing the index file I'm mocking, but why did this only break now?? :psyduck:

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-21 12:36:16 -04:00
Kuldeep M 31aa1c8a59
[Workplace Search] remove or replace xs props for text on source connect view (#102663)
* remove xs props for text on source connect view

* change more text sizes
2021-06-18 21:11:25 +01:00
Constance 02c1c61828
[Workplace Search] Convert Groups pages to new page template (#102449)
* Convert Groups page to new page template

* Convert Groups > Group overview to new page template

- Because dataLoading is no longer an early return, certain items need to be converted to conditional checks in order for the app to not crash

* Convert Groups > source prioritization to new page template

* Convert Group subnav to EuiSideNav format

* Update routers
2021-06-17 16:01:24 -04:00
Constance 0e14cef4cb
[Workplace Search] Convert Settings pages to new page template (#102445)
* Convert Settings > Customize to new page template

* Convert Settings > oAuth application to new page template

+ DRY form wrappers, update test

* Convert Settings > Connectors to new page template

* Convert source config view to new page template

* Convert Settings subnav to EuiSideNav format

+ update main WS nav

* Update routers
2021-06-17 09:36:17 -07:00
Constance 1627240ff8
[Workplace Search] Convert Overview & Security pages to new page template (#102444)
* Convert WS Overview page to new page template

* Misc Overview refactors

- Fix extra spacing caused by hidden onboarding steps

- Default page title to "Organization overview" instead of to onboarding title which flashes during loading

- Prefer shallow over mount (will matter later, when WorkplaceSearchPageTemplate nav includes more kea logic)

* Convert Security page to new page template

+ misc ux enhancement disabling header actions while data is still loading
2021-06-17 09:28:14 -07:00
Constance e8c16e310f
Fix logout link not working on local dev (#102451) 2021-06-17 09:08:51 -07:00
Constance 66c9d801d5
[Enterprise Search] Set up initial KibanaPageTemplate (#102170)
* Set up shared EnterpriseSearchPageTemplate component

* Set up product-specific page templates + setPageChrome

+ misc tech debt - create AS components/layout/index.ts for imports

* Set up navigation helpers for EuiSideNav usage

- Update react_router_helpers to pass back props as a plain JS obj instead of only working with React components (+ update react components to use new simpler helper)

- Convert SideNavLink active logic to a plain JS helper

* Set up top-level product navigations

NYI: sub navigations (future separate PRs)

* Set up test_helpers for inspecting pageHeaders

- primarily useful for rightSideItems, which often contain conditional logic

* Initial example: Convert RoleMappings views to new page template

Minor refactors:
+ remove unnecessary type union
+ fix un-i18n'ed product names
+ add full stop to documentation sentence
+ add semantic HTML tags around various page landmarks (header, section)

* EUI feedback: add empty root parent section

* Revert Role Mappings union type removal

- but shenanigans it a bit to take our i18n'd shared product names (requires as const assertion)

- done to reduce merge conflicts for Scotty / make his life (hopefully) a bit easier between ent-search and Kibana

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-16 18:23:13 -04:00
Vadim Yakhin 7683d9ef17
[Workplace Search] Fix sidebar copy for Account Settings page (#102110)
* Rename PrivateSourcesLayout to PersonalDashboardLayout

The renaming was required because this layout is also used for Account Settings.

* Rename imports

* Rename files

* More personal_dashboard_layout from sources folder to layout folder

* Extract PrivateSourcesSidebar from PersonalDashboardLayout

This is needed to add the ability to pass AccountSettingsSidebar in the
next commit.

* Add and use AccountSettingsSidebar

* Move related styles to personal_dashboard_layout folder

* Move tests from personal_dashboard_layout to private_sources_sidebar

* Add tests for account_settings_sidebar

* Remove redundant import

* Move source-related sidebar text constants to top-level constants file

Now all personal dashboard sidebar copy is in one place
2021-06-15 13:50:43 -03:00
Scotty Bollinger 42aa7f569a
[Enterprise Search] Refactor Role mappings to use single endpoint (#102096)
* Add tooltip back to table row

This was missed when refactoring the table to an EUI component. Built-in mappings have tooltips and don’t have IDs and need to show tooltips instead of actions.

* Fix roleType display

Also missed in the refactor. Made a mistake when copying/pasting

* Refactor logic files to use single endpoint for UI props

As a part of this feature, we are now passing all props needed for the UI in the list endpoint. Previously, whether creating a new mapping, or updating an existing mapping, an endpoint had to be called to fetch the data needed for display. Now all this data comes from the initial fetching of mappings and the other endpoints are no longer needed.

* Refactor WS test to match AS

There was an issue where 100% test coverage was not achieved in Workplace Search. This had already been fixed in App Search by refactoring. This changes the code and test in Workplace Search to match

* Remove server routes
2021-06-15 10:12:47 -05:00
Byron Hulcher 8ca7b55c15
App Search: Domains Table for Crawler Overview (#101515)
* Add delete route for crawler domains

* Added deleteDomain action to CrawlerOverviewLogic

* New DomainsTable component

* Replace EuiCode with DomainsTable in CrawlerOverview

* Fixing mock imports

* Fix spleling

* Fix i18n tag

* Clean up DomainsTable

* Clean up DomainsTable tests

* Clean up CrawlerOverview tests

* Clean up i18n tag in CrawlerOverviewLogic

* Utilize Kibana i18n and React for timestamp display

* Use elastic.co domain in tests

* Remove unneeded type casting

* Adjusting isDateToday check

* Apply suggestions from code review

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.ts

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-06-15 10:08:07 -04:00
Scotty Bollinger f28777f3ba
[Enterprise Search] Add owner and description properties to kibana.json (#101957)
* [Enterprise Search] Add owner and description properties to kibana.json

Adds owner and description properties to kibana.json

* Reorder to match other plugins

Both others have the props at the end of the file:

https://github.com/elastic/kibana/blob/master/src/plugins/bfetch/kibana.json

Also removes redundant prefix from description

* Copy change

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-06-10 20:04:37 -04:00
Scotty Bollinger 797c0c90b0
[Enterprise Search] Refactor RoleMappingsTable to use EuiInMemoryTable (#101918)
* Add shared actions component

Both tables use the same actions

* Refactor RoleMappingsTable to use EuiInMemoryTable

This is way better than the bespoke one I wrote and it comes with pagination for free

- Also fixes a typo in the i18n id
2021-06-10 14:20:54 -04:00
Scotty Bollinger d7d67df5eb
[Enterprise Search] Create reusable Group and Engine assignment selectors (#101790)
* Create AssignmentSelectors

These components will be used in both the Role Mapping and User flyouts to create and edit role mappings and users, respectively

* Implement AssignmentSelectors in components
2021-06-10 14:36:11 -03:00
Vadim Yakhin a9a834a105
[Workplace Search] Add Account Settings page imported from Security plugin (#99791)
* Copy lazy_wrapper and suspense_error_boundary from Spaces plugin

These components are needed to enable async loading of Security components into Enterprise Search.

The components are copied without any changes except for i18n ids, so it's easier to DRY out in the future if needed.

* Create async versions of personal_info and change_password components

* Create ui_api that allows to load Security components asuncronously

The patterns were mostly copied from Spaces plugin

* Make ui_api available through Security components's lifecycle methods

* Import Security plugin into Enterprise Search

* Add Security plugin and Notifications service to Kibana Logic file

* Export the required components from the Security plugin and
use them in the new AccountSettings component

* Update link to the Account Settings page

* Move getUiApi call to security start and pass core instead of getStartServices

* Simplify import of change_password_async component by providing...
... `notifications` and `userAPIClient` props in the security plugin

* Remove UserAPIClient from ui_api

It's not needed anymore since the components are initiated with this prop already passed

* Export ChangePasswordProps and PersonalInfoProps from account_management/index.ts

This makes it easier to import these props from outside the account_management folder

* Remove notifications service from kibana_logic

It is not needed anymore since we're initializing security components with notifications already provided

* Add UiApi to SecurityPluginStart interface

* Utilize index files for exporting Props types

* Replace Pick<...> with two separate interfaces as it doesn't work well with our docs

* Add a comment explaining why we're not loading async components through index file
2021-06-10 14:20:30 -03:00
Constance 12986fb8fc
[Enterprise Search] Mocks/tests tech debt - avoid hungry mocking (#101107)
* Move enzyme & misc test helpers out of __mocks__/ and into new test_helpers/

They're not technically mocks since nothing is being mocked, so we should move them into a test_helpers folder for specificity & organization

* Move React Router mocks into its own separate folder/import

This was part of the initial feedback, that it was unclear why importing something for Kea in __mocks__/index.ts was mocking react router along for the ride. Separating this out makes things clearer and imports more explicit

+ add some handy new mock useX jest.fn()s helpers, so we're not doing `useParams() as jest.Mock` errywhere

* Move Kea & logic mocks/helpers into kea_logic subfolder
- for organization

NOTE: It can't be a plain kea/ folder because then Jest automatically mocks the `kea` module itself kea 🤦

* Fix type failures

- Caused by switch from any to unknown (changed back to any + added a .test_helper suffix exclusion for any)

* Fix Enterprise Search tests/imports

- I checked all application folders but this one, whoops

* PR feedback: comment copy

* Update tests/files added since PR open with new import locations

* Fix misc react router typing

- null not being type-able as a boolean
- forgot to remove various useParam imports after adding mockUseParams
+ misc unused kea import, probably added while debugging kea mocks
2021-06-08 21:36:06 -07:00
Jason Stoltzfus a9e64abe8c
[App Search] Updated Search UI to new URL (#101320) 2021-06-08 12:42:50 -04:00
Scotty Bollinger c1924c38ef
[Enterprise Search] Refactor Role mappings landing pages for both products (#101534)
* Add constants and type

* Add RoleMappingsHeading component

I toyed with trying to make a shared component between the Role mappings and Users sections since they both have the same layout, but the need to have all of the conditional copy and button text just seemed too messy, so I opted to share this component between the two products and will make a UsersHeading component in a future PR

* Remove action from table

This is now in the RoleMappingsHeading component from the previous commit

* Remove empty states

Also removed the add mapping button since it is in the heading component

* Remove page headings in favor of table headings

* Remove a bunch of constants and translations

* Update placeholder to match mockup
2021-06-08 08:08:45 -05:00
Scotty Bollinger 1e3f916cd9
[Enterprise Search] Fix edge case UI issues in Role Mapping flyouts (#101436)
* Add invalidation to Attribute Value field when empty

Also added some missed i18n strings for the form row labels

* Disable forms if attribute value is invalid

* Move error from saving role mapping to inline form error

Flash message was rendering behind flyover.
*Best to view this commit with whitespace changes hidden

* Fix i18n

Copy/Paste FTW

* Attempt at fixing lint issue

My local linter seems to be broken

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-07 12:13:02 -05:00
Scotty Bollinger fc511f9ec1
[Enterprise Search] Convert Role mappings for both apps to use flyouts (#101198)
* Add RoleOptionLabel component

* Refactor RoleSelector to use EuiRadioGroup

Previously, we used individual radio buttons in a map in the component. However the new designs have a shared label and work best in the EuiRadioGroup component.

* Add reducer and actions to logic file for flyout visibility

* Remove redirects in favor of refreshing lists

With the existing multi-page view, we redirect after creating, editing or deleting a mapping. We now simply refresh the list after the action.

Also as a part of this commit, we show a hard-coded error message if a user tries to navigate to a non-existant mapping, instead of redirecting to a 404 page

* Add RoleMappingFlyout component

* Refactor AttributeSelector

No longer uses a panel or has the need for flex groups

- Also added a test for 100% coverage

* Refactor RoleMappingsTable

- Use EuiButtonIcons instead of Link
- Manage button now triggers flyout instead of linking to route

* Remove AddRoleMappingButton

We can just use an EuiButton to trigger the flyout

* Convert to use RoleSelector syntax

- Passes the entire array to the component instead of mapping.
- Uses ‘id’ instead of ‘type’ to match EUI component
- For App Search, as per design and PM direction, dropping labels for advanced and standard roles and showing them all in the same list.
- Removed unused constant and i18ns

* Move constants to shared

Will do a lot more of this in a future PR

* Remove DeleteMappingCallout

- This now an action in the row
- Also added tests for correct titles for 100% test coverage

* Remove routers and routes

- SPA FTW

* No longer pass isNew as prop

- Determine based on existence of Role Mapping instead

* No longer need to initialze role mapping in the component

This will become a flyout and the intialization will be triggered when the button in the table is clicked.

* Remove flash messages

This will be handled globally in the main component.

* Wrap components with flyout

Also add to main RoleMappings views

* Add form row validation for App Search

* Remove unnecessary layout components

- Don’t need the panel, headings, spacer, and Flex components
- Also removed constants and i18n from unused headings

* Wire up handleDeleteMapping to take ID param

The method now passes the ID directly from the table row action item

* Add EuiPortal wrapper for flyout

Without this, the flyout was was under the overlay. Hide whitespace changes on this commit

* Add spacer to better match design

* Update constants for new copy from design

* Replace all engines/groups radio and group/engine selectors

- The designs call for a radio group and a combo box, instead of separate radios and a list of checkboxes
- Also added a spacer to each layout

* Remove util that is no longer needed

- This was used for generating routes that are no longer there
- Also removed unused test file from a component deleted in an earlier PR
- Fix test since spacer was added

* Add missing i18n constant

* Add back missing scoped engine check

* Rename roleId -> roleMappingId

* Use shared constant for “Cancel”

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-04 14:22:31 -05:00
Jason Stoltzfus 77533da2be
[App Search] 100% code coverage plus fix console error (#101407) 2021-06-04 14:32:17 -04:00
Byron Hulcher 9a275de0f9
[App Search] Initial logic for Crawler Overview (#101176)
* New CrawlerOverview component

* CrawlerRouter should use CrawlerOverview in dev mode

* New CrawlerOverviewLogic

* New crawler route

* Display domains data for CrawlerOverview in EuiCode

* Update types

* Clean up tests for Crawler utils

* Better todo commenting for CrawlerOverview tests

* Remove unused div from CrawlerOverview

* Rename CrawlerOverviewLogic.actios.setCrawlerData to onFetchCrawlerData

* Cleaning up CrawlerOverviewLogic

* Cleaning up CrawlerOverviewLogic tests

* Fix CrawlerPolicies capitalization

* Add Loading UX

* Cleaning up afterEachs across Crawler tests
2021-06-04 14:28:11 -04:00
Jason Stoltzfus 9618fd7dfe
[App Search] Added a persistent query tester flyout (#101071) 2021-06-03 11:00:12 -04:00
Oleksiy Kovyrin 58b1416f84
Enterpise Search SSL Settings Support (#100946)
Introduce a new set of SSL configuration settings for Enterprise Search plugin,
allowing users to configure a set of custom certificate authorities and to 
control TLS validation mode used for all requests to Enterprise Search.

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>
Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
2021-06-03 10:58:11 -04:00
Byron Hulcher 90f2d094ce
[App Search] Crawler Landing Page (#100822)
* New CrawlerLanding component

* New CrawlerRouter component

* Adding CrawlerRouter to EngineRouter

* Using internal route for Crawler link in EngineNav

* Rename crawler landing background

* Fix CrawlerLanding css

* Fix crawler documentation link

* Add Crawler title to breadcrumbs

* Reduce png filesize

* Improve CrawlerLanding copy

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.scss

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-06-02 11:36:40 -04:00
Constance 8529040a92
[Enterprise Search] Log warning for Kibana/EntSearch version mismatches (#100809)
* Add server log warnings whenever Kibana and Enterprise Search versions are mismatched

* Copy feedback
2021-05-28 10:57:30 -07:00
Jason Stoltzfus be001f2aa6
[App Search] Added a query tester button (#100560) 2021-05-27 15:39:16 -04:00
Byron Hulcher ea8c92b353
[App Search] Allow user to manage source engines through Kibana UX (#98866)
* New bulk create route for meta engine source engines

* New delete route for meta engine source engines

* Add removeSourceEngine and onSourceEngineRemove to SourceEnginesLogicActions

* New SourceEnginesTable component

* Use new SourceEnginesTable component in SourceEngines view

* Added closeAddSourceEnginesModal and openAddSourceEnginesModal to SourceEnginesLogic

* New AddSourceEnginesModal component

* New AddSourceEnginesButton component

* Add AddSourceEnginesButton and AddSourceEnginesModal to SourceEngines view

* Allow user to select source engines to add

* Add addSourceEngines and onSourceEnginesAdd to SourceEnginesLogic

* Submit new source engines when user saves from inside AddSourceEnginesModal

* Fix failing tests

* fix i18n

* Fix imports

* Use body instead of query params for source engines bulk create endpoint

* Tests for SouceEnginesLogic actions setIndexedEngines and fetchIndexedEngines

* Re-enabling two skipped tests

* Feedback: move source engine APIs to own file

- We generally organize routes/logic etc. by view, and since this is its own view, it can get its own file

* Misc UI polish

Table:
- Add EuiPageContent bordered panel (matches Curations & API logs which is a table in a panel)
- Remove bolding on engine name (matches rest of Kibana UI)
- Remove responsive false (we do want responsive tables in Kibana)

Modal:
- Remove EuiOverlayMask - per recent EUI changes, this now comes baked in with EuiModal
- Change description text to subdued to match other modals (e.g. Curations queries) in Kibana

* Misc i18n/copy tweaks

Modal:
- Add combobox placeholder text
- i18n cancel/save buttons
- inline i18n and change title casing to sentence casing

* Table refactors

- DRY out table columns shared with the main engines tables (title & formatting change slightly from the standalone UI, but this is fine / we should prefer Kibana standardization moving forward)
- Actions column changes
  - Give it a name - axe will throw issues for table column missing headings
  - Do not make actions a conditional empty array - we should opt to remove the column totally if there is no content present, otherwise screen readers will read out blank cells unnecessarily
  - Switch to icons w/ description tooltips to match the other Kibana tables
- Remove unnecessary sorting props (we don't have sorting enabled on any columns)

Tests
- Add describe block for organization
- Add missing coverage for window confirm branch and canManageMetaEngineSourceEngines branch

* Modal test fixes

- Remove unnecessary type casting
- Remove commented out line
- Fix missing onChange function coverage

* Modal: move unmemoized array iterations to Kea selectors

- more performant: kea selectors are memoized
- cleaner/less logic in views
- easier to write unit tests for

+ rename setSelectedEngineNamesToAdd to onAddEnginesSelection
+ remove unused selectors test code

* Modal: Add isLoading UX to submit button + value renames

- isLoading prevents double clicks/dupe events, and also provides a responsive UX hint that something is happening

- Var renames: there's only one modal on the page, being extra specific with the name isn't really necessary. If we ever add more than one to this view it would probably make sense to split up the logic files or do something else. Verbose modal names/states shouldn't necessarily be the answer

* Source Engines view test fixes

- Remove unused mock values/actions
- Move constants to within main describe
- Remove unhappy vs happy path describes - there aren't enough of either scenario to warrant the distinction
- add page actions describe block and fix skipped/mounted test by shallow diving into EuiPageHeader

* [Misc] Single components/index.ts export

For easier group importing

* Move all copy consts/strings to their own i18n constants file

* Refactor recursive fetchEngines fn to shared util

+ update MetaEnginesTableLogic to use new helper/DRY out code
+ write unit tests for just that helper
+ simplify other previous logic checks to just check that the fn was called + add mock

* Tests cleanup

- Move consts into top of describe blocks to match rest of codebase
- Remove logic comments for files that are only sourcing 1 logic file
- Modal:
  - shallow is fairly cheap and it's easier / more consistent w/ other tests to start a new wrapper every test
- Logic:
  - Remove unnecessarily EnginesLogic mocks
  - Remove mount() in beforeEach - it doesn't save us that many extra lines / better to be more consistent when starting tests that mount with values vs not
  - mock clearing in beforeEach to match rest of codebase
  - describe blocks: split up actions vs listeners, move selectors between the two
  - actions: fix tests that are in a describe() but not an it() (incorrect syntax)
  - Reducer/value checks: check against entire values obj to check for regressions or untested reducers & be consistent rest of codebase
  - listeners - DRY out beforeEach of success vs error paths, combine some tests that are a bit repetitive vs just having multiple assertions
- Logic comments:
  - Remove unnecessary comments (if we're not setting a response, it seems clear we're not using it)
  - Add extra business logic context explanation as to why we call re-initialize the engine

Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
2021-05-15 01:10:53 -04:00
Constance 091ca4384a
[App Search] Meta engines schema view (#100087)
* Set up TruncatedEnginesList component

- Used for listing source engines
- New in Kibana: now links to source engine schema pages for easier schema fixes!

* Add meta engines schema active fields table

* Render meta engine schema conflicts table & warning callout

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/truncated_engines_list.tsx

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
2021-05-14 18:13:26 -04:00
Scotty Bollinger 5507ba6226
[Workplace Search] Fix bug when transitioning to personal dashboard (#100061)
The unmount callback should have never been in the useEffect keyed off of the pathname. Another issue appeared earlier and I tried to fix it with the now removed conditional, but it should have been removed into it’s own useEffect that only runs when the component is unmounted, not on every route change.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-13 16:16:28 -05:00
Constance 609fed35f2
[Enterprise Search] Fix SchemaFieldTypeSelect axe issues (#100035)
* Update SchemaFieldTypeSelect to allow passing any aria props

- We'll specifically be using aria-labelledby in this PR, but theoretically any aria prop should be fine.

* Update AS & WS schema tables to use the type table column heading as an aria-labelledby ID
2021-05-13 12:11:30 -07:00
Constance 63f18aaac5
[App Search] Schema view (#99868)
* Add schema add field modal to page

* Add SchemaCallouts component

* Add empty state

* Add SchemaTable component

- Main update functionality is covered by the shared SchemaFieldTypeSelect component

+ Readd 'Recently added' i18n strings removed in d93e31dd41 (r624038044)

squash with table

* Add final update types button behavior

+ expand tests more explicitly & cleanly

* Fix i18n

just throw my body in the trash

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/views/schema.test.tsx

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* [Misc] Add missing SchemaBaseLogic state check

- Missed this in https://github.com/elastic/kibana/pull/99548

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/empty_state.tsx

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
2021-05-12 19:44:28 -04:00
Constance 4803f28ef3
[App Search] Add red alert icon to Schema nav link if engine has schema reindex errors (#99976)
* Add hasSchemaErrors selector

* [Cleanup] Remove now-unused setIndexingStatus action

- Was previous used onSuccess after schema was manually updated in the UI, but we now re-fetch all engine detail data instead (to get additional document/boost/relevance tuning info) and no longer need that specific setter

* Add red alert/warning icon to Schema nav link

* [Polish] Fix mobile UI when nav icons are present
2021-05-12 16:29:07 -04:00
Constance ea7582361d
[App Search] Schema reindex job errors view (#99941)
* Set up ReindexJobLogic

* Update ReindexJob view with load behavior & shared SchemaErrorsAccordion
2021-05-12 12:33:10 -07:00
Constance 907c8a5a86
Fix Flash Messages live region axe issue (#99872) 2021-05-12 09:27:38 -07:00
Jason Stoltzfus 2ce8e10cdc
Removed fromKibana param (#99834) 2021-05-12 08:20:31 -04:00
Constance c28213b6c3
[App Search] Schema: Set up server routes, grand foray into shared/connected Kea logic (#99548)
* Set up server API routes

* Set up types

* Set up shared/base Schema logic file

- values & actions shared between both default source engine & meta engine pages

* Add default/indexed engine SchemaLogic

* Add MetaEnginesSchemaLogic

- significantly different actions (no updating) & API response from source engines, hence the separate files

+ fix typing issue - without Partial<>, all 4 enum types are expected instead of 1-4
- for some reason this causes an error in a separate a util file, not sure why (Typescript issue?)

* Update Schema & MetaEngineSchema views with loaders

* PR feedback: comment nit

* PR feedback: Remove unnecessary async/awaits

* PR feedback: Simplify loadSchema to be shared by base logic

Much clean, such simple

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-11 11:48:08 -07:00
Jason Stoltzfus 56908e1739
Support prepopulated Search UI fields (#99793) 2021-05-11 13:11:32 -04:00
Jason Stoltzfus eb52bd2318
[App Search] Added Search UI form (#99359) 2021-05-11 09:16:27 -04:00
Scotty Bollinger 0b5d323613
[Workplace Search] Fix bug with updating a role mapping (#99688)
`id` is not needed by the server as a body prop, as it’s inferred from the params.
2021-05-10 18:30:57 -04:00
Scotty Bollinger 238fc3ac1d
[App Search] Remove reset mappings button from Role mappings (#99499)
* Move toolTip type to shared

This is used by Workplace Search as well

* Remove reset mappings button

Will not be used as a part of the User transition

* Remove server route

* Remove unused import

* Remove unused translations
2021-05-06 17:11:52 -04:00
Jonathan Budzenski 79be58ee1b Revert "[App Search] Remove reset mappings button from Role mappings (#99414)"
This reverts commit 1d4bdc554c.
2021-05-06 11:14:31 -05:00
Scotty Bollinger 1d4bdc554c
[App Search] Remove reset mappings button from Role mappings (#99414)
* Move toolTip type to shared

This is used by Workplace Search as well

* Remove reset mappings button

Will not be used as a part of the User transition

* Remove server route

* Remove unused import
2021-05-06 10:37:16 -05:00
Constance 1322eee98e
[App Search] Create Engine UI polish (#99281)
* Remove incorrect external icon indicator

davey pls

* Add isLoading state to the Create Engine button

* Add isLoading state to the Create Meta Engine button
2021-05-05 09:58:06 -07:00
Scotty Bollinger e0d4acb1b1
[Workplace Search] Refactor RoleMappingsLogic (#99284)
* Reorder methods

* Reorder actions interface

* Reorder values interface

* Reorder server details interface

* Add path

* Refactor handleDeleteMapping logic

* REorder and refactor actions

Also changes functions with no return values to properties to match app search

// Before:
foo: () => true

// After
foo: true

* Reorder reducers

* Reorder JSON body props

* Change JSON order in test

Passes locally but fails on CI

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-05 11:41:36 -05:00
Larry Gregory aab29cdbb0
Document plugin API for spaces and spacesOss (#98966)
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-05 10:50:59 -04:00
Scotty Bollinger 3e54390293
[Enterprise Search] Add callouts on product selector for license and trial status (#99122)
* Add isTrial selector to LicensingLogic

* Add LicenseCallout component

In order to match the existing design, I opted to use an extra EuiFlexItem for the gap between the button, instead of adding a stylesheet with padding, like the legacy version had. Verified it looks good on mobile as well.

* Add TrialCallout component

* Wire up new callouts

- Only render when the host is set, otherwise, fall back to the Setup Guide callout
- Add some extra padding with a larger spacer to beter match legacy UI

* Refactor for a better test

* Use isEmptyRender API instead of checking for length

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* DRY out callout heading

* Remove grow prop to align button to right

* Update button copy

* Replace EuiButton with EuiButtonTo

* Remove EuiText wrapper on link text

* Better test organization

* Remove unnecessarydivs

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Refactor i18n for link

Also changes link style to underline

* Center-align trial callout

* Rename i18n ID

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Add back and rename translations

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-05-04 18:05:44 -04:00
Constance 992ff93a6e
[Enterprise Search] Refactor shared SchemaErrorsAccordion component (#99069)
* Move SchemaErrorsAccordion to its own folder

+ give it its own export

* Move errors-specific copy to its own file

+ Capitalize ID heading

* [UI polish] Accordion header tweaks

- Fix responsive behavior
- Make Review button more accessible (a within a button is not semantically correct)
- Add <code> markup for field type

* [UI polish] CSS tweaks

- use OOTB EUI CSS classes for borders (see https://elastic.github.io/eui/#/layout/accordion#styled-for-forms)
- tweak spacing
- misc fixes

* [Code polish] Misc cleanup

- Simplify / DRY out props types
- Prefer unique IDs/names over map indexes for React keys
- Improve var names

* Simplify conditional "view" column + misc fixes

- Rename prop to match AS's generateSomePath helpers
- Remove need for itemId - AS should be able to generate its own URL route without it
- Fix accessibility for view column - should be totally hidden to screen readers if not present
- Fix semantics of view link - should be an <a> link not a button

* Update WS's use of SchemaErrorsAccordion
2021-05-03 19:24:52 -04:00
Constance 292b6d2638
[Enterprise Search] Refactor shared SchemaAddFieldModal component (#99096)
* Move SchemaAddFieldModal to its own folder

+ misc test cleanup - remove unnecessary jest.spyOn in individual tests, it's already in the beforeEach

* i18n fixes

- Move constants to subfolder
- Fix various i18n IDs/var names - modal titles is not a fieldNote title
- Fix an i18n string that should be a FormattedMessage (could have grammar issues otherwise)
- Add missing i18n strings - labels (shared, AS will also use these as column headers) & placeholder
- Import order

* Move formatFieldName util to its own file

- simplify leading/trailing trimming regex
- add unit tests - primarily for documenting regexes & providing examples

* Refactor modal form submission

- See https://elastic.github.io/eui/#/layout/modal#forms-in-a-modal for documentation - form should be submitted via ID & EuiModalFooter form={id}

* Misc props cleanup

- Move optional props to bottom of type list
- Remove unnecessary props (default EUI behavior)
- Data test subj cleanup
- Add missing `disabled` passed prop, add unit test for disableForm prop
2021-05-03 14:29:36 -07:00
Jason Stoltzfus ad9f1c3155
Fixed Search UI route (#99065) 2021-05-03 13:57:39 -04:00
Constance 49b6583946
[Enterprise Search] Refactor out IndexingStatus to just a SchemaErrorsCallout (#98969)
* Create new SchemaErrorsCallout component
- will replace IndexingStatus and IndexingStatusErrors

- The concept of "indexing status"/loading no longer really exists, now that schema updates instantly

* Update views to use new SchemaErrorsCallout
- instead of IndexingStatus component

* Remove remaining concepts of an indexing job/loading progress

+ remove /status reindex_job routes, since we no longer need to poll for indexing status

* Remove IndexingStatus components

* Update i18n

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-03 12:50:27 -04:00
Jason Stoltzfus 7cabbb81ba
[App Search] Add logic and routes for Search UI (#98641) 2021-04-30 17:10:41 -04:00
Constance 8810e8484c
[Enterprise Search] Refactor SchemaExistingField component to SchemaFieldTypeSelect (#98955)
* Refactor SchemaExistingField to just the select component

- Removes unnecessary CSS, conditionals, etc. (letting AS & WS manage their own table/row views & styling)
+ Move to its own component folder for organization

* Update WS to use new SchemaFieldTypeSelect component

* Update SchemaAddFieldModal to dogfood SchemaFieldTypeSelect component

- DRY's out fieldTypeSelectOptions to only having to exist within SchemaFieldTypeSelect

* i18n cleanup

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-30 16:25:08 -04:00
Constance a5d910d50c
[App Search] Schema: route & bare-bones views setup (#98679)
* Set up basic Schema skeleton views+router

* Update engine router + nav with new schema routes

* Breadcrumbs

* PR feedback: derpin

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>

* reindexJobId pls

* my life is in shambles

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
2021-04-30 09:22:16 -07:00
Constance 40282f8128
[Enterprise Search] Refactor shared schema types (#98801)
* Move schema-specific shared types to shared/schema folder

- This helps provide more context when people are reaching into shared types grab items, and keeps concepts/components together
+ minor comment updates

* Convert interfaces to Records where applicable

- see https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype

* [Opinionated] Change schema types to enums and DRY out field_types constants

- in favor of using SchemaType enum keys and iterating

- Not 100% sure about this as the internet seems to think string unions are still pretty good, but since we're using const references for the types anyway, it seems like the use case fits

* Update files to use new schema type enum

* Update all remaining files (basic imports)

* [Misc] DRY out FieldCoercionErrors type

+ change to record
- AS will also use this type
2021-04-30 09:14:58 -07:00
Constance d26f1dc82b
[App Search] Synonyms: Create/update/delete & modal behavior (#98344)
* Add SynonymsLogic create/update/delete actions & modal state

* [Setup] Update MultiInputRows to work with a ModalFooter submit + allow hiding submit button

* Add SynonymModal component

* Update existing views with modal behavior

* PR feedback: Fix MultiInputRows to not render a form component for Relevance Tuning / onChange-only components

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-29 13:35:57 -07:00
Scotty Bollinger 5f57766e03
[Workplace Search] Add 'Folders' to ObjTypes (#98558)
Adds 'Folders' to the list of synced items in the UI for Dropbox, Google Drive, OneDrive and SharePoint Online
2021-04-29 12:32:38 -04:00
Scotty Bollinger 1d5fa6f53a
[Workplace Search] Remove MVP and expose beta (#98680)
* Remove references to `/alpha` route

* Delete all files and references to them for the existing MVP

* Remove conditional MVP Personal dashboard link

* Remove extra Route component

* Wrap header actions in EuiHeaderLinks for mobile

This is an add-on and should be reviewed with white space changes hidden.
2021-04-29 08:24:57 -03:00
Constance 794e040847
[App Search] Small route fixes/updates (#98556)
* Various route URL updates

- Snake case Kibana routes
- Remove unnecessary extra subdirectory pathing

* Fix missing ability check

- There isn't currently a role that would fail the check, but since the nav link is wrapped in the role, we might as well copy it and look at our role checks in the 8.0 refactor

* fix test
2021-04-28 08:49:37 -07:00
Byron Hulcher 9cade4299f
[App Search] Empty shell view for engine source engines view (#96896)
* Add route to get source engines for meta engines

* New empty SourceEngines component

* Add SourceEngines to EngineRouter

* New SourceEnginesLogic file

* Hook up SourceEngines component to SourceEnginesLogic

* Update EngineNav link to manage source engines to point internally

* PR Feedback:
- Copy fixes
- Markup improvements
- Spleling erors
- Test improvements

* Move EnginesAPIResponse to shared types file

* Use existing mock for EngineLogic

* setSourceEngines -> onSourceEnginesFetch

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-26 21:49:30 -04:00
Scotty Bollinger 17c8a53876
[Workplace Search] Update copy in source settings (#98358)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-26 17:26:44 -04:00