Commit graph

524 commits

Author SHA1 Message Date
Thomas Watson c58148981c
Remove duplicate license comments (#106848) 2021-07-28 08:42:21 -06:00
Jason Stoltzfus 904c370378
[App Search] Added a ReorderableTable component (#106306) 2021-07-28 09:16:43 -05:00
Byron Hulcher 925c9006ef
[App Search] Attempt to add protocols to crawler urls when they are submitted for validation (#106764)
* Add validate_url route to crawler routes

* Add getDomainWithProtocol to crawler add domain form utils

* AddDomainLogic.actions.validateDomain now attempts to fix protocols for urls

* Apply suggestions from code review for AddDomain utils

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

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-07-27 14:26:00 -04:00
Greg Thompson 566c16ac1b
Upgrade EUI to v36.0.0 (#106334)
* eui to v36.0.0

* i18n tokens

* remove temp styled-components types

* euiemptybutton size updates

* betanotification size prop

* i18n snapshot

* functional timeout

* beta badge unit test
2021-07-27 13:12:00 -05:00
Constance 63bedaa285
[Enterprise Search] Set up automated a11y tests (#106765)
* Set up a11y test/config

* Add product card checks

* Add setup guide checks

* Add documentation
2021-07-27 10:27:27 -07:00
Byron Hulcher f7a308859f
[App Search] New Add Domain Flyout for Crawler (#106102)
* Added /api/app_search/engines/{name}/crawler/domains to Crawler routes

* New AddDomainLogic

* New AddDomainFormSubmitButton component

* New AddDomainFormErrors component

* New AddDomainForm component

* New AddDomainFlyout component

* Add AddDomainFlyout to CrawlerOverview

* Use exact path for CrawlerOverview in CrawlerRouter

* Clean-up AddDomainFlyout

* Clean-up AddDomainForm

* Clean-up AddDomainFormSubmitButton

* Extract getErrorsFromHttpResponse from flashAPIErrors

* Clean-up AddDomainLogic

* Remove unused imports

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-25 10:53:17 -04:00
Constance d4eeea49f8
[Enterprise Search] Require security plugin in 8.0 (#106307)
* Change security to a required plugin

* Change typings to reflect non-optional security dep

+ update KibanaLogic to no longer need a {} fallback

* Typings cleanup pt 2

Remove `!`s now that security is required

* Update checkAccess lib

- turns out I need to do a little more than just updating the requiredPlugin arr & types!

- based on my understanding of our 8.0 behavior Enterprise Search will not start if x-pack security is disabled, so we should probably opt to early disable the plugin for simplicity as well

* [PR feedback] yeet
2021-07-20 15:32:12 -07:00
Constance bc4928fd0b
[Enterprise Search] Create reusable EntSearchLogStream component (#105804)
* Set up Kibana dependencies required by LogStream component

- notably, `infra` and `data` - @see https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx#prerequisites

- tsconfig.json note - I believe I missed kibana_react from when we previously started requiring it for KibanaPageTemplate. Because LogStream requires it for KibanaContextProvider anyway I decided to add as a reference just in case

* Set up log source configuration for ent search logs

@see https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx#with-a-source-configuration

or, monitoring plugin also has example usage

* Set up providers required by the LogStream component

@see https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx#prerequisites

Note: there's some overlap in KibanaContextProvider with KibanaLogic that may be worth investigating/DRYing out in the future

* Create reusable EntSearchLogStream component

- light wrapper over LogStream with certain prepopulated defaults

+ Update LogStreamProps from infra team to be exported publicly for reuse (eslint will error otherwise)

* Fix bad type export

- thanks @afgomez!!

* Fix failing security_only nav_links test

- which was caused by `spaces` being required by infra but optional for our plugin. I moved `spaces` to required by `enterprise_search for clarity.

- I'm still not sure I actually fixed the nav_links test correctly. I have almost no memory of adding those lines 12 months ago 🙈

* Fix spaces typing

- remove `?` notation now that it's a required and non-optional plugin
+ reorder required plugins slightly

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-20 13:58:57 -04:00
Scotty Bollinger 4e99580788
Fix Users copy to account for built-in users (#106166) 2021-07-20 08:06:10 -05:00
Chenhui Wang 373d6e2a2e
Use empty string for unassigned Display Settings fields (#105921) 2021-07-17 12:01:55 +08:00
Constance da7c43c1db
[App Search] Fix bash API code example (#106015)
* Fix bash/curl API code example not correctly having `\`s at the end of non-body lines

- Doing this requires removing the `dedent()` fn which is messing up backslashes

- Removing dedent requires setting the template literal indentation to 0 and changing the indent level on DOCUMENTS_API_JSON_EXAMPLE

* I unindented DOCUMENTS_API_JSON_EXAMPLE too hard
- the { is no longer lined up with the [ I think??? what am I even doing with my life
2021-07-16 19:25:55 -04:00
Scotty Bollinger 0f3e4f415f
[Workplace Search] Fix Chrome issues with GitHub sources (#105680)
* Fix route validation

This param is not always required. Was already fixed for org version but the personal dashboard came later and was not fixed.

Original fix for org:
30d8b1dfa8 (diff-07f094b2a4719e8511f003d8e278a77cd6b808d11b14d1c528705f9b259c328fR373)

* Fix route to account for private github route

Previously had the org route hard-coded

* Move the logic for parsing the query params to template

Because the useEffect call comes after the initial render, the chrome flashes. We originally got around this by hiding the chrome always because in non-github scenarios, this worked fine.

However, because the oauth plugin sends the state in the quert params and uses the same URL, we need to parse that to determine whether this is an org or accoutn route. We now do that logic in the template and set the chrome before calling the useEffect.

We still need to pass both the parsed params and the original quert string because the redirect passes that string to the next view.
2021-07-14 19:44:49 -04:00
Jason Stoltzfus 02cd5086bc
[Enterprise Search] Added Thumbnails to Search UI (#104199) 2021-07-14 15:40:05 -04:00
Jason Stoltzfus fd0cd860a4
Translate App Search credentials list (#105619) 2021-07-14 15:39:13 -04:00
Scotty Bollinger 41bd4b287d
Fix rendering bug where line on logo in v7 theme (#105481) 2021-07-14 12:02:11 -04:00
Scotty Bollinger e5c3065adf
Handle edge case for GitHub oAuth URL mismatch (#105302)
* Hangle edge case for github oauth mismatch

* Fix grammar

* Refactor test
2021-07-13 15:36:57 -04:00
Vadim Yakhin fdc99681a7
[Workplace Search] Port PR 4033 from ent-search to Kibana and update typings (#105054)
* Improve typings

Custom API Source allow indexing several types of data. We didn't
account for all of them.
For example, geolocation can be array of arrays of numbers.

This commit improves typings.
The following commits mostly fix TS errors
that appear after this commit.

* Remove type castings to account for all possible variable types

* Update helper functions to accept new CustomAPIFieldValue

* Fix TS error: convert url to string before using it in EuiLink

* Update mock and tests to match updated typings

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-12 17:20:48 -03:00
Scotty Bollinger 0121dee9a4
Hide heading when page loading (#105263) 2021-07-12 14:36:59 -04:00
Constance afc07c376f
[Enterprise Search] Update README/description (#105151)
* Update plugin README with beta copy & fancier product info

* Update API dev docs plugin description punctuation

* Update README dev section

- Remote reference to native auth - no longer applicable in 7.14
- Add reference to Getting Started guide (Elastic only)

* Run node scripts/build_plugin_list_docs to update https://www.elastic.co/guide/en/kibana/master/plugin-list.html

* Add link to main Kibana README
- which should link out to their contributing docs
2021-07-12 13:51:38 -04:00
Jason Stoltzfus a80791aa4c
Pass locale to calendar (#105134) 2021-07-12 10:26:41 -04:00
Constance 1739b55f94
[Enterprise Search] Fix Error Connecting view not displaying for auth issues (#105125)
* Fix ent-search authentication to show the error connecting screen

Missed this in #103555

* [Misc] updoot handleConnectionError order/spacing to match

- why? because i've lost control of my life, probably
2021-07-09 17:31:01 -04:00
Jason Stoltzfus fdd37e3cfb
Fixed description on Ent Home (#105122) 2021-07-09 17:14:37 -04:00
Scotty Bollinger 65bc4a9c0e
[Workplace Search] Remove users from groups views (#105108)
* Remove user list from groups table

* Remove users table from group overview

* Lint
2021-07-09 14:53:15 -05:00
Constance facaeb7d65
[App Search] Relevance Tuning: Fix unsaved changes bug (#104951)
* Fix unsavedChanges false positive when MultiInputRows is present

- The fix for this is to change MultiInputRows from useEffect to useUpdateEffect, which prevents onChange from firing on initial mount/render (triggering updateBoostValue->unsavedChanges)

@see https://github.com/streamich/react-use/blob/master/docs/useUpdateEffect.md

* Fix precision tuner not triggering unsavedChanges
2021-07-09 09:23:18 -07:00
Vadim Yakhin 48fa754042
Replace cmd with bash as EuiCodeBlock language (#105065)
cmd is no longer supported by 3rd party library used by EuiCodeBlock
2021-07-09 12:11:14 -04:00
Constance 07bd76c2a3
[App Search] Result Settings: Max size input fixes (#104755)
* Fix "Max size" number inputs cutting off the "No limit" placeholder text on Chrome/webkit

- textOnly={false} is required for the input to expand in width

* Fix handleFieldNumberBlur behavior:
- should allow setting a number field back to empty/no limits

- dev note: '' is the blank/empty state, which gets parsed to NaN. Random invalid strings ALSO get parsed to '', which is NaN

* Fix input not clearing invalid non-number strings

For some really odd reason, '' and undefined aren't correctly resetting the input value when a string gets entered into the input. I had to add a space for EUI to actually start clearing it

Note that this change completely prevents users from writing non-numbers into the input at all, but this is probably fine/valid honestly
2021-07-08 08:58:59 -07:00
Constance 9744de2a1a
[Workplace Search] Fix download diagnostics button (#104792)
* EnterpriseSearchRequestHandler: Create new hasJsonResponse param
- in place of try/catch previously added for an empty response

- we should instead attempt to handle all non-JSON responses manually, as they're (currently) the outlier

* Update AS sample engine/onboarding route with hasJsonResponse: false

- as this was the original route that added the try/catch
- should still work without it now

* Update WS source download diagnostic route with hasJsonResponse: false

- this was the original impetus for the non-JSON feature request - WS needs the ability to download JSON files directly

* Update Download Diagnostics filename to match standalone UI

* Fix misc routing issues in Source Settings

- `/api` route is missing Kibana basepaths (affects both dev modes and users who have Kibana canonically set to a non-root URL)

- We shouldn't be using RR's native <Link>, but instead our RR helpers which use Kibana's instance of RR history
2021-07-08 08:16:49 -07:00
Scotty Bollinger 60a9eb9e84
[Workplace Search] Remove groups user management and filter (#104734)
* Remove TableFilterUsersDropdown

* Update button to point to users and roles

* Remove modal and group users logic

* Remove route

* Remove i18n translations
2021-07-08 08:40:52 -05:00
Constance dea450c5c4
[Enterprise Search] Fix beta notification in sidebar (#104763)
* Fix beta notification to use flex instead of absolute positioning

- probably should have done that from the start

* Remove now-unnecessary `betaNotification*` classes/wrappers
2021-07-07 18:49:26 -04:00
Constance 7af3be0655
Fix engine routes that are meta engine or non-meta-engine specific (#104757)
- to include conditionals in their routing

- this matches their nav link behavior - we should have checks in routes as well just in case
2021-07-07 17:51:28 -04:00
Scotty Bollinger b20669eaf3
[Workplace Search] Fix Media Type field preview is unformatted bug (#104684)
* Add mimeTypes util

* Properly format mimeTypes
2021-07-07 13:45:49 -04:00
Scotty Bollinger 979c6e8031
[Workplace Search] Refactor OAuth permissions modal to be a conditional heading (#104323)
* Rename constants

* Refactor to use alternate heading instead of modal

* Fix i18n order

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-07 10:09:55 -05:00
Scotty Bollinger 874882ead8
[Workplace Search] Fix bug where error was behind modal stuck in loading state (#104360)
* Fix an issue from previous PR

In https://github.com/elastic/kibana/pull/104024, the error handling incorrectly used the `message` property on the response, when it should have been the attributes.errors array.

* Use inline error for duplicate name
2021-07-07 09:42:21 -03:00
Scotty Bollinger 5baff65863
[Workplace Search] Fix a couple of Source Display settings bugs (#104355)
* Remove `exact` prop on route

This was preventing the rendering of the subroute. Not sure why it was working before

* Replace `EuiFlexGrid` with `EuiFlexGroup`

Again, not sure why this was chosen, but although the EuiFlexGrid component renders fine in the standalone UI, it does not look correct in Kibana. EuiFlexGroup seems to render as intended.
2021-07-07 09:39:40 -03:00
Vadim Yakhin 1b92c29d18
Fix Overview page crashing (#104258)
The activity feed tried to render a link to a source for activity items like
"New user joined organization". This couldn't be done and the page crashed.
This PR accounts for this case by rendering an item with no link for such cases.

This was already fixed before in ent-search in https://github.com/elastic/ent-search/pull/2574
But we didn't port the PR, because we thought there is no need to port a part
of Standard auth functionality. Turned out there is.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-05 11:45:43 -04:00
Scotty Bollinger 068112049a
[Enterprise Search] Fix bug in Add Schema modal (#104024)
* [Enterprise Search] Fix bug in Add Schema modal

This PR fixes a bug where an error passed from the server was not rendering and was causing the UI to hang. The problem is that the `body` property was missed in the error object.

* Use default message when error response for actions.setServerField has no message

* i18n-ize default error message

* Remove TODO

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-02 11:25:41 -03:00
Constance 0673aab33d
Remove role=alert attribute from flash messages (#103937) 2021-06-30 15:02:18 -04:00
Vadim Yakhin 712ab004c5
Port PR 3746 from ent-search (#103765)
* Port the changes as is with no modifications

* Fix accessibility errors

* Rename variable

* Fix Stylelint issues and remove unused CSS

* Extract getAsLocalDatetimeString as a util function and use it everywhere

* Update backend schema

Also replace schema.maybe with schema.nullable. Previously assigning
"Leave unassigned" value to subtitle and description caused a server error,
because we were receiving null for these values that server did not expect.

* Update exampleResult mock

* Add tests for DisplaySettingsLogic

* Add tests for ExampleSearchResultGroup

* Add tests for ExampleStandoutResult

* Add tests for SearchResults

* Add missed null fallback type
2021-06-29 21:11:09 -04:00
Caroline Horn 7d45fcf8ee
[Page layouts] Some light fixes (#103197)
* [Solution Toolbar] Fixing button border on non-text color versions

* [Alerts] Removed extra wrappers and use EuiPageHeader

* [Logstash] Basic conversion to template

* [Reporting] Adding bottomBorder to page header

* [ML] Fix display of main navigation tabs

* [Stack Management] Fix side nav not updating when going back to landing page

* [Tags] Add spacing after page header

* [License Management] Full width on file uploader

* [Page Template] Fixed `emptyState` default template for pages with side nav

* [Infra] Removing some page header displays in empty states

* [Enterprise Search] Fix some error layouts

* [Index Patterns] Quick fix for empty state

* snaps

* [Page Template] Remove forced padding when `centeredBody`

* small hack for tab padding for ml

* scroll ML page to fix test

* fix test method type signature

Co-authored-by: Dave Snider <dave.snider@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michail Yasonik <michail.yasonik@elastic.co>
2021-06-29 19:50:15 -05:00
Constance 8d49e27002
[App Search] Update delete copy to indicate immediate deletion (#103700)
* Update delete copy to immediate deletion

- David recently changed our dashboard action to invoke an index refresh, which means it should be a synchronous action now

* Run node scripts/i18n_check --fix
2021-06-29 14:41:25 -04:00
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