diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts index d6669e947..397692423 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/chart/chart.component.ts @@ -35,7 +35,10 @@ export class ChartComponent implements OnChanges { scales: { y: { stacked: true, - ticks: { callback: this.valueFormatter ? (value: number) => this.valueFormatter(value) : undefined }, + ticks: { + callback: this.valueFormatter ? (value: number) => this.valueFormatter(value) : undefined, + count: 9, + }, title: { display: !!this.yAxisLabel, text: this.yAxisLabel, @@ -46,7 +49,10 @@ export class ChartComponent implements OnChanges { y1: { display: this.secondaryAxis, position: 'right', - ticks: { callback: this.valueFormatter ? (value: number) => this.valueFormatter(value) : undefined }, + ticks: { + callback: this.valueFormatter ? (value: number) => this.valueFormatter(value) : undefined, + count: 9, + }, title: { display: !!this.yAxisLabelRight, text: this.yAxisLabelRight, diff --git a/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts b/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts index 1711451bc..107bcbf6b 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/utils/functions.ts @@ -1,7 +1,7 @@ import dayjs, { Dayjs } from 'dayjs'; import { FillTarget } from 'chart.js'; import { hexToRgba } from '@utils/functions'; -import { ILicenseData, ILicenseReport } from '@red/domain'; +import { ILicenseReport } from '@red/domain'; import { ComplexFillTarget } from 'chart.js/dist/types'; const monthNames = dayjs.monthsShort(); @@ -31,11 +31,9 @@ export const getLineConfig: ( pointStyle: false, }); -export const getLabelsFromMonthlyData = (monthlyData: ILicenseData[]) => monthlyData.map(data => verboseDate(dayjs(data.startDate))); - export const getLabelsFromLicense = (license: ILicenseReport) => { - let startMonth = dayjs(license.startDate); - const endMonth = dayjs(license.endDate); + let startMonth = dayjs(license.startDate).startOf('month'); + const endMonth = dayjs(license.endDate).endOf('month'); const result = []; diff --git a/apps/red-ui/src/app/services/license.service.ts b/apps/red-ui/src/app/services/license.service.ts index 4f439f32e..270f5724f 100644 --- a/apps/red-ui/src/app/services/license.service.ts +++ b/apps/red-ui/src/app/services/license.service.ts @@ -86,7 +86,7 @@ export class LicenseService extends GenericService { get analysisCapacityBytes(): number { const capacityFeature = this.getFeature(LicenseFeatures.ANALYSIS_CAPACITY_BYTES); - return Number(capacityFeature?.value ?? '-1'); + return (Number(capacityFeature?.value ?? '-1') / 10) * 10; } get retentionCapacityBytes(): number { @@ -122,11 +122,6 @@ export class LicenseService extends GenericService { this.licenseData$ = this.#licenseData$.pipe(filter(licenses => !!licenses)); } - hasNumberFeature(key: LicenseFeatures): boolean { - const feature = this.getFeature(key); - return !!feature && Number(feature.value) >= 0; - } - getFeature(name: string): ILicenseFeature | undefined { return this.selectedLicense.features?.find(f => f.name === name); }