Skip to content

Commit

Permalink
Fix import no-cycle dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
puranban committed Aug 26, 2024
1 parent c6103b4 commit deed0cc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/src/components/domain/RiskImminentEventMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import {
DEFAULT_MAP_PADDING,
DURATION_MAP_ZOOM,
} from '#utils/constants';
import { ImminentEventSource } from '#utils/domain/risk';

import { ImminentEventSource } from '../RiskImminentEvents';
import GdacsMap from '../RiskImminentEvents/Gdacs/GdacsMap';
import PdcMap from '../RiskImminentEvents/Pdc/PdcMap';
import {
Expand Down
6 changes: 4 additions & 2 deletions app/src/components/domain/RiskImminentEvents/Gdacs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import {
import { type LngLatBoundsLike } from 'mapbox-gl';

import RiskImminentEventMap, { type EventPointFeature } from '#components/domain/RiskImminentEventMap';
import { isValidFeatureCollection } from '#utils/domain/risk';
import {
ImminentEventSource,
isValidFeatureCollection,
} from '#utils/domain/risk';
import {
RiskApiResponse,
useRiskLazyRequest,
useRiskRequest,
} from '#utils/restRequest';

import { ImminentEventSource } from '..';
import EventDetails from './EventDetails';
import EventListItem from './EventListItem';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import type { LngLatBoundsLike } from 'mapbox-gl';

import type { EventPointFeature } from '#components/domain/RiskImminentEventMap';
import RiskImminentEventMap from '#components/domain/RiskImminentEventMap';
import { isValidFeatureCollection } from '#utils/domain/risk';
import {
ImminentEventSource,
isValidFeatureCollection,
} from '#utils/domain/risk';
import {
type RiskApiResponse,
useRiskLazyRequest,
Expand Down Expand Up @@ -36,6 +39,7 @@ function getLayerType(geometryType: GeoJSON.Geometry['type']) {
type BaseProps = {
title: React.ReactNode;
bbox: LngLatBoundsLike | undefined;
activeView: ImminentEventSource;
}

type Props = BaseProps & ({
Expand All @@ -53,6 +57,7 @@ function MeteoSwiss(props: Props) {
title,
bbox,
variant,
activeView,
} = props;

const {
Expand Down Expand Up @@ -191,6 +196,7 @@ function MeteoSwiss(props: Props) {
activeEventExposure={exposureResponse}
activeEventExposurePending={exposureResponsePending}
onActiveEventChange={handleActiveEventChange}
activeView={activeView}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/domain/RiskImminentEvents/Pdc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { type LngLatBoundsLike } from 'mapbox-gl';

import RiskImminentEventMap, { type EventPointFeature } from '#components/domain/RiskImminentEventMap';
import {
ImminentEventSource,
isValidFeature,
isValidPointFeature,
} from '#utils/domain/risk';
Expand All @@ -17,7 +18,6 @@ import {
useRiskRequest,
} from '#utils/restRequest';

import { ImminentEventSource } from '..';
import EventDetails from './EventDetails';
import EventListItem from './EventListItem';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import {
import { type LngLatBoundsLike } from 'mapbox-gl';

import RiskImminentEventMap, { type EventPointFeature } from '#components/domain/RiskImminentEventMap';
import { isValidFeatureCollection } from '#utils/domain/risk';
import {
ImminentEventSource,
isValidFeatureCollection,
} from '#utils/domain/risk';
import {
type RiskApiResponse,
useRiskLazyRequest,
useRiskRequest,
} from '#utils/restRequest';

import { ImminentEventSource } from '..';
import EventDetails from './EventDetails';
import EventListItem from './EventListItem';

Expand Down
6 changes: 4 additions & 2 deletions app/src/components/domain/RiskImminentEvents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import Link from '#components/Link';
import WikiLink from '#components/WikiLink';
import { environment } from '#config';
import { type components } from '#generated/riskTypes';
import { hazardTypeToColorMap } from '#utils/domain/risk';
import {
hazardTypeToColorMap,
ImminentEventSource,
} from '#utils/domain/risk';

import Gdacs from './Gdacs';
import MeteoSwiss from './MeteoSwiss';
Expand All @@ -34,7 +37,6 @@ import WfpAdam from './WfpAdam';
import i18n from './i18n.json';
import styles from './styles.module.css';

export type ImminentEventSource = 'pdc' | 'wfpAdam' | 'gdacs' | 'meteoSwiss';
type HazardType = components<'read'>['schemas']['HazardTypeEnum'];

type BaseProps = {
Expand Down
1 change: 1 addition & 0 deletions app/src/utils/domain/risk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
} from '#utils/constants';
import { type RiskApiResponse } from '#utils/restRequest';

export type ImminentEventSource = 'pdc' | 'wfpAdam' | 'gdacs' | 'meteoSwiss';
export type HazardType = components<'read'>['schemas']['HazardTypeEnum'];
type IpcEstimationType = components<'read'>['schemas']['EstimationTypeEnum'];
type CountrySeasonal = RiskApiResponse<'/api/v1/country-seasonal/'>;
Expand Down

0 comments on commit deed0cc

Please sign in to comment.