Merge branch 'RED-7641' into 'master'
Resolve RED-7641 Closes RED-7641 See merge request redactmanager/red-ui!115
This commit is contained in:
commit
63164da2b8
@ -35,7 +35,10 @@ export class ChartComponent implements OnChanges {
|
|||||||
scales: {
|
scales: {
|
||||||
y: {
|
y: {
|
||||||
stacked: true,
|
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: {
|
title: {
|
||||||
display: !!this.yAxisLabel,
|
display: !!this.yAxisLabel,
|
||||||
text: this.yAxisLabel,
|
text: this.yAxisLabel,
|
||||||
@ -46,7 +49,10 @@ export class ChartComponent implements OnChanges {
|
|||||||
y1: {
|
y1: {
|
||||||
display: this.secondaryAxis,
|
display: this.secondaryAxis,
|
||||||
position: 'right',
|
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: {
|
title: {
|
||||||
display: !!this.yAxisLabelRight,
|
display: !!this.yAxisLabelRight,
|
||||||
text: this.yAxisLabelRight,
|
text: this.yAxisLabelRight,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
import { FillTarget } from 'chart.js';
|
import { FillTarget } from 'chart.js';
|
||||||
import { hexToRgba } from '@utils/functions';
|
import { hexToRgba } from '@utils/functions';
|
||||||
import { ILicenseData, ILicenseReport } from '@red/domain';
|
import { ILicenseReport } from '@red/domain';
|
||||||
import { ComplexFillTarget } from 'chart.js/dist/types';
|
import { ComplexFillTarget } from 'chart.js/dist/types';
|
||||||
|
|
||||||
const monthNames = dayjs.monthsShort();
|
const monthNames = dayjs.monthsShort();
|
||||||
@ -31,11 +31,9 @@ export const getLineConfig: (
|
|||||||
pointStyle: false,
|
pointStyle: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getLabelsFromMonthlyData = (monthlyData: ILicenseData[]) => monthlyData.map(data => verboseDate(dayjs(data.startDate)));
|
|
||||||
|
|
||||||
export const getLabelsFromLicense = (license: ILicenseReport) => {
|
export const getLabelsFromLicense = (license: ILicenseReport) => {
|
||||||
let startMonth = dayjs(license.startDate);
|
let startMonth = dayjs(license.startDate).startOf('month');
|
||||||
const endMonth = dayjs(license.endDate);
|
const endMonth = dayjs(license.endDate).endOf('month');
|
||||||
|
|
||||||
const result = [];
|
const result = [];
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ export class LicenseService extends GenericService<ILicenseReport> {
|
|||||||
|
|
||||||
get analysisCapacityBytes(): number {
|
get analysisCapacityBytes(): number {
|
||||||
const capacityFeature = this.getFeature(LicenseFeatures.ANALYSIS_CAPACITY_BYTES);
|
const capacityFeature = this.getFeature(LicenseFeatures.ANALYSIS_CAPACITY_BYTES);
|
||||||
return Number(capacityFeature?.value ?? '-1');
|
return (Number(capacityFeature?.value ?? '-1') / 10) * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
get retentionCapacityBytes(): number {
|
get retentionCapacityBytes(): number {
|
||||||
@ -122,11 +122,6 @@ export class LicenseService extends GenericService<ILicenseReport> {
|
|||||||
this.licenseData$ = this.#licenseData$.pipe(filter(licenses => !!licenses));
|
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 {
|
getFeature(name: string): ILicenseFeature | undefined {
|
||||||
return this.selectedLicense.features?.find(f => f.name === name);
|
return this.selectedLicense.features?.find(f => f.name === name);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user