Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting fixes 1 #88477

Merged
merged 14 commits into from
Jan 15, 2021
Merged

Porting fixes 1 #88477

merged 14 commits into from
Jan 15, 2021

Conversation

yakhinvadim
Copy link
Contributor

@yakhinvadim yakhinvadim commented Jan 15, 2021

Summary

This PR ports the bugfixes that were previously made in ent-search but after the code was already migrated to Kibana.
i18n and tests for changed code will be added in future PRs.

@yakhinvadim
Copy link
Contributor Author

@elasticmachine merge upstream

@yakhinvadim yakhinvadim added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.0.0 labels Jan 15, 2021
@yakhinvadim yakhinvadim marked this pull request as ready for review January 15, 2021 16:14
@yakhinvadim yakhinvadim requested a review from a team January 15, 2021 16:14
Copy link
Contributor

@scottybollinger scottybollinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change regarding constants. Also, make sure your tests still pass. You can run both of these (adjust the path to match your local)

Source Row

cd ~/kibana/x-pack/plugins/enterprise_search && sh jest.sh public/applications/workplace_search/components/shared/source_row

Add Source

x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source

@@ -24,6 +24,7 @@ const SUCCESS_MESSAGE = 'Display Settings have been successfuly updated.';

import { DetailField, SearchResultConfig, OptionValue, Result } from '../../../../types';

export const UNASSIGNED_FIELD = 'Leave unassigned';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you go ahead and create a constants.ts file in the this folder and move this here?

x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/constants.ts

Also, let's go ahead and add i18n to this constant. You can view the patterns here.

@scottybollinger
Copy link
Contributor

@yakhinvadim Looks like the tests passed. If you don't mind, just make sure you still have 100% coverage on those folders above. Those commands will give you a report

@yakhinvadim
Copy link
Contributor Author

yakhinvadim commented Jan 15, 2021

@scottybollinger I moved both constants from logic file to a separate file. All tests are passing and coverage is 100%:

image
image

import { i18n } from '@kbn/i18n';

export const LEAVE_UNASSIGNED_FIELD = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettingsLogic.leaveUnassignedField',
Copy link
Contributor

@scottybollinger scottybollinger Jan 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change here but we don't use component names in these; just a contextual path. So instead of displaySettingsLogic, let's stick with displaySettings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, thanks! Updated in the following commit.
Please continue being vocal in comments, I feel almost blind in the codebase so far. 🙈

Copy link
Contributor

@scottybollinger scottybollinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for knocking this out and welcome to Kibana!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1080 1081 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 1.8MB 1.8MB +1.5KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@scottybollinger scottybollinger merged commit fbb8238 into elastic:master Jan 15, 2021
scottybollinger added a commit to scottybollinger/kibana that referenced this pull request Jan 15, 2021
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 18, 2021
* master: (33 commits)
  [Security Solution][Case] Fix patch cases integration test with alerts (elastic#88311)
  [Security Solutions][Detection Engine] Removes duplicate API calls (elastic#88420)
  Fix log msg (elastic#88370)
  [Test] Add tag cloud visualization to dashboard in functional test for reporting (elastic#87600)
  removing kibana-core-ui from codeowners (elastic#88111)
  [Alerting] Migrate Event Log plugin to TS project references (elastic#81557)
  [Maps] fix zooming while drawing shape filter logs errors in console (elastic#88413)
  Porting fixes 1 (elastic#88477)
  [APM] Explicitly set environment for cross-service links (elastic#87481)
  chore(NA): remove mocha junit ci integrations (elastic#88129)
  [APM] Only display relevant sections for rum agent in service overview (elastic#88410)
  [Enterprise Search] Automatically mock shared logic files (elastic#88494)
  [APM] Disable Create custom link button on Transaction details page for read-only users
  [Docs] clean-up vega map reference documenation (elastic#88487)
  [Security Solution] Fix Timeline event details layout (elastic#88377)
  Change DELETE to POST for _bulk_delete to avoid incompatibility issues (elastic#87914)
  [Monitoring] Change cloud messaging on no data page (elastic#88375)
  [Uptime] clear ping state when PingList component in unmounted (elastic#88321)
  [APM] Consistent terminology for latency and throughput (elastic#88452)
  fix copy (elastic#88481)
  ...
scottybollinger added a commit that referenced this pull request Jan 18, 2021
* Add type

Our code allows for an array but the type did not.

* Add exampleResult mock

* Add test-subj attrs

* Remove FIXMEs for linter errors

The linter was complaining when these were initially migrated, stating that a11y required all mouse events to have focus and blur events. This commit uses the hover events for those. EuiColorPicker was added in error and removing them does not disrupt the linter.

* Add tests for components

* Add test for router

Also updates routes to use consistent syntax and remove the render prop

* Use helper instead of history.push

* Remove redundant resetDisplaySettingsState method

Since all this does is wrap the clearFlashMessages function, we can just call it directly. Also use the new clearFlashMessages helper instead of using FlashMessageLogic directly insideof toggleFieldEditorModal

* Add tests for DisplaySettings container

* Fix a typo and associated tests

Also adds ‘subtitleField’ that is needed in a future test

* Add constants from PR to test

#88477

* Add tests for DisplaySettingsLogic

* Remove unused imports and use new mocks

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants