RED-7641: Fix (oops, uncommited changes)

This commit is contained in:
Adina Țeudan 2023-09-26 19:26:40 +03:00
parent 3d5df36321
commit 5be8409711
3 changed files with 28 additions and 18 deletions

View File

@ -25,11 +25,6 @@ const defaultOnError: ILicenses = {
type: 'NUMBER',
value: '2000000',
},
{
name: LicenseFeatures.UPLOADED_BYTES_CAPACITY,
type: 'NUMBER',
value: '-1',
},
{
name: LicenseFeatures.PDFTRON,
type: 'STRING',
@ -80,32 +75,47 @@ export class LicenseService extends GenericService<ILicenseReport> {
get totalLicensedNumberOfPages(): number {
const processingPagesFeature = this.getFeature(LicenseFeatures.PROCESSING_PAGES);
return Math.max(Number(processingPagesFeature?.value ?? '0'), 0);
return Number(processingPagesFeature?.value ?? '-1');
}
get analyzedPagesPercentageForSelectedLicensePercentage(): number {
return this.totalLicensedNumberOfPages
return this.totalLicensedNumberOfPages > 0
? (this.selectedLicenseReport.numberOfAnalyzedPages / this.totalLicensedNumberOfPages) * 100
: -1;
}
get uploadedBytesCapacity(): number {
const capacityFeature = this.getFeature(LicenseFeatures.UPLOADED_BYTES_CAPACITY);
return Math.max(Number(capacityFeature?.value ?? '0'), 0);
get analysisCapacityBytes(): number {
const capacityFeature = this.getFeature(LicenseFeatures.ANALYSIS_CAPACITY_BYTES);
return Number(capacityFeature?.value ?? '-1');
}
get analyzedFilesBytesForSelectedLicensePercentage(): number {
return this.uploadedBytesCapacity ? (this.selectedLicenseReport.analysedFilesBytes / this.uploadedBytesCapacity) * 100 : -1;
get retentionCapacityBytes(): number {
const capacityFeature = this.getFeature(LicenseFeatures.RETENTION_CAPACITY_BYTES);
return Number(capacityFeature?.value ?? '-1');
}
get uploadedFilesBytesForSelectedLicensePercentage(): number {
return this.uploadedBytesCapacity ? (this.selectedLicenseReport.totalFilesUploadedBytes / this.uploadedBytesCapacity) * 100 : -1;
get analysisCapacityBytesForSelectedLicensePercentage(): number {
return this.analysisCapacityBytes > 0 ? (this.selectedLicenseReport.analysedFilesBytes / this.analysisCapacityBytes) * 100 : -1;
}
get retentionCapacityBytesForSelectedLicensePercentage(): number {
return this.retentionCapacityBytes > 0
? (this.selectedLicenseReport.totalFilesUploadedBytes / this.retentionCapacityBytes) * 100
: -1;
}
get unlicensedPages(): number {
return Math.max(0, this.selectedLicenseReport.numberOfAnalyzedPages - this.totalLicensedNumberOfPages);
}
get isPageBased(): boolean {
return this.totalLicensedNumberOfPages >= 0;
}
get isCapacityBased(): boolean {
return this.analysisCapacityBytes >= 0 && this.retentionCapacityBytes >= 0;
}
constructor() {
super();
this.selectedLicense$ = this.#selectedLicense$.pipe(filter(license => !!license));

View File

@ -1787,8 +1787,8 @@
"ocr-analyzed-pages": "OCR Processed Pages in Licensing Period",
"pages-per-month": "Pages per Month",
"section-title": "Page Usage Details",
"total-analyzed": "Total Analyzed Pages Since {date}",
"total-ocr-analyzed": "Total OCR Processed Pages Since {date}",
"total-analyzed": "Total Analyzed Pages",
"total-ocr-analyzed": "Total OCR Processed Pages",
"total-pages": "Total Pages",
"unlicensed-analyzed": "Unlicensed Analyzed Pages"
},

View File

@ -1787,8 +1787,8 @@
"ocr-analyzed-pages": "OCR Processed Pages in Licensing Period",
"pages-per-month": "Pages per Month",
"section-title": "Page Usage Details",
"total-analyzed": "Total Analyzed Pages Since {date}",
"total-ocr-analyzed": "Total OCR Processed Pages Since {date}",
"total-analyzed": "Total Analyzed Pages",
"total-ocr-analyzed": "Total OCR Processed Pages",
"total-pages": "Total Pages",
"unlicensed-analyzed": "Unlicensed Analyzed Pages"
},