You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "nsivarajan (via GitHub)" <gi...@apache.org> on 2024/06/05 10:50:32 UTC

[PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

nsivarajan opened a new pull request, #29088:
URL: https://github.com/apache/superset/pull/29088

   ### SUMMARY
   Addition of an option to provide **cc and bcc list** for email notifications along with email validation under Alerts and Reports.
   
   ### SAMPLE SCREENSHOT
   
   <img width="388" alt="image" src="https://github.com/apache/superset/assets/117266407/821590d3-de1c-4d15-b9d8-06532d008843">
   
   ### TESTING INSTRUCTIONS
   
   - Open Superset in browser > Click on the "Settings" menu on top right > Click on "Alerts & Reports"
   - Create a new alert/report or edit an existing alert/report. Enter the required details.
   - Select "Email" as the preferred notification method.
   - Enter valid/invalid email ids in the To field, CC and BCC fields and hit add/save to test the feature.
   
   ### CONTRIBUTORS
   nsivarajan, episkey24
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [X] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684198864


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   Please could you suggest , can I change `role` with `data-testid`
   
   like below
   
   ```
                  <span
                     className="ghost-button"
                     data-testid="ccbutton"
                     tabIndex={0}
                     onClick={() => setCcVisible(true)}
                     style={{ display: ccVisible ? 'none' : 'inline-flex' }}
                   >
   ```
   
   ```
                 <span
                   data-testid="delbutton"
                   tabIndex={0}
                   className="delete-button"
                   onClick={() => onRemove(index)}
                 >
   
   ```
   
   ```
                   <span
                     className="ghost-button"
                     data-testid="bccbutton"
                     tabIndex={0}
                     onClick={() => setBccVisible(true)}
                     style={{ display: bccVisible ? 'none' : 'inline-flex' }}
                   >
   ```
   
   and relevant test case to evaluate real delete is as below
   
   ```
   const deleteButton = screen.getByTestId('delbutton');
   userEvent.click(deleteButton);
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1672439219


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -178,57 +256,134 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
         </StyledInputContainer>
       </div>
       {method !== undefined ? (
-        <>
-          <div className="inline-container">
-            <StyledInputContainer>
-              {method === 'Email' ? (
-                <>
-                  <div className="control-label">
-                    {TRANSLATIONS.EMAIL_SUBJECT_NAME}
+        method === 'Email' ? (
+          <StyledInputContainer>
+            <div className="control-label">
+              {t('To')}
+              <span className="required">*</span>
+            </div>
+            <div className="input-container">
+              <textarea
+                name="To"
+                data-test="recipients"
+                value={recipientValue}
+                onChange={onRecipientsChange}
+              />
+            </div>
+            <div className="input-container">
+              <div className="helper">
+                {t('Recipients are separated by "," or ";"')}
+              </div>
+            </div>
+            {/* Render "CC" input field if ccVisible is true */}
+            {ccVisible && (
+              <>
+                <div className="control-label">
+                  {TRANSLATIONS.EMAIL_CC_NAME}
+                </div>
+                <div className="input-container">
+                  <textarea
+                    name="CC"
+                    data-test="cc"
+                    value={ccValue}
+                    onChange={onCcChange}
+                  />
+                </div>
+                <div className="input-container">
+                  <div className="helper">
+                    {t('Recipients are separated by "," or ";"')}
                   </div>
-                  <div className={`input-container ${error ? 'error' : ''}`}>
-                    <input
-                      type="text"
-                      name="email_subject"
-                      value={email_subject}
-                      placeholder={defaultSubject}
-                      onChange={onSubjectChange}
-                    />
+                </div>
+              </>
+            )}
+            {/* Render "BCC" input field if bccVisible is true */}
+            {bccVisible && (
+              <>
+                <div className="control-label">
+                  {TRANSLATIONS.EMAIL_BCC_NAME}
+                </div>
+                <div className="input-container">
+                  <textarea
+                    name="BCC"
+                    data-test="bcc"
+                    value={bccValue}
+                    onChange={onBccChange}
+                  />
+                </div>
+                <div className="input-container">
+                  <div className="helper">
+                    {t('Recipients are separated by "," or ";"')}
                   </div>
-                  {error && (
-                    <div
-                      style={{
-                        color: theme.colors.error.base,
-                        fontSize: theme.gridUnit * 3,
-                      }}
-                    >
-                      {TRANSLATIONS.EMAIL_SUBJECT_ERROR_TEXT}
-                    </div>
-                  )}
-                </>
-              ) : null}
-            </StyledInputContainer>
-          </div>
-          <div className="inline-container">
-            <StyledInputContainer>
-              <div className="control-label">
-                {t('%s recipients', method)}
-                <span className="required">*</span>
-              </div>
-              <div className="input-container">
-                <textarea
-                  name="recipients"
-                  data-test="recipients"
-                  value={recipientValue}
-                  onChange={onRecipientsChange}
-                />
+                </div>
+              </>
+            )}
+            {/* New buttons container */}
+            <div className="ghost-button">
+              <span
+                className="ghost-button"
+                role="button"
+                tabIndex={0}
+                onClick={() => setCcVisible(true)}
+                style={{ display: ccVisible ? 'none' : 'inline-flex' }}
+              >
+                <Icons.Email className="icon" />
+                {t('Add CC Recipients')}
+              </span>
+              <span
+                className="ghost-button"
+                role="button"
+                tabIndex={0}
+                onClick={() => setBccVisible(true)}
+                style={{ display: bccVisible ? 'none' : 'inline-flex' }}
+              >
+                <Icons.Email className="icon" />
+                {t('Add BCC Recipients')}
+              </span>
+            </div>
+            <div className="control-label">
+              {TRANSLATIONS.EMAIL_SUBJECT_NAME}
+            </div>
+            <div className={`input-container ${error ? 'error' : ''}`}>
+              <input
+                type="text"
+                name="email_subject"
+                value={email_subject}
+                placeholder={defaultSubject}
+                onChange={onSubjectChange}
+              />
+            </div>
+            {error && (
+              <div
+                style={{
+                  color: theme.colors.error.base,
+                  fontSize: theme.gridUnit * 3,

Review Comment:
   We’ve got specific theme variables for font sizes - check out typography part of superset theme



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1644894896


##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -1010,6 +1014,29 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
     return hasInfo;
   };
 
+  const checkEmailFormat = () => {
+    if (!notificationSettings.length) {
+      return true;
+    }
+
+    const validateEmails = (emails: string): boolean => {
+      if (!emails) return true; // No emails to validate
+      return emails
+        .split(/[,;]/)

Review Comment:
   Should we add whitespace?
   ```suggestion
           .split(/[,\s;]/)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2224291923

   Thanks @rusackas,
   
   The Python-Integration tests for test-mysql (pull_request) and test-postgres (current) (pull_request) are failing, although both passed successfully on my local setup. A retrigger should resolve this.
   
   Appreciate your assistance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2155835137

   @nytai Thanks for raising these points. In our use of Superset's alerts and reports feature, TO recipients receive actionable items, CC recipients—including leadership, hierarchical levels, and cross-functional teams—benefit from increased visibility into the communication without being directly responsible for action, while BCC recipients discreetly monitor email delivery and processes.
   
   I've addressed the failing checks and added test cases,Could you please assist with triggering the workflow/checks again?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684119879


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;
 
-  .input-container {
-    textarea {
-      height: auto;
+    .input-container {
+      textarea {
+        height: auto;
+      }
+
+      &.error {
+        input {
+          border-color: ${theme.colors.error.base};
+        }
+      }
+
+      .helper {
+        margin-top: ${theme.gridUnit * 2}px;
+        font-size: ${theme.typography.sizes.s}px;
+        color: ${theme.colors.grayscale.base};
+      }
     }
 
-    &.error {
-      input {
-        border-color: ${({ theme }) => theme.colors.error.base};
+    .inline-container {
+      margin-bottom: ${theme.gridUnit * 2}px;
+
+      > div {
+        margin: ${theme.gridUnit * 0}px;
+      }
+
+      .delete-button {
+        margin-left: ${theme.gridUnit * 2}px;
+        padding-top: ${theme.gridUnit}px;
       }
     }
-  }
 
-  .inline-container {
-    margin-bottom: 10px;
+    .ghost-button {
+      color: ${theme.colors.primary.dark1};
+      display: inline-flex;
+      align-items: center;
+      font-size: ${theme.typography.sizes.s}px;
+      cursor: pointer;
+      margin-top: ${theme.gridUnit}px;
 
-    > div {
-      margin: 0;
+      .icon {
+        width: ${theme.gridUnit * 3}px;
+        height: ${theme.gridUnit * 3}px;
+        font-size: ${theme.typography.sizes.s}px;
+        margin-right: ${theme.gridUnit}px;
+      }
     }
 
-    .delete-button {
-      margin-left: 10px;
-      padding-top: 3px;
+    .ghost-button + .ghost-button {
+      margin-left: ${theme.gridUnit * 4}px;
     }
-  }
+
+    .ghost-button:first-child[style*='none'] + .ghost-button {
+      margin-left: ${
+        theme.gridUnit * 0

Review Comment:
   Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2220267265

   @kasiazjc 
   
   Thank you for your feedback! I've incorporated the requested adjustments into the PR.
   
   Could you please review the changes once more to confirm they meet the requirements? Additionally, I would appreciate your assistance in merging this PR.
   
   
   <img width="516" alt="Screenshot 2024-07-10 at 2 01 32 PM" src="https://github.com/apache/superset/assets/117266407/28802033-3b92-4123-86dd-4a7b516f6bbf">
   <img width="377" alt="Screenshot 2024-07-10 at 4 30 45 PM" src="https://github.com/apache/superset/assets/117266407/aa4aca16-8e72-4f3a-9a98-3243a0a1bf60">
   <img width="374" alt="Screenshot 2024-07-10 at 4 33 03 PM" src="https://github.com/apache/superset/assets/117266407/46079bc8-a953-4b95-b399-962b8a841403">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2229288061

   FEATURE_ALERT_REPORTS=True /testenv up 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2229292165

   /testenv up FEATURE_ALERT_REPORTS=true
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2232307358

   @villebro @eschutho Thank you for spinning up the ephemeral environment. Could you please review and assist with merging this PR? Your support in moving this forward would be greatly appreciated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684694131


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   yeah its definitely flaky... I re-run it, hopefully it passes now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1680361075


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   @kgabryje Could you please review and resolve the conversation?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1682697687


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;
 
-  .input-container {
-    textarea {
-      height: auto;
+    .input-container {
+      textarea {
+        height: auto;
+      }
+
+      &.error {
+        input {
+          border-color: ${theme.colors.error.base};
+        }
+      }
+
+      .helper {
+        margin-top: ${theme.gridUnit * 2}px;
+        font-size: ${theme.typography.sizes.s}px;
+        color: ${theme.colors.grayscale.base};
+      }
     }
 
-    &.error {
-      input {
-        border-color: ${({ theme }) => theme.colors.error.base};
+    .inline-container {
+      margin-bottom: ${theme.gridUnit * 2}px;
+
+      > div {
+        margin: ${theme.gridUnit * 0}px;
+      }
+
+      .delete-button {
+        margin-left: ${theme.gridUnit * 2}px;
+        padding-top: ${theme.gridUnit}px;
       }
     }
-  }
 
-  .inline-container {
-    margin-bottom: 10px;
+    .ghost-button {
+      color: ${theme.colors.primary.dark1};
+      display: inline-flex;
+      align-items: center;
+      font-size: ${theme.typography.sizes.s}px;
+      cursor: pointer;
+      margin-top: ${theme.gridUnit}px;
 
-    > div {
-      margin: 0;
+      .icon {
+        width: ${theme.gridUnit * 3}px;
+        height: ${theme.gridUnit * 3}px;
+        font-size: ${theme.typography.sizes.s}px;
+        margin-right: ${theme.gridUnit}px;
+      }
     }
 
-    .delete-button {
-      margin-left: 10px;
-      padding-top: 3px;
+    .ghost-button + .ghost-button {
+      margin-left: ${theme.gridUnit * 4}px;
     }
-  }
+
+    .ghost-button:first-child[style*='none'] + .ghost-button {
+      margin-left: ${
+        theme.gridUnit * 0

Review Comment:
   same here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1672436139


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   Can we use theme variables for all spacings and font sizes?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684672039


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   @kgabryje 
   
   The "Python-Integration / test-mysql (pull_request)" job is failing intermittently and appears to be flaky. A retrigger or reattempt should succeed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2225215689

   /testenv up FLAG_ALERT_REPORTS=True


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1680361164


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -178,57 +256,134 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
         </StyledInputContainer>
       </div>
       {method !== undefined ? (
-        <>
-          <div className="inline-container">
-            <StyledInputContainer>
-              {method === 'Email' ? (
-                <>
-                  <div className="control-label">
-                    {TRANSLATIONS.EMAIL_SUBJECT_NAME}
+        method === 'Email' ? (
+          <StyledInputContainer>
+            <div className="control-label">
+              {t('To')}
+              <span className="required">*</span>
+            </div>
+            <div className="input-container">
+              <textarea
+                name="To"
+                data-test="recipients"
+                value={recipientValue}
+                onChange={onRecipientsChange}
+              />
+            </div>
+            <div className="input-container">
+              <div className="helper">
+                {t('Recipients are separated by "," or ";"')}
+              </div>
+            </div>
+            {/* Render "CC" input field if ccVisible is true */}
+            {ccVisible && (
+              <>
+                <div className="control-label">
+                  {TRANSLATIONS.EMAIL_CC_NAME}
+                </div>
+                <div className="input-container">
+                  <textarea
+                    name="CC"
+                    data-test="cc"
+                    value={ccValue}
+                    onChange={onCcChange}
+                  />
+                </div>
+                <div className="input-container">
+                  <div className="helper">
+                    {t('Recipients are separated by "," or ";"')}
                   </div>
-                  <div className={`input-container ${error ? 'error' : ''}`}>
-                    <input
-                      type="text"
-                      name="email_subject"
-                      value={email_subject}
-                      placeholder={defaultSubject}
-                      onChange={onSubjectChange}
-                    />
+                </div>
+              </>
+            )}
+            {/* Render "BCC" input field if bccVisible is true */}
+            {bccVisible && (
+              <>
+                <div className="control-label">
+                  {TRANSLATIONS.EMAIL_BCC_NAME}
+                </div>
+                <div className="input-container">
+                  <textarea
+                    name="BCC"
+                    data-test="bcc"
+                    value={bccValue}
+                    onChange={onBccChange}
+                  />
+                </div>
+                <div className="input-container">
+                  <div className="helper">
+                    {t('Recipients are separated by "," or ";"')}
                   </div>
-                  {error && (
-                    <div
-                      style={{
-                        color: theme.colors.error.base,
-                        fontSize: theme.gridUnit * 3,
-                      }}
-                    >
-                      {TRANSLATIONS.EMAIL_SUBJECT_ERROR_TEXT}
-                    </div>
-                  )}
-                </>
-              ) : null}
-            </StyledInputContainer>
-          </div>
-          <div className="inline-container">
-            <StyledInputContainer>
-              <div className="control-label">
-                {t('%s recipients', method)}
-                <span className="required">*</span>
-              </div>
-              <div className="input-container">
-                <textarea
-                  name="recipients"
-                  data-test="recipients"
-                  value={recipientValue}
-                  onChange={onRecipientsChange}
-                />
+                </div>
+              </>
+            )}
+            {/* New buttons container */}
+            <div className="ghost-button">
+              <span
+                className="ghost-button"
+                role="button"
+                tabIndex={0}
+                onClick={() => setCcVisible(true)}
+                style={{ display: ccVisible ? 'none' : 'inline-flex' }}
+              >
+                <Icons.Email className="icon" />
+                {t('Add CC Recipients')}
+              </span>
+              <span
+                className="ghost-button"
+                role="button"
+                tabIndex={0}
+                onClick={() => setBccVisible(true)}
+                style={{ display: bccVisible ? 'none' : 'inline-flex' }}
+              >
+                <Icons.Email className="icon" />
+                {t('Add BCC Recipients')}
+              </span>
+            </div>
+            <div className="control-label">
+              {TRANSLATIONS.EMAIL_SUBJECT_NAME}
+            </div>
+            <div className={`input-container ${error ? 'error' : ''}`}>
+              <input
+                type="text"
+                name="email_subject"
+                value={email_subject}
+                placeholder={defaultSubject}
+                onChange={onSubjectChange}
+              />
+            </div>
+            {error && (
+              <div
+                style={{
+                  color: theme.colors.error.base,
+                  fontSize: theme.gridUnit * 3,

Review Comment:
   @kgabryje Could you please review and resolve the conversation?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1680617095


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   Sorry for the delay! As a rule we try to avoid fractions of grid units like `gridUnit * 2.5` or `gridUnit * 0.75`. Could you please round those values to whole grid units?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2229326984

   @eschutho Ephemeral environment spinning up at http://54.184.34.192:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2185562164

   @eschutho Thanks for checking. Each report will have its own configurable CC and BCC recipients, allowing for specific recipients to be designated as needed.
   
    For example, the Sales dashboard will have its own CC and BCC recipients, and similarly, the Manufacturing dashboard will have its own CC and BCC recipients. This approach provides flexibility and ensures that the appropriate people are included for each report.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684198864


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   Please could you suggest , can I change `role` with `data-testid`
   
   like below
   
   ```
                  <span
                     className="ghost-button"
                     data-testid="ccbutton"
                     tabIndex={0}
                     onClick={() => setCcVisible(true)}
                     style={{ display: ccVisible ? 'none' : 'inline-flex' }}
                   >
   ```
   
   ```
                 <span
                   data-testid="delbutton"
                   tabIndex={0}
                   className="delete-button"
                   onClick={() => onRemove(index)}
                 >
   
   ```
   
   ```
                   <span
                     className="ghost-button"
                     data-testid="bccbutton"
                     tabIndex={0}
                     onClick={() => setBccVisible(true)}
                     style={{ display: bccVisible ? 'none' : 'inline-flex' }}
                   >
   ```
   
   and relevant test case to evaluate real delete is as below
   
   ```
   const deleteButton = screen.getByTestId('delbutton');
   userEvent.click(deleteButton);
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2243472406

   Merged, thanks for the contribution @nsivarajan!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1682697440


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;
 
-  .input-container {
-    textarea {
-      height: auto;
+    .input-container {
+      textarea {
+        height: auto;
+      }
+
+      &.error {
+        input {
+          border-color: ${theme.colors.error.base};
+        }
+      }
+
+      .helper {
+        margin-top: ${theme.gridUnit * 2}px;
+        font-size: ${theme.typography.sizes.s}px;
+        color: ${theme.colors.grayscale.base};
+      }
     }
 
-    &.error {
-      input {
-        border-color: ${({ theme }) => theme.colors.error.base};
+    .inline-container {
+      margin-bottom: ${theme.gridUnit * 2}px;
+
+      > div {
+        margin: ${theme.gridUnit * 0}px;

Review Comment:
   If it's 0 it's fine to just put `0px` since that won't really depend on gridUnit's value 😄 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2236294945

   /testenv up


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nytai (via GitHub)" <gi...@apache.org>.
nytai commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2151319550

   @nsivarajan can you please describe why this features is useful and what problem it's solving? I'm not sure it's clear why having someone cc'd on the notification email would be any different than just adding directly to the recipients list. For BCC I can see a use case where someone would silently like to know if the report is delivered as expected, but are there any others? 
   
   
   Please address the failing checks and add some unit/integration tests for this functionality 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2243473078

   Ephemeral environment shutdown and build artifacts deleted.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2225232416

   @villebro Ephemeral environment spinning up at http://34.218.252.68:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1680949149


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   Side note - you might notice that there are some components that use fractions of grid units. However, those are old components created before we started enforcing that rule and those haven't been refactored yet. In new code we should stick to the full grid units



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1680992435


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   @kgabryje Thanks for detailed explanation.
   
    I have done below changes and pushed commit. Please assist with triggering the CI and resolving comment, and bringing up ephemeral env as needed.
   
   ```
   -      margin-bottom: ${theme.gridUnit * 2.5}px;
   +      margin-bottom: ${theme.gridUnit * 2}px;
   -        margin-left: ${theme.gridUnit * 2.5}px;
   -        padding-top: ${theme.gridUnit * 0.75}px;
   +        margin-left: ${theme.gridUnit * 2}px;
   +        padding-top: ${theme.gridUnit}px;
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684616171


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   Thanks @kgabryje !  Updated test case and validated to be success.
   
   ```
   npm run test -- --silent src/features/alerts/components/NotificationMethod.test.tsx
   
    PASS  src/features/alerts/components/NotificationMethod.test.tsx
   
   Test Suites: 1 passed, 1 total
   Tests:       7 passed, 7 total
   Snapshots:   0 total
   Time:        4.149 s, estimated 7 s
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2236315838

   @kgabryje Ephemeral environment spinning up at http://54.245.193.57:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1674263552


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -178,57 +256,134 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
         </StyledInputContainer>
       </div>
       {method !== undefined ? (
-        <>
-          <div className="inline-container">
-            <StyledInputContainer>
-              {method === 'Email' ? (
-                <>
-                  <div className="control-label">
-                    {TRANSLATIONS.EMAIL_SUBJECT_NAME}
+        method === 'Email' ? (
+          <StyledInputContainer>
+            <div className="control-label">
+              {t('To')}
+              <span className="required">*</span>
+            </div>
+            <div className="input-container">
+              <textarea
+                name="To"
+                data-test="recipients"
+                value={recipientValue}
+                onChange={onRecipientsChange}
+              />
+            </div>
+            <div className="input-container">
+              <div className="helper">
+                {t('Recipients are separated by "," or ";"')}
+              </div>
+            </div>
+            {/* Render "CC" input field if ccVisible is true */}
+            {ccVisible && (
+              <>
+                <div className="control-label">
+                  {TRANSLATIONS.EMAIL_CC_NAME}
+                </div>
+                <div className="input-container">
+                  <textarea
+                    name="CC"
+                    data-test="cc"
+                    value={ccValue}
+                    onChange={onCcChange}
+                  />
+                </div>
+                <div className="input-container">
+                  <div className="helper">
+                    {t('Recipients are separated by "," or ";"')}
                   </div>
-                  <div className={`input-container ${error ? 'error' : ''}`}>
-                    <input
-                      type="text"
-                      name="email_subject"
-                      value={email_subject}
-                      placeholder={defaultSubject}
-                      onChange={onSubjectChange}
-                    />
+                </div>
+              </>
+            )}
+            {/* Render "BCC" input field if bccVisible is true */}
+            {bccVisible && (
+              <>
+                <div className="control-label">
+                  {TRANSLATIONS.EMAIL_BCC_NAME}
+                </div>
+                <div className="input-container">
+                  <textarea
+                    name="BCC"
+                    data-test="bcc"
+                    value={bccValue}
+                    onChange={onBccChange}
+                  />
+                </div>
+                <div className="input-container">
+                  <div className="helper">
+                    {t('Recipients are separated by "," or ";"')}
                   </div>
-                  {error && (
-                    <div
-                      style={{
-                        color: theme.colors.error.base,
-                        fontSize: theme.gridUnit * 3,
-                      }}
-                    >
-                      {TRANSLATIONS.EMAIL_SUBJECT_ERROR_TEXT}
-                    </div>
-                  )}
-                </>
-              ) : null}
-            </StyledInputContainer>
-          </div>
-          <div className="inline-container">
-            <StyledInputContainer>
-              <div className="control-label">
-                {t('%s recipients', method)}
-                <span className="required">*</span>
-              </div>
-              <div className="input-container">
-                <textarea
-                  name="recipients"
-                  data-test="recipients"
-                  value={recipientValue}
-                  onChange={onRecipientsChange}
-                />
+                </div>
+              </>
+            )}
+            {/* New buttons container */}
+            <div className="ghost-button">
+              <span
+                className="ghost-button"
+                role="button"
+                tabIndex={0}
+                onClick={() => setCcVisible(true)}
+                style={{ display: ccVisible ? 'none' : 'inline-flex' }}
+              >
+                <Icons.Email className="icon" />
+                {t('Add CC Recipients')}
+              </span>
+              <span
+                className="ghost-button"
+                role="button"
+                tabIndex={0}
+                onClick={() => setBccVisible(true)}
+                style={{ display: bccVisible ? 'none' : 'inline-flex' }}
+              >
+                <Icons.Email className="icon" />
+                {t('Add BCC Recipients')}
+              </span>
+            </div>
+            <div className="control-label">
+              {TRANSLATIONS.EMAIL_SUBJECT_NAME}
+            </div>
+            <div className={`input-container ${error ? 'error' : ''}`}>
+              <input
+                type="text"
+                name="email_subject"
+                value={email_subject}
+                placeholder={defaultSubject}
+                onChange={onSubjectChange}
+              />
+            </div>
+            {error && (
+              <div
+                style={{
+                  color: theme.colors.error.base,
+                  fontSize: theme.gridUnit * 3,

Review Comment:
   @kgabryje Thank you for the review! I've refactored styles to use theme variables for spacings and font sizes. Could you please merge this PR?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1680911776


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   Before making adjustments, I'd like confirmation on aligning with our guideline to avoid fractional grid units. Based on our 4px gridUnit definition, here are the proposed changes:
   
   ```
   - margin-bottom: ${theme.gridUnit * 2.5}px;
   + margin-bottom: ${theme.gridUnit * 2 + 2}px;
   
   - margin-left: ${theme.gridUnit * 2.5}px;
   - padding-top: ${theme.gridUnit * 0.75}px;
   + margin-left: ${theme.gridUnit * 2 + 2}px;
   + padding-top: ${theme.gridUnit - 1}px;
   ```
   
   Please review and confirm so I can proceed accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684162214


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   `role` attribute should only use [aria roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role) since the application's accessibility depends on it.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684191091


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;
 
-  .input-container {
-    textarea {
-      height: auto;
+    .input-container {
+      textarea {
+        height: auto;
+      }
+
+      &.error {
+        input {
+          border-color: ${theme.colors.error.base};
+        }
+      }
+
+      .helper {
+        margin-top: ${theme.gridUnit * 2}px;
+        font-size: ${theme.typography.sizes.s}px;
+        color: ${theme.colors.grayscale.base};
+      }
     }
 
-    &.error {
-      input {
-        border-color: ${({ theme }) => theme.colors.error.base};
+    .inline-container {
+      margin-bottom: ${theme.gridUnit * 2}px;
+
+      > div {
+        margin: ${theme.gridUnit * 0}px;

Review Comment:
   Please could you suggest, can I change `role` with `data-testid` . 
   
   like below
   
   
   ```
   <span
       data-testid="delbutton"
       tabIndex={0}
       className="delete-button"
       onClick={() => onRemove(index)}
   >
   ```
   
   ```
   <span
       data-testid="ccbutton"
       tabIndex={0}
       className="delete-button"
       onClick={() => onRemove(index)}
   >
   ```
   
   
                 
   and test case for specific delete button as 
   
   ```
   const deleteButton = screen.getByTestId('delbutton');
   userEvent.click(deleteButton);
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1682698536


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   Thank you! Spotted 1 remaining fraction, and we can just use 0px instead of theme.gridUnit * 0 🙂 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2236295368

   /testenv up FEATURE_ALERT_REPORTS=true


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kasiazjc (via GitHub)" <gi...@apache.org>.
kasiazjc commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2218027167

   > @kasiazjc Thank you for your great suggestions and detailed review! I've incorporated the feedback and completed the changes with a commit.
   > 
   > Could you please assist with reviewing the PR to ensure everything aligns correctly? Your help in getting this merged would be greatly appreciated.
   > 
   > <img alt="Screenshot 2024-07-08 at 10 04 37 PM" width="367" src="https://private-user-images.githubusercontent.com/117266407/346650506-dfba0f93-5832-43ed-9308-c446d40e6456.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1MzkxMjYsIm5iZiI6MTcyMDUzODgyNiwicGF0aCI6Ii8xMTcyNjY0MDcvMzQ2NjUwNTA2LWRmYmEwZjkzLTU4MzItNDNlZC05MzA4LWM0NDZkNDBlNjQ1Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwOVQxNTI3MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01OGJlMWQ3NDYwOTU3NWFmYmEyMGJlNjJlZGJiMWE3Mzg2ODBlNmFkNzZlOGYxZmM0YzZjZjY5NzhhYzliYjYxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7XAX7zKZ9PbVsxSOL1VV5f9PtdVxPo61UPOiKzascLw"> <img alt="Screenshot 2024-07-08 at 10 06 07 PM" width="367" src="https://private-user-images.githubus
 ercontent.com/117266407/346650524-b8f47f7d-0cdf-448d-ba3b-958fd88b2fa5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1MzkxMjYsIm5iZiI6MTcyMDUzODgyNiwicGF0aCI6Ii8xMTcyNjY0MDcvMzQ2NjUwNTI0LWI4ZjQ3ZjdkLTBjZGYtNDQ4ZC1iYTNiLTk1OGZkODhiMmZhNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwOVQxNTI3MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yYWE0ODllZWMzMzBiMjVlMGE0ZGUwNzgzNWY0NDAyOWMzOGM2YTg2YmEyMTA3N2VlODZhZTIzMThkMzZjZTViJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.48L-OtzseDFNkJAWBPKZaJGYs7JE333hEzgYZazuvSo"> <img alt="Screenshot 2024-07-08 at 10 07 38 PM" width="370" src="https://private-user-images.githubusercontent.com/117266407/346650528-128a38c4-af37-49db-8b5e-074ebb06b280.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6
 IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1MzkxMjYsIm5iZiI6MTcyMDUzODgyNiwicGF0aCI6Ii8xMTcyNjY0MDcvMzQ2NjUwNTI4LTEyOGEzOGM0LWFmMzctNDlkYi04YjVlLTA3NGViYjA2YjI4MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwOVQxNTI3MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zM2NmODZkMDZiMTYwYjBiMGYyNjFkNjdiNGEwNmNmODg1ZmMzZWM2NjRhZjgwNGE0NjExYzg1OTQ0MmNkYTM4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.2PQdnmzApeYhTCZIIfSXxjRHmQAFhKtgX64rvR6vHto"> <img alt="Screenshot 2024-07-08 at 10 08 50 PM" width="367" src="https://private-user-images.githubusercontent.com/117266407/346650531-e267ae22-a2ec-4b8b-be35-8bbc51f8aa3a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOj
 E3MjA1MzkxMjYsIm5iZiI6MTcyMDUzODgyNiwicGF0aCI6Ii8xMTcyNjY0MDcvMzQ2NjUwNTMxLWUyNjdhZTIyLWEyZWMtNGI4Yi1iZTM1LThiYmM1MWY4YWEzYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwOVQxNTI3MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xZGE2YTczNzY1NGI3ODczNjQxM2IyZWFmMmIzZWRlZDZmZmRjYTkzMzliMDY2YjgyZjMxNGIzYTQxOTZiMzhiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.sxWQ25Fh_g0NaS9HIMND32OX7n6sc3dqscAYU3_u-_w">
   
   Thank you for the changes, this looks good! I have two small things: 
   - I think envelope icon might be bigger than 12px, can you make it smaller? Also align both text and icon to the center (should be looking similar to the "button" below with "+ add new notification method" 
   - when you add one field, the button is not aligned to the left "add bcc..." and there is some space left, can it be in one line with all of the other fields etc aligned to the left? 
   <img width="256" alt="image" src="https://github.com/apache/superset/assets/36897697/9349b776-5e90-45f9-8ebf-a24f671863e9">
   
   <img width="256" alt="image" src="https://github.com/apache/superset/assets/36897697/0ba14f6a-acc0-465b-b838-ee6b957179e8">
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2224130684

   restarted some failing tests... hoping they're just flaky 🤞 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2185326423

   @nsivarajan curious if you're looking for cc/bcc for each report, or if you want the same cc/bcc list for all reports. If it's the later, there's a [recent feature](https://github.com/apache/superset/pull/27851) that would allow you to add cc to all emails. We could also add a bcc there. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1685933958


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   Thanks again, @kgabryje! All tests are now successful. Please assist with merging this PR.



##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   Thanks again, @kgabryje! All tests are now successful. Please assist with merging this PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje merged PR #29088:
URL: https://github.com/apache/superset/pull/29088


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684117778


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;
 
-  .input-container {
-    textarea {
-      height: auto;
+    .input-container {
+      textarea {
+        height: auto;
+      }
+
+      &.error {
+        input {
+          border-color: ${theme.colors.error.base};
+        }
+      }
+
+      .helper {
+        margin-top: ${theme.gridUnit * 2}px;
+        font-size: ${theme.typography.sizes.s}px;
+        color: ${theme.colors.grayscale.base};
+      }
     }
 
-    &.error {
-      input {
-        border-color: ${({ theme }) => theme.colors.error.base};
+    .inline-container {
+      margin-bottom: ${theme.gridUnit * 2}px;
+
+      > div {
+        margin: ${theme.gridUnit * 0}px;
+      }
+
+      .delete-button {
+        margin-left: ${theme.gridUnit * 2}px;
+        padding-top: ${theme.gridUnit}px;
       }
     }
-  }
 
-  .inline-container {
-    margin-bottom: 10px;
+    .ghost-button {
+      color: ${theme.colors.primary.dark1};
+      display: inline-flex;
+      align-items: center;
+      font-size: ${theme.typography.sizes.s}px;
+      cursor: pointer;
+      margin-top: ${theme.gridUnit}px;
 
-    > div {
-      margin: 0;
+      .icon {
+        width: ${theme.gridUnit * 3}px;
+        height: ${theme.gridUnit * 3}px;
+        font-size: ${theme.typography.sizes.s}px;
+        margin-right: ${theme.gridUnit}px;
+      }
     }
 
-    .delete-button {
-      margin-left: 10px;
-      padding-top: 3px;
+    .ghost-button + .ghost-button {
+      margin-left: ${theme.gridUnit * 4}px;
     }
-  }
+
+    .ghost-button:first-child[style*='none'] + .ghost-button {
+      margin-left: ${
+        theme.gridUnit * 0

Review Comment:
   Thanks! corrected to ```margin-left: 0px;```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684115901


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;

Review Comment:
   Oh yes, updated now with ```margin-bottom: ${theme.gridUnit * 3}px;```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2214686633

   @kasiazjc Thank you for your great suggestions and detailed review! I've incorporated the feedback and completed the changes with a commit.
   
   Could you please assist with reviewing the PR to ensure everything aligns correctly? Your help in getting this merged would be greatly appreciated.
   
   
   <img width="367" alt="Screenshot 2024-07-08 at 10 04 37 PM" src="https://github.com/apache/superset/assets/117266407/dfba0f93-5832-43ed-9308-c446d40e6456">
   <img width="367" alt="Screenshot 2024-07-08 at 10 06 07 PM" src="https://github.com/apache/superset/assets/117266407/b8f47f7d-0cdf-448d-ba3b-958fd88b2fa5">
   <img width="370" alt="Screenshot 2024-07-08 at 10 07 38 PM" src="https://github.com/apache/superset/assets/117266407/128a38c4-af37-49db-8b5e-074ebb06b280">
   <img width="367" alt="Screenshot 2024-07-08 at 10 08 50 PM" src="https://github.com/apache/superset/assets/117266407/e267ae22-a2ec-4b8b-be35-8bbc51f8aa3a">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1680946900


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   Not exactly - we use the grid units to enforce consistent spacing between elements and to maintain that consistent spacing in case the grid unit is changed (for example as a result of a user customising the theme). So in other words, we should just use full multiples of grid unit.
   Of course that takes away some flexibility, as you can't set a margin of 5, 6 or 7 pixels. You can just pick the closest grid unit (the closest multiple of 4) that looks good



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "kgabryje (via GitHub)" <gi...@apache.org>.
kgabryje commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1682696656


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;

Review Comment:
   ```suggestion
       margin-bottom: ${theme.gridUnit * 2}px;
   ```
   (or `* 3`)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1684116952


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -24,34 +24,77 @@ import { NotificationMethodOption, NotificationSetting } from '../types';
 import { StyledInputContainer } from '../AlertReportModal';
 
 const StyledNotificationMethod = styled.div`
-  margin-bottom: 10px;
+  ${({ theme }) => `
+    margin-bottom: ${theme.gridUnit * 2.5}px;
 
-  .input-container {
-    textarea {
-      height: auto;
+    .input-container {
+      textarea {
+        height: auto;
+      }
+
+      &.error {
+        input {
+          border-color: ${theme.colors.error.base};
+        }
+      }
+
+      .helper {
+        margin-top: ${theme.gridUnit * 2}px;
+        font-size: ${theme.typography.sizes.s}px;
+        color: ${theme.colors.grayscale.base};
+      }
     }
 
-    &.error {
-      input {
-        border-color: ${({ theme }) => theme.colors.error.base};
+    .inline-container {
+      margin-bottom: ${theme.gridUnit * 2}px;
+
+      > div {
+        margin: ${theme.gridUnit * 0}px;

Review Comment:
   Thanks! corrected to ```margin: 0px;```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1685933958


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -437,7 +437,7 @@ export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
             />
             {index !== 0 && !!onRemove ? (
               <span
-                role="button"
+                role="delbutton"

Review Comment:
   Thanks again, @kgabryje! All tests are now successful. Please assist with merging this PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "nsivarajan (via GitHub)" <gi...@apache.org>.
nsivarajan commented on code in PR #29088:
URL: https://github.com/apache/superset/pull/29088#discussion_r1674262860


##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -36,6 +36,12 @@ const StyledNotificationMethod = styled.div`
         border-color: ${({ theme }) => theme.colors.error.base};
       }
     }
+
+    .helper {
+      margin-top: 5px;

Review Comment:
   @kgabryje Thank you for the review! I've refactored styles to use theme variables for spacings and font sizes. 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2223505476

   @nsivarajan I've started CI and I'll start an eph env once the Docker image is ready so we can poke around on the modal.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(alert/report): Added optional CC and BCC fields for email notifi… [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #29088:
URL: https://github.com/apache/superset/pull/29088#issuecomment-2150607249

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/29088?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `50.00000%` with `4 lines` in your changes missing coverage. Please review.
   > Project coverage is 64.62%. Comparing base [(`76d897e`)](https://app.codecov.io/gh/apache/superset/commit/76d897eaa2f9e137102bc194c2e3109c29d0348f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`663c51c`)](https://app.codecov.io/gh/apache/superset/commit/663c51cdc65da54349cd83c4975f3de2377e4857?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 279 commits behind head on master.
   
   | [Files](https://app.codecov.io/gh/apache/superset/pull/29088?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/reports/notifications/email.py](https://app.codecov.io/gh/apache/superset/pull/29088?src=pr&el=tree&filepath=superset%2Freports%2Fnotifications%2Femail.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL2VtYWlsLnB5) | 33.33% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/29088?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #29088      +/-   ##
   ==========================================
   + Coverage   60.48%   64.62%   +4.13%     
   ==========================================
     Files        1931      518    -1413     
     Lines       76236    37471   -38765     
     Branches     8568        0    -8568     
   ==========================================
   - Hits        46114    24216   -21898     
   + Misses      28017    13255   -14762     
   + Partials     2105        0    -2105     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/29088/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/29088/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `48.94% <50.00%> (-0.23%)` | :arrow_down: |
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/29088/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/29088/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.54% <50.00%> (-0.27%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/29088/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `64.62% <50.00%> (+1.13%)` | :arrow_up: |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/29088/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `59.01% <50.00%> (+1.39%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/29088?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org