-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cases] Adding deprecated icon to additional actions dropdown selectors #115287
Conversation
...ggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx
Outdated
Show resolved
Hide resolved
...ggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx
Outdated
Show resolved
Hide resolved
...ggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx
Outdated
Show resolved
Hide resolved
...ggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx
Outdated
Show resolved
Hide resolved
...ggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx
Outdated
Show resolved
Hide resolved
...s/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx
Outdated
Show resolved
Hide resolved
...s/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx
Outdated
Show resolved
Hide resolved
@@ -86,24 +88,14 @@ export const AddConnectorInline = ({ | |||
); | |||
|
|||
useEffect(() => { | |||
if (connectors) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
x-pack/plugins/triggers_actions_ui/public/application/sections/common/connectors.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/common/connectors.ts
Outdated
Show resolved
Hide resolved
💔 Build Failed
Failed CI StepsTest FailuresKibana 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 typeStandard Out
Stack Trace
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 typeStandard Out
Stack Trace
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 flyoutStandard Out
Stack Trace
and 1 more failures, only showing the first 3. Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
@elasticmachine merge upstream |
merge conflict between base and head |
@elasticmachine merge upstream |
…ner/kibana into connectors-deprecated-icon
@elasticmachine merge upstream |
@elasticmachine merge upstream |
I think we will need to add truncation regardless to avoid this situation for any long connector name.
Some questions, but I think what I'm getting at is that we don't need either appended texts:
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)? |
@mdefazio thanks for the feedback.
Good idea, I'll add that.
Good point. I don't believe users can edit preconfigured connectors name. Is that right @YulNaumenko ?
Yeah we probably don't need the Cases looks similar: PR: #114234 Should I remove it in both places?
Good point, I had totally missed that we lose the ability to search. I tried getting an icon to show up using the 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. |
…ner/kibana into connectors-deprecated-icon
+1 on this
Correct, this is a part of the configuration.
I prefer to have the icon to have less busy UI with the text. And +1 to be consistent everywhere.
Yes, lets have the icon with tooltip only.
Great catch! That needs to be fixed. |
@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. |
Adding in our summary from the Slack thread: |
d2cf023
to
0ed891f
Compare
There was a problem hiding this 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
- Fixes the overflow of text in a long connector title
- Don't show the icon in the dropdown list, but show
(deprecated)
@@ -214,90 +175,73 @@ export const ActionTypeForm = ({ | |||
<> | |||
{actionGroups && selectedActionGroup && setActionGroupIdByIndex && ( | |||
<> | |||
<EuiFlexGroup component="div"> | |||
<EuiFlexItem grow={true}> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<EuiSpacer size="l" /> | ||
</> | ||
)} | ||
<EuiFlexGroup component="div"> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
@elasticmachine merge upstream |
@@ -135,6 +135,12 @@ export interface ActionTypeModel<ActionConfig = any, ActionSecrets = any, Action | |||
> | |||
> | null; | |||
actionParamsFields: React.LazyExoticComponent<ComponentType<ActionParamsProps<ActionParams>>>; | |||
customConnectorSelectItem?: { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…ner/kibana into connectors-deprecated-icon
There was a problem hiding this 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!
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…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]>
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:
connector_add_inline
componentConnector list view
Adding table api connector to rule
This PR doesn't include the copy updates outlined here: https://github.com/elastic/security-team/issues/1938