Просмотр исходного кода

ref(alerts): Move alerts out of settings directory (#27095)

Alerts used to be a part of project settings, but now they have their own folder
Scott Cooper 3 лет назад
Родитель
Сommit
700b71a86b

+ 2 - 2
static/app/components/createAlertButton.tsx

@@ -20,11 +20,11 @@ import {Organization, Project} from 'app/types';
 import EventView from 'app/utils/discover/eventView';
 import {Aggregation, AGGREGATIONS, explodeFieldString} from 'app/utils/discover/fields';
 import withApi from 'app/utils/withApi';
-import {getQueryDatasource} from 'app/views/alerts/utils';
 import {
   errorFieldConfig,
   transactionFieldConfig,
-} from 'app/views/settings/incidentRules/constants';
+} from 'app/views/alerts/incidentRules/constants';
+import {getQueryDatasource} from 'app/views/alerts/utils';
 
 /**
  * Discover query supports more features than alert rules

+ 1 - 1
static/app/components/externalIssues/abstractExternalIssueForm.tsx

@@ -6,10 +6,10 @@ import {ModalRenderProps} from 'app/actionCreators/modal';
 import AsyncComponent from 'app/components/asyncComponent';
 import {tct} from 'app/locale';
 import {Choices, IntegrationIssueConfig, IssueConfigField} from 'app/types';
+import {FormField} from 'app/views/alerts/issueRuleEditor/ruleNode';
 import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig';
 import Form from 'app/views/settings/components/forms/form';
 import {FieldValue} from 'app/views/settings/components/forms/model';
-import {FormField} from 'app/views/settings/projectAlerts/issueRuleEditor/ruleNode';
 
 export type ExternalIssueAction = 'create' | 'link';
 

+ 3 - 3
static/app/routes.tsx

@@ -1176,7 +1176,7 @@ function routes() {
                 <Route
                   path=":ruleId/"
                   name="Edit Alert Rule"
-                  componentPromise={() => import('app/views/settings/projectAlerts/edit')}
+                  componentPromise={() => import('app/views/alerts/edit')}
                   component={errorHandler(LazyLoad)}
                 />
               </Route>
@@ -1195,7 +1195,7 @@ function routes() {
                 <Route
                   path=":ruleId/"
                   name="Edit Alert Rule"
-                  componentPromise={() => import('app/views/settings/projectAlerts/edit')}
+                  componentPromise={() => import('app/views/alerts/edit')}
                   component={errorHandler(LazyLoad)}
                 />
               </Route>
@@ -1222,7 +1222,7 @@ function routes() {
                 path="new/"
                 name="New Alert Rule"
                 component={errorHandler(LazyLoad)}
-                componentPromise={() => import('app/views/settings/projectAlerts/create')}
+                componentPromise={() => import('app/views/alerts/create')}
               />
               <Route
                 path="wizard/"

+ 2 - 2
static/app/views/settings/projectAlerts/create.tsx → static/app/views/alerts/create.tsx

@@ -11,14 +11,14 @@ import {trackAnalyticsEvent} from 'app/utils/analytics';
 import EventView from 'app/utils/discover/eventView';
 import {uniqueId} from 'app/utils/guid';
 import BuilderBreadCrumbs from 'app/views/alerts/builder/builderBreadCrumbs';
+import IncidentRulesCreate from 'app/views/alerts/incidentRules/create';
+import IssueRuleEditor from 'app/views/alerts/issueRuleEditor';
 import {
   AlertType as WizardAlertType,
   AlertWizardAlertNames,
   WizardRuleTemplate,
 } from 'app/views/alerts/wizard/options';
 import {getAlertTypeFromAggregateDataset} from 'app/views/alerts/wizard/utils';
-import IncidentRulesCreate from 'app/views/settings/incidentRules/create';
-import IssueRuleEditor from 'app/views/settings/projectAlerts/issueRuleEditor';
 
 type RouteParams = {
   orgId: string;

+ 3 - 3
static/app/views/alerts/details/body.tsx

@@ -22,9 +22,9 @@ import {defined} from 'app/utils';
 import Projects from 'app/utils/projects';
 import theme from 'app/utils/theme';
 import {alertDetailsLink} from 'app/views/alerts/details/index';
-import {DATASET_EVENT_TYPE_FILTERS} from 'app/views/settings/incidentRules/constants';
-import {makeDefaultCta} from 'app/views/settings/incidentRules/presets';
-import {AlertRuleThresholdType} from 'app/views/settings/incidentRules/types';
+import {DATASET_EVENT_TYPE_FILTERS} from 'app/views/alerts/incidentRules/constants';
+import {makeDefaultCta} from 'app/views/alerts/incidentRules/presets';
+import {AlertRuleThresholdType} from 'app/views/alerts/incidentRules/types';
 
 import {
   AlertRuleStatus,

+ 1 - 1
static/app/views/alerts/details/chart.tsx

@@ -6,7 +6,7 @@ import LineChart, {LineChartSeries} from 'app/components/charts/lineChart';
 import {t} from 'app/locale';
 import space from 'app/styles/space';
 import theme from 'app/utils/theme';
-import {Trigger} from 'app/views/settings/incidentRules/types';
+import {Trigger} from 'app/views/alerts/incidentRules/types';
 
 import closedSymbol from './closedSymbol';
 import startedSymbol from './startedSymbol';

+ 1 - 1
static/app/views/alerts/details/header.tsx

@@ -21,7 +21,7 @@ import space from 'app/styles/space';
 import {use24Hours} from 'app/utils/dates';
 import getDynamicText from 'app/utils/getDynamicText';
 import Projects from 'app/utils/projects';
-import {Dataset} from 'app/views/settings/incidentRules/types';
+import {Dataset} from 'app/views/alerts/incidentRules/types';
 
 import Status from '../status';
 import {Incident, IncidentStats} from '../types';

+ 2 - 2
static/app/views/settings/projectAlerts/edit.tsx → static/app/views/alerts/edit.tsx

@@ -8,8 +8,8 @@ import {t} from 'app/locale';
 import space from 'app/styles/space';
 import {Organization, Project} from 'app/types';
 import BuilderBreadCrumbs from 'app/views/alerts/builder/builderBreadCrumbs';
-import IncidentRulesDetails from 'app/views/settings/incidentRules/details';
-import IssueEditor from 'app/views/settings/projectAlerts/issueRuleEditor';
+import IncidentRulesDetails from 'app/views/alerts/incidentRules/details';
+import IssueEditor from 'app/views/alerts/issueRuleEditor';
 
 type RouteParams = {
   orgId: string;

+ 0 - 0
static/app/views/settings/incidentRules/actions.tsx → static/app/views/alerts/incidentRules/actions.tsx


+ 6 - 6
static/app/views/settings/incidentRules/constants.tsx → static/app/views/alerts/incidentRules/constants.tsx

@@ -1,11 +1,6 @@
 import EventView from 'app/utils/discover/eventView';
 import {AggregationKey, LooseFieldKey} from 'app/utils/discover/fields';
 import {WEB_VITAL_DETAILS} from 'app/utils/performance/vitals/constants';
-import {
-  DATA_SOURCE_TO_SET_AND_EVENT_TYPES,
-  getQueryDatasource,
-} from 'app/views/alerts/utils';
-import {AlertType, WizardRuleTemplate} from 'app/views/alerts/wizard/options';
 import {
   AlertRuleThresholdType,
   Dataset,
@@ -13,7 +8,12 @@ import {
   EventTypes,
   Trigger,
   UnsavedIncidentRule,
-} from 'app/views/settings/incidentRules/types';
+} from 'app/views/alerts/incidentRules/types';
+import {
+  DATA_SOURCE_TO_SET_AND_EVENT_TYPES,
+  getQueryDatasource,
+} from 'app/views/alerts/utils';
+import {AlertType, WizardRuleTemplate} from 'app/views/alerts/wizard/options';
 
 export const DEFAULT_AGGREGATE = 'count()';
 export const DEFAULT_TRANSACTION_AGGREGATE = 'p95(transaction.duration)';

Некоторые файлы не были показаны из-за большого количества измененных файлов