RED-6403: Changed values in License information page.

This commit is contained in:
Nicoleta Panaghiu 2023-04-21 16:02:49 +03:00
parent 2e420e17f5
commit 96d0ad4629
5 changed files with 23 additions and 36 deletions

View File

@ -93,7 +93,7 @@ export class LicenseChartComponent {
}
}
if (cumulativePages !== this._licenseService.currentInfo.numberOfAnalyzedPages) {
if (cumulativePages !== this._licenseService.currentLicenseInfo.numberOfAnalyzedPages) {
this._licenseService.wipeStoredReportsAndReloadSelectedLicenseData();
}

View File

@ -73,7 +73,7 @@
<div class="row">
<div translate="license-info-screen.ocr-analyzed-pages"></div>
<div>{{ licenseService.currentInfo.numberOfOcrPages }}</div>
<div>{{ licenseService.currentLicenseInfo.numberOfOcrPages }}</div>
</div>
<div *ngIf="!!licenseService.unlicensedPages" class="row">
@ -82,20 +82,14 @@
</div>
<div class="row">
<div
*ngIf="licenseService.annualInfo.startDate | date : 'longDate' as startDate"
[innerHTML]="'license-info-screen.total-analyzed' | translate : { date: startDate }"
></div>
<div [innerHTML]="'license-info-screen.total-analyzed' | translate"></div>
<div>{{ licenseService.annualInfo.numberOfAnalyzedPages }}</div>
<div>{{ licenseService.allLicensesInfo.numberOfAnalyzedPages }}</div>
</div>
<div class="row">
<div
*ngIf="licenseService.annualInfo.startDate | date : 'longDate' as startDate"
[innerHTML]="'license-info-screen.total-ocr-analyzed' | translate : { date: startDate }"
></div>
<div>{{ licenseService.annualInfo.numberOfOcrPages }}</div>
<div [innerHTML]="'license-info-screen.total-ocr-analyzed' | translate"></div>
<div>{{ licenseService.allLicensesInfo.numberOfOcrPages }}</div>
</div>
</div>

View File

@ -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,

View File

@ -50,8 +50,8 @@ export class LicenseService extends GenericService<ILicenseReport> {
readonly selectedLicense$: Observable<ILicense>;
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<ILicenseReport> {
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) {

View File

@ -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"
},