RED-7740: Fixed canvas reuse

This commit is contained in:
Adina Țeudan 2023-10-11 11:23:39 +03:00
parent fe518374d7
commit 9f80018ca0
3 changed files with 9 additions and 5 deletions

View File

@ -80,6 +80,8 @@ export class ChartComponent implements OnChanges {
aspectRatio: 2.5,
};
this.chart?.destroy();
this.chart = new Chart(this.chartId, {
type: 'line',
data: this.chartData,

View File

@ -3,7 +3,7 @@ import { LicenseService } from '@services/license.service';
import { ILicense } from '@red/domain';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { map, tap } from 'rxjs/operators';
import { IqserPermissionsService } from '@iqser/common-ui';
import { LoadingService } from '@iqser/common-ui';
const translations = {
active: _('license-info-screen.status.active'),
@ -26,14 +26,16 @@ export class LicenseSelectComponent {
}),
);
constructor(readonly licenseService: LicenseService, private readonly _permissionsService: IqserPermissionsService) {}
constructor(readonly licenseService: LicenseService, private readonly _loadingService: LoadingService) {}
getStatus(id) {
getStatus(id: string): string {
return id === this.licenseService.activeLicense.id ? translations.active : translations.inactive;
}
async licenseChanged(license: ILicense) {
this._loadingService.start();
await this.licenseService.loadLicenseData(license);
this.licenseService.setSelectedLicense(license);
this._loadingService.stop();
}
}

View File

@ -17,8 +17,8 @@ const defaultOnError: ILicenses = {
product: 'Error',
licensedTo: 'Error',
licensedToEmail: 'Error',
validFrom: '01-01-2023',
validUntil: '01-01-2024',
validFrom: '2023-01-01T00:00:00Z',
validUntil: '2023-12-31T00:00:00Z',
features: [
{
name: LicenseFeatures.PROCESSING_PAGES,