|
@@ -22,7 +22,7 @@ import {
|
|
import LoadingMask from 'sentry/components/loadingMask';
|
|
import LoadingMask from 'sentry/components/loadingMask';
|
|
import {PanelAlert} from 'sentry/components/panels';
|
|
import {PanelAlert} from 'sentry/components/panels';
|
|
import Placeholder from 'sentry/components/placeholder';
|
|
import Placeholder from 'sentry/components/placeholder';
|
|
-import {IconWarning} from 'sentry/icons';
|
|
|
|
|
|
+import {IconSettings, IconWarning} from 'sentry/icons';
|
|
import {t} from 'sentry/locale';
|
|
import {t} from 'sentry/locale';
|
|
import {space} from 'sentry/styles/space';
|
|
import {space} from 'sentry/styles/space';
|
|
import type {
|
|
import type {
|
|
@@ -219,6 +219,7 @@ class TriggersChart extends PureComponent<Props, State> {
|
|
query,
|
|
query,
|
|
dataset,
|
|
dataset,
|
|
} = this.props;
|
|
} = this.props;
|
|
|
|
+
|
|
const statsPeriod = this.getStatsPeriod();
|
|
const statsPeriod = this.getStatsPeriod();
|
|
|
|
|
|
const queryExtras = getMetricDatasetQueryExtras({
|
|
const queryExtras = getMetricDatasetQueryExtras({
|
|
@@ -317,6 +318,7 @@ class TriggersChart extends PureComponent<Props, State> {
|
|
minutesThresholdToDisplaySeconds={minutesThresholdToDisplaySeconds}
|
|
minutesThresholdToDisplaySeconds={minutesThresholdToDisplaySeconds}
|
|
/>
|
|
/>
|
|
)}
|
|
)}
|
|
|
|
+
|
|
<ChartControls>
|
|
<ChartControls>
|
|
<InlineContainer data-test-id="alert-total-events">
|
|
<InlineContainer data-test-id="alert-total-events">
|
|
<SectionHeading>
|
|
<SectionHeading>
|
|
@@ -338,6 +340,7 @@ class TriggersChart extends PureComponent<Props, State> {
|
|
selected={period}
|
|
selected={period}
|
|
onChange={this.handleStatsPeriodChange}
|
|
onChange={this.handleStatsPeriodChange}
|
|
title={t('Display')}
|
|
title={t('Display')}
|
|
|
|
+ disabled={isOnDemandMetricAlert}
|
|
/>
|
|
/>
|
|
</InlineContainer>
|
|
</InlineContainer>
|
|
</ChartControls>
|
|
</ChartControls>
|
|
@@ -362,6 +365,7 @@ class TriggersChart extends PureComponent<Props, State> {
|
|
triggers,
|
|
triggers,
|
|
thresholdType,
|
|
thresholdType,
|
|
isQueryValid,
|
|
isQueryValid,
|
|
|
|
+ isOnDemandMetricAlert,
|
|
} = this.props;
|
|
} = this.props;
|
|
|
|
|
|
const period = this.getStatsPeriod();
|
|
const period = this.getStatsPeriod();
|
|
@@ -376,6 +380,17 @@ class TriggersChart extends PureComponent<Props, State> {
|
|
newAlertOrQuery,
|
|
newAlertOrQuery,
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ // Currently we don't have anything to show for on-demand metric alerts
|
|
|
|
+ if (isOnDemandMetricAlert) {
|
|
|
|
+ return this.renderChart({
|
|
|
|
+ timeseriesData: [],
|
|
|
|
+ isQueryValid: true,
|
|
|
|
+ isLoading: false,
|
|
|
|
+ isReloading: false,
|
|
|
|
+ orgFeatures: organization.features,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
return isSessionAggregate(aggregate) ? (
|
|
return isSessionAggregate(aggregate) ? (
|
|
<SessionsRequest
|
|
<SessionsRequest
|
|
api={api}
|
|
api={api}
|
|
@@ -485,7 +500,7 @@ const ChartPlaceholder = styled(Placeholder)`
|
|
`;
|
|
`;
|
|
|
|
|
|
const StyledErrorPanel = styled(ErrorPanel)`
|
|
const StyledErrorPanel = styled(ErrorPanel)`
|
|
- /* Height and margin should with the alert should match up placeholer height of (184px) */
|
|
|
|
|
|
+ /* Height and margin should with the alert should match up placeholder height of (184px) */
|
|
padding: ${space(2)};
|
|
padding: ${space(2)};
|
|
height: 119px;
|
|
height: 119px;
|
|
`;
|
|
`;
|
|
@@ -515,13 +530,13 @@ function ErrorChart({isAllowIndexed, isQueryValid, errorMessage}) {
|
|
function WarningChart() {
|
|
function WarningChart() {
|
|
return (
|
|
return (
|
|
<ChartErrorWrapper>
|
|
<ChartErrorWrapper>
|
|
- <PanelAlert type="warning">
|
|
|
|
|
|
+ <PanelAlert type="info">
|
|
{t(
|
|
{t(
|
|
- 'Your filter conditions contain a field for which we have no previous data. We will start collecting this metric once the alert is saved.'
|
|
|
|
|
|
+ 'Selected filters include advanced conditions, which is a feature that is currently in early access. We will start collecting data for the chart once this alert rule is saved.'
|
|
)}
|
|
)}
|
|
</PanelAlert>
|
|
</PanelAlert>
|
|
<StyledErrorPanel>
|
|
<StyledErrorPanel>
|
|
- <IconWarning color="gray500" size="lg" />
|
|
|
|
|
|
+ <IconSettings color="gray500" size="lg" />
|
|
</StyledErrorPanel>
|
|
</StyledErrorPanel>
|
|
</ChartErrorWrapper>
|
|
</ChartErrorWrapper>
|
|
);
|
|
);
|