|
@@ -4,19 +4,16 @@ import type {LegendComponentOption} from 'echarts';
|
|
|
import type {Location} from 'history';
|
|
|
|
|
|
import type {Client} from 'sentry/api';
|
|
|
-import {Alert} from 'sentry/components/alert';
|
|
|
import ErrorPanel from 'sentry/components/charts/errorPanel';
|
|
|
import {HeaderTitle} from 'sentry/components/charts/styles';
|
|
|
import ErrorBoundary from 'sentry/components/errorBoundary';
|
|
|
import {LazyRender} from 'sentry/components/lazyRender';
|
|
|
-import ExternalLink from 'sentry/components/links/externalLink';
|
|
|
import Panel from 'sentry/components/panels/panel';
|
|
|
import PanelAlert from 'sentry/components/panels/panelAlert';
|
|
|
import Placeholder from 'sentry/components/placeholder';
|
|
|
-import {parseSearch} from 'sentry/components/searchSyntax/parser';
|
|
|
import {Tooltip} from 'sentry/components/tooltip';
|
|
|
import {IconWarning} from 'sentry/icons';
|
|
|
-import {t, tct} from 'sentry/locale';
|
|
|
+import {t} from 'sentry/locale';
|
|
|
import {space} from 'sentry/styles/space';
|
|
|
import type {PageFilters} from 'sentry/types/core';
|
|
|
import type {Series} from 'sentry/types/echarts';
|
|
@@ -25,13 +22,8 @@ import type {Organization} from 'sentry/types/organization';
|
|
|
import {getFormattedDate} from 'sentry/utils/dates';
|
|
|
import type {TableDataWithTitle} from 'sentry/utils/discover/discoverQuery';
|
|
|
import type {AggregationOutputType} from 'sentry/utils/discover/fields';
|
|
|
-import {parseFunction} from 'sentry/utils/discover/fields';
|
|
|
import {hasOnDemandMetricWidgetFeature} from 'sentry/utils/onDemandMetrics/features';
|
|
|
import {ExtractedMetricsTag} from 'sentry/utils/performance/contexts/metricsEnhancedPerformanceDataContext';
|
|
|
-import {
|
|
|
- MEPConsumer,
|
|
|
- MEPState,
|
|
|
-} from 'sentry/utils/performance/contexts/metricsEnhancedSetting';
|
|
|
import {VisuallyCompleteWithData} from 'sentry/utils/performanceForSentry';
|
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
import withApi from 'sentry/utils/withApi';
|
|
@@ -49,7 +41,6 @@ import {DisplayType, OnDemandExtractionState, WidgetType} from '../types';
|
|
|
import {DEFAULT_RESULTS_LIMIT} from '../widgetBuilder/utils';
|
|
|
import type WidgetLegendSelectionState from '../widgetLegendSelectionState';
|
|
|
|
|
|
-import {DashboardsMEPConsumer} from './dashboardsMEPContext';
|
|
|
import WidgetCardChartContainer from './widgetCardChartContainer';
|
|
|
import WidgetCardContextMenu from './widgetCardContextMenu';
|
|
|
|
|
@@ -96,16 +87,6 @@ type Props = WithRouterProps & {
|
|
|
windowWidth?: number;
|
|
|
};
|
|
|
|
|
|
-type SearchFilterKey = {key?: {value: string}};
|
|
|
-
|
|
|
-const ERROR_FIELDS = [
|
|
|
- 'error.handled',
|
|
|
- 'error.unhandled',
|
|
|
- 'error.mechanism',
|
|
|
- 'error.type',
|
|
|
- 'error.value',
|
|
|
-];
|
|
|
-
|
|
|
type Data = {
|
|
|
pageLinks?: string;
|
|
|
tableResults?: TableDataWithTitle[];
|
|
@@ -135,7 +116,6 @@ function WidgetCard(props: Props) {
|
|
|
tableItemLimit,
|
|
|
windowWidth,
|
|
|
noLazyLoad,
|
|
|
- showStoredAlert,
|
|
|
dashboardFilters,
|
|
|
isWidgetInvalid,
|
|
|
location,
|
|
@@ -162,21 +142,6 @@ function WidgetCard(props: Props) {
|
|
|
query.aggregates.some(aggregate => aggregate.includes('session.duration'))
|
|
|
);
|
|
|
|
|
|
- // prettier-ignore
|
|
|
- const widgetContainsErrorFields = widget.queries.some(
|
|
|
- ({columns, aggregates, conditions}) =>
|
|
|
- ERROR_FIELDS.some(
|
|
|
- errorField =>
|
|
|
- columns.includes(errorField) ||
|
|
|
- aggregates.some(
|
|
|
- aggregate => parseFunction(aggregate)?.arguments.includes(errorField)
|
|
|
- ) ||
|
|
|
- parseSearch(conditions)?.some(
|
|
|
- filter => (filter as SearchFilterKey).key?.value === errorField
|
|
|
- )
|
|
|
- )
|
|
|
- );
|
|
|
-
|
|
|
if (widget.widgetType === WidgetType.METRICS) {
|
|
|
return (
|
|
|
<MetricWidgetCard
|
|
@@ -311,41 +276,6 @@ function WidgetCard(props: Props) {
|
|
|
)}
|
|
|
</WidgetCardPanel>
|
|
|
</VisuallyCompleteWithData>
|
|
|
- {!organization.features.includes('performance-mep-bannerless-ui') && (
|
|
|
- <MEPConsumer>
|
|
|
- {metricSettingContext => {
|
|
|
- return (
|
|
|
- <DashboardsMEPConsumer>
|
|
|
- {({isMetricsData}) => {
|
|
|
- if (
|
|
|
- showStoredAlert &&
|
|
|
- isMetricsData === false &&
|
|
|
- widget.widgetType === WidgetType.DISCOVER &&
|
|
|
- metricSettingContext &&
|
|
|
- metricSettingContext.metricSettingState !== MEPState.TRANSACTIONS_ONLY
|
|
|
- ) {
|
|
|
- if (!widgetContainsErrorFields) {
|
|
|
- return (
|
|
|
- <StoredDataAlert showIcon>
|
|
|
- {tct(
|
|
|
- "Your selection is only applicable to [indexedData: indexed event data]. We've automatically adjusted your results.",
|
|
|
- {
|
|
|
- indexedData: (
|
|
|
- <ExternalLink href="https://docs.sentry.io/product/dashboards/widget-builder/#errors--transactions" />
|
|
|
- ),
|
|
|
- }
|
|
|
- )}
|
|
|
- </StoredDataAlert>
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }}
|
|
|
- </DashboardsMEPConsumer>
|
|
|
- );
|
|
|
- }}
|
|
|
- </MEPConsumer>
|
|
|
- )}
|
|
|
</ErrorBoundary>
|
|
|
);
|
|
|
}
|
|
@@ -447,11 +377,6 @@ export const WidgetCardPanel = styled(Panel, {
|
|
|
}
|
|
|
`;
|
|
|
|
|
|
-const StoredDataAlert = styled(Alert)`
|
|
|
- margin-top: ${space(1)};
|
|
|
- margin-bottom: 0;
|
|
|
-`;
|
|
|
-
|
|
|
const StyledErrorPanel = styled(ErrorPanel)`
|
|
|
padding: ${space(2)};
|
|
|
`;
|