Skip to content

ROX-12343: unauthenticated email integration#2984

Merged
bradr5 merged 2 commits intomasterfrom
ROX-12343-unauthenticated-email-integration
Sep 7, 2022
Merged

ROX-12343: unauthenticated email integration#2984
bradr5 merged 2 commits intomasterfrom
ROX-12343-unauthenticated-email-integration

Conversation

@bradr5
Copy link
Contributor

@bradr5 bradr5 commented Sep 7, 2022

Description

We want to allow users the ability to configure email integrations without having to authenticate with SMTP

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
  • Evaluated and added CHANGELOG entry if required
  • Determined and documented upgrade steps
  • Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)

Testing Performed

On create

Screen Shot 2022-09-07 at 1 33 43 AM

---

Screen Shot 2022-09-07 at 1 35 34 AM

Screen Shot 2022-09-07 at 1 34 00 AM

On edit

Screen Shot 2022-09-07 at 1 34 30 AM

Screen Shot 2022-09-07 at 1 34 41 AM

On create (vulnerability management modal)

Screen Shot 2022-09-07 at 1 35 07 AM

@bradr5 bradr5 requested review from a team, pedrottimark and vjwilson September 7, 2022 06:32
@ghost
Copy link

ghost commented Sep 7, 2022

Images are ready for the commit at dfe22f1.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.71.x-503-gdfe22f16c5.

@openshift-ci
Copy link

openshift-ci bot commented Sep 7, 2022

@bradr5: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-ui-e2e-tests e3eea58 link false /test gke-ui-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@pedrottimark
Copy link
Contributor

The integration test failure is not related to these changes.

should display all the columns expected in node components list page

Timed out retrying after 5000ms: cy.wait() timed out waiting 5000ms for the 1st request to the route: auth/status. No request ever occurred.

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."
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good callout. We can change that but who typically signs off on copy changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question. I will answer via direct message.

Copy link
Contributor

Choose a reason for hiding this comment

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

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."

Suggested change
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';
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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">
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

@pedrottimark pedrottimark left a comment

Choose a reason for hiding this comment

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

Clear changes to achieve the goal.

  • storedUsername is excellent attention to detail for interactive behavior
  • 3 comments for your consideration for possible follow up contributions.

Copy link
Contributor

@vjwilson vjwilson left a comment

Choose a reason for hiding this comment

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

Left a high-level suggestion, a couple of comments, and a usage question.

@@ -0,0 +1,35 @@
import React, { ReactElement, ReactNode } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

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

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 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"
Copy link
Contributor

Choose a reason for hiding this comment

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

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}
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

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'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', '');
Copy link
Contributor

Choose a reason for hiding this comment

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

@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?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Unauth has optional username @vjwilson so safe to clear out

@bradr5 bradr5 merged commit 257df54 into master Sep 7, 2022
@bradr5 bradr5 deleted the ROX-12343-unauthenticated-email-integration branch September 7, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants