fix(plugin-chart-country-map): resolve TypeScript lint errors

- Remove unused CategoricalColorNamespace import in CountryMap.tsx
- Remove unused isAdminSubdivision helper in controlPanel.tsx
- Add resolveJsonModule + include manifest.json in tsconfig
- Cast chartProps.formData to CountryMapFormData in transformProps

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Superset Dev
2026-05-12 23:03:58 -07:00
parent 9fd7fd441a
commit cbb8477d47
4 changed files with 41 additions and 20 deletions

View File

@@ -18,6 +18,7 @@
*/
import {
CountryMapChartProps,
CountryMapFormData,
CountryMapTransformedProps,
} from '../types';
@@ -40,7 +41,8 @@ const GEOJSON_BASE = '/static/assets/country-maps';
export default function transformProps(
chartProps: CountryMapChartProps,
): CountryMapTransformedProps {
const { formData, queriesData, width, height } = chartProps;
const { queriesData, width, height } = chartProps;
const formData = chartProps.formData as CountryMapFormData;
const data = (queriesData?.[0]?.data as Record<string, unknown>[]) ?? [];
const worldview = formData.worldview || 'ukr';
@@ -50,11 +52,9 @@ export default function transformProps(
if (formData.composite) {
geoJsonUrl = `${GEOJSON_BASE}/composite_${formData.composite}_${worldview}.geo.json`;
} else if (formData.region_set && formData.country) {
geoJsonUrl =
`${GEOJSON_BASE}/regional_${formData.country}_${formData.region_set}_${worldview}.geo.json`;
geoJsonUrl = `${GEOJSON_BASE}/regional_${formData.country}_${formData.region_set}_${worldview}.geo.json`;
} else if (adminLevel === 1 && formData.country) {
geoJsonUrl =
`${GEOJSON_BASE}/${worldview}_admin1_${formData.country}.geo.json`;
geoJsonUrl = `${GEOJSON_BASE}/${worldview}_admin1_${formData.country}.geo.json`;
} else if (adminLevel === 0) {
geoJsonUrl = `${GEOJSON_BASE}/${worldview}_admin0.geo.json`;
}