sadpandajoe commented on code in PR #40525:
URL: https://github.com/apache/superset/pull/40525#discussion_r3344759613


##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -2342,46 +2382,78 @@ const AlertReportModal: 
FunctionComponent<AlertReportModalProps> = ({
                           {t('Select chart')}
                           <span className="required">*</span>
                         </div>
-                        <AsyncSelect
-                          ariaLabel={t('Chart')}
-                          name="chart"
-                          allowClear
-                          value={
-                            currentAlert?.chart?.label &&
-                            currentAlert?.chart?.value
-                              ? {
-                                  value: currentAlert.chart.value,
-                                  label: currentAlert.chart.label,
-                                }
-                              : undefined
-                          }
-                          options={loadChartOptions}
-                          onChange={onChartChange}
-                          placeholder={t('Select chart to use')}
-                        />
+                        <div className="input-container select-with-open-btn">
+                          <div>
+                            <AsyncSelect
+                              ariaLabel={t('Chart')}
+                              name="chart"
+                              allowClear
+                              value={
+                                currentAlert?.chart?.label &&
+                                currentAlert?.chart?.value
+                                  ? {
+                                      value: currentAlert.chart.value,
+                                      label: currentAlert.chart.label,
+                                    }
+                                  : undefined
+                              }
+                              options={loadChartOptions}
+                              onChange={onChartChange}
+                              placeholder={t('Select chart to use')}
+                            />
+                          </div>
+                          <div>
+                            <Button
+                              aria-label={t('Open chart in new tab')}
+                              onClick={() =>
+                                openChartInNewTab(currentAlert?.chart?.value)
+                              }
+                              icon={<Icons.LinkOutlined iconSize="s" />}
+                              buttonSize="small"
+                              disabled={!currentAlert?.chart?.value}
+                            />
+                          </div>
+                        </div>
                       </>
                     ) : (
                       <>
                         <div className="control-label">
                           {t('Select dashboard')}
                           <span className="required">*</span>
                         </div>
-                        <AsyncSelect
-                          ariaLabel={t('Dashboard')}
-                          name="dashboard"
-                          value={
-                            currentAlert?.dashboard?.label &&
-                            currentAlert?.dashboard?.value
-                              ? {
-                                  value: currentAlert.dashboard.value,
-                                  label: currentAlert.dashboard.label,
-                                }
-                              : undefined
-                          }
-                          options={loadDashboardOptions}
-                          onChange={onDashboardChange}
-                          placeholder={t('Select dashboard to use')}
-                        />
+                        <div className="input-container select-with-open-btn">
+                          <div>
+                            <AsyncSelect
+                              ariaLabel={t('Dashboard')}
+                              name="dashboard"
+                              value={
+                                currentAlert?.dashboard?.label &&
+                                currentAlert?.dashboard?.value
+                                  ? {
+                                      value: currentAlert.dashboard.value,
+                                      label: currentAlert.dashboard.label,
+                                    }
+                                  : undefined
+                              }
+                              options={loadDashboardOptions}
+                              onChange={onDashboardChange}
+                              placeholder={t('Select dashboard to use')}
+                            />
+                          </div>
+                          <div>
+                            <Button
+                              aria-label={t('Open dashboard in new tab')}
+                              onClick={() =>
+                                openDashboardInNewTab(
+                                  currentAlert?.dashboard?.value,
+                                )
+                              }
+                              icon={<Icons.LinkOutlined iconSize="s" />}
+                              buttonSize="small"
+                              disabled={!currentAlert?.dashboard?.value}
+                            />

Review Comment:
   Same here, we should add a tooltip to the button.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to