@@ -5,7 +5,6 @@ import styled from '@emotion/styled';
55import { Location } from 'history' ;
66import isEqual from 'lodash/isEqual' ;
77
8- import { addErrorMessage } from 'app/actionCreators/indicator' ;
98import { loadOrganizationTags } from 'app/actionCreators/tags' ;
109import { Client } from 'app/api' ;
1110import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage' ;
@@ -14,7 +13,6 @@ import SentryDocumentTitle from 'app/components/sentryDocumentTitle';
1413import { t } from 'app/locale' ;
1514import { PageContent } from 'app/styles/organization' ;
1615import { GlobalSelection , Organization , Project } from 'app/types' ;
17- import { defined } from 'app/utils' ;
1816import { trackAnalyticsEvent } from 'app/utils/analytics' ;
1917import DiscoverQuery from 'app/utils/discover/discoverQuery' ;
2018import EventView from 'app/utils/discover/eventView' ;
@@ -62,7 +60,6 @@ type State = {
6260 eventView : EventView | undefined ;
6361 transactionThreshold : number | undefined ;
6462 transactionThresholdMetric : TransactionThresholdMetric | undefined ;
65- loadingThreshold : boolean ;
6663} ;
6764
6865// Used to cast the totals request to numbers
@@ -73,7 +70,6 @@ class TransactionSummary extends Component<Props, State> {
7370 state : State = {
7471 transactionThreshold : undefined ,
7572 transactionThresholdMetric : undefined ,
76- loadingThreshold : false ,
7773 spanOperationBreakdownFilter : decodeFilterFromLocation ( this . props . location ) ,
7874 eventView : generateSummaryEventView (
7975 this . props . location ,
@@ -95,9 +91,6 @@ class TransactionSummary extends Component<Props, State> {
9591 componentDidMount ( ) {
9692 const { api, organization, selection} = this . props ;
9793 loadOrganizationTags ( api , organization . slug , selection ) ;
98- if ( organization . features . includes ( 'project-transaction-threshold-override' ) ) {
99- this . fetchTransactionThreshold ( ) ;
100- }
10194 addRoutePerformanceContext ( selection ) ;
10295 }
10396
@@ -137,72 +130,6 @@ class TransactionSummary extends Component<Props, State> {
137130 } ) ;
138131 } ;
139132
140- getProject ( ) {
141- const { projects} = this . props ;
142- const { eventView} = this . state ;
143- if ( ! defined ( eventView ) ) {
144- return undefined ;
145- }
146-
147- const projectId = String ( eventView . project [ 0 ] ) ;
148- const project = projects . find ( proj => proj . id === projectId ) ;
149-
150- return project ;
151- }
152-
153- fetchTransactionThreshold = ( ) => {
154- const { api, organization, location} = this . props ;
155- const transactionName = getTransactionName ( location ) ;
156-
157- const project = this . getProject ( ) ;
158- if ( ! defined ( project ) ) {
159- return ;
160- }
161- const transactionThresholdUrl = `/organizations/${ organization . slug } /project-transaction-threshold-override/` ;
162-
163- this . setState ( { loadingThreshold : true } ) ;
164-
165- api
166- . requestPromise ( transactionThresholdUrl , {
167- method : 'GET' ,
168- includeAllArgs : true ,
169- query : {
170- project : project . id ,
171- transaction : transactionName ,
172- } ,
173- } )
174- . then ( ( [ data ] ) => {
175- this . setState ( {
176- loadingThreshold : false ,
177- transactionThreshold : data . threshold ,
178- transactionThresholdMetric : data . metric ,
179- } ) ;
180- } )
181- . catch ( ( ) => {
182- const projectThresholdUrl = `/projects/${ organization . slug } /${ project . slug } /transaction-threshold/configure/` ;
183- this . props . api
184- . requestPromise ( projectThresholdUrl , {
185- method : 'GET' ,
186- includeAllArgs : true ,
187- query : {
188- project : project . id ,
189- } ,
190- } )
191- . then ( ( [ data ] ) => {
192- this . setState ( {
193- loadingThreshold : false ,
194- transactionThreshold : data . threshold ,
195- transactionThresholdMetric : data . metric ,
196- } ) ;
197- } )
198- . catch ( err => {
199- this . setState ( { loadingThreshold : false } ) ;
200- const errorMessage = err . responseJSON ?. threshold ?? null ;
201- addErrorMessage ( errorMessage ) ;
202- } ) ;
203- } ) ;
204- } ;
205-
206133 getDocumentTitle ( ) : string {
207134 const name = getTransactionName ( this . props . location ) ;
208135
@@ -296,12 +223,7 @@ class TransactionSummary extends Component<Props, State> {
296223
297224 render ( ) {
298225 const { organization, projects, location} = this . props ;
299- const {
300- eventView,
301- transactionThreshold,
302- transactionThresholdMetric,
303- loadingThreshold,
304- } = this . state ;
226+ const { eventView, transactionThreshold, transactionThresholdMetric} = this . state ;
305227 const transactionName = getTransactionName ( location ) ;
306228 if ( ! eventView || transactionName === undefined ) {
307229 // If there is no transaction name, redirect to the Performance landing page
@@ -371,9 +293,6 @@ class TransactionSummary extends Component<Props, State> {
371293 transactionThresholdMetric : metric ,
372294 } )
373295 }
374- transactionThreshold = { transactionThreshold }
375- transactionThresholdMetric = { transactionThresholdMetric }
376- loadingThreshold = { loadingThreshold }
377296 />
378297 ) ;
379298 } }
0 commit comments