diff --git a/apps/red-ui/src/app/modules/admin/screens/license/license-chart/license-chart.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/license-chart/license-chart.component.ts index 387e81038..30cf658d3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/license-chart/license-chart.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/license-chart/license-chart.component.ts @@ -93,7 +93,7 @@ export class LicenseChartComponent { } } - if (cumulativePages !== this._licenseService.currentInfo.numberOfAnalyzedPages) { + if (cumulativePages !== this._licenseService.currentLicenseInfo.numberOfAnalyzedPages) { this._licenseService.wipeStoredReportsAndReloadSelectedLicenseData(); } diff --git a/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html index d02b006f1..eba7eed13 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.html @@ -73,7 +73,7 @@
-
{{ licenseService.currentInfo.numberOfOcrPages }}
+
{{ licenseService.currentLicenseInfo.numberOfOcrPages }}
@@ -82,20 +82,14 @@
-
+
-
{{ licenseService.annualInfo.numberOfAnalyzedPages }}
+
{{ licenseService.allLicensesInfo.numberOfAnalyzedPages }}
-
-
{{ licenseService.annualInfo.numberOfOcrPages }}
+
+
{{ licenseService.allLicensesInfo.numberOfOcrPages }}
diff --git a/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.ts index 8cac134c2..e704a511f 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/license-screen/license-screen.component.ts @@ -1,14 +1,7 @@ import { Component } from '@angular/core'; import { ConfigService } from '@services/config.service'; import { TranslateService } from '@ngx-translate/core'; -import { - ButtonConfig, - getCurrentUser, - IconButtonTypes, - IqserPermissionsService, - LoadingService, - OverlappingElements, -} from '@iqser/common-ui'; +import { ButtonConfig, getCurrentUser, IconButtonTypes, IqserPermissionsService, LoadingService } from '@iqser/common-ui'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { RouterHistoryService } from '@services/router-history.service'; import { LicenseService } from '@services/license.service'; @@ -61,7 +54,7 @@ export class LicenseScreenComponent { const lineBreak = '%0D%0A'; const body = [ this._translateService.instant('license-info-screen.email.body.analyzed', { - pages: this.licenseService.currentInfo.numberOfAnalyzedPages, + pages: this.licenseService.currentLicenseInfo.numberOfAnalyzedPages, }), this._translateService.instant('license-info-screen.email.body.licensed', { pages: this.licenseService.totalLicensedNumberOfPages, diff --git a/apps/red-ui/src/app/services/license.service.ts b/apps/red-ui/src/app/services/license.service.ts index 771dad593..c70cf7f5b 100644 --- a/apps/red-ui/src/app/services/license.service.ts +++ b/apps/red-ui/src/app/services/license.service.ts @@ -50,8 +50,8 @@ export class LicenseService extends GenericService { readonly selectedLicense$: Observable; activeLicenseId: string; totalLicensedNumberOfPages = 0; - currentInfo: ILicenseReport = {}; - annualInfo: ILicenseReport = {}; + currentLicenseInfo: ILicenseReport = {}; + allLicensesInfo: ILicenseReport = {}; unlicensedPages = 0; analyzedPagesInCurrentLicensingPeriod = 0; protected readonly _defaultModelPath = 'report'; @@ -96,27 +96,27 @@ export class LicenseService extends GenericService { const startDate = dayjs(license.validFrom); const endDate = dayjs(license.validUntil); - const currentConfig = { + const currentLicenseConfig = { startDate: startDate.toDate(), endDate: endDate.toDate(), }; - const thisYearConfig = { - startDate: `${startDate.year()}-01-01T00:00:00.000Z`, - endDate: `${startDate.year()}-12-31T00:00:00.000Z`, + const allLicensesConfig = { + startDate: '2020-01-01T00:00:00.000Z', + endDate: '2023-12-31T00:00:00.000Z', }; - const configs = [currentConfig, thisYearConfig]; + + const configs = [currentLicenseConfig, allLicensesConfig]; const reports = configs.map(config => this.getReport(config)); - [this.currentInfo, this.annualInfo] = await Promise.all(reports); + [this.currentLicenseInfo, this.allLicensesInfo] = await Promise.all(reports); - if (this.currentInfo.numberOfAnalyzedPages > this.totalLicensedNumberOfPages) { - this.unlicensedPages = this.currentInfo.numberOfAnalyzedPages - this.totalLicensedNumberOfPages; - this.analyzedPagesInCurrentLicensingPeriod = this.totalLicensedNumberOfPages; + if (this.currentLicenseInfo.numberOfAnalyzedPages > this.totalLicensedNumberOfPages) { + this.unlicensedPages = this.currentLicenseInfo.numberOfAnalyzedPages - this.totalLicensedNumberOfPages; } else { this.unlicensedPages = 0; - this.analyzedPagesInCurrentLicensingPeriod = this.currentInfo.numberOfAnalyzedPages; } + this.analyzedPagesInCurrentLicensingPeriod = this.currentLicenseInfo.numberOfAnalyzedPages; } getTotalLicensedNumberOfPages(license: ILicense) { diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index f0f2872a0..ec2fa30a3 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -1671,7 +1671,7 @@ "end-user-license-text": "The use of this product is subject to the terms of the Redaction End User Agreement, unless otherwise specified therein.", "end-user-license-title": "End User License Agreement", "license-title": "License Title", - "licensed-page-count": "Licensed pages", + "licensed-page-count": "Licensed Pages", "licensed-to": "Licensed to", "licensing-details": "Licensing Details", "licensing-period": "Licensing Period", @@ -1680,8 +1680,8 @@ "active": "Active", "inactive": "Inactive" }, - "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", "unlicensed-analyzed": "Unlicensed Analyzed Pages", "usage-details": "Usage Details" },