mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 01:53:51 +00:00
Fixed inconsistent type
This commit is contained in:
@@ -125,7 +125,7 @@ const VisitsStats: FC<VisitsStatsProps> = (
|
|||||||
<div className="col-12 mt-4">
|
<div className="col-12 mt-4">
|
||||||
<LineChartCard
|
<LineChartCard
|
||||||
title="Visits during time"
|
title="Visits during time"
|
||||||
visits={visits}
|
visits={normalizedVisits}
|
||||||
highlightedVisits={highlightedVisits}
|
highlightedVisits={highlightedVisits}
|
||||||
highlightedLabel={highlightedLabel}
|
highlightedLabel={highlightedLabel}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { Line } from 'react-chartjs-2';
|
|||||||
import { always, cond, reverse } from 'ramda';
|
import { always, cond, reverse } from 'ramda';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { ChartData, ChartDataSets } from 'chart.js';
|
import { ChartData, ChartDataSets } from 'chart.js';
|
||||||
import { NormalizedVisit, Stats, Visit } from '../types';
|
import { NormalizedVisit, Stats } from '../types';
|
||||||
import { fillTheGaps } from '../../utils/helpers/visits';
|
import { fillTheGaps } from '../../utils/helpers/visits';
|
||||||
import { useToggle } from '../../utils/helpers/hooks';
|
import { useToggle } from '../../utils/helpers/hooks';
|
||||||
import { rangeOf } from '../../utils/utils';
|
import { rangeOf } from '../../utils/utils';
|
||||||
@@ -22,7 +22,7 @@ import './LineChartCard.scss';
|
|||||||
interface LineChartCardProps {
|
interface LineChartCardProps {
|
||||||
title: string;
|
title: string;
|
||||||
highlightedLabel?: string;
|
highlightedLabel?: string;
|
||||||
visits: Visit[];
|
visits: NormalizedVisit[];
|
||||||
highlightedVisits: NormalizedVisit[];
|
highlightedVisits: NormalizedVisit[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ const determineInitialStep = (oldestVisitDate: string): Step => {
|
|||||||
return matcher() ?? 'monthly';
|
return matcher() ?? 'monthly';
|
||||||
};
|
};
|
||||||
|
|
||||||
const groupVisitsByStep = (step: Step, visits: (Visit | NormalizedVisit)[]): Stats => visits.reduce<Stats>(
|
const groupVisitsByStep = (step: Step, visits: NormalizedVisit[]): Stats => visits.reduce<Stats>(
|
||||||
(acc, visit) => {
|
(acc, visit) => {
|
||||||
const key = STEP_TO_DATE_FORMAT[step](visit.date);
|
const key = STEP_TO_DATE_FORMAT[step](visit.date);
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ const groupVisitsByStep = (step: Step, visits: (Visit | NormalizedVisit)[]): Sta
|
|||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
|
|
||||||
const generateLabels = (step: Step, visits: Visit[]): string[] => {
|
const generateLabels = (step: Step, visits: NormalizedVisit[]): string[] => {
|
||||||
const unit = STEP_TO_DATE_UNIT_MAP[step];
|
const unit = STEP_TO_DATE_UNIT_MAP[step];
|
||||||
const formatter = STEP_TO_DATE_FORMAT[step];
|
const formatter = STEP_TO_DATE_FORMAT[step];
|
||||||
const newerDate = moment(visits[0].date);
|
const newerDate = moment(visits[0].date);
|
||||||
@@ -91,7 +91,7 @@ const generateLabels = (step: Step, visits: Visit[]): string[] => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const generateLabelsAndGroupedVisits = (
|
const generateLabelsAndGroupedVisits = (
|
||||||
visits: Visit[],
|
visits: NormalizedVisit[],
|
||||||
groupedVisitsWithGaps: Stats,
|
groupedVisitsWithGaps: Stats,
|
||||||
step: Step,
|
step: Step,
|
||||||
skipNoElements: boolean,
|
skipNoElements: boolean,
|
||||||
|
|||||||
Reference in New Issue
Block a user