Browse Source

feat(ui): Remove discover button from session alerts (#29071)

Matej Minar 3 years ago
parent
commit
e3cb5e1bfe
1 changed files with 8 additions and 5 deletions
  1. 8 5
      static/app/views/alerts/rules/details/metricChart.tsx

+ 8 - 5
static/app/views/alerts/rules/details/metricChart.tsx

@@ -41,6 +41,7 @@ import {Incident, IncidentActivityType, IncidentStatus} from '../../types';
 import {
 import {
   alertAxisFormatter,
   alertAxisFormatter,
   alertTooltipValueFormatter,
   alertTooltipValueFormatter,
+  isSessionAggregate,
   SESSION_AGGREGATE_TO_FIELD,
   SESSION_AGGREGATE_TO_FIELD,
 } from '../../utils';
 } from '../../utils';
 
 
@@ -300,11 +301,13 @@ class MetricChart extends React.PureComponent<Props, State> {
             </StatItem>
             </StatItem>
           </SummaryStats>
           </SummaryStats>
         </ChartSummary>
         </ChartSummary>
-        <Feature features={['discover-basic']}>
-          <Button size="small" {...props}>
-            {buttonText}
-          </Button>
-        </Feature>
+        {!isSessionAggregate(rule.aggregate) && (
+          <Feature features={['discover-basic']}>
+            <Button size="small" {...props}>
+              {buttonText}
+            </Button>
+          </Feature>
+        )}
       </ChartActions>
       </ChartActions>
     );
     );
   }
   }