* 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
* 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
* 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
* Remove TableFilterUsersDropdown
* Update button to point to users and roles
* Remove modal and group users logic
* Remove route
* Remove i18n translations
* Fix beta notification to use flex instead of absolute positioning
- probably should have done that from the start
* Remove now-unnecessary `betaNotification*` classes/wrappers
* Rename constants
* Refactor to use alternate heading instead of modal
* Fix i18n order
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* 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
* 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.
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>
* [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>
* 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
* [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>
* 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
* 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
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
* 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>
* 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`
* 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>
* 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
* 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>
* 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>
* 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>
- 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
* 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>
* 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
* 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>
* 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>
* 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>
* 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>