@@ -19,12 +19,10 @@ import { resolveAuthFlow } from '@datadog/ui-extensions-sdk'
19
19
import ConfigProvider from 'common/providers/ConfigProvider'
20
20
import Permission from 'common/providers/Permission'
21
21
import { getOrganisationUsage } from 'common/services/useOrganisationUsage'
22
- import { getSubscriptionMetadata } from 'common/services/useSubscriptionMetadata'
23
22
import Button from './base/forms/Button'
24
23
import Icon from './Icon'
25
24
import AccountStore from 'common/stores/account-store'
26
25
import InfoMessage from './InfoMessage'
27
- import Format from 'common/utils/format'
28
26
import OrganisationLimit from './OrganisationLimit'
29
27
30
28
const App = class extends Component {
@@ -41,10 +39,8 @@ const App = class extends Component {
41
39
asideIsVisible : ! isMobile ,
42
40
lastEnvironmentId : '' ,
43
41
lastProjectId : '' ,
44
- maxApiCalls : 50000 ,
45
42
pin : '' ,
46
43
showAnnouncement : true ,
47
- totalApiCalls : 0 ,
48
44
}
49
45
50
46
constructor ( props , context ) {
@@ -74,19 +70,11 @@ const App = class extends Component {
74
70
AccountStore . getOrganisation ( ) ?. id &&
75
71
this . state . activeOrganisation !== AccountStore . getOrganisation ( ) . id
76
72
) {
77
- getSubscriptionMetadata ( getStore ( ) , {
78
- id : AccountStore . getOrganisation ( ) ?. id ,
79
- } ) . then ( ( res ) => {
80
- this . setState ( {
81
- maxApiCalls : res ?. data ?. max_api_calls ,
82
- } )
83
- } )
84
73
getOrganisationUsage ( getStore ( ) , {
85
74
organisationId : AccountStore . getOrganisation ( ) ?. id ,
86
75
} ) . then ( ( res ) => {
87
76
this . setState ( {
88
77
activeOrganisation : AccountStore . getOrganisation ( ) . id ,
89
- totalApiCalls : res ?. data ?. totals . total ,
90
78
} )
91
79
} )
92
80
}
@@ -299,17 +287,6 @@ const App = class extends Component {
299
287
)
300
288
const dismissed = flagsmith . getTrait ( 'dismissed_announcement' )
301
289
const showBanner = ! dismissed || dismissed !== announcementValue . id
302
- const maxApiCallsPercentage = Utils . calculateRemainingLimitsPercentage (
303
- this . state . totalApiCalls ,
304
- this . state . maxApiCalls ,
305
- 70 ,
306
- ) . percentage
307
-
308
- const alertMaxApiCallsText = `You have used ${ Format . shortenNumber (
309
- this . state . totalApiCalls ,
310
- ) } /${ Format . shortenNumber (
311
- this . state . maxApiCalls ,
312
- ) } of your allowed requests.`
313
290
314
291
return (
315
292
< Provider store = { getStore ( ) } >
0 commit comments