mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 13:36:20 +00:00
Updated dependencies and fixed coding styles
This commit is contained in:
@@ -55,7 +55,7 @@ const generateGraphData = (
|
||||
'#DCDCDC',
|
||||
'#463730',
|
||||
],
|
||||
borderColor: isBarChart ? MAIN_COLOR : (isDarkThemeEnabled() ? PRIMARY_DARK_COLOR : PRIMARY_LIGHT_COLOR),
|
||||
borderColor: isBarChart ? MAIN_COLOR : isDarkThemeEnabled() ? PRIMARY_DARK_COLOR : PRIMARY_LIGHT_COLOR,
|
||||
borderWidth: 2,
|
||||
},
|
||||
highlightedData && {
|
||||
@@ -127,7 +127,7 @@ const DefaultChart = (
|
||||
}, { ...stats }),
|
||||
);
|
||||
const highlightedData = statsAreDefined(highlightedStats) ? fillTheGaps(highlightedStats, labels) : undefined;
|
||||
const [ chartRef, setChartRef ] = useState<HorizontalBar | Doughnut | undefined>()
|
||||
const [ chartRef, setChartRef ] = useState<HorizontalBar | Doughnut | undefined>();
|
||||
|
||||
const options: ChartOptions = {
|
||||
legend: { display: false },
|
||||
@@ -137,7 +137,6 @@ const DefaultChart = (
|
||||
{
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
// @ts-expect-error
|
||||
precision: 0,
|
||||
callback: prettify,
|
||||
max,
|
||||
|
||||
@@ -81,17 +81,18 @@ const groupVisitsByStep = (step: Step, visits: NormalizedVisit[]): Stats => visi
|
||||
{},
|
||||
);
|
||||
|
||||
const visitsToDatasetGroups = (step: Step, visits: NormalizedVisit[]) => visits.reduce(
|
||||
(acc, visit) => {
|
||||
const key = STEP_TO_DATE_FORMAT[step](visit.date);
|
||||
const visitsToDatasetGroups = (step: Step, visits: NormalizedVisit[]) =>
|
||||
visits.reduce<Record<string, NormalizedVisit[]>>(
|
||||
(acc, visit) => {
|
||||
const key = STEP_TO_DATE_FORMAT[step](visit.date);
|
||||
|
||||
acc[key] = acc[key] ?? [];
|
||||
acc[key].push(visit);
|
||||
acc[key] = acc[key] ?? [];
|
||||
acc[key].push(visit);
|
||||
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, NormalizedVisit[]>,
|
||||
);
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
|
||||
const generateLabels = (step: Step, visits: NormalizedVisit[]): string[] => {
|
||||
const unit = STEP_TO_DATE_UNIT_MAP[step];
|
||||
@@ -186,7 +187,6 @@ const LineChartCard = (
|
||||
{
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
// @ts-expect-error
|
||||
precision: 0,
|
||||
callback: prettify,
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Stats, StatsRow } from '../types';
|
||||
import GraphCard from './GraphCard';
|
||||
import { DefaultChartProps } from './DefaultChart';
|
||||
|
||||
const toLowerIfString = (value: any) => type(value) === 'String' ? toLower(value) : value;
|
||||
const toLowerIfString = (value: any) => type(value) === 'String' ? toLower(value) : value; // eslint-disable-line @typescript-eslint/no-unsafe-return
|
||||
const pickKeyFromPair = ([ key ]: StatsRow) => key;
|
||||
const pickValueFromPair = ([ , value ]: StatsRow) => value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user