Commit graph

524 commits

Author SHA1 Message Date
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
Constance 9b2d0c3354
[App Search] Fix error connecting state (#98234)
* Fix ErrorConnecting state to be caught/returned earlier

- This fixes AppSearch crashing when in an error connecting state and missing props required for AppSearchConfigured

- This also fixes the error connecting page not showing up for engine routes

- The SetupGuide route was moved to a top-level route, so that all views always have access to it no matter what

* [Extra] Simplify engine route/path

- Move engine/route path under the main <Layout>

- Change <AppSearchNav> behavior to pass subNavs based on route matches, rather than requiring a prop passed to it

+ add useRouteMatch mock

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-26 16:09:31 -04:00
Scotty Bollinger 4efbe8d1e7
[Workplace Search] Fix an issue where lack of host hid chrome (#98315) 2021-04-26 12:20:38 -05:00
Jason Stoltzfus 1351510ce8
Creating a stub page for Search UI (#98069) 2021-04-26 12:53:23 -04:00
Scotty Bollinger f0a3244f54
[Workplace Search] Redirect to correct route for form created sources (#98215)
* [Workplace Search] Redirect to correct route for form created sources

* Remove unnecessary passing of query params

This is no longer needed with the new route

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-26 11:52:27 -04:00
Scotty Bollinger fec07b766f
[Workplace Search] PR#3362 to Kibana (#98207)
* Add StatusItem component

* Replace tooltip with new popover

* Consistant spacing

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-26 11:49:29 -04:00
Constance a510c27565
[App Search] Synonyms: initial logic, cards, & pagination (#98101)
* Set up initial SynonymsLogic

* Set up SynonymCard & Icon components

* Set up EmptyState component

* Update Synonyms view with new components
2021-04-23 17:14:51 -07:00
Davey Holler 4eb6c22bcc
[App Search] UI polish - empty states (#97875)
* Empty State in Curations

* Adds Empty State to Documents View

* Updates Empty State in Engines Overview

* Updates Relevance Tuning empty state

* Updates the Result Settings empty state

* Updating test files.

* Display the empty state in the table only

* Copy changes

Small copy changes to bring it more inline with Elastic guidelines

* Update api_logs_table test

* Copy adjustments

* Fixing failing type check

* Copy adjustments on credentials empty state

* Copy changes on meta engines table

* Removes emptyState__prompt class

* Removes emptyState__prompt class

Forgot to save a file

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

* Adding the popout icon to docs links

* Removes the need  for the engineIcon class

Also allows EuiIcon props to be passed to metaEngineIcon

* Updates meta engine empty state button to docs link

* Adds a separate constant for the empty meta engine button

* Meta Engines empty state refactor

- pull it out to its own component
- simplify tests
- simplify constants, they're only in 1 location so prob don't need to be in DRY'd out
- fix some i18n IDs

* Curations refactor

* Documents empty state refactor

 - create components/ folder, move document creation button to there (feels like it belongs)
 - move empty state there
 - remove other empty state prompt from SearchExperienceContent??? Not sure why that wasn't showing up, but fixed tests/returns

* Relevance Tuning refactor

- create components/ folder
- move empty state + shared boost icon & value badge to it
- write test for missing value badge coverage

MISC
- Fix loading screen to an early return (matches UI of all other views)
- Remove extra EuiSpacer in layout (matches UI of all other views)

Sorry for the extra noise in your PR Davey!

* Result Settings refactor

- move empty state to its own component
- fix broken .html.html link

* Fix missing popout icon on documentation button link

* EnginesOverview cleanup

- Remove unnecessary CSS
- fix responsive behavior of icons
- standardize responsive behavior of create button actions
- standardize spacing between content headers & tables
- Tweak gap between 2 tables

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
2021-04-22 21:43:14 -04:00
Jason Stoltzfus fc45de9fd0
Don't hungry mock within mocks (#98040) 2021-04-22 16:25:07 -04:00
Constance 94e5acd147
Update synonyms API routes (#98046)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-22 16:24:36 -04:00
Jason Stoltzfus 8bbf9c0e28
[App Search] Disabled Save button when nothing selected (#97896) 2021-04-22 11:50:38 -04:00
Scotty Bollinger 65287dffad
[Enterprise Search] Fix unstyled UI for Schema Errors (#97776)
* Refactor main component

* Refactor faux view button

The original design called for a button-looking component on the accordion header so it looks clickable to reveal the error underneath. Using a button element caused the console to error because the entire header is a button and this is a child. Adding an href fixes the error and allows for styling as a button

* Use empty button rather than styles components for view button

* Remove extra classNames and fix layout to stretch cells

* Add stylesheet

Without the width: 100% on .euiIEFlexWrapFix, the header table does not stretch across the screen. Couldn’t find another way around this and happy to take suggestions of a better idea.

* Add prop to prevent line break on IDs

Existing implementation was causing multi-character IDs to break to a new line. So for 12, its was:

1
2
2021-04-22 09:43:53 -05:00
Scotty Bollinger 649a2e01fc
[Workplace Search] PR#3358 to Kibana (#97921)
* Render flash message when server sends back an error

* Fetch data on all route changes

This produced a bug where the nav and loading states were triggered between route changes. Added conditional to prevent resetting between in-source changes
2021-04-22 08:01:45 -05:00
Jason Stoltzfus 6e64e15f95
[App Search] Remove unknowns: 'allow' from enterprise_search routes (#97510)
* Remove unknown allows from enterprisesearch routes

It is a best practice to avoid `unknowns: allow` in request
body validations.

Usage of `unknowns: allow` in the App Search plugin has primarily
been to avoid creating full validation schemas, as they can often
be complex.

Rather than have a half-baked validation that uses `unknowns: allow`,
we have the option to skip parsing and validating a JSON body entirely,
and simply pass it through "as-is" to the enterprise_search server
for validation.

* Move to helper

* Swap comment block style

* PR feedback

* Update x-pack/plugins/enterprise_search/server/lib/route_config_helpers.test.ts

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

* Update x-pack/plugins/enterprise_search/server/lib/route_config_helpers.test.ts

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

* Update x-pack/plugins/enterprise_search/server/lib/route_config_helpers.ts

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

* Update x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts

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

* Better TS

* Change to TS validations

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-04-21 16:53:08 -07:00
Constance 1985e0a1c0
Improve focus UX of MultiInputRows (#97695) 2021-04-21 10:28:25 -07:00
Scotty Bollinger 216304b0bd
[Workplace Search] Add target _blank to search link (#97702) 2021-04-20 16:20:50 -04:00
Jason Stoltzfus b57abad9dc
[App Search] 2 fixes for Result Settings (#97179) 2021-04-20 08:12:53 -04:00
Constance 283e2ca798
[App Search] Synonyms set up (#97187)
* Add barebones Synonyms view

* Update Synonyms route+nav link

* Add server API routes

- will be used in upcoming PRs, may change

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-19 13:35:22 -04:00
Scotty Bollinger 08b5f0db2f
[Workplace Search] Fix doc link, remove shadows on panels and fix source id bug (#97482)
* Fix private source docs link

* Add a whole bunch of missed shadow/background changes to panels

* Add success messages to Role mappings

* Fix bug where sourceId still in memory

If you were on an org source and then clicked to view your Personal dashboard, the subnav was visible because the source Id was still in the logic file. This resets it on unmount.

As a part of this fix, dataLoading was set to true on reset. Because of this, some places that were resettings state, but not fetching new data, were left in a loading state. This commit also removes the redundant `resetSourceState` calls around the components that don’t fetch a fresh copy of the source data
2021-04-19 12:27:37 -05:00
Scotty Bollinger 3a32817a7a
[Workplace Search] Add ErrorReasons fix from ent-search (#97299)
Ports https://github.com/elastic/ent-search/pull/3393 to Kibana
2021-04-15 16:23:59 -04:00
Constance 2a281c99c6
[App Search] Refactor out a shared MultiInputRows component (#96881)
* Add new reusable MultiInputRows component

- basically the CurationQuery component, but with a generic values var & allows passing in custom text for every string

* Update CurationQueries with MultiInputRows

* Update MultiInputRows to support on change behavior

- for upcoming Relevance Tuning usage

* Update Relevance Tuning value boost form to use new component

- relevance_tuning_form.test.tsx fix: was getting test errors with mount(), so I switched to shallow()

* Change submitOnChange to onChange fn

- more flexible - allows for either an onSubmit or onChange, or even potentially both

* Convert MultiInputRowsLogic to keyed Kea logic

- so that we can have multiple instances on the same page - primarily the value boosts use case

* Update LogicMounter helper & tests to handle keyed logic w/ props

* [Misc] LogicMounter helper - fix typing, perf

- Use Kea's types instead of trying to rewrite my own LogicFile
- Add an early return for tests that pass `{}` to values as well for performance

* PR feedback: Change values prop to initialValues

+ bonus - add a fallback for initially empty components
+ add a test to check that the logic was mounted correctly

* PR feedback: Remove useRef/on mount onChange catch for now

- We don't currently need the extra catch for any live components, and it's confusing
2021-04-14 18:11:25 -04:00
Jason Stoltzfus e9eff7181a
Fixed relevance tuning (#97172) 2021-04-14 16:50:42 -04:00
Scotty Bollinger af9129b584
[Workplace Search] Source row and Group Manager Modal bugfixes (#97166)
* Add spacing to group manager modal

* Add error state to source row

This mimics the design pattern from the overview page
2021-04-14 16:25:59 -04:00
Scotty Bollinger 3bc2952216
[Workplace Search] Bypass UnsavedChangesPrompt for tab changes in Display Settings (#97062)
* Move redirect logic into logic file

* Add logic to prevent prompt from triggering when changing tabs

The idea here is to set a boolean flag that sends false for unsavedChanges when switching between tabs and then sets it back after a successful tab change

* Keep sidebar nav item active for both tabs

* Add tests
2021-04-14 13:28:00 -04:00
Jason Stoltzfus ec6f652cc5
[App Search] Remaining Result Settings work (#96974) 2021-04-14 12:14:57 -04:00
Scotty Bollinger fe00b68aa2
[Workplace Search] Update ID label to Source Identifier (#96970) 2021-04-14 11:39:56 -04:00
Scotty Bollinger 366a537d37
[Workplace Search] Add breadcrumbs to Role mappings (#97051)
* Update Workplace Search nav to align with App Search

* Add constants to shared

* [App Search] Use shared constants

* [Workplace Search] Add breadcrumbs to Role mappings

* Enable shouldShowActiveForSubroutes
2021-04-14 08:25:18 -05:00
Scotty Bollinger 1630c14a15
[Workplace Search] Remove shadows from Source overview panels (#97055) 2021-04-14 10:14:12 -03:00
Byron Hulcher 71672c4c38
[App Search] Migrate expanded rows for meta engines table in Engines Overview (#96251)
* Pull out columns to be re-used for MetaEnginesTable

* Add route to get source engines for meta engines

* New MetaEnginesTableLogic

* New MetaEnginesTable component

* Remove isMeta prop from EnginesTable

* Swap EnginesTable with MetaEnginesTable in EnginesOverview for meta engines

* Missing test for MetaEnginesTableNameColumnContent

* Created new /app_search/components/engines/components/tables directory

* Moving columns to shared_columns.tsx file

* Updates to MetaEnginesTableExpandedRow and MetaEnginesTableNameColumnContent

* Fixes to EnginesTable, MetaEnginesTable, MetaEnginesTableLogic

* Remove flatten import

* Fix i18n

* PR Feedback

* DRY out shared engine link helpers

* DRY out shared ACTIONS_COLUMN

* Tests: DRY out shared columns/props tests

+ update to account for 2 previous DRY commits (e.g. deleteEngine mock)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
2021-04-13 21:15:37 -04:00
Scotty Bollinger 448562f758
[Workplace Search] Hide Kibana chrome on 3rd party connector redirects (#97028) 2021-04-13 16:57:38 -04:00
Constance d774a41aef
[App Search] Add small engine breadcrumb utility helper (#96917)
* Add new getEngineBreadcrumbs utility helper

* Update all routes passing engineBreadcrumb as a prop to use new helper
2021-04-13 12:56:22 -07:00
Scotty Bollinger 93e270e60a
[Enterprise Search] Design Pass: Role mappings (#96882)
* Update shared button color and panel shading

* Vertically align table cells to top

* [App Search] Update panels to have backgrounds not borders

* [Workplace Search] Update panels to have backgrounds not borders

* re-align last cell to right

Accidentally deleted it refactoring

* Conditionally have border for App Search

Requested to remove for empty state
2021-04-13 10:31:00 -03:00
Constance f4bc0d61a1
Update create meta engine button to match create engine (#96884) 2021-04-12 18:55:04 -04:00
Scotty Bollinger 4d593bbc08
[Workplace Search] Design polish: Groups, Security and Custom source (#96870)
* Add missing i18n

Oops

* Change button color

* Fix custom source created screen

* Add better empty state to groups

* Align toggle to right side of table

* Update design for security page
2021-04-12 18:27:23 -04:00
Scotty Bollinger 31c1a08384
[Workplace Search] Design polish: Configure and connect source (#96851)
* Update ‘How to add’ view

* Update config completed view

* Update add source connect page

* Remove padding on how to add card

Original had no padding.
2021-04-12 15:28:12 -04:00
Constance 171f39821a
[App Search] Results follow-up (#96709)
* CSS cleanup

* Refactor ResultActions component + DRY out link behavior

- Create new separate ResultActions component
- Pass actions array through to header and have haeder in charge of conditional visibility / FlexItem wrapper (this matches the other header items)
- shouldLinkToDetailPage: instead of generating custom JSX, just have it be a standard action and append it to the actions array

Link behavior:
- ResultHeaderItem - switch to EuiLinkTo, no need for extra wrapper
- ResultHeader - DRY out unnecessary extra path generation - instead pass down a conditional documentLink instead of a bool

* PR feedback: Fix test name

* PR feedback: unshift

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-12 15:12:33 -04:00
Jason Stoltzfus b4d330219a
[App Search] Add header details to the Result Settings page (#96623) 2021-04-12 13:38:44 -04:00
Jason Stoltzfus baac478ff3
[Enterprise Search] Allow jest script to run on individual files (#96589) 2021-04-12 13:33:45 -04:00
Vadim Yakhin 47df866223
[Enterprise Search] Add missing and remove redundant breadcrumbs (#96636)
* Workplace Search: Remove redundant Overview breadcrumb from Sources

There is "Source name" breadcrumb that is used for Overview page

* App Search: remove "Overview" breadcrumb from Engine page

So instead of `engines / national-parks-demo / overview (greyed)`
we will have just
`engines / national-parks-demo (greyed)`

* App Search: Add "Engines" breadcrumb to the main App Search page

This needs to be added to 3 states of the page: Normal, Empty and Loading

* Fix failing WS test

* App Search: DRY out SetPageChrome declaration by putting it in header

* Fix failed test "ShallowWrapper::dive() can only be called on components"

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-12 13:04:06 -04:00
Davey Holler 0bf57a2447
App Search: Result Component Updates (#96184)
* Starting work on result component

* Write tests

* Fix types

* Cleanup

* Fix type errors

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-08 15:51:39 -07:00
Constance e6e3b16ee1
[Enterprise Search] Change last breadcrumb to inactive/non-linked breadcrumb (#96489)
* Update our EUI breadcrumb helper to skip generating links for the last breadcrumb in the list

* Fix useEuiBreadcrumbs tests

- add a describe block to make it clear we're testing link behavior in non-last breadcrumbs
- add a helper that automatically adds a last breadcrumb so that link generation still works

* Add comment/note as to why I didn't add last-breadcrumb-specific logic to useGenerateBreadcrumbs
2021-04-07 17:18:36 -04:00
Davey Holler 8e1bd9ccf3
App Search Polish (#96345)
* Button adjustments to Engine Overview page

* Subdued preview panel color

* Vertically aligns "manage fields" and "preview"

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-07 10:37:14 -07:00
Scotty Bollinger 92b659dae0
[Workplace Search] Add AccountHeader to Personal dashboard (#96353)
* Revert change to wrap setContext in useEffect

A recommendation was made to wrap the setContext call in a previous PR, which lets the app know if the context is org or account, in a useEffect call, for potential performance reasons. Unfortunately, this causes the lifecycle to change so that changing routes from org to personal dashboard does not register the change in time. This commit changes it back to a working state.

* Add constants and routes for Account nav

* Add AccountHeader component

* Add header to layout and fix height

The main layout stylesheet, https://github.com/elastic/kibana/blob/master/x-pack/plugins/enterprise_search/public/applications/shared/layout/layout.scss gives a static height that includes the main Kibana navigation. The height with the account nav only is added to the existing privateSourcesLayout css class

* Refactor test
2021-04-07 13:01:26 -04:00
Jason Stoltzfus 818a740033
[App Search] Added a query performance rating to the Result Settings page (#96230) 2021-04-07 11:56:31 -04:00
James Rucker 4610764426
Fix reauthenticate links for OneDrive and SharePoint (#96271)
For both OneDrive and SharePoint we define a service_type that has an
underscore in the middle (one_drive and share_point). This fixes the
route definitions so sources of these connector types can be
reauthenticated.
2021-04-06 12:19:23 -07:00
Constance 56d9f3d968
[App Search] API logs: Add log detail flyout (#96162)
* Set up helper for showing JSON request/response bodies

* Set up mock API log obj for tests to use

* Add ApiLogLogic file for flyout handling

* Add ApiLogFlyout component

* Update views to load flyout

* Update table to open flyout

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/utils.ts

* PR feedback: comments

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>

Co-authored-by: Byron Hulcher <byronhulcher@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 16:48:00 -04:00
Mikhail Shustov e457f212c4
Revert "TS Incremental build exclude test files (#95610)" (#96223)
This reverts commit b6e582c53e.
2021-04-05 11:59:26 -07:00
Jason Stoltzfus ad5f83a362
[App Search] Added Sample Response section to Result Settings (#95971) 2021-04-05 13:49:54 -04:00
Scotty Bollinger ea03eb1bab
[Enterprise Search] Expose core.chrome.setIsVisible for use in Workplace Search (#95984)
* Hide chrome for Workplace Search by default

The Workplace Search Personal dashboard needs the chrome hidden. We hide it globally here first to prevent a flash of chrome on the Personal dashboard and unhide it for admin routes, which will be in a future commit

* Add core.chrome.setIsVisible to KibanaLogic

* Toggle chrome visibility for Workplace Search

* Add test

* Refactor to set context and chrome when pathname changes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 11:27:05 -04:00
Scotty Bollinger 123f3400a8
[Workplace Search] Add sub nav and fix rendering bugs in Personal dashboard (#96100)
* Fix route for private deferated source summary

* Make schema types nullable

Federated sources don’t have counts and the server returns null so our routes have to expect that sometimes these values will be null

* Add SourceSubNav to Personal dashboard

We are able to leverage the existing component with a couple a small change; the existing componet is a subnav in the larger Enterprise Search shared navigation component and does not include its styles. This caused the list items to render with bullet points next to them. Adding this class and displaying the nav items as block elements fixes this issue.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-05 11:19:32 -04:00
Constance c97c51876e
Remove incorrect error toast on successful poll (#96159) 2021-04-02 17:28:18 -04:00
Jason Stoltzfus 82f7b2127e
Move trs to be under tbody in ResultSettings (#96132)
This was causing console errors.

I factored out the column headers to their own component, and moved
all table rows to be under a tbody. This alleviates the console
warnings.
2021-04-02 13:24:04 -04:00
Constance 1d58266559
[Enterprise Search] Add toasts support to FlashMessages component (#95981)
* Add toasts to FlashMessagesLogic

+ Tests cleanup:

- Group actions by their reducer blocks (since flashMessages has such specific logic) - recommend viewing with whitespace changes off for this
- Do not reset context between each test, but instead by mount(), which allows tests to maintain state between adding/removing/resetting
- Remove '()' from test names (feedback from previous PRs)

* Add toast message helpers

+ refactor FLASH_MESSAGE_TYPES to constants, so that both callouts & toasts can use it effectively

* Update FlashMessages to display toasts as well as callouts

- This means we can automatically use toasts alongside callouts in all views that already have FlashMessages

+ a11y enhancement! update callouts to also announce new messages to screenreaders

* [Example] Update ApiLogsLogic to flash an error toast on poll

+ update copy to better match EUI guidelines (shorter)

* Fix test caused by new FlashMessages structure

* PR suggestion - destructure

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>

* PR feedback: implicit return

* Fix color types

- adding our own string enum fixes the typescript errors that both EuiCallout & EuiToast emit when passing color props to the base EUI types

* PR feedback: Update flashToast API to match callout helper API

- accepts a string title with optional args, creates a unique ID automatically if missing

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
2021-04-02 09:50:39 -07:00
Scotty Bollinger fb681d9062
[Workplace Search] Fix broken reauthenticate URLs and fix spelling (#96140)
* Remove kebabCase

Kibana routes are snake case, which matches the existing serviceType, so this is no longer needed

* Fix route segment

The word reauthenticate is not hyphenated

* Fix all misspelling of reauthenticate

Renames files too
2021-04-02 12:41:27 -04:00
Constance 3237fd0637
[Enterprise Search] Fix eslint import rule not ordering sibling mocks with parent mocks (#96070)
* Enterprise Search eslint import order rule fix
- mocks in current folder should be grouped with mocks from parent folders

* Run --fix/update instances of importing ./__mocks__
2021-04-02 09:05:53 -04:00
Constance 7db838e0b8
[App Search] API Logs: Add ApiLogsTable and NewApiEventsPrompt components (#96008)
* Set up getStatusColor util for upcoming EuiHealth components

* Add ApiLogsTable component

* Add NewApiEventsPrompt component

* Update ApiLogs view with new components

+ add EuiPageContent wrapper (missed this originally)

* Update EngineOverview with new components

* PR feedback: Comments + mock FormattedRelative

* Fix type error
2021-04-02 08:49:12 -04:00
Constance df8166f20e
[App Search] Update instances of EuiPanel/EuiPageContent to bordered or filled panels (#96090)
* Add hasBorder to all EuiPageContent panels

* EngineCreation: switch EuiPageBody to EuiPageContent
+ add hasBorder

* Credentials: update EuiPanels w/ hasBorder

* ApiCodeExample: switch to hasBorder

* DataPanel: update to take & pass hasBorder prop

* Analytics & EngineOverview: use hasBorder

* Relevance Tuning: update EuiPanels

- switch to hasBorder for top level panels
- switch to color="subdued" for boost accordion
- tweak padding of boost panel
- CSS cleanup

* Role Mappings: switch to hasBorder

+ remove unused class - `euiPanel--disabled` was not applying any styles
+ remove random 'export' string

* Sample engine CTA: switch to subdued panel
+ fix sizing - when loading button pops in, it was causing text to overflow
2021-04-01 17:54:53 -04:00
Mikhail Shustov b6e582c53e
TS Incremental build exclude test files (#95610)
* add base config for all the TS projects

* all the project use new tsconfig.project.json

* compile test files in the high-level tsconfig.json

* fix TS error in maps plugin

* fix TS error in infra plugin

* exclude mote test and test until folders

* uptime. do not import test code within prod code

* expressions. do not import test code within prod code

* data: export mocks from high level folder

* task_manager: comply with es client typings

* infra: remove unused enzyme_helpers

* check_ts_project requires "include" key

* ts_check should handle parent configs

* all ts configs should extend base one

* exclude test folders from plugins

* update patterns to fix ts_check errors

* Apply suggestions from code review

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

* uptime: MountWithReduxProvider to test helpers

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-01 14:40:47 +02:00
Ryan Keairns b301d416b7
Update Cloud plugin to handle new config in kibana.yml (#95569)
* Handle cloud urls from kibana.yml

* Add types to utils params

* Update utils

* address nits

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-31 07:49:50 -05:00
Jason Stoltzfus 80a19a86d7
[App Search] Result settings form (#95462) 2021-03-30 17:07:16 -04:00
Constance 53d4fa7052
[App Search] API logs: Server route + ApiLogsLogic + useEffects (#95732)
* Set up API route

* Set up API types

* Set up date util needed by filters dates

* Add ApiLogsLogic

* Update ApiLogs and EngineOverview views with polling behavior

* Add API type notes - maybe serves as a TODO to clean up our API data some day
2021-03-30 14:35:54 -04:00
Scotty Bollinger c6b37dec70
[Workplace Search] Add download diagnostics button to source settings (#95726)
* Add routes

* Add button to UI
2021-03-30 10:07:58 -03:00
Byron Hulcher e91d0d4a76
[App Search] Add a Sample Engine CTA panel to the engines table when empty (#94647)
* Added new onboarding complete route for App Search

* Allow responses without JSON bodies in Enterprise Search

* New SampleEngineCreationCtaLogic

* New SampleEngineCreationCta component

* Add SampleEngineCreationCTA to engines EmptyState

* Improve SampleEngineCreationCta

* Fix spelling error in Enterprise Search request handler test

* Improve SampleEngineCreationCtaLogic

* Fix types

* Fix tests after origin/master merge

* Turns out I 'fixed' my tests by removing this test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-30 06:49:02 -04:00
James Rucker 4c89da2b45
[Workplace Search] Send kibana_host when calling /reauth_prepare (#95529)
* WIP almost there?

* Fix server route validation

* fix account route

* Fix test expectations

Co-authored-by: scottybollinger <scotty.bollinger@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-29 21:49:16 -04:00
Scotty Bollinger 73f60e132d
[Enterprise Search] Fix bug in indexing status (#95719)
* Add interface

The component was already passing the props the logic file needed, they just aren’t listed in the interface

* Pass props to logic file

Also destructures from props to prevent collision with the local logic values that are repopulated when data is fetched.

* Update logic file to use props for default values

* Fix test and use spy

* Remove resetContext

No longer needed!
2021-03-29 20:59:21 -04:00
Constance 35d0ac8d1c
[App Search] Remove API logs/Analytics-specific unavailable logic (#95601)
* EngineOverview: Remove apiLogsUnavailable logic & UnavailablePrompt

* Analytics: Remove analyticsUnavailable logic & AnalyticsUnavailable

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-29 14:00:32 -04:00
Constance 04340d3ad1
[Enterprise Search] DRY out various repeated action button copy (#95114)
* DRY out repeated button/table/modal actions copy to a shared file

* DRY out 'Edit' copy

* DRY out 'Delete' copy

* DRY out 'Save' copy

* DRY out 'Cancel' copy

* DRY out 'Continue' copy

* DRY out 'Close' copy

* DRY out 'Manage' copy

* DRY out 'Update' copy

* [WS] DRY repeated 'Update'/'Save'/'Cancel' copy

* [AS] DRY out 'Restore defaults' button

- used on 2 pages so far, and will also be used on result settings

* PR feedback: Add _BUTTON_LABEL specificity
2021-03-29 13:57:25 -04:00
Jason Stoltzfus 3f86bab334
[App Search] Refactor Result Settings logic (#95531) 2021-03-29 12:54:20 -04:00
Larry Gregory 31ea160fc7
Move production dependencies out of devDependencies (#93997)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-26 15:23:45 -04:00
John Barrier Wilson 593b03fc60
[Workplace Search] Design polish: overview page (#95363)
* Rework panels to subdued style

* Fix button when source has been onboarded

* Update content_section test for EuiSpacer

* Update content_section test for EuiSpacer Length

* Lint fix for onboarding_card

* Remove spacer size due to default

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>

* Remove test line for Spacer now that size=default

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-26 14:09:45 -05:00
Constance 6b59fe3d01
[App Search] Refactor EuiPageHeader components to use new props instead of children (#95454)
* Update EuiPageHeaders with basic titles

* Update engine creation views

- meta engine - move to description
+ misc fix - non-heading EuiTitles that do not match the standalone UI

* Update EuiPageHeaders with simpler actions

* Update Documents page header

+ test reorg - move DocumentCreationButton tests to its own test block

* Update EnginesOverviewHeader (+ refactors)

- Switch from FormattedMessage to i18n to match rest of repo
- Switch to eslint-disbable instead of doing a buttonProps workaround (this will get deleted anyway post-migration)

* whoops
2021-03-26 14:17:00 -04:00
Scotty Bollinger 21192222fd
Add button on non-MVP pages to link to personal dashboard (#95441) 2021-03-26 11:46:01 -05:00
Scotty Bollinger c5fb8ab8c2
[Workplace Search] Update global state when org nane changes (#95448)
Currently we instantiate the Workplace Search app with server props passed in from the server on initial page load. This data includes the organization name. In our settings section, we poll the server to get update information, but once the data is change, the global state does not get updated on a route change. This is only a problem in the case where a user has changed their org name and returns to the overview page before reloading the page. When this happens, the onboarding step asking the user to change thier org name is still visible.
2021-03-26 10:19:36 -05:00
Constance b9ef084130
[App Search] API Logs - set up basic view & routing (#95369)
* Add basic API Logs view

* Update engine router + nav link
2021-03-25 09:19:39 -07:00
Scotty Bollinger 50d7cea812
[Workplace Search] Add UI logic for GitHub Configure Step (#95254)
* Fix typo

This was mis-copied from ent-search

* No longer store preContentSourceId in query param

In ent-search, we had the Rails server redirect with this param. Now, it is contained in the server response as JSON and is persisted in the logic file

* Pass query params to SourceAdded component

The entire state is stored in query params now and must be passed when doing a manual redirect

* Redirect to config view if config needed

* Don’t redirect if the config has already been completed

This was really tricky and could use a refactor in the future, perhaps. The issue is that the persisted query params will contain the `preContentSourceId` even after the config has been completed. This caused the UI to attempt to navigate back to the config screen after it had been completed. This sets a prop once that has been completed and bypasses the redirect.

* Use correct key to determine if config needed

* Update tests
2021-03-25 11:12:53 -05:00
Constance 983c3a0139
[App Search] Log retention role fix (#95227)
* LogRetentionCallout - add ability check to API call

- on non-admin users, we're otherwise getting a forbidden error

- remove now-unnecessary canManageLogSettings wrapping check around the link CTA, since the entire callout is now essentially gated behind the check

* LogRententionTooltip - add ability check to API call

- on non-admin users, we're otherwise getting a forbidden error

- tests now require a ...values spread for myRole

* [MISC] Refactor previous isLogRetentionUpdating check in favor of a Kea breakpoint

- both dedupe calls for the commented use case, but breakpoint feels simpler & more Kea-y

* PR feedback: Increase breakpoint speed
2021-03-24 15:37:02 -04:00
Constance ec3926433c
[App Search] Various engines fixes (#95127)
* [Misc] Update trash icon color

- should be danger/red to match other tables in Kibana

* Engine table - fix incorrect conditional around when users can delete engines

- The check for that should be around Dev/Editor/Analyst roles, not around whether the account has a platinum license

- Tests - DRY out reset mock
- ideally would be in a beforeEach, but mount/beforeAll perf makes that difficult

* Create engine button - wrap with canManageEngines check

- prevents Dev/Editor/Analyst roles from hitting a 404 page

- test cleanup - use describe blocks to convey conditional branching, combine 2 tests into 1

* Empty engines prompt - add canManageEngines check

+ switch from FormattedMessage to i18n (this view was created a long time ago before we settled on generally preferring i18n)

+ provide a more helpful body text when the user cannot create engines

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_overview.test.tsx

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

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
2021-03-24 13:23:07 -04:00
Constance 759a52c74d
[App Search] Add describe('listeners') blocks to older logic tests (#95215)
* Add describe('listener') blocks to older logic tests

* [Misc] LogRetentionLogic - move 2 it() blocks not within a describe() to its parent listener
2021-03-24 08:36:23 -07:00
Scotty Bollinger 80b05b914a
[Workplace Search] Add missing tests to get 100% coverage (#95240) 2021-03-23 18:39:57 -04:00
Scotty Bollinger 3ff76fd022
[Workplace Search] Fix redirect and state for personal oAuth plugin (#95238)
* Move source added route to top-level index component

* Use state passed back from oAuth app to determine context

The previous tests weren’t actually using this state so they have been updated with actual state data for proper testing
2021-03-23 18:02:36 -04:00
Scotty Bollinger 29ee309dd8
[App Search] Role mappings migration part 3 (#94763)
* Remove validaition of ID property in route body

The ID is inferred from the param in the URL. This was fixed in the logic file but the server route was never updated

* Add RoleMappings component

- ROLE_MAPPINGS_TITLE was moved to a shared constant in an earlier PR
- Also removing redundant exports of interface

* Add RoleMapping component

- Also removing redundant export of interface from AppLogic

* Add RoleMappingsRouter

ROLE_MAPPINGS_TITLE was moved to a shared constant in an earlier PR

# Conflicts:
#	x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/index.ts

* Add route and update link in navigation

* Remove unused translations

* Change casing

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

* Change casing

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

* Change casing

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

* Add ability test

* Refactor conditional constants

* Refactor role type constants

* Remove EuiPageContent

* Refactor action mocks

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-23 15:18:11 -04:00
Jason Stoltzfus 97a03479e3
[App Search] Fix Relevance Tuning bugs (#95069) 2021-03-23 13:37:17 -04:00
James Rucker f3b71bce2a
Change the type of content source errorReason to match ent-search (#95098)
A recent refactor of content source jobs models unintentionally
changed this API. This change restores the functionality of the
re-authentication "Fix" link.
2021-03-23 08:04:22 -07:00
Byron Hulcher 4dec429fc9
Use string values for EngineTypes instead of int (#94823)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-23 10:09:11 -04:00
Jason Stoltzfus 19aeb99dc3
[App Search] Remaining Result Settings logic and routes (#94947) 2021-03-22 15:58:32 -04:00
Constance ab0f45c053
[Curation] Add Result Manually flyout/search (#94887)
* Set up curation search server route

- not really sure which API endpoint to use, hedging my bets

* Set up AddResultLogic

- fairly simple, mostly concerned with flyout behavior & search query
- could likely be reused (or replaced with??) query tester logic in the future

* Add main AddResultFlyout component

- with custom isPromoted / isHidden logic & actions

* Update AddResultButton to open flyout

* Update Curation page to render the flyout

* PR feedback: reset search query on flyout re-open
2021-03-18 14:53:46 -07:00
Constance 704d22b699
Improve responsiveness of promoted/hidden panel button actions (#94888) 2021-03-18 08:47:04 -07:00
Jason Stoltzfus 49aef21bd4
[App Search] Result settings logic - actions and reducers (#94629) 2021-03-18 09:27:16 -04:00
Constance f4da06349d
[Curation] Add promoted/hidden documents section & logic + Restore defaults button (#94769)
* Set up promoted & hidden documents logic

* Set up result utility for converting CurationResult to Result

* Set up AddResultButton in documents sections

- not hooked up to anything right now, but will be in the next PR

* Add HiddenDocuments section

* Add PromotedDocuments section w/ draggable results

* Update OrganicDocuments results with promote/hide actions

* Add the Restore Defaults button+logic

* PR feedback: key ID

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-17 20:01:50 -07:00
Scotty Bollinger e1371b3d33
[Workplace Search] Fix confirm modal (#94844)
This PR addresses an issue where the confirmation modal when removing a content source connector was brokedn. The issue was that the component was not passed the props to render correctly
2021-03-17 19:55:35 -04:00
Vadim Yakhin 1b65ea91e5
Remove custom styles (#94839)
* Replace custom margin style with EuiFlexGroup gutter

* Replace custom padding style with EuiFlexGroup gutter

* Remove custom wrapper around Loading on Overview page (alpha)

* Replace custom range value output with EuiRange's showInput prop

* Remove custom style

I'll refer the correct handling of this to design pass

* Remove "euiPanel--inset" className, as it doesn't do anything in Amsterdam theme

* Remove unused className `euiPanel--noShadow`

We're already using hasShadow={false} prop that does the same

* Remove `euiPanel--outline` className, as it doesn't do anything in Amsterdam theme

* Inline classNames declaration with the goal to remove them later

They don't do anything in Amsterdam theme, but I'm not removing them to keep context for design pass.

* Remove `eui-textNoWrap` className from buttons, as it's already included in button styles

* Remove classNames with no styles attached

* Replace custom padding in content_section with EuiSpacer

* Remove source-row styles

Most of the classNames were redundant and not needed anymore. The ones that were actually used were either replaced with EUI props or deleted, so we could apply EUI styles during design pass.

* Replace source_icon styles with EUI components and props

* Replace source-card icon styles with EUI prop

* Remove className declarations with no styles attached to classes

* Fix tests

* Increase space between source overview panels

* Use smaller icons on source prioritization and connectors pages

* Invert SourceIcon default size and size provided via props

The default size was "xxl", now it's "m". "m" size is default in EUI, so it's more consistent.

* Get rid of &nbsp; as horizontal spacer
2021-03-17 18:26:50 -04:00
Scotty Bollinger 74b604608a
[Workplace Search] Add conditional props for Gmail (#94855)
THis PR adds conditional query params that gmail sends when doing an oauth redirect.
2021-03-17 18:22:59 -04:00
Scotty Bollinger 4aa7036d77
[App Search] Role mappings migration part 2 (#94461)
* Add engines mock and fix mock role mapping

The original asRoleMapping was merely for a smoke test in the shared component. Refactored to work better in App Search component

* Add RoleMappingsLogic

* Fix test description

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

* Fix test description

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

* Add flash messages when creating, updating or deleting

* Add path and resetState calls

Refactoring the tests showed me that some parts of the state weren’t being reset.

* Refactor handleAuthProviderChange logic

I some how got the test coverage at 100% with my wrong way of doing tests before (scary). When I fixed it I noticed that noting I could do would trigger the fallback of just returning the `[ANY_AUTH_PROVIDER]` array. After talking with Constance, we could not come up with a way to trigger it either, given the conditions.

She had suggested removing the first return statement but that caused an empty array being returned sometimes.

Ultimately, I was able to get it working and covered with these changes.

* Refactor tests per PR feedback

The places where `role: 'superuser’` was deleted in the listeners was a side effect of using `setRoleMappingData` and not `mount`

* Add back deleted assertion

* Copy nit

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

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
2021-03-16 17:06:21 -04:00
Constance badf38b0cd
[Curation] Add support for a custom drag handle to the Result component (#94652)
* Update Result component to render a custom drag handle

* Update Result library with a draggable example

- note: this doesn't actually handle reorder logic, it's purely a UI/UX example

* Update CurationResult to pass dragHandleProps through to Result
2021-03-16 08:30:32 -07:00
Vadim Yakhin c9d1dbf599
[Workplace Search] Misc bugfixes (#94612)
* Fix incorrect copy

* Fix incorrect copy

* Update Box icon to match other icon sizes

* Add missing spacer on connector configuration screen

* Add missing spacer to Manage Source modal on Group page

* Remove shadows on Security page

* Align the last column content in tables to the right

* Fix colors on save custom source page

"Secondary" is greenish in new version is EUI, we need "subdued"

* Fix link to personal dashboard

* Add missing breadcrumbs to Security and Settings pages

* Deduplicate Security tests on Basic and Platinum licenses

* Prevent range slider from shifting to left when priority is 10

When priority is 10, the number become wider and it pushes the range slider to the left. This commit is a quick fix for that. We could improve it later by adding a proper input.

* Fix i18n duplicate ID

* Revert "Fix link to personal dashboard"

This reverts commit 5fc3ad2937.
2021-03-16 10:48:07 -04:00
Constance 5396d27043
[App Search] Curation: Add query management UX & organic documents list (#94488)
* Update CurationLogic to handle queries management

- updating the active query
- adding queriesLoading and organicDocumentsLoading state
- clean up / refactor updateCurations slightly - instead of taking a {queries} param, we should opt for a separate updateQueries action and storing a queries state
  - this allows us to more granularly hook into activeQuery when queries is updated without the current activeQuery and correct for that

* Add ActiveQuerySelect component

- used for switching the currently active query

* Add ManageQueriesModal component

- used for editing/adding/removing the queries a curation manages
- primarily a light wrapper around the existing reusable CurationQueries component (also used in the create new curation view)

* Add OrganicDocuments and CurationResult components

* Update Curation view with new components

+ update breadcrumb to pull from queries instead of curation.queries, mostly for consistency w/ other usages & slightly faster responsiveness when updating queries

* Fix unnecessary import

* Meeting feedback: organic documents title copy tweak

* PR feedback - test assertion
2021-03-15 15:39:26 -07:00
Constance 521c336df2
[App Search] Curation: set up server routes, API calls, & bare-bones view (#94341)
* Add server side API routes & update types expected from server

* Create CurationLogic with GET and PUT listeners

- PUT is mostly placeholder for now, we'll actually use it later in future Curation PRs

* Create Curation view component & page load effect

* Update CurationsRouter to use new view + remove add_result route

- Per design discussion w/ Davey, we'll be removing the standalone add result route in favor of an in-page flyout
2021-03-11 09:34:28 -08:00
Constance 8be1dd7c54
[App Search] Add custom actions prop to Result component (#94378)
* Add custom actions prop to Result component

- will be used by upcoming Curations work to promote and hide documents

* Add Result custom actions to library

+ [misc] export main Result component from index
2021-03-11 08:40:31 -08:00
Jason Stoltzfus dee1272dd6
Created a stub page for result settings (#94334) 2021-03-11 08:38:34 -08:00
James Rucker 0e1fa8d50a
Small changes to callback params for Atlassian OAuth1 flows (#94395) 2021-03-11 09:26:21 -06:00
Scotty Bollinger 26603620a4
[App Search] Role mappings migration part 1 (#94346)
* Fix test suite name

https://github.com/elastic/kibana/pull/94038/files#r590545670

* Move types out of AttributeSelector component to shared types

* Fix random typo

* Add routes and path generator util

* Move constants to shared

* Fix types in mock

* Fix routes

* Fix failing tests
2021-03-10 17:16:46 -05:00