@ -50,12 +50,12 @@ import {
UserAction
UserAction
} from 'app/common/DocActions' ;
} from 'app/common/DocActions' ;
import { DocData } from 'app/common/DocData' ;
import { DocData } from 'app/common/DocData' ;
import { getDataLimit Ratio, getDataLimitStatus , getSeverity , LimitExceededError } from 'app/common/DocLimits' ;
import { getDataLimit Info, getDataLimitRatio , getSeverity , LimitExceededError } from 'app/common/DocLimits' ;
import { DocSnapshots } from 'app/common/DocSnapshot' ;
import { DocSnapshots } from 'app/common/DocSnapshot' ;
import { DocumentSettings } from 'app/common/DocumentSettings' ;
import { DocumentSettings } from 'app/common/DocumentSettings' ;
import {
import {
APPROACHING_LIMIT_RATIO ,
APPROACHING_LIMIT_RATIO ,
DataLimit Status ,
DataLimit Info ,
DocumentUsage ,
DocumentUsage ,
DocUsageSummary ,
DocUsageSummary ,
FilteredDocUsageSummary ,
FilteredDocUsageSummary ,
@ -421,8 +421,8 @@ export class ActiveDoc extends EventEmitter {
return getDataLimitRatio ( this . _docUsage , this . _product ? . features ) ;
return getDataLimitRatio ( this . _docUsage , this . _product ? . features ) ;
}
}
public get dataLimit Status( ) : DataLimitStatus {
public get dataLimit Info( ) : DataLimitInfo {
return getDataLimit Status ( {
return getDataLimit Info ( {
docUsage : this._docUsage ,
docUsage : this._docUsage ,
productFeatures : this._product?.features ,
productFeatures : this._product?.features ,
gracePeriodStart : this._gracePeriodStart ,
gracePeriodStart : this._gracePeriodStart ,
@ -431,7 +431,7 @@ export class ActiveDoc extends EventEmitter {
public getDocUsageSummary ( ) : DocUsageSummary {
public getDocUsageSummary ( ) : DocUsageSummary {
return {
return {
dataLimit Status: this.dataLimitStatus ,
dataLimit Info: this.dataLimitInfo ,
rowCount : this._docUsage?.rowCount ? ? 'pending' ,
rowCount : this._docUsage?.rowCount ? ? 'pending' ,
dataSizeBytes : this._docUsage?.dataSizeBytes ? ? 'pending' ,
dataSizeBytes : this._docUsage?.dataSizeBytes ? ? 'pending' ,
attachmentsSizeBytes : this._docUsage?.attachmentsSizeBytes ? ? 'pending' ,
attachmentsSizeBytes : this._docUsage?.attachmentsSizeBytes ? ? 'pending' ,
@ -2176,7 +2176,7 @@ export class ActiveDoc extends EventEmitter {
await this . waitForInitialization ( ) ;
await this . waitForInitialization ( ) ;
if (
if (
this . dataLimit S tatus === "deleteOnly" &&
this . dataLimit Info. s tatus === "deleteOnly" &&
! actions . every ( action = > [
! actions . every ( action = > [
'RemoveTable' , 'RemoveColumn' , 'RemoveRecord' , 'BulkRemoveRecord' ,
'RemoveTable' , 'RemoveColumn' , 'RemoveRecord' , 'BulkRemoveRecord' ,
'RemoveViewSection' , 'RemoveView' , 'ApplyUndoActions' , 'RespondToRequests' ,
'RemoveViewSection' , 'RemoveView' , 'ApplyUndoActions' , 'RespondToRequests' ,
@ -2253,13 +2253,13 @@ export class ActiveDoc extends EventEmitter {
* /
* /
private async _updateDocUsage ( usage : Partial < DocumentUsage > , options : UpdateUsageOptions = { } ) {
private async _updateDocUsage ( usage : Partial < DocumentUsage > , options : UpdateUsageOptions = { } ) {
const { syncUsageToDatabase = true , broadcastUsageToClients = true } = options ;
const { syncUsageToDatabase = true , broadcastUsageToClients = true } = options ;
const oldStatus = this . dataLimit S tatus;
const oldStatus = this . dataLimit Info. s tatus;
this . _docUsage = { . . . ( this . _docUsage || { } ) , . . . usage } ;
this . _docUsage = { . . . ( this . _docUsage || { } ) , . . . usage } ;
if ( syncUsageToDatabase ) {
if ( syncUsageToDatabase ) {
/ * I f s t a t u s d e c r e a s e d , w e ' l l u p d a t e u s a g e i n t h e d a t a b a s e w i t h m i n i m a l d e l a y , s o s i t e u s a g e
/ * I f s t a t u s d e c r e a s e d , w e ' l l u p d a t e u s a g e i n t h e d a t a b a s e w i t h m i n i m a l d e l a y , s o s i t e u s a g e
* banners show up - to - date statistics . If status increased or stayed the same , we ' ll schedule
* banners show up - to - date statistics . If status increased or stayed the same , we ' ll schedule
* a delayed update , since it ' s less critical for banners to update immediately . * /
* a delayed update , since it ' s less critical for banners to update immediately . * /
const didStatusDecrease = getSeverity ( this . dataLimit S tatus) < getSeverity ( oldStatus ) ;
const didStatusDecrease = getSeverity ( this . dataLimit Info. s tatus) < getSeverity ( oldStatus ) ;
this . _syncDocUsageToDatabase ( didStatusDecrease ) ;
this . _syncDocUsageToDatabase ( didStatusDecrease ) ;
}
}
if ( broadcastUsageToClients ) {
if ( broadcastUsageToClients ) {