Skip to content

Commit 9818dc5

Browse files
authored
fix: Address publisher metrics compiler warnings from TiCS (#5086)
1 parent fe80c75 commit 9818dc5

11 files changed

Lines changed: 194 additions & 223 deletions

File tree

static/js/public/snap-details/map.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@ import { feature, mesh } from "topojson-client";
77
import { GeoJsonProperties } from "geojson";
88
import { Topology, Objects } from "topojson-specification";
99

10+
import type { TerritoriesMetricsData } from "../../publisher/types/shared";
11+
1012
export default function renderMap(
1113
el: string,
12-
snapData: {
13-
[key: number]: {
14-
code: string;
15-
color_rgb: number[];
16-
name: string;
17-
number_of_users: number;
18-
percentage_of_users: number;
19-
};
20-
},
14+
snapData: TerritoriesMetricsData,
2115
) {
2216
const mapEl = select(el);
2317

@@ -30,15 +24,7 @@ export default function renderMap(
3024

3125
function render(
3226
mapEl: Selection<BaseType, unknown, HTMLElement, unknown>,
33-
snapData: {
34-
[key: number]: {
35-
code: string;
36-
color_rgb: number[];
37-
name: string;
38-
number_of_users: number;
39-
percentage_of_users: number;
40-
};
41-
},
27+
snapData: TerritoriesMetricsData,
4228
world: Topology<Objects<GeoJsonProperties>>,
4329
) {
4430
const width = mapEl.property("clientWidth");

static/js/publisher/pages/Metrics/TerritoryMetrics.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { useEffect } from "react";
55
import { renderTerritoriesMetrics } from "./metrics/metrics";
66
import useCountryMetrics from "../../hooks/useCountryMetrics";
77

8+
import type { TerritoriesMetricsData } from "../../types/shared";
9+
810
export const TerritoryMetrics = ({
911
isEmpty,
1012
onDataLoad,
@@ -21,15 +23,7 @@ export const TerritoryMetrics = ({
2123
status: string;
2224
data:
2325
| {
24-
active_devices: {
25-
[key: string]: {
26-
code: string;
27-
color_rgb: string;
28-
name: string;
29-
number_of_users: number;
30-
percentage_of_users: number;
31-
};
32-
};
26+
active_devices: TerritoriesMetricsData;
3327
territories_total: number;
3428
}
3529
| undefined;
File renamed without changes.

static/js/publisher/pages/Metrics/metrics/filters.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

static/js/publisher/pages/Metrics/metrics/graphs/activeDevicesGraph/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
prepareStackedData,
99
prepareLineData,
1010
prepareScales,
11-
prepareAnnotationsData,
1211
prepareAxis,
1312
} from "./dataProcessing";
1413
import {

static/js/publisher/pages/Metrics/metrics/graphs/activeDevicesGraph/rendering.js

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)