ROX-12343: unauthenticated email integration#2984
Conversation
|
Images are ready for the commit at dfe22f1. To use with deploy scripts, first |
|
@bradr5: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
The integration test failure is not related to these changes.
When it fits your priorities, we can investigate it together as a learning experience. |
| onBlur={handleBlur} | ||
| /> | ||
| <ToggledPopoverElement | ||
| popoverContent="Enable unauthenticated SMTP will allow you to setup the RHACS email notifiers if you don’t have authenticated email services." |
There was a problem hiding this comment.
Not a blocker to merge:
- Unless there is a difference in behavior between Red Hat and open-source StackRox, we omit reference to product branding.
There was a problem hiding this comment.
Good callout. We can change that but who typically signs off on copy changes?
There was a problem hiding this comment.
Good question. I will answer via direct message.
There was a problem hiding this comment.
Let's just drop the part that reads "the RHACS"; that qualification is unnecessary to the meaning.
Also, for a small change for clarity like this, I agree with Grace Hopper, "If it's a good idea, go ahead and do it. It's much easier to apologize than it is to get permission."
| popoverContent="Enable unauthenticated SMTP will allow you to setup the RHACS email notifiers if you don’t have authenticated email services." | |
| popoverContent="Enable unauthenticated SMTP will allow you to setup an email notifier if you don’t have authenticated email services." |
| import FormCancelButton from 'Components/PatternFly/FormCancelButton'; | ||
| import FormTestButton from 'Components/PatternFly/FormTestButton'; | ||
| import FormSaveButton from 'Components/PatternFly/FormSaveButton'; | ||
| import ToggledPopoverElement from 'Components/ToggledPopoverElement'; |
There was a problem hiding this comment.
Not a blocker to merge: To reduce the effort to distinguish the many classic StackRox theme components from the fewer and newer components that are intended for PatternFly pages, we create them in PatternFly subfolder as in the import statements above.
There was a problem hiding this comment.
Great info, I'll go ahead and get that moved over
| errors={errors} | ||
| > | ||
| <> | ||
| <div className="pf-u-display-flex pf-u-align-items-flex-start"> |
There was a problem hiding this comment.
Not a blocker to merge: See if the following example supports an equivalent popover via FormLabelGroup props without the need for flex alignment.
https://www.patternfly.org/v4/components/form#form-group-with-additional-label-info
There was a problem hiding this comment.
Yeah I wasn't a huge fan of having to do it this way. I originally tried adding the isInline prop to the FormLabelGroup component and using that but patternfly added a pretty large margin between the icon and text. So I'm not sure if theres a way to do what we want without a few utility classes. I'll dig a little more though
pedrottimark
left a comment
There was a problem hiding this comment.
Clear changes to achieve the goal.
storedUsernameis excellent attention to detail for interactive behavior- 3 comments for your consideration for possible follow up contributions.
vjwilson
left a comment
There was a problem hiding this comment.
Left a high-level suggestion, a couple of comments, and a usage question.
| @@ -0,0 +1,35 @@ | |||
| import React, { ReactElement, ReactNode } from 'react'; | |||
There was a problem hiding this comment.
I prefer not to create extra reusable components that really wrap other reusable components (like PatternFly elements) and don't add much value or abstraction to the original reusable components.
Reusable components of reusable components remind me of Aristotle's "third-man" argument against Plato's theory of forms.
https://educalingo.com/en/dic-en/third-man-argument
There was a problem hiding this comment.
I went back and forth on this – ultimately decided to create the component because it looks like we're using a button every time the popover is being used (I assume ADA reasons?) but I'm not hard stuck on this being the right approach and I could easily be swayed both ways
| type="button" | ||
| aria-label={ariaLabel} | ||
| onClick={(e) => e.preventDefault()} | ||
| aria-describedby="simple-form-name-01" |
There was a problem hiding this comment.
I see where you saw the example of both aria-label and aria-describedby together, but I think they are redundant, and in this case the -describedby variant is unhelpful and better dropped. (Could also be dropped to improve the example locations, too.)
Whether you replace this component with direct use of the PatternFly pattern, or keep it, the aria-describedby should be deleted.
| aria-label={ariaLabel} | ||
| onClick={(e) => e.preventDefault()} | ||
| aria-describedby="simple-form-name-01" | ||
| className={className} |
There was a problem hiding this comment.
When we do use className prop, let's make it optional, either with a default function param (className = '') or allow it to be appended to a necessary foundation className.
There was a problem hiding this comment.
I'll go ahead and just remove the component, it looks like the other instances where we use the popover + button are unique enough to where I can see this reusable component getting cluttered
| function onUpdateUnauthenticatedChange(isChecked) { | ||
| if (isChecked) { | ||
| setStoredUsername(values.notifier.email.username); | ||
| setFieldValue('notifier.email.username', ''); |
There was a problem hiding this comment.
@theencee Should we be clearing out the username when switching to unauthenticated, or is a username still required in certain cases?
(More importantly, is it required for the customer who asked for this feature?)
There was a problem hiding this comment.
Unauth has optional username @vjwilson so safe to clear out
Description
We want to allow users the ability to configure email integrations without having to authenticate with SMTP
Checklist
Testing Performed
On create

---On edit
On create (vulnerability management modal)