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

[Cases] Adding deprecated icon to additional actions dropdown selectors #115287

Merged

Conversation

jonathan-buttner
Copy link
Contributor

@jonathan-buttner jonathan-buttner commented Oct 15, 2021

Issue: #114097

This PR adds the deprecated icon to the dropdown selector when creating rules with the triggers_actions_ui plugin.

To get the icon to show up I had to refactor it to use a super selector instead of a combobox.

I also refactored the code to use a single component since it needed to be added in two places:

  • In the normal workflow of adding an action for a rule
  • When a connector cannot be found it shows the connector_add_inline component
Connector list view

image

Adding table api connector to rule

image

This PR doesn't include the copy updates outlined here: https://github.com/elastic/security-team/issues/1938

@jonathan-buttner jonathan-buttner added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 Team:Threat Hunting:Cases labels Oct 15, 2021
@@ -86,24 +88,14 @@ export const AddConnectorInline = ({
);

useEffect(() => {
if (connectors) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A couple things about these changes. This logic was setting state to keep track of whether it had some connectors after the filter. I moved the filter functionality to a helper that is used in a couple places (getEnabledAndConfiguredConnectors).

The helper will return an empty array if there were no connectors passed in, so we don't need the if (connectors) anymore.

Once it set the setConnectorOptionsList, it would also set the errors.

The errors are only used when connectorOptionsList is not an empty array (aka in the connectorsDropdown). The connectorsDropdown is also only rendered when connectorOptionsList is not empty. Therefore, I believe we can remove most of the state, pass the error array directly into the connectorsDropdown component, and use a boolean to determine if we had any connectors instead.

error={errors}
isInvalid={errors.length > 0}
error={connectorDropdownErrors}
isInvalid
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could be missing something but I believe the only time this component is render is when there would be errors. So we don't need the check.

@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 19, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form.action_form action_form in alert renders available connectors for the selected action type

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: Method “props” is meant to be run on 1 node. 0 found instead.
    at ReactWrapper.single (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/ReactWrapper.js:1168:13)
    at ReactWrapper.props (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/ReactWrapper.js:710:17)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx:493:32)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form.action_form action_form in alert renders only preconfigured connectors for the selected preconfigured action type

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: Method “props” is meant to be run on 1 node. 0 found instead.
    at ReactWrapper.single (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/ReactWrapper.js:1168:13)
    at ReactWrapper.props (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/enzyme/src/ReactWrapper.js:710:17)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx:517:32)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Kibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details·ts.Actions and Triggers app Alert Details Edit alert button should open edit alert flyout

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://github.com/elastic/kibana/issues/65603

[00:00:00]     │
[00:00:00]       └-: Actions and Triggers app
[00:00:00]         └-> "before all" hook in "Actions and Triggers app"
[00:03:15]         └-: Alert Details
[00:03:15]           └-> "before all" hook in "Alert Details"
[00:03:34]           └-: Edit alert button
[00:03:34]             └-> "before all" hook for "should open edit alert flyout"
[00:03:34]             └-> "before all" hook for "should open edit alert flyout"
[00:03:36]             └-> should open edit alert flyout
[00:03:36]               └-> "before each" hook: global before each for "should open edit alert flyout"
[00:03:36]               │ debg navigating to triggersActions url: http://localhost:61161/app/management/insightsAndAlerting/triggersActions
[00:03:36]               │ debg navigate to: http://localhost:61161/app/management/insightsAndAlerting/triggersActions
[00:03:36]               │ debg browser[INFO] http://localhost:61161/app/management/insightsAndAlerting/triggersActions?_t=1634664566247 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:03:36]               │
[00:03:36]               │ debg browser[INFO] http://localhost:61161/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:03:36]               │ debg ... sleep(700) start
[00:03:37]               │ debg ... sleep(700) end
[00:03:37]               │ debg returned from get, calling refresh
[00:03:38]               │ debg browser[INFO] http://localhost:61161/app/management/insightsAndAlerting/triggersActions?_t=1634664566247 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:03:38]               │
[00:03:38]               │ debg browser[INFO] http://localhost:61161/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:03:38]               │ debg currentUrl = http://localhost:61161/app/management/insightsAndAlerting/triggersActions
[00:03:38]               │          appUrl = http://localhost:61161/app/management/insightsAndAlerting/triggersActions
[00:03:38]               │ debg TestSubjects.find(kibanaChrome)
[00:03:38]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:03:38]               │ debg ... sleep(501) start
[00:03:39]               │ debg ... sleep(501) end
[00:03:39]               │ debg in navigateTo url = http://localhost:61161/app/management/insightsAndAlerting/triggersActions/rules
[00:03:39]               │ debg --- retry.tryForTime error: URL changed, waiting for it to settle
[00:03:39]               │ debg ... sleep(501) start
[00:03:40]               │ debg ... sleep(501) end
[00:03:40]               │ debg in navigateTo url = http://localhost:61161/app/management/insightsAndAlerting/triggersActions/rules
[00:03:40]               │ debg isGlobalLoadingIndicatorVisible
[00:03:40]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:03:40]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:03:42]               │ debg browser[INFO] http://localhost:61161/app/management/insightsAndAlerting/triggersActions/rules 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:03:42]               │
[00:03:42]               │ debg browser[INFO] http://localhost:61161/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:03:42]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:03:42]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:03:42]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:03:42]               │ debg TestSubjects.exists(alertsList)
[00:03:42]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="alertsList"]') with timeout=120000
[00:03:42]               │ debg TestSubjects.find(alertSearchField)
[00:03:42]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:03:43]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:03:43]               │ debg Find.clickDisplayedByCssSelector('[data-test-subj="alertsList"] [title="a930c0e1-8a0a-4953-9129-639fadddb26d"]') with timeout=10000
[00:03:43]               │ debg Find.displayedByCssSelector([data-test-subj="alertsList"] [title="a930c0e1-8a0a-4953-9129-639fadddb26d"])
[00:03:43]               │ debg Find.findByCssSelector('[data-test-subj="alertsList"] [title="a930c0e1-8a0a-4953-9129-639fadddb26d"]') with timeout=10000
[00:03:43]               │ debg Wait for element become visible: [data-test-subj="alertsList"] [title="a930c0e1-8a0a-4953-9129-639fadddb26d"] with timeout=10000
[00:03:43]               │ debg TestSubjects.find(openEditAlertFlyoutButton)
[00:03:43]               │ debg Find.findByCssSelector('[data-test-subj="openEditAlertFlyoutButton"]') with timeout=10000
[00:03:44]               │ debg TestSubjects.exists(hasActionsDisabled)
[00:03:44]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="hasActionsDisabled"]') with timeout=2500
[00:03:46]               │ warn browser[SEVERE] http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js 446:84011 TypeError: Cannot read properties of undefined (reading 'isLegacy')
[00:03:46]               │          at i (http://localhost:61161/47309/bundles/plugin/triggersActionsUi/kibana/triggersActionsUi.chunk.6.js:3:30104)
[00:03:46]               │          at u (http://localhost:61161/47309/bundles/plugin/triggersActionsUi/kibana/triggersActionsUi.chunk.6.js:3:33771)
[00:03:46]               │          at ga (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:59761)
[00:03:46]               │          at rs (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:68106)
[00:03:46]               │          at ts (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:67925)
[00:03:46]               │          at es (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:67644)
[00:03:46]               │          at Ns (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:111133)
[00:03:46]               │          at Iu (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:97334)
[00:03:46]               │          at Pu (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:97146)
[00:03:46]               │          at Ou (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:94325)
[00:03:46]               │ warn browser[SEVERE] http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js 446:84011 TypeError: Cannot read properties of undefined (reading 'isLegacy')
[00:03:46]               │          at i (http://localhost:61161/47309/bundles/plugin/triggersActionsUi/kibana/triggersActionsUi.chunk.6.js:3:30104)
[00:03:46]               │          at u (http://localhost:61161/47309/bundles/plugin/triggersActionsUi/kibana/triggersActionsUi.chunk.6.js:3:33771)
[00:03:46]               │          at ga (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:59761)
[00:03:46]               │          at rs (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:68106)
[00:03:46]               │          at ts (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:67925)
[00:03:46]               │          at es (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:67644)
[00:03:46]               │          at Ns (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:111133)
[00:03:46]               │          at Iu (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:97334)
[00:03:46]               │          at Pu (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:97146)
[00:03:46]               │          at Ou (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:94325)
[00:03:46]               │ warn browser[SEVERE] http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js 446:84011 TypeError: Cannot read properties of undefined (reading 'isLegacy')
[00:03:46]               │          at i (http://localhost:61161/47309/bundles/plugin/triggersActionsUi/kibana/triggersActionsUi.chunk.6.js:3:30104)
[00:03:46]               │          at u (http://localhost:61161/47309/bundles/plugin/triggersActionsUi/kibana/triggersActionsUi.chunk.6.js:3:33771)
[00:03:46]               │          at ga (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:59761)
[00:03:46]               │          at rs (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:68106)
[00:03:46]               │          at ts (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:67925)
[00:03:46]               │          at es (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:67644)
[00:03:46]               │          at Ns (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:111133)
[00:03:46]               │          at Iu (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:97334)
[00:03:46]               │          at Pu (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:97146)
[00:03:46]               │          at Ou (http://localhost:61161/47309/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:447:94325)
[00:03:46]               │ debg browser[INFO] http://localhost:61161/47309/bundles/core/core.entry.js 7:106882 "Detected an unhandled Promise rejection.
[00:03:46]               │      TypeError: Cannot read properties of undefined (reading 'isLegacy')"
[00:03:46]               │ warn browser[SEVERE] http://localhost:61161/47309/bundles/plugin/triggersActionsUi/kibana/triggersActionsUi.chunk.6.js 2:30103 Uncaught TypeError: Cannot read properties of undefined (reading 'isLegacy')
[00:03:46]               │ debg --- retry.tryForTime error: [data-test-subj="hasActionsDisabled"] is not displayed
[00:03:47]               │ debg TestSubjects.setValue(alertNameInput, Changed Alert Name a930c0e1-8a0a-4953-9129-639fadddb26d)
[00:03:47]               │ debg TestSubjects.click(alertNameInput)
[00:03:47]               │ debg Find.clickByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:03:47]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:03:57]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:03:57]               │      Wait timed out after 10014ms
[00:03:57]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:04:07]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:04:07]               │      Wait timed out after 10038ms
[00:04:08]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:04:18]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:04:18]               │      Wait timed out after 10019ms
[00:04:18]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:04:28]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:04:28]               │      Wait timed out after 10042ms
[00:04:29]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:04:39]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:04:39]               │      Wait timed out after 10055ms
[00:04:39]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:04:50]               │ debg --- retry.try failed again with the same message...
[00:04:50]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:05:00]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:00]               │      Wait timed out after 10009ms
[00:05:01]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:05:11]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:11]               │      Wait timed out after 10010ms
[00:05:11]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:05:21]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:21]               │      Wait timed out after 10046ms
[00:05:22]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:05:32]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:32]               │      Wait timed out after 10044ms
[00:05:32]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:05:42]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:42]               │      Wait timed out after 10026ms
[00:05:43]               │ debg Find.findByCssSelector('[data-test-subj="alertNameInput"]') with timeout=10000
[00:05:53]               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:53]               │      Wait timed out after 10015ms
[00:05:53]               │ debg --- retry.try error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:53]               │      Wait timed out after 10015ms
[00:05:53]               │          at /dev/shm/workspace/parallel/16/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:05:53]               │          at runMicrotasks (<anonymous>)
[00:05:53]               │          at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:05:54]               │ info Taking screenshot "/dev/shm/workspace/parallel/16/kibana/x-pack/test/functional/screenshots/failure/Actions and Triggers app Alert Details Edit alert button should open edit alert flyout.png"
[00:05:54]               │ info Current URL is: http://localhost:61161/app/management/insightsAndAlerting/triggersActions/rule/1a5bc440-3102-11ec-866a-7932a49dc26a
[00:05:54]               │ info Saving page source to: /dev/shm/workspace/parallel/16/kibana/x-pack/test/functional/failure_debug/html/Actions and Triggers app Alert Details Edit alert button should open edit alert flyout.html
[00:05:54]               └- ✖ fail: Actions and Triggers app Alert Details Edit alert button should open edit alert flyout
[00:05:54]               │      retry.try timeout: Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:54]               │ Wait timed out after 10015ms
[00:05:54]               │     at /dev/shm/workspace/parallel/16/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:05:54]               │     at runMicrotasks (<anonymous>)
[00:05:54]               │     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:05:54]               │     at onFailure (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:05:54]               │     at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:59:13)
[00:05:54]               │     at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
[00:05:54]               │     at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/find.ts:368:5)
[00:05:54]               │     at TestSubjects.click (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:105:5)
[00:05:54]               │     at /dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:205:7
[00:05:54]               │     at runAttempt (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:29:15)
[00:05:54]               │     at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:68:21)
[00:05:54]               │     at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
[00:05:54]               │     at TestSubjects.setValue (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:202:12)
[00:05:54]               │     at Context.<anonymous> (/dev/shm/workspace/parallel/16/kibana/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts:272:9)
[00:05:54]               │     at Object.apply (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:05:54]               │   Error: retry.try timeout: Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
[00:05:54]               │   Wait timed out after 10015ms
[00:05:54]               │       at /dev/shm/workspace/parallel/16/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:05:54]               │       at runMicrotasks (<anonymous>)
[00:05:54]               │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:05:54]               │       at onFailure (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:05:54]               │       at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:59:13)
[00:05:54]               │       at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
[00:05:54]               │       at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/find.ts:368:5)
[00:05:54]               │       at TestSubjects.click (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:105:5)
[00:05:54]               │       at /dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:205:7
[00:05:54]               │       at runAttempt (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:29:15)
[00:05:54]               │       at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:68:21)
[00:05:54]               │       at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
[00:05:54]               │       at TestSubjects.setValue (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:202:12)
[00:05:54]               │       at Context.<anonymous> (test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts:272:9)
[00:05:54]               │       at Object.apply (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:05:54]               │       at onFailure (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:05:54]               │       at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:59:13)
[00:05:54]               │       at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
[00:05:54]               │       at TestSubjects.setValue (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:202:12)
[00:05:54]               │       at Context.<anonymous> (test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts:272:9)
[00:05:54]               │       at Object.apply (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:05:54]               │ 
[00:05:54]               │ 

Stack Trace

Error: retry.try timeout: Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="alertNameInput"])
Wait timed out after 10015ms
    at /dev/shm/workspace/parallel/16/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at onFailure (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:17:9)
    at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:59:13)
    at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
    at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/find.ts:368:5)
    at TestSubjects.click (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:105:5)
    at /dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:205:7
    at runAttempt (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:29:15)
    at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:68:21)
    at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
    at TestSubjects.setValue (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:202:12)
    at Context.<anonymous> (test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts:272:9)
    at Object.apply (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
    at onFailure (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:17:9)
    at retryForSuccess (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry_for_success.ts:59:13)
    at RetryService.try (/dev/shm/workspace/parallel/16/kibana/test/common/services/retry/retry.ts:31:12)
    at TestSubjects.setValue (/dev/shm/workspace/parallel/16/kibana/test/functional/services/common/test_subjects.ts:202:12)
    at Context.<anonymous> (test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts:272:9)
    at Object.apply (/dev/shm/workspace/parallel/16/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)

and 1 more failures, only showing the first 3.

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 379 382 +3

Async chunks

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

id before after diff
triggersActionsUi 789.4KB 793.3KB +3.9KB

History

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

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine merge upstream

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine merge upstream

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine merge upstream

@mdefazio
Copy link
Contributor

how we can make it better for preconfigured connectors, when we have deprecated word as well. The button Add connector is shifted outside of the window size.

I think we will need to add truncation regardless to avoid this situation for any long connector name.
From the doc example:

{
      value: 'option_three',
      inputDisplay: (
        <span className="eui-textTruncate eui-displayBlock">
          Option three has a super long text and added truncation
        </span>
      ),
    }

Some questions, but I think what I'm getting at is that we don't need either appended texts:

  • Do we need to include 'preconfigured' here? It seems we are adding it to the name of the connector (can the user edit this name on a preconfigured connector?)
  • If we have the icon, do we need to also add 'deprecated'? With the added warning callout when its selected, I think its ok to rely solely on the icon+tooltip here. Was there a previous discussion about this that I'm forgetting?

To get the icon to show up I had to refactor it to use a super selector instead of a combobox.

By modifying this, don't we lose the option to have search in this dropdown? Is it a case of being able to have one or the other (an icon vs allowing search)?

@jonathan-buttner
Copy link
Contributor Author

@mdefazio thanks for the feedback.

I think we will need to add truncation regardless to avoid this situation for any long connector name.

Good idea, I'll add that.

Do we need to include 'preconfigured' here? It seems we are adding it to the name of the connector (can the user edit this name on a preconfigured connector?)

Good point. I don't believe users can edit preconfigured connectors name. Is that right @YulNaumenko ?

If we have the icon, do we need to also add 'deprecated'? With the added warning callout when its selected, I think its ok to rely solely on the icon+tooltip here. Was there a previous discussion about this that I'm forgetting?

Yeah we probably don't need the deprecated text with the icon. I was trying to keep it inline with what we had for cases. I'm not sure how we arrived at the decision to include it initially.

Cases looks similar:

PR: #114234

Should I remove it in both places?

By modifying this, don't we lose the option to have search in this dropdown? Is it a case of being able to have one or the other (an icon vs allowing search)?

Good point, I had totally missed that we lose the ability to search. I tried getting an icon to show up using the renderOption prop with the original ComboBox implementation but wasn't able to. We were using the singleSelection={{ asPlainText: true }} to only allow single selection, I'm not sure if using asPlainText would prevent us from also rendering additional react components?

If you have an example I'm happy to give it another shot. Or if there's another EUI component that would be a better fit, let me know.

@YulNaumenko
Copy link
Contributor

I think we will need to add truncation regardless to avoid this situation for any long connector name.

+1 on this

Do we need to include 'preconfigured' here? It seems we are adding it to the name of the connector (can the user edit this name on a preconfigured connector?)
We still need to have peconfigured identifier, because the name not necessary will start from the word preconfigured. This is up to the users choice for now.

Good point. I don't believe users can edit preconfigured connectors name. Is that right @YulNaumenko ?

Correct, this is a part of the configuration.

If we have the icon, do we need to also add 'deprecated'? With the added warning callout when its selected, I think its ok to rely solely on the icon+tooltip here. Was there a previous discussion about this that I'm forgetting?

I prefer to have the icon to have less busy UI with the text. And +1 to be consistent everywhere.

Should I remove it in both places?

Yes, lets have the icon with tooltip only.

By modifying this, don't we lose the option to have search in this dropdown? Is it a case of being able to have one or the other (an icon vs allowing search)?

Great catch! That needs to be fixed.

@YulNaumenko
Copy link
Contributor

@jonathan-buttner, regarding the issue I've opened to fix the deprecation for preconfigured connectors by exposing the config values. The team decided to postpone that functionality till we get the better research on the impact and will get some telemetry around how many customers using preconfigured ServiceNow connectors to prioritize that feature.

@mdefazio
Copy link
Contributor

mdefazio commented Dec 3, 2021

Adding in our summary from the Slack thread:
We will not include the icon in the dropdown list and instead include (deprecated) after the connector title.
When a deprecated connector is selected, we will show a prepended icon to the dropdown (with tooltip). This will help avoid any potential issue with truncating 'deprecated' from the title and the user forgetting or not realizing this is selected.
The warning callout that appears will stay as the use case for this still makes sense in Cases.

@jonathan-buttner jonathan-buttner force-pushed the connectors-deprecated-icon branch from d2cf023 to 0ed891f Compare December 3, 2021 19:27
Copy link
Contributor Author

@jonathan-buttner jonathan-buttner left a comment

Choose a reason for hiding this comment

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

The latest commit fixes:

  • Reverts back to using a combo box to provide search capability
  • When a deprecated connector is selected we prepend the warning icon
Example prepended icon

image

  • Fixes the overflow of text in a long connector title
Example long connector title

image

  • Don't show the icon in the dropdown list, but show (deprecated)
Example deprecated text

image

@@ -214,90 +175,73 @@ export const ActionTypeForm = ({
<>
{actionGroups && selectedActionGroup && setActionGroupIdByIndex && (
<>
<EuiFlexGroup component="div">
<EuiFlexItem grow={true}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Caroline asked that I remove the FlexGroup and Item because they're only useful when you have multiple items within a group.

@@ -214,90 +175,73 @@ export const ActionTypeForm = ({
<>
{actionGroups && selectedActionGroup && setActionGroupIdByIndex && (
<>
<EuiFlexGroup component="div">
<EuiFlexItem grow={true}>
<EuiFormControlLayout
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Caroline recommended that I move the prepend prop from this component straight into the super select and and remove the EuiFormControlLayout as it wasn't needed. This was also causing rounded edges which wasn't consistent with the prepend on the combobox we use below

image

<EuiSpacer size="l" />
</>
)}
<EuiFlexGroup component="div">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same thing here, we didn't need the group and item because there was only one of them and they're only needed when aligning things horizontally.

This also addresses the overflow of text for the ComboBox and super selector that we were seeing.

}

setIsEmptyActionId(!!emptyActionsIds.find((emptyId: string) => actionItem.id === emptyId));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const connectorsDropdown = (
<EuiFlexGroup component="div">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same thing here don't need the group and item.

Copy link
Contributor

@mdefazio mdefazio 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 working through these!

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine merge upstream

@@ -135,6 +135,12 @@ export interface ActionTypeModel<ActionConfig = any, ActionSecrets = any, Action
>
> | null;
actionParamsFields: React.LazyExoticComponent<ComponentType<ActionParamsProps<ActionParams>>>;
customConnectorSelectItem?: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@YulNaumenko I split this up into two different operations because we only display the icon (aka getComponent) after the row has been selected, but we display the text in the dropdown of the combo box. Let me know if you have a better idea. I'm happy to change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the explanation. I think we better create the proper reusable interface instead of providing that details coupled to the ActionTypeModel. But the rest looks good to me.

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the changes!

@jonathan-buttner
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 328 332 +4

Async chunks

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

id before after diff
triggersActionsUi 778.3KB 780.8KB +2.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 52.5KB 53.9KB +1.3KB
Unknown metric groups

async chunk count

id before after diff
triggersActionsUi 66 67 +1

History

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

@jonathan-buttner jonathan-buttner added backport:skip This commit does not require backporting and removed auto-backport Deprecated - use backport:version if exact versions are needed labels Dec 8, 2021
@jonathan-buttner jonathan-buttner merged commit e94d63f into elastic:main Dec 8, 2021
@jonathan-buttner jonathan-buttner deleted the connectors-deprecated-icon branch December 8, 2021 16:02
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
…rs (elastic#115287)

* adding deprecated icon to the other actions list

* Adding deprecated text to list view

* Each action type can render the dropdown row

* Refactoring and fixing todos

* Fixing jest tests

* Adding and fixing other tests

* Fixing functional test

* Fixing tests

* Adjusting text to match cases

* Fixing tests

* Addressing pr feedback

* Renaming connector dropdown to selection

* Fixing type errors

* Fixing type error

* Fixing translation error

* Fixing test

* Addressing ux feedback and using ComboBox

* Extracting customConnectorSelectItem to an interface

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 release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team v8.1.0
Projects
None yet
8 participants