Browse Source

ref(alerts): Rename Issue Rules and Metric Rules consistently (#34663)

* ref(alerts): Rename Issue Rules and Metric Rules consistently

* revert trace file

* delete old metric rule paths

* move issueRules to rules/issue and metricRules to rules/metric

* move alert lists pages to their own folders

* move utils functions into alerts/utils

* rename MetricRulesDetails to MetricRulesEdit

* undo webstorm refactor

* more undo webstorm refactor

* misnamed MetricRulesDetails

* more misnamed MetricRulesDetails file

* move ruleForm/index.tsx to ruleForm.tsx

* post rebase fix
Taylan Gocmen 2 years ago
parent
commit
ab50a1d229

+ 0 - 3
.github/CODEOWNERS

@@ -82,9 +82,6 @@ build-utils/        @getsentry/owners-js-build
 /static/app/views/settings/projectAlerts/                       @getsentry/workflow
 /tests/js/spec/views/settings/projectAlerts/                    @getsentry/workflow
 
-/static/app/views/settings/incidentRules/                       @getsentry/workflow
-/tests/js/spec/views/settings/incidentRules/                    @getsentry/workflow
-
 /static/app/views/alerts/                                       @getsentry/workflow
 /tests/js/spec/views/alerts/                                    @getsentry/workflow
 

+ 1 - 1
static/app/chartcuterie/metricAlert.tsx

@@ -9,7 +9,7 @@ import {
   getMetricAlertChartOption,
   MetricChartData,
   transformSessionResponseToSeries,
-} from 'sentry/views/alerts/rules/details/metricChartOption';
+} from 'sentry/views/alerts/rules/metric/details/metricChartOption';
 
 import {DEFAULT_FONT_FAMILY, slackChartDefaults, slackChartSize} from './slack';
 import {ChartType, RenderDescriptor} from './types';

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

@@ -27,7 +27,7 @@ import useApi from 'sentry/utils/useApi';
 import {
   errorFieldConfig,
   transactionFieldConfig,
-} from 'sentry/views/alerts/incidentRules/constants';
+} from 'sentry/views/alerts/rules/metric/constants';
 import {getQueryDatasource} from 'sentry/views/alerts/utils';
 import {
   AlertType,

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

@@ -15,7 +15,7 @@ import {
   IssueConfigField,
   SelectValue,
 } from 'sentry/types';
-import {FormField} from 'sentry/views/alerts/issueRuleEditor/ruleNode';
+import {FormField} from 'sentry/views/alerts/rules/issue/ruleNode';
 
 export type ExternalIssueAction = 'create' | 'link';
 

+ 2 - 2
static/app/components/issues/groupList.tsx

@@ -22,8 +22,8 @@ import {Group} from 'sentry/types';
 import {callIfFunction} from 'sentry/utils/callIfFunction';
 import StreamManager from 'sentry/utils/streamManager';
 import withApi from 'sentry/utils/withApi';
-import {TimePeriodType} from 'sentry/views/alerts/rules/details/constants';
-import {RELATED_ISSUES_BOOLEAN_QUERY_ERROR} from 'sentry/views/alerts/rules/details/relatedIssuesNotAvailable';
+import {TimePeriodType} from 'sentry/views/alerts/rules/metric/details/constants';
+import {RELATED_ISSUES_BOOLEAN_QUERY_ERROR} from 'sentry/views/alerts/rules/metric/details/relatedIssuesNotAvailable';
 
 import GroupListHeader from './groupListHeader';
 

+ 1 - 1
static/app/components/stream/group.tsx

@@ -41,7 +41,7 @@ import EventView from 'sentry/utils/discover/eventView';
 import {queryToObj} from 'sentry/utils/stream';
 import withOrganization from 'sentry/utils/withOrganization';
 import withPageFilters from 'sentry/utils/withPageFilters';
-import {TimePeriodType} from 'sentry/views/alerts/rules/details/constants';
+import {TimePeriodType} from 'sentry/views/alerts/rules/metric/details/constants';
 import {
   DISCOVER_EXCLUSION_FIELDS,
   getTabs,

+ 7 - 5
static/app/routes.tsx

@@ -1026,19 +1026,19 @@ function buildRoutes() {
       component={SafeLazyLoad}
     >
       <IndexRoute
-        componentPromise={() => import('sentry/views/alerts/list')}
+        componentPromise={() => import('sentry/views/alerts/list/incidents')}
         component={SafeLazyLoad}
       />
       <Route path="rules/">
         <IndexRoute
           component={SafeLazyLoad}
-          componentPromise={() => import('sentry/views/alerts/rules')}
+          componentPromise={() => import('sentry/views/alerts/list/rules')}
         />
         <Route
           path="details/:ruleId/"
           name={t('Alert Rule Details')}
           component={SafeLazyLoad}
-          componentPromise={() => import('sentry/views/alerts/rules/details')}
+          componentPromise={() => import('sentry/views/alerts/rules/metric/details')}
         />
         <Route
           path=":projectId/"
@@ -1056,12 +1056,14 @@ function buildRoutes() {
         <Route
           path=":projectId/:ruleId/details/"
           name={t('Alert Rule Details')}
-          componentPromise={() => import('sentry/views/alerts/details')}
+          componentPromise={() => import('sentry/views/alerts/rules/issue/details')}
           component={SafeLazyLoad}
         >
           <IndexRoute
             component={SafeLazyLoad}
-            componentPromise={() => import('sentry/views/alerts/details/ruleDetails')}
+            componentPromise={() =>
+              import('sentry/views/alerts/rules/issue/details/ruleDetails')
+            }
           />
         </Route>
       </Route>

+ 5 - 5
static/app/views/alerts/create.tsx

@@ -12,9 +12,9 @@ import EventView from 'sentry/utils/discover/eventView';
 import {uniqueId} from 'sentry/utils/guid';
 import Teams from 'sentry/utils/teams';
 import BuilderBreadCrumbs from 'sentry/views/alerts/builder/builderBreadCrumbs';
-import IncidentRulesCreate from 'sentry/views/alerts/incidentRules/create';
-import IncidentRulesDuplicate from 'sentry/views/alerts/incidentRules/duplicate';
-import IssueRuleEditor from 'sentry/views/alerts/issueRuleEditor';
+import IssueRuleEditor from 'sentry/views/alerts/rules/issue';
+import MetricRulesCreate from 'sentry/views/alerts/rules/metric/create';
+import MetricRulesDuplicate from 'sentry/views/alerts/rules/metric/duplicate';
 import {AlertRuleType} from 'sentry/views/alerts/types';
 import {
   AlertType as WizardAlertType,
@@ -181,7 +181,7 @@ class Create extends Component<Props, State> {
                     {hasMetricAlerts &&
                       alertType === AlertRuleType.METRIC &&
                       (this.isDuplicateRule ? (
-                        <IncidentRulesDuplicate
+                        <MetricRulesDuplicate
                           {...this.props}
                           eventView={eventView}
                           wizardTemplate={wizardTemplate}
@@ -190,7 +190,7 @@ class Create extends Component<Props, State> {
                           userTeamIds={teams.map(({id}) => id)}
                         />
                       ) : (
-                        <IncidentRulesCreate
+                        <MetricRulesCreate
                           {...this.props}
                           eventView={eventView}
                           wizardTemplate={wizardTemplate}

+ 3 - 3
static/app/views/alerts/edit.tsx

@@ -10,8 +10,8 @@ import {Organization, Project} from 'sentry/types';
 import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
 import Teams from 'sentry/utils/teams';
 import BuilderBreadCrumbs from 'sentry/views/alerts/builder/builderBreadCrumbs';
-import IncidentRulesDetails from 'sentry/views/alerts/incidentRules/details';
-import IssueEditor from 'sentry/views/alerts/issueRuleEditor';
+import IssueEditor from 'sentry/views/alerts/rules/issue';
+import MetricRulesEdit from 'sentry/views/alerts/rules/metric/edit';
 import {AlertRuleType} from 'sentry/views/alerts/types';
 
 type RouteParams = {
@@ -97,7 +97,7 @@ class ProjectAlertsEditor extends Component<Props, State> {
                       />
                     )}
                     {hasMetricAlerts && alertType === AlertRuleType.METRIC && (
-                      <IncidentRulesDetails
+                      <MetricRulesEdit
                         {...this.props}
                         project={project}
                         onChangeTitle={this.handleChangeTitle}

+ 1 - 1
static/app/views/alerts/filterBar.tsx

@@ -8,7 +8,7 @@ import SearchBar from 'sentry/components/searchBar';
 import {t} from 'sentry/locale';
 import space from 'sentry/styles/space';
 
-import TeamFilter from './rules/teamFilter';
+import TeamFilter from './list/rules/teamFilter';
 import {getQueryStatus, getTeamParams} from './utils';
 
 interface Props {

Some files were not shown because too many files changed in this diff