Commit graph

484 commits

Author SHA1 Message Date
Byron Hulcher
662d8a6159
[App Search] Updated copy for Precision Slider step descriptions (#103684)
* Update precision slider description copy

* Fixed a broken (but passing) test
2021-06-29 13:07:33 -04:00
Aurélien FOUCRET
f1719af2d6
Fix crawler URL in the landing page. (#103479) 2021-06-29 08:46:43 -07:00
Vadim Yakhin
51767e7cb9
Use the user-provided source name in SourceInfoCard (#103542) 2021-06-29 10:39:04 -04:00
Jason Stoltzfus
af62b05e3a
Dont record analytics when showing curations (#103558) 2021-06-29 08:24:51 -04:00
Constance
633649460a
[Enterprise Search] Improve flash messages screen reader UX (#103412)
* Remove role region on flash messages

- just `aria-live` is enough for screen readers to read it out, and `role` was causing "Flash messages" to get read out loud repeatedly between page navigation even when empty which was annoying and not good

* Further a11y attribute recommendations from @myasonik
2021-06-28 20:25:24 -04:00
Scotty Bollinger
699c875b21
[Workplace Search] Fix edge case API error (#103574)
This PR fixes an edge case where a race condition mught cause the total_results from a federated content source to come back null from the server. This PR tells the server to expect null in those edge cases to prevent browser errors
2021-06-28 20:18:14 -04:00
Scotty Bollinger
6085f90e2d
[Workplace Search] Port 4 PRs from ent-search to kibana (#103547)
* Poprt #3567 to Kibana

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

* Poer #3582 to Kibana

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

Also adds missing i18n

* Port #3634 to Kibana

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

* Port #3758 to Kibana

* Rename var
2021-06-28 19:20:12 -04:00
Constance
6feea1a506
[Enterprise Search] Distinguish between error connecting vs. 5xx responses from Enterprise Search in UI (#103555)
* Update Enterprise Search request handler to send back an error connecting header

- vs only distinguishing error connecting issues by 502 status

+ clarify comment where this.handleConnectionError is called - for the most part, auth issues should already be caught by 401s in logic above

* Update HttpLogic to set errorConnecting state based on header

+ update tests etc to match read-only-mode state

* [Tech debt] Gracefully handle invalid HTTP responses

I've noticed this error a few times after Kibana gets shut down (http.response is undefined) so figured I would catch it here

* Fix missing try/catch/flashAPIErrors on engines overview

- This is the only http call I found missing a try/catch across our codebase, so we should be set for all views correctly flashing an API error that receive a 5xx response from ent-search

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 18:56:03 -04:00
Jason Stoltzfus
068aef82bc
[App Search] Remove analytics tracking from the entire dashboard (#103534) 2021-06-28 18:45:48 -04:00
James Rucker
b6fb390ea9
[Workplace Search] OAuth flows for Custom Search and Default Search (#101996)
* Add OAuth authorize endpoint support for custom search experiences

* Add support for default search experience authentication

Co-authored-by: scottybollinger <scotty.bollinger@elastic.co>
2021-06-28 18:27:49 -04:00
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