From dcca3388518453abf0e91ecf9e65adfd23d6cb5f Mon Sep 17 00:00:00 2001 From: Alessandro Kreslin Date: Tue, 14 Apr 2026 12:50:27 -0400 Subject: [PATCH 1/6] forgot password migration --- src/app/[locale]/forgot-password/page.tsx | 11 +++++++++++ src/app/screens/ForgotPassword.tsx | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 src/app/[locale]/forgot-password/page.tsx diff --git a/src/app/[locale]/forgot-password/page.tsx b/src/app/[locale]/forgot-password/page.tsx new file mode 100644 index 0000000..a5092e6 --- /dev/null +++ b/src/app/[locale]/forgot-password/page.tsx @@ -0,0 +1,11 @@ +import { type ReactElement } from 'react'; +import ForgotPassword from '../../screens/ForgotPassword'; +import { ReduxGateWrapper } from '../../components/ReduxGateWrapper'; + +export default function ForgotPasswordPage(): ReactElement { + return ( + + + + ); +} \ No newline at end of file diff --git a/src/app/screens/ForgotPassword.tsx b/src/app/screens/ForgotPassword.tsx index 647b6e7..0f202ef 100644 --- a/src/app/screens/ForgotPassword.tsx +++ b/src/app/screens/ForgotPassword.tsx @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import Button from '@mui/material/Button'; import CssBaseline from '@mui/material/CssBaseline'; From 991b61c7f894961d862ad7bf829c7c667073c37c Mon Sep 17 00:00:00 2001 From: Alessandro Kreslin Date: Tue, 14 Apr 2026 12:52:24 -0400 Subject: [PATCH 2/6] metrics migration --- .../Analytics/GBFSFeedAnalytics/DetailPanel.tsx | 0 .../Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx} | 10 ++++++---- .../GBFSFeedAnalytics/GBFSFeedAnalyticsTable.tsx | 0 .../GBFSNoticeAnalytics/GBFSNoticeAnalytics.tsx} | 4 +++- .../GBFSVersionAnalytics/GBFSVersionAnalytics.tsx} | 6 ++++-- .../GTFSFeatureAnalytics/GTFSFeatureAnalytics.tsx} | 8 +++++--- .../Analytics/GTFSFeedAnalytics/DetailPanel.tsx | 2 +- .../Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx} | 10 ++++++---- .../GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx | 2 +- .../GTFSNoticeAnalytics/GTFSNoticeAnalytics.tsx} | 6 ++++-- .../metrics/_components}/Analytics/analytics.css | 0 .../[locale]/metrics/_components/Analytics/types.ts | 1 + .../metrics/_components}/Analytics/utils.ts | 0 src/app/[locale]/metrics/gbfs/feeds/page.tsx | 6 ++++++ src/app/[locale]/metrics/gbfs/notices/page.tsx | 6 ++++++ src/app/[locale]/metrics/gbfs/versions/page.tsx | 6 ++++++ src/app/[locale]/metrics/gtfs/features/page.tsx | 6 ++++++ src/app/[locale]/metrics/gtfs/feeds/page.tsx | 6 ++++++ src/app/[locale]/metrics/gtfs/notices/page.tsx | 6 ++++++ src/app/[locale]/metrics/gtfs/page.tsx | 6 ++++++ src/app/[locale]/metrics/layout.tsx | 10 ++++++++++ src/app/store/analytics-reducer.ts | 2 +- src/app/store/gbfs-analytics-reducer.ts | 2 +- src/app/store/gbfs-analytics-selector.ts | 2 +- src/app/store/gtfs-analytics-reducer.ts | 2 +- src/app/store/gtfs-analytics-selector.ts | 2 +- src/app/store/saga/gbfs-analytics-saga.ts | 4 ++-- src/app/store/saga/gtfs-analytics-saga.ts | 4 ++-- .../Analytics/types.ts => utils/analytics-types.ts} | 6 +++--- 29 files changed, 95 insertions(+), 30 deletions(-) rename src/app/{screens => [locale]/metrics/_components}/Analytics/GBFSFeedAnalytics/DetailPanel.tsx (100%) rename src/app/{screens/Analytics/GBFSFeedAnalytics/index.tsx => [locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx} (97%) rename src/app/{screens => [locale]/metrics/_components}/Analytics/GBFSFeedAnalytics/GBFSFeedAnalyticsTable.tsx (100%) rename src/app/{screens/Analytics/GBFSNoticeAnalytics/index.tsx => [locale]/metrics/_components/Analytics/GBFSNoticeAnalytics/GBFSNoticeAnalytics.tsx} (98%) rename src/app/{screens/Analytics/GBFSVersionAnalytics/index.tsx => [locale]/metrics/_components/Analytics/GBFSVersionAnalytics/GBFSVersionAnalytics.tsx} (97%) rename src/app/{screens/Analytics/GTFSFeatureAnalytics/index.tsx => [locale]/metrics/_components/Analytics/GTFSFeatureAnalytics/GTFSFeatureAnalytics.tsx} (97%) rename src/app/{screens => [locale]/metrics/_components}/Analytics/GTFSFeedAnalytics/DetailPanel.tsx (98%) rename src/app/{screens/Analytics/GTFSFeedAnalytics/index.tsx => [locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx} (97%) rename src/app/{screens => [locale]/metrics/_components}/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx (99%) rename src/app/{screens/Analytics/GTFSNoticeAnalytics/index.tsx => [locale]/metrics/_components/Analytics/GTFSNoticeAnalytics/GTFSNoticeAnalytics.tsx} (97%) rename src/app/{screens => [locale]/metrics/_components}/Analytics/analytics.css (100%) create mode 100644 src/app/[locale]/metrics/_components/Analytics/types.ts rename src/app/{screens => [locale]/metrics/_components}/Analytics/utils.ts (100%) create mode 100644 src/app/[locale]/metrics/gbfs/feeds/page.tsx create mode 100644 src/app/[locale]/metrics/gbfs/notices/page.tsx create mode 100644 src/app/[locale]/metrics/gbfs/versions/page.tsx create mode 100644 src/app/[locale]/metrics/gtfs/features/page.tsx create mode 100644 src/app/[locale]/metrics/gtfs/feeds/page.tsx create mode 100644 src/app/[locale]/metrics/gtfs/notices/page.tsx create mode 100644 src/app/[locale]/metrics/gtfs/page.tsx create mode 100644 src/app/[locale]/metrics/layout.tsx rename src/app/{screens/Analytics/types.ts => utils/analytics-types.ts} (92%) diff --git a/src/app/screens/Analytics/GBFSFeedAnalytics/DetailPanel.tsx b/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/DetailPanel.tsx similarity index 100% rename from src/app/screens/Analytics/GBFSFeedAnalytics/DetailPanel.tsx rename to src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/DetailPanel.tsx diff --git a/src/app/screens/Analytics/GBFSFeedAnalytics/index.tsx b/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx similarity index 97% rename from src/app/screens/Analytics/GBFSFeedAnalytics/index.tsx rename to src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx index 814fe7e..9db562c 100644 --- a/src/app/screens/Analytics/GBFSFeedAnalytics/index.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx @@ -1,3 +1,5 @@ +'use client'; + import React, { useMemo } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import FormHelperText from '@mui/material/FormHelperText'; @@ -29,16 +31,16 @@ import { useSearchParams } from 'next/navigation'; import { fetchAvailableFilesStart, selectFile, -} from '../../../store/gbfs-analytics-reducer'; +} from '../../../../../store/gbfs-analytics-reducer'; import { selectGBFSFeedMetrics, selectGBFSAnalyticsStatus, selectGBFSAnalyticsError, -} from '../../../store/gbfs-analytics-selector'; +} from '../../../../../store/gbfs-analytics-selector'; import { useTableColumns } from './GBFSFeedAnalyticsTable'; -import { type RootState } from '../../../store/store'; +import { type RootState } from '../../../../../store/store'; import { type AnalyticsFile, type GBFSFeedMetrics } from '../types'; -import { useRemoteConfig } from '../../../context/RemoteConfigProvider'; +import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; import DetailPanel from './DetailPanel'; import { setAnalyticsBucketEndpoint } from '../utils'; diff --git a/src/app/screens/Analytics/GBFSFeedAnalytics/GBFSFeedAnalyticsTable.tsx b/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalyticsTable.tsx similarity index 100% rename from src/app/screens/Analytics/GBFSFeedAnalytics/GBFSFeedAnalyticsTable.tsx rename to src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalyticsTable.tsx diff --git a/src/app/screens/Analytics/GBFSNoticeAnalytics/index.tsx b/src/app/[locale]/metrics/_components/Analytics/GBFSNoticeAnalytics/GBFSNoticeAnalytics.tsx similarity index 98% rename from src/app/screens/Analytics/GBFSNoticeAnalytics/index.tsx rename to src/app/[locale]/metrics/_components/Analytics/GBFSNoticeAnalytics/GBFSNoticeAnalytics.tsx index 28c4eba..1aefd02 100644 --- a/src/app/screens/Analytics/GBFSNoticeAnalytics/index.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GBFSNoticeAnalytics/GBFSNoticeAnalytics.tsx @@ -1,3 +1,5 @@ +'use client'; + import { useState, useEffect, useMemo } from 'react'; import { useSearchParams, useRouter } from 'next/navigation'; @@ -24,7 +26,7 @@ import * as React from 'react'; import { useTheme } from '@mui/material/styles'; import { InfoOutlined, ListAltOutlined } from '@mui/icons-material'; import { type GBFSNoticeMetrics } from '../types'; -import { useRemoteConfig } from '../../../context/RemoteConfigProvider'; +import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; export default function GBFSNoticeAnalytics(): React.ReactElement { const router = useRouter(); diff --git a/src/app/screens/Analytics/GBFSVersionAnalytics/index.tsx b/src/app/[locale]/metrics/_components/Analytics/GBFSVersionAnalytics/GBFSVersionAnalytics.tsx similarity index 97% rename from src/app/screens/Analytics/GBFSVersionAnalytics/index.tsx rename to src/app/[locale]/metrics/_components/Analytics/GBFSVersionAnalytics/GBFSVersionAnalytics.tsx index 438ed5f..2ec10c2 100644 --- a/src/app/screens/Analytics/GBFSVersionAnalytics/index.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GBFSVersionAnalytics/GBFSVersionAnalytics.tsx @@ -1,3 +1,5 @@ +'use client'; + import { useState, useEffect, useMemo } from 'react'; import { useSearchParams, useRouter } from 'next/navigation'; @@ -31,9 +33,9 @@ import * as React from 'react'; import { useTheme } from '@mui/material/styles'; import { InfoOutlined, ListAltOutlined } from '@mui/icons-material'; import { type GBFSVersionMetrics } from '../types'; -import { useRemoteConfig } from '../../../context/RemoteConfigProvider'; +import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; import MUITooltip from '@mui/material/Tooltip'; -import { GBFS_LINK } from '../../../constants/Navigation'; +import { GBFS_LINK } from '../../../../../constants/Navigation'; export default function GBFSVersionAnalytics(): React.ReactElement { const router = useRouter(); diff --git a/src/app/screens/Analytics/GTFSFeatureAnalytics/index.tsx b/src/app/[locale]/metrics/_components/Analytics/GTFSFeatureAnalytics/GTFSFeatureAnalytics.tsx similarity index 97% rename from src/app/screens/Analytics/GTFSFeatureAnalytics/index.tsx rename to src/app/[locale]/metrics/_components/Analytics/GTFSFeatureAnalytics/GTFSFeatureAnalytics.tsx index 4ef16a8..0e4260f 100644 --- a/src/app/screens/Analytics/GTFSFeatureAnalytics/index.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GTFSFeatureAnalytics/GTFSFeatureAnalytics.tsx @@ -1,3 +1,5 @@ +'use client'; + import { useState, useEffect, useMemo } from 'react'; import { useSearchParams, useRouter } from 'next/navigation'; import { @@ -29,13 +31,13 @@ import * as React from 'react'; import { useTheme } from '@mui/material/styles'; import { InfoOutlined, ListAltOutlined } from '@mui/icons-material'; import { type FeatureMetrics } from '../types'; -import { useRemoteConfig } from '../../../context/RemoteConfigProvider'; +import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; import MUITooltip from '@mui/material/Tooltip'; -import { GTFS_ORG_LINK } from '../../../constants/Navigation'; +import { GTFS_ORG_LINK } from '../../../../../constants/Navigation'; import { DATASET_FEATURES, getComponentDecorators, -} from '../../../utils/consts'; +} from '../../../../../utils/consts'; export default function GTFSFeatureAnalytics(): React.ReactElement { const router = useRouter(); diff --git a/src/app/screens/Analytics/GTFSFeedAnalytics/DetailPanel.tsx b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/DetailPanel.tsx similarity index 98% rename from src/app/screens/Analytics/GTFSFeedAnalytics/DetailPanel.tsx rename to src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/DetailPanel.tsx index c9b0e09..58a1914 100644 --- a/src/app/screens/Analytics/GTFSFeedAnalytics/DetailPanel.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/DetailPanel.tsx @@ -22,7 +22,7 @@ import { CalendarToday, } from '@mui/icons-material'; import { type GTFSFeedMetrics } from '../types'; -import { getLocationName } from '../../../services/feeds/utils'; +import { getLocationName } from '../../../../../services/feeds/utils'; interface RowData { original: GTFSFeedMetrics; diff --git a/src/app/screens/Analytics/GTFSFeedAnalytics/index.tsx b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx similarity index 97% rename from src/app/screens/Analytics/GTFSFeedAnalytics/index.tsx rename to src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx index 37bc670..ae777dd 100644 --- a/src/app/screens/Analytics/GTFSFeedAnalytics/index.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx @@ -1,3 +1,5 @@ +'use client'; + import React, { useMemo } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { @@ -23,17 +25,17 @@ import { useSearchParams } from 'next/navigation'; import { fetchAvailableFilesStart, selectFile, -} from '../../../store/gtfs-analytics-reducer'; +} from '../../../../../store/gtfs-analytics-reducer'; import { selectGTFSFeedMetrics, selectGTFSAnalyticsStatus, selectGTFSAnalyticsError, -} from '../../../store/gtfs-analytics-selector'; +} from '../../../../../store/gtfs-analytics-selector'; import { useTableColumns } from './GTFSFeedAnalyticsTable'; import DetailPanel from './DetailPanel'; -import { type RootState } from '../../../store/store'; +import { type RootState } from '../../../../../store/store'; import { type AnalyticsFile, type GTFSFeedMetrics } from '../types'; -import { useRemoteConfig } from '../../../context/RemoteConfigProvider'; +import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; import DownloadIcon from '@mui/icons-material/Download'; import { download, generateCsv, mkConfig } from 'export-to-csv'; diff --git a/src/app/screens/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx similarity index 99% rename from src/app/screens/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx rename to src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx index 018f9c3..44bb089 100644 --- a/src/app/screens/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx @@ -8,7 +8,7 @@ import { OpenInNew } from '@mui/icons-material'; import { getComponentDecorators, groupFeaturesByComponent, -} from '../../../utils/consts'; +} from '../../../../../utils/consts'; /** * Returns the columns for the feed analytics table. diff --git a/src/app/screens/Analytics/GTFSNoticeAnalytics/index.tsx b/src/app/[locale]/metrics/_components/Analytics/GTFSNoticeAnalytics/GTFSNoticeAnalytics.tsx similarity index 97% rename from src/app/screens/Analytics/GTFSNoticeAnalytics/index.tsx rename to src/app/[locale]/metrics/_components/Analytics/GTFSNoticeAnalytics/GTFSNoticeAnalytics.tsx index 43aa064..5c003a8 100644 --- a/src/app/screens/Analytics/GTFSNoticeAnalytics/index.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GTFSNoticeAnalytics/GTFSNoticeAnalytics.tsx @@ -1,3 +1,5 @@ +'use client'; + import { useState, useEffect, useMemo } from 'react'; import { useSearchParams, useRouter } from 'next/navigation'; @@ -32,8 +34,8 @@ import * as React from 'react'; import { useTheme } from '@mui/material/styles'; import { InfoOutlined, ListAltOutlined } from '@mui/icons-material'; import { type NoticeMetrics } from '../types'; -import { WEB_VALIDATOR_LINK } from '../../../constants/Navigation'; -import { useRemoteConfig } from '../../../context/RemoteConfigProvider'; +import { WEB_VALIDATOR_LINK } from '../../../../../constants/Navigation'; +import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; export default function GTFSNoticeAnalytics(): React.ReactElement { const router = useRouter(); diff --git a/src/app/screens/Analytics/analytics.css b/src/app/[locale]/metrics/_components/Analytics/analytics.css similarity index 100% rename from src/app/screens/Analytics/analytics.css rename to src/app/[locale]/metrics/_components/Analytics/analytics.css diff --git a/src/app/[locale]/metrics/_components/Analytics/types.ts b/src/app/[locale]/metrics/_components/Analytics/types.ts new file mode 100644 index 0000000..bddb0ca --- /dev/null +++ b/src/app/[locale]/metrics/_components/Analytics/types.ts @@ -0,0 +1 @@ +export * from '../../../../utils/analytics-types'; diff --git a/src/app/screens/Analytics/utils.ts b/src/app/[locale]/metrics/_components/Analytics/utils.ts similarity index 100% rename from src/app/screens/Analytics/utils.ts rename to src/app/[locale]/metrics/_components/Analytics/utils.ts diff --git a/src/app/[locale]/metrics/gbfs/feeds/page.tsx b/src/app/[locale]/metrics/gbfs/feeds/page.tsx new file mode 100644 index 0000000..27e1762 --- /dev/null +++ b/src/app/[locale]/metrics/gbfs/feeds/page.tsx @@ -0,0 +1,6 @@ +import { type ReactElement } from 'react'; +import GBFSFeedAnalytics from '../../_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics'; + +export default function GBFSFeedsMetricsPage(): ReactElement { + return ; +} \ No newline at end of file diff --git a/src/app/[locale]/metrics/gbfs/notices/page.tsx b/src/app/[locale]/metrics/gbfs/notices/page.tsx new file mode 100644 index 0000000..e40ea48 --- /dev/null +++ b/src/app/[locale]/metrics/gbfs/notices/page.tsx @@ -0,0 +1,6 @@ +import { type ReactElement } from 'react'; +import GBFSNoticeAnalytics from '../../_components/Analytics/GBFSNoticeAnalytics/GBFSNoticeAnalytics'; + +export default function GBFSNoticesMetricsPage(): ReactElement { + return ; +} \ No newline at end of file diff --git a/src/app/[locale]/metrics/gbfs/versions/page.tsx b/src/app/[locale]/metrics/gbfs/versions/page.tsx new file mode 100644 index 0000000..04437dd --- /dev/null +++ b/src/app/[locale]/metrics/gbfs/versions/page.tsx @@ -0,0 +1,6 @@ +import { type ReactElement } from 'react'; +import GBFSVersionAnalytics from '../../_components/Analytics/GBFSVersionAnalytics/GBFSVersionAnalytics'; + +export default function GBFSVersionsMetricsPage(): ReactElement { + return ; +} \ No newline at end of file diff --git a/src/app/[locale]/metrics/gtfs/features/page.tsx b/src/app/[locale]/metrics/gtfs/features/page.tsx new file mode 100644 index 0000000..746c370 --- /dev/null +++ b/src/app/[locale]/metrics/gtfs/features/page.tsx @@ -0,0 +1,6 @@ +import { type ReactElement } from 'react'; +import GTFSFeatureAnalytics from '../../_components/Analytics/GTFSFeatureAnalytics/GTFSFeatureAnalytics'; + +export default function GTFSFeaturesMetricsPage(): ReactElement { + return ; +} \ No newline at end of file diff --git a/src/app/[locale]/metrics/gtfs/feeds/page.tsx b/src/app/[locale]/metrics/gtfs/feeds/page.tsx new file mode 100644 index 0000000..5fbac6d --- /dev/null +++ b/src/app/[locale]/metrics/gtfs/feeds/page.tsx @@ -0,0 +1,6 @@ +import { type ReactElement } from 'react'; +import GTFSFeedAnalytics from '../../_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics'; + +export default function GTFSFeedsMetricsPage(): ReactElement { + return ; +} \ No newline at end of file diff --git a/src/app/[locale]/metrics/gtfs/notices/page.tsx b/src/app/[locale]/metrics/gtfs/notices/page.tsx new file mode 100644 index 0000000..c1fba05 --- /dev/null +++ b/src/app/[locale]/metrics/gtfs/notices/page.tsx @@ -0,0 +1,6 @@ +import { type ReactElement } from 'react'; +import GTFSNoticeAnalytics from '../../_components/Analytics/GTFSNoticeAnalytics/GTFSNoticeAnalytics'; + +export default function GTFSNoticesMetricsPage(): ReactElement { + return ; +} \ No newline at end of file diff --git a/src/app/[locale]/metrics/gtfs/page.tsx b/src/app/[locale]/metrics/gtfs/page.tsx new file mode 100644 index 0000000..1a0f7a6 --- /dev/null +++ b/src/app/[locale]/metrics/gtfs/page.tsx @@ -0,0 +1,6 @@ +import { type ReactElement } from 'react'; +import GTFSFeedAnalytics from '../_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics'; + +export default function GTFSMetricsPage(): ReactElement { + return ; +} \ No newline at end of file diff --git a/src/app/[locale]/metrics/layout.tsx b/src/app/[locale]/metrics/layout.tsx new file mode 100644 index 0000000..0e239dd --- /dev/null +++ b/src/app/[locale]/metrics/layout.tsx @@ -0,0 +1,10 @@ +import { type ReactElement } from 'react'; +import { ReduxGateWrapper } from '../../components/ReduxGateWrapper'; + +export default function MetricsLayout({ + children, +}: { + children: React.ReactNode; +}): ReactElement { + return {children}; +} \ No newline at end of file diff --git a/src/app/store/analytics-reducer.ts b/src/app/store/analytics-reducer.ts index 259ee96..3a9d689 100644 --- a/src/app/store/analytics-reducer.ts +++ b/src/app/store/analytics-reducer.ts @@ -4,7 +4,7 @@ import { type FeatureMetrics, type GTFSFeedMetrics, type AnalyticsFile, -} from '../screens/Analytics/types'; +} from '../utils/analytics-types'; interface GTFSAnalyticsState { feedMetrics: GTFSFeedMetrics[]; diff --git a/src/app/store/gbfs-analytics-reducer.ts b/src/app/store/gbfs-analytics-reducer.ts index f3da9e8..2a0aabe 100644 --- a/src/app/store/gbfs-analytics-reducer.ts +++ b/src/app/store/gbfs-analytics-reducer.ts @@ -2,7 +2,7 @@ import { createSlice, type PayloadAction } from '@reduxjs/toolkit'; import { type AnalyticsFile, type GBFSFeedMetrics, -} from '../screens/Analytics/types'; +} from '../utils/analytics-types'; // Define the state interface interface GBFSAnalyticsState { diff --git a/src/app/store/gbfs-analytics-selector.ts b/src/app/store/gbfs-analytics-selector.ts index 8fe4c1b..827c7a9 100644 --- a/src/app/store/gbfs-analytics-selector.ts +++ b/src/app/store/gbfs-analytics-selector.ts @@ -1,6 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; import { type RootState } from './store'; -import { type GBFSFeedMetrics } from '../screens/Analytics/types'; +import { type GBFSFeedMetrics } from '../utils/analytics-types'; // Selector to get the GBFS feed metrics export const selectGBFSFeedMetrics = (state: RootState): GBFSFeedMetrics[] => diff --git a/src/app/store/gtfs-analytics-reducer.ts b/src/app/store/gtfs-analytics-reducer.ts index 259ee96..3a9d689 100644 --- a/src/app/store/gtfs-analytics-reducer.ts +++ b/src/app/store/gtfs-analytics-reducer.ts @@ -4,7 +4,7 @@ import { type FeatureMetrics, type GTFSFeedMetrics, type AnalyticsFile, -} from '../screens/Analytics/types'; +} from '../utils/analytics-types'; interface GTFSAnalyticsState { feedMetrics: GTFSFeedMetrics[]; diff --git a/src/app/store/gtfs-analytics-selector.ts b/src/app/store/gtfs-analytics-selector.ts index a6cd6da..a0ad3e7 100644 --- a/src/app/store/gtfs-analytics-selector.ts +++ b/src/app/store/gtfs-analytics-selector.ts @@ -1,5 +1,5 @@ import { type RootState } from './store'; -import { type GTFSFeedMetrics } from '../screens/Analytics/types'; +import { type GTFSFeedMetrics } from '../utils/analytics-types'; export const selectGTFSFeedMetrics = (state: RootState): GTFSFeedMetrics[] => state.gtfsAnalytics.feedMetrics; diff --git a/src/app/store/saga/gbfs-analytics-saga.ts b/src/app/store/saga/gbfs-analytics-saga.ts index 1a995a4..5d43c21 100644 --- a/src/app/store/saga/gbfs-analytics-saga.ts +++ b/src/app/store/saga/gbfs-analytics-saga.ts @@ -11,9 +11,9 @@ import { type AnalyticsFile, type GBFSFeedMetrics, type GBFSMetrics, -} from '../../screens/Analytics/types'; +} from '../../utils/analytics-types'; import { getLocationName } from '../../services/feeds/utils'; -import { getAnalyticsBucketEndpoint } from '../../screens/Analytics/utils'; +import { getAnalyticsBucketEndpoint } from '../../[locale]/metrics/_components/Analytics/utils'; function* fetchFeedMetricsSaga( action: ReturnType, diff --git a/src/app/store/saga/gtfs-analytics-saga.ts b/src/app/store/saga/gtfs-analytics-saga.ts index 7c6803a..8ef2d4a 100644 --- a/src/app/store/saga/gtfs-analytics-saga.ts +++ b/src/app/store/saga/gtfs-analytics-saga.ts @@ -11,9 +11,9 @@ import { type AnalyticsFile, type GTFSFeedMetrics, type GTFSMetrics, -} from '../../screens/Analytics/types'; +} from '../../utils/analytics-types'; import { getLocationName } from '../../services/feeds/utils'; -import { getAnalyticsBucketEndpoint } from '../../screens/Analytics/GTFSFeedAnalytics'; +import { getAnalyticsBucketEndpoint } from '../../[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics'; function* fetchFeedMetricsSaga( action: ReturnType, diff --git a/src/app/screens/Analytics/types.ts b/src/app/utils/analytics-types.ts similarity index 92% rename from src/app/screens/Analytics/types.ts rename to src/app/utils/analytics-types.ts index 0c6cc92..0b6391e 100644 --- a/src/app/screens/Analytics/types.ts +++ b/src/app/utils/analytics-types.ts @@ -1,4 +1,4 @@ -import { type EntityLocations } from '../../services/feeds/utils'; +import { type EntityLocations } from '../services/feeds/utils'; export interface Notices { errors: string[]; @@ -40,7 +40,7 @@ export interface FeatureMetrics { computed_on: Date[]; feeds_count: number[]; latest_feed_count: number; - feature_group?: string; // Add a property to handle feature grouping + feature_group?: string; feature_sub_group?: string; } @@ -90,4 +90,4 @@ export interface GBFSVersionMetrics { version: string; computed_on: Date[]; feeds_count: number[]; -} +} \ No newline at end of file From de233dd22361b7df88b89e7b8fee6df1222ce238 Mon Sep 17 00:00:00 2001 From: Alessandro Kreslin Date: Tue, 14 Apr 2026 12:52:59 -0400 Subject: [PATCH 3/6] feed submission migration --- .../FeedSubmission/FeedSubmission.tsx} | 6 +- .../FeedSubmission/Form/FirstStep.tsx | 7 ++- .../FeedSubmission/Form/FourthStep.tsx | 5 +- .../FeedSubmission/Form/SecondStep.tsx | 2 +- .../Form/SecondStepRealtime.tsx | 7 ++- .../FeedSubmission/Form/ThirdStep.tsx | 7 ++- .../Form/components/FormLabelDescription.tsx | 0 .../contribute}/FeedSubmission/Form/index.tsx | 56 +++++-------------- .../contribute/FeedSubmission/Form/types.ts | 1 + src/app/[locale]/contribute/page.tsx | 11 ++++ .../[locale]/contribute/submitted/page.tsx | 8 +++ src/app/screens/FeedSubmitted.tsx | 4 +- .../services/feeds/add-feed-form-service.ts | 2 +- src/app/utils/feed-submission-types.ts | 40 +++++++++++++ 14 files changed, 100 insertions(+), 56 deletions(-) rename src/app/{screens/FeedSubmission/index.tsx => [locale]/contribute/FeedSubmission/FeedSubmission.tsx} (95%) rename src/app/{screens => [locale]/contribute}/FeedSubmission/Form/FirstStep.tsx (98%) rename src/app/{screens => [locale]/contribute}/FeedSubmission/Form/FourthStep.tsx (98%) rename src/app/{screens => [locale]/contribute}/FeedSubmission/Form/SecondStep.tsx (99%) rename src/app/{screens => [locale]/contribute}/FeedSubmission/Form/SecondStepRealtime.tsx (98%) rename src/app/{screens => [locale]/contribute}/FeedSubmission/Form/ThirdStep.tsx (98%) rename src/app/{screens => [locale]/contribute}/FeedSubmission/Form/components/FormLabelDescription.tsx (100%) rename src/app/{screens => [locale]/contribute}/FeedSubmission/Form/index.tsx (82%) create mode 100644 src/app/[locale]/contribute/FeedSubmission/Form/types.ts create mode 100644 src/app/[locale]/contribute/page.tsx create mode 100644 src/app/[locale]/contribute/submitted/page.tsx create mode 100644 src/app/utils/feed-submission-types.ts diff --git a/src/app/screens/FeedSubmission/index.tsx b/src/app/[locale]/contribute/FeedSubmission/FeedSubmission.tsx similarity index 95% rename from src/app/screens/FeedSubmission/index.tsx rename to src/app/[locale]/contribute/FeedSubmission/FeedSubmission.tsx index 398c64b..700d822 100644 --- a/src/app/screens/FeedSubmission/index.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/FeedSubmission.tsx @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import { useSelector } from 'react-redux'; import { @@ -9,11 +11,11 @@ import { Typography, } from '@mui/material'; import CheckIcon from '@mui/icons-material/Check'; -import { selectIsAuthenticated } from '../../store/profile-selectors'; +import { selectIsAuthenticated } from '../../../store/profile-selectors'; import { useTranslations } from 'next-intl'; import { useSearchParams } from 'next/navigation'; import FeedSubmissionForm from './Form'; -import { ColoredContainer } from '../../styles/PageLayout.style'; +import { ColoredContainer } from '../../../styles/PageLayout.style'; function Component(): React.ReactElement { const t = useTranslations('feeds'); diff --git a/src/app/screens/FeedSubmission/Form/FirstStep.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx similarity index 98% rename from src/app/screens/FeedSubmission/Form/FirstStep.tsx rename to src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx index 0a36064..385b8cb 100644 --- a/src/app/screens/FeedSubmission/Form/FirstStep.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx @@ -18,11 +18,14 @@ import { useForm, useWatch, } from 'react-hook-form'; -import { type YesNoFormInput, type FeedSubmissionFormFormInput } from '.'; import { useEffect } from 'react'; import { useTranslations } from 'next-intl'; -import { isValidFeedLink } from '../../../services/feeds/utils'; +import { isValidFeedLink } from '../../../../services/feeds/utils'; import FormLabelDescription from './components/FormLabelDescription'; +import { + type FeedSubmissionFormFormInput, + type YesNoFormInput, +} from './types'; export interface FeedSubmissionFormFormInputFirstStep { isOfficialProducer: YesNoFormInput; diff --git a/src/app/screens/FeedSubmission/Form/FourthStep.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx similarity index 98% rename from src/app/screens/FeedSubmission/Form/FourthStep.tsx rename to src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx index a207fed..e290f0a 100644 --- a/src/app/screens/FeedSubmission/Form/FourthStep.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx @@ -14,9 +14,12 @@ import { useForm, useWatch, } from 'react-hook-form'; -import { type YesNoFormInput, type FeedSubmissionFormFormInput } from '.'; import { useTranslations } from 'next-intl'; import FormLabelDescription from './components/FormLabelDescription'; +import { + type FeedSubmissionFormFormInput, + type YesNoFormInput, +} from './types'; export interface FeedSubmissionFormInputFourthStep { dataProducerEmail?: string; diff --git a/src/app/screens/FeedSubmission/Form/SecondStep.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/SecondStep.tsx similarity index 99% rename from src/app/screens/FeedSubmission/Form/SecondStep.tsx rename to src/app/[locale]/contribute/FeedSubmission/Form/SecondStep.tsx index 1e13c4e..481b91b 100644 --- a/src/app/screens/FeedSubmission/Form/SecondStep.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/SecondStep.tsx @@ -10,11 +10,11 @@ import { FormHelperText, } from '@mui/material'; import { Controller, type SubmitHandler, useForm } from 'react-hook-form'; -import { type FeedSubmissionFormFormInput } from '.'; import { useTranslations } from 'next-intl'; import { getCountryDataList } from 'countries-list'; import { useState } from 'react'; import FormLabelDescription from './components/FormLabelDescription'; +import { type FeedSubmissionFormFormInput } from './types'; export interface FeedSubmissionFormInputSecondStep { country: string; diff --git a/src/app/screens/FeedSubmission/Form/SecondStepRealtime.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx similarity index 98% rename from src/app/screens/FeedSubmission/Form/SecondStepRealtime.tsx rename to src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx index 8291521..b0a2961 100644 --- a/src/app/screens/FeedSubmission/Form/SecondStepRealtime.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx @@ -7,10 +7,13 @@ import { TextField, } from '@mui/material'; import { type SubmitHandler, Controller, useForm } from 'react-hook-form'; -import { type AuthTypes, type FeedSubmissionFormFormInput } from '.'; import { useEffect } from 'react'; import { useTranslations } from 'next-intl'; -import { isValidFeedLink } from '../../../services/feeds/utils'; +import { isValidFeedLink } from '../../../../services/feeds/utils'; +import { + type AuthTypes, + type FeedSubmissionFormFormInput, +} from './types'; export interface FeedSubmissionFormInputSecondStepRT { tripUpdates: string; diff --git a/src/app/screens/FeedSubmission/Form/ThirdStep.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx similarity index 98% rename from src/app/screens/FeedSubmission/Form/ThirdStep.tsx rename to src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx index 7aeda6d..a1faa62 100644 --- a/src/app/screens/FeedSubmission/Form/ThirdStep.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx @@ -14,10 +14,13 @@ import { useForm, useWatch, } from 'react-hook-form'; -import { type FeedSubmissionFormFormInput, type AuthTypes } from '.'; import { useTranslations } from 'next-intl'; -import { isValidFeedLink } from '../../../services/feeds/utils'; +import { isValidFeedLink } from '../../../../services/feeds/utils'; import FormLabelDescription from './components/FormLabelDescription'; +import { + type AuthTypes, + type FeedSubmissionFormFormInput, +} from './types'; export interface FeedSubmissionFormInputThirdStep { authType: AuthTypes; diff --git a/src/app/screens/FeedSubmission/Form/components/FormLabelDescription.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/components/FormLabelDescription.tsx similarity index 100% rename from src/app/screens/FeedSubmission/Form/components/FormLabelDescription.tsx rename to src/app/[locale]/contribute/FeedSubmission/Form/components/FormLabelDescription.tsx diff --git a/src/app/screens/FeedSubmission/Form/index.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/index.tsx similarity index 82% rename from src/app/screens/FeedSubmission/Form/index.tsx rename to src/app/[locale]/contribute/FeedSubmission/Form/index.tsx index 9fc8cfd..07b6b34 100644 --- a/src/app/screens/FeedSubmission/Form/index.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/index.tsx @@ -13,48 +13,12 @@ import { } from '@mui/material'; import { useRouter, useSearchParams, usePathname } from 'next/navigation'; import FormThirdStep from './ThirdStep'; -import { submitNewFeedForm } from '../../../services/feeds/add-feed-form-service'; +import { submitNewFeedForm } from '../../../../services/feeds/add-feed-form-service'; import { useTranslations } from 'next-intl'; - -export type YesNoFormInput = 'yes' | 'no' | ''; -export type AuthTypes = - | 'None - 0' - | 'API key - 1' - | 'HTTP header - 2' - | 'choiceRequired'; - -export interface FeedSubmissionFormFormInput { - isOfficialProducer: YesNoFormInput; - isOfficialFeed: 'yes' | 'no' | 'unsure' | undefined; - dataType: 'gtfs' | 'gtfs_rt'; - transitProviderName: string; - feedLink?: string; - oldFeedLink?: string; - isUpdatingFeed?: YesNoFormInput; - licensePath?: string; - country?: string; - region?: string; - municipality?: string; - tripUpdates?: string; - vehiclePositions?: string; - serviceAlerts?: string; - oldTripUpdates?: string; - oldVehiclePositions?: string; - oldServiceAlerts?: string; - gtfsRelatedScheduleLink?: string; - name?: string; - authType: AuthTypes; - authSignupLink?: string; - authParameterName?: string; - dataProducerEmail: string; - isInterestedInQualityAudit: YesNoFormInput; - userInterviewEmail?: string; - whatToolsUsedText?: string; - hasLogoPermission: YesNoFormInput; - unofficialDesc?: string; // Why was this feed created? - updateFreq?: string; // How often is this feed updated? - emptyLicenseUsage?: string; // Confirm usage if no license and official -} +import { + type FeedSubmissionFormFormInput, + type YesNoFormInput, +} from './types'; const defaultFormValues: FeedSubmissionFormFormInput = { isOfficialProducer: '', @@ -176,14 +140,20 @@ export default function FeedSubmissionForm(): React.ReactElement { const formStepSubmit = ( partialFormData: Partial, ): void => { - setFormData((prevData) => ({ ...prevData, ...partialFormData })); + setFormData((prevData: FeedSubmissionFormFormInput) => ({ + ...prevData, + ...partialFormData, + })); handleNext(); }; const formStepBack = ( partialFormData: Partial, ): void => { - setFormData((prevData) => ({ ...prevData, ...partialFormData })); + setFormData((prevData: FeedSubmissionFormFormInput) => ({ + ...prevData, + ...partialFormData, + })); handleBack(); }; diff --git a/src/app/[locale]/contribute/FeedSubmission/Form/types.ts b/src/app/[locale]/contribute/FeedSubmission/Form/types.ts new file mode 100644 index 0000000..2da045d --- /dev/null +++ b/src/app/[locale]/contribute/FeedSubmission/Form/types.ts @@ -0,0 +1 @@ +export * from '../../../../utils/feed-submission-types'; \ No newline at end of file diff --git a/src/app/[locale]/contribute/page.tsx b/src/app/[locale]/contribute/page.tsx new file mode 100644 index 0000000..57e32dc --- /dev/null +++ b/src/app/[locale]/contribute/page.tsx @@ -0,0 +1,11 @@ +import { type ReactElement } from 'react'; +import FeedSubmission from './FeedSubmission/FeedSubmission'; +import { ReduxGateWrapper } from '../../components/ReduxGateWrapper'; + +export default function ContributePage(): ReactElement { + return ( + + + + ); +} \ No newline at end of file diff --git a/src/app/[locale]/contribute/submitted/page.tsx b/src/app/[locale]/contribute/submitted/page.tsx new file mode 100644 index 0000000..ad4c16a --- /dev/null +++ b/src/app/[locale]/contribute/submitted/page.tsx @@ -0,0 +1,8 @@ +import { type ReactElement } from 'react'; +import FeedSubmitted from '../../../screens/FeedSubmitted'; + +export default function ContributeSubmittedPage(): ReactElement { + return ( + + ); +} \ No newline at end of file diff --git a/src/app/screens/FeedSubmitted.tsx b/src/app/screens/FeedSubmitted.tsx index 1286c04..d1fa087 100644 --- a/src/app/screens/FeedSubmitted.tsx +++ b/src/app/screens/FeedSubmitted.tsx @@ -1,8 +1,9 @@ +'use client'; + import { Typography, Box, Container, - CssBaseline, useTheme, Button, } from '@mui/material'; @@ -11,7 +12,6 @@ export default function FeedSubmitted(): React.ReactElement { const theme = useTheme(); return ( - Date: Tue, 14 Apr 2026 12:53:07 -0400 Subject: [PATCH 4/6] router cleanup --- src/app/router/Router.tsx | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/app/router/Router.tsx b/src/app/router/Router.tsx index dc277a7..0c83293 100644 --- a/src/app/router/Router.tsx +++ b/src/app/router/Router.tsx @@ -1,34 +1,5 @@ import React from 'react'; -import { Routes, Route } from 'react-router-dom'; -import ForgotPassword from '../screens/ForgotPassword'; -import FeedSubmission from '../screens/FeedSubmission'; -import FeedSubmitted from '../screens/FeedSubmitted'; -import GTFSFeedAnalytics from '../screens/Analytics/GTFSFeedAnalytics'; -import GTFSNoticeAnalytics from '../screens/Analytics/GTFSNoticeAnalytics'; -import GTFSFeatureAnalytics from '../screens/Analytics/GTFSFeatureAnalytics'; -import GBFSFeedAnalytics from '../screens/Analytics/GBFSFeedAnalytics'; -import GBFSNoticeAnalytics from '../screens/Analytics/GBFSNoticeAnalytics'; -import GBFSVersionAnalytics from '../screens/Analytics/GBFSVersionAnalytics'; -export const AppRouter: React.FC = () => { - return ( - - } /> - } /> - } /> - - } /> - } /> - } /> - } /> - - - } /> - } /> - } /> - - - ); -}; +export const AppRouter: React.FC = () => null; export default AppRouter; From 15a875edbc2e1afeb079d9b15967742d07a50c6f Mon Sep 17 00:00:00 2001 From: Alessandro Kreslin Date: Tue, 21 Apr 2026 08:09:37 -0400 Subject: [PATCH 5/6] lint fix --- .../[locale]/contribute/FeedSubmission/Form/FirstStep.tsx | 5 +---- .../contribute/FeedSubmission/Form/FourthStep.tsx | 5 +---- .../contribute/FeedSubmission/Form/SecondStepRealtime.tsx | 5 +---- .../[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx | 5 +---- src/app/[locale]/contribute/FeedSubmission/Form/index.tsx | 5 +---- src/app/[locale]/contribute/FeedSubmission/Form/types.ts | 2 +- src/app/[locale]/contribute/page.tsx | 2 +- src/app/[locale]/contribute/submitted/page.tsx | 6 ++---- src/app/[locale]/forgot-password/page.tsx | 2 +- src/app/[locale]/metrics/gbfs/feeds/page.tsx | 2 +- src/app/[locale]/metrics/gbfs/notices/page.tsx | 2 +- src/app/[locale]/metrics/gbfs/versions/page.tsx | 2 +- src/app/[locale]/metrics/gtfs/features/page.tsx | 2 +- src/app/[locale]/metrics/gtfs/feeds/page.tsx | 2 +- src/app/[locale]/metrics/gtfs/notices/page.tsx | 2 +- src/app/[locale]/metrics/gtfs/page.tsx | 2 +- src/app/[locale]/metrics/layout.tsx | 2 +- src/app/router/Router.tsx | 2 +- src/app/screens/FeedSubmitted.tsx | 8 +------- src/app/utils/analytics-types.ts | 2 +- src/app/utils/feed-submission-types.ts | 2 +- 21 files changed, 22 insertions(+), 45 deletions(-) diff --git a/src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx index 385b8cb..c46c768 100644 --- a/src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/FirstStep.tsx @@ -22,10 +22,7 @@ import { useEffect } from 'react'; import { useTranslations } from 'next-intl'; import { isValidFeedLink } from '../../../../services/feeds/utils'; import FormLabelDescription from './components/FormLabelDescription'; -import { - type FeedSubmissionFormFormInput, - type YesNoFormInput, -} from './types'; +import { type FeedSubmissionFormFormInput, type YesNoFormInput } from './types'; export interface FeedSubmissionFormFormInputFirstStep { isOfficialProducer: YesNoFormInput; diff --git a/src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx index e290f0a..cc6d784 100644 --- a/src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/FourthStep.tsx @@ -16,10 +16,7 @@ import { } from 'react-hook-form'; import { useTranslations } from 'next-intl'; import FormLabelDescription from './components/FormLabelDescription'; -import { - type FeedSubmissionFormFormInput, - type YesNoFormInput, -} from './types'; +import { type FeedSubmissionFormFormInput, type YesNoFormInput } from './types'; export interface FeedSubmissionFormInputFourthStep { dataProducerEmail?: string; diff --git a/src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx index b0a2961..4a37854 100644 --- a/src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/SecondStepRealtime.tsx @@ -10,10 +10,7 @@ import { type SubmitHandler, Controller, useForm } from 'react-hook-form'; import { useEffect } from 'react'; import { useTranslations } from 'next-intl'; import { isValidFeedLink } from '../../../../services/feeds/utils'; -import { - type AuthTypes, - type FeedSubmissionFormFormInput, -} from './types'; +import { type AuthTypes, type FeedSubmissionFormFormInput } from './types'; export interface FeedSubmissionFormInputSecondStepRT { tripUpdates: string; diff --git a/src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx index a1faa62..e5eb485 100644 --- a/src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/ThirdStep.tsx @@ -17,10 +17,7 @@ import { import { useTranslations } from 'next-intl'; import { isValidFeedLink } from '../../../../services/feeds/utils'; import FormLabelDescription from './components/FormLabelDescription'; -import { - type AuthTypes, - type FeedSubmissionFormFormInput, -} from './types'; +import { type AuthTypes, type FeedSubmissionFormFormInput } from './types'; export interface FeedSubmissionFormInputThirdStep { authType: AuthTypes; diff --git a/src/app/[locale]/contribute/FeedSubmission/Form/index.tsx b/src/app/[locale]/contribute/FeedSubmission/Form/index.tsx index 07b6b34..6993a4a 100644 --- a/src/app/[locale]/contribute/FeedSubmission/Form/index.tsx +++ b/src/app/[locale]/contribute/FeedSubmission/Form/index.tsx @@ -15,10 +15,7 @@ import { useRouter, useSearchParams, usePathname } from 'next/navigation'; import FormThirdStep from './ThirdStep'; import { submitNewFeedForm } from '../../../../services/feeds/add-feed-form-service'; import { useTranslations } from 'next-intl'; -import { - type FeedSubmissionFormFormInput, - type YesNoFormInput, -} from './types'; +import { type FeedSubmissionFormFormInput, type YesNoFormInput } from './types'; const defaultFormValues: FeedSubmissionFormFormInput = { isOfficialProducer: '', diff --git a/src/app/[locale]/contribute/FeedSubmission/Form/types.ts b/src/app/[locale]/contribute/FeedSubmission/Form/types.ts index 2da045d..beb8f80 100644 --- a/src/app/[locale]/contribute/FeedSubmission/Form/types.ts +++ b/src/app/[locale]/contribute/FeedSubmission/Form/types.ts @@ -1 +1 @@ -export * from '../../../../utils/feed-submission-types'; \ No newline at end of file +export * from '../../../../utils/feed-submission-types'; diff --git a/src/app/[locale]/contribute/page.tsx b/src/app/[locale]/contribute/page.tsx index 57e32dc..5a872e7 100644 --- a/src/app/[locale]/contribute/page.tsx +++ b/src/app/[locale]/contribute/page.tsx @@ -8,4 +8,4 @@ export default function ContributePage(): ReactElement { ); -} \ No newline at end of file +} diff --git a/src/app/[locale]/contribute/submitted/page.tsx b/src/app/[locale]/contribute/submitted/page.tsx index ad4c16a..9dc3231 100644 --- a/src/app/[locale]/contribute/submitted/page.tsx +++ b/src/app/[locale]/contribute/submitted/page.tsx @@ -2,7 +2,5 @@ import { type ReactElement } from 'react'; import FeedSubmitted from '../../../screens/FeedSubmitted'; export default function ContributeSubmittedPage(): ReactElement { - return ( - - ); -} \ No newline at end of file + return ; +} diff --git a/src/app/[locale]/forgot-password/page.tsx b/src/app/[locale]/forgot-password/page.tsx index a5092e6..67ab605 100644 --- a/src/app/[locale]/forgot-password/page.tsx +++ b/src/app/[locale]/forgot-password/page.tsx @@ -8,4 +8,4 @@ export default function ForgotPasswordPage(): ReactElement { ); -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/gbfs/feeds/page.tsx b/src/app/[locale]/metrics/gbfs/feeds/page.tsx index 27e1762..b96a336 100644 --- a/src/app/[locale]/metrics/gbfs/feeds/page.tsx +++ b/src/app/[locale]/metrics/gbfs/feeds/page.tsx @@ -3,4 +3,4 @@ import GBFSFeedAnalytics from '../../_components/Analytics/GBFSFeedAnalytics/GBF export default function GBFSFeedsMetricsPage(): ReactElement { return ; -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/gbfs/notices/page.tsx b/src/app/[locale]/metrics/gbfs/notices/page.tsx index e40ea48..16d28f3 100644 --- a/src/app/[locale]/metrics/gbfs/notices/page.tsx +++ b/src/app/[locale]/metrics/gbfs/notices/page.tsx @@ -3,4 +3,4 @@ import GBFSNoticeAnalytics from '../../_components/Analytics/GBFSNoticeAnalytics export default function GBFSNoticesMetricsPage(): ReactElement { return ; -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/gbfs/versions/page.tsx b/src/app/[locale]/metrics/gbfs/versions/page.tsx index 04437dd..eb1556a 100644 --- a/src/app/[locale]/metrics/gbfs/versions/page.tsx +++ b/src/app/[locale]/metrics/gbfs/versions/page.tsx @@ -3,4 +3,4 @@ import GBFSVersionAnalytics from '../../_components/Analytics/GBFSVersionAnalyti export default function GBFSVersionsMetricsPage(): ReactElement { return ; -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/gtfs/features/page.tsx b/src/app/[locale]/metrics/gtfs/features/page.tsx index 746c370..dd02c5b 100644 --- a/src/app/[locale]/metrics/gtfs/features/page.tsx +++ b/src/app/[locale]/metrics/gtfs/features/page.tsx @@ -3,4 +3,4 @@ import GTFSFeatureAnalytics from '../../_components/Analytics/GTFSFeatureAnalyti export default function GTFSFeaturesMetricsPage(): ReactElement { return ; -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/gtfs/feeds/page.tsx b/src/app/[locale]/metrics/gtfs/feeds/page.tsx index 5fbac6d..cc9dcc9 100644 --- a/src/app/[locale]/metrics/gtfs/feeds/page.tsx +++ b/src/app/[locale]/metrics/gtfs/feeds/page.tsx @@ -3,4 +3,4 @@ import GTFSFeedAnalytics from '../../_components/Analytics/GTFSFeedAnalytics/GTF export default function GTFSFeedsMetricsPage(): ReactElement { return ; -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/gtfs/notices/page.tsx b/src/app/[locale]/metrics/gtfs/notices/page.tsx index c1fba05..a9e8aa8 100644 --- a/src/app/[locale]/metrics/gtfs/notices/page.tsx +++ b/src/app/[locale]/metrics/gtfs/notices/page.tsx @@ -3,4 +3,4 @@ import GTFSNoticeAnalytics from '../../_components/Analytics/GTFSNoticeAnalytics export default function GTFSNoticesMetricsPage(): ReactElement { return ; -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/gtfs/page.tsx b/src/app/[locale]/metrics/gtfs/page.tsx index 1a0f7a6..3a3b5a9 100644 --- a/src/app/[locale]/metrics/gtfs/page.tsx +++ b/src/app/[locale]/metrics/gtfs/page.tsx @@ -3,4 +3,4 @@ import GTFSFeedAnalytics from '../_components/Analytics/GTFSFeedAnalytics/GTFSFe export default function GTFSMetricsPage(): ReactElement { return ; -} \ No newline at end of file +} diff --git a/src/app/[locale]/metrics/layout.tsx b/src/app/[locale]/metrics/layout.tsx index 0e239dd..16e7251 100644 --- a/src/app/[locale]/metrics/layout.tsx +++ b/src/app/[locale]/metrics/layout.tsx @@ -7,4 +7,4 @@ export default function MetricsLayout({ children: React.ReactNode; }): ReactElement { return {children}; -} \ No newline at end of file +} diff --git a/src/app/router/Router.tsx b/src/app/router/Router.tsx index 0c83293..1a12816 100644 --- a/src/app/router/Router.tsx +++ b/src/app/router/Router.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; export const AppRouter: React.FC = () => null; diff --git a/src/app/screens/FeedSubmitted.tsx b/src/app/screens/FeedSubmitted.tsx index d1fa087..6cfa742 100644 --- a/src/app/screens/FeedSubmitted.tsx +++ b/src/app/screens/FeedSubmitted.tsx @@ -1,12 +1,6 @@ 'use client'; -import { - Typography, - Box, - Container, - useTheme, - Button, -} from '@mui/material'; +import { Typography, Box, Container, useTheme, Button } from '@mui/material'; export default function FeedSubmitted(): React.ReactElement { const theme = useTheme(); diff --git a/src/app/utils/analytics-types.ts b/src/app/utils/analytics-types.ts index 0b6391e..4ad4cb6 100644 --- a/src/app/utils/analytics-types.ts +++ b/src/app/utils/analytics-types.ts @@ -90,4 +90,4 @@ export interface GBFSVersionMetrics { version: string; computed_on: Date[]; feeds_count: number[]; -} \ No newline at end of file +} diff --git a/src/app/utils/feed-submission-types.ts b/src/app/utils/feed-submission-types.ts index 1f16b7d..e172a34 100644 --- a/src/app/utils/feed-submission-types.ts +++ b/src/app/utils/feed-submission-types.ts @@ -37,4 +37,4 @@ export interface FeedSubmissionFormFormInput { unofficialDesc?: string; updateFreq?: string; emptyLicenseUsage?: string; -} \ No newline at end of file +} From 84299af721705973ccfd89259cf9545b0cee06e1 Mon Sep 17 00:00:00 2001 From: Alessandro Kreslin Date: Tue, 21 Apr 2026 08:31:21 -0400 Subject: [PATCH 6/6] better separation of metric utils --- .../Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx | 2 +- .../Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx | 7 ++----- src/app/store/saga/gbfs-analytics-saga.ts | 2 +- src/app/store/saga/gtfs-analytics-saga.ts | 2 +- .../Analytics/utils.ts => utils/metricsUtils.ts} | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) rename src/app/{[locale]/metrics/_components/Analytics/utils.ts => utils/metricsUtils.ts} (84%) diff --git a/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx b/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx index 9db562c..2f0d6ca 100644 --- a/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GBFSFeedAnalytics/GBFSFeedAnalytics.tsx @@ -42,7 +42,7 @@ import { type RootState } from '../../../../../store/store'; import { type AnalyticsFile, type GBFSFeedMetrics } from '../types'; import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; import DetailPanel from './DetailPanel'; -import { setAnalyticsBucketEndpoint } from '../utils'; +import { setAnalyticsBucketEndpoint } from '../../../../../utils/metricsUtils'; export default function GBFSFeedAnalytics(): React.ReactElement { const searchParams = useSearchParams(); diff --git a/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx index ae777dd..f4d0c2f 100644 --- a/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx +++ b/src/app/[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics.tsx @@ -38,10 +38,7 @@ import { type AnalyticsFile, type GTFSFeedMetrics } from '../types'; import { useRemoteConfig } from '../../../../../context/RemoteConfigProvider'; import DownloadIcon from '@mui/icons-material/Download'; import { download, generateCsv, mkConfig } from 'export-to-csv'; - -let globalAnalyticsBucketEndpoint: string | undefined; -export const getAnalyticsBucketEndpoint = (): string | undefined => - globalAnalyticsBucketEndpoint; +import { setAnalyticsBucketEndpoint } from '../../../../../utils/metricsUtils'; export default function GTFSFeedAnalytics(): React.ReactElement { const searchParams = useSearchParams(); @@ -81,7 +78,7 @@ export default function GTFSFeedAnalytics(): React.ReactElement { }; React.useEffect(() => { - globalAnalyticsBucketEndpoint = config.gtfsMetricsBucketEndpoint; + setAnalyticsBucketEndpoint(config.gtfsMetricsBucketEndpoint); dispatch(fetchAvailableFilesStart()); }, [dispatch, config.gtfsMetricsBucketEndpoint]); diff --git a/src/app/store/saga/gbfs-analytics-saga.ts b/src/app/store/saga/gbfs-analytics-saga.ts index 5d43c21..d64567c 100644 --- a/src/app/store/saga/gbfs-analytics-saga.ts +++ b/src/app/store/saga/gbfs-analytics-saga.ts @@ -13,7 +13,7 @@ import { type GBFSMetrics, } from '../../utils/analytics-types'; import { getLocationName } from '../../services/feeds/utils'; -import { getAnalyticsBucketEndpoint } from '../../[locale]/metrics/_components/Analytics/utils'; +import { getAnalyticsBucketEndpoint } from '../../utils/metricsUtils'; function* fetchFeedMetricsSaga( action: ReturnType, diff --git a/src/app/store/saga/gtfs-analytics-saga.ts b/src/app/store/saga/gtfs-analytics-saga.ts index 8ef2d4a..f1e1d7f 100644 --- a/src/app/store/saga/gtfs-analytics-saga.ts +++ b/src/app/store/saga/gtfs-analytics-saga.ts @@ -13,7 +13,7 @@ import { type GTFSMetrics, } from '../../utils/analytics-types'; import { getLocationName } from '../../services/feeds/utils'; -import { getAnalyticsBucketEndpoint } from '../../[locale]/metrics/_components/Analytics/GTFSFeedAnalytics/GTFSFeedAnalytics'; +import { getAnalyticsBucketEndpoint } from '../../utils/metricsUtils'; function* fetchFeedMetricsSaga( action: ReturnType, diff --git a/src/app/[locale]/metrics/_components/Analytics/utils.ts b/src/app/utils/metricsUtils.ts similarity index 84% rename from src/app/[locale]/metrics/_components/Analytics/utils.ts rename to src/app/utils/metricsUtils.ts index 58a8888..2f374ab 100644 --- a/src/app/[locale]/metrics/_components/Analytics/utils.ts +++ b/src/app/utils/metricsUtils.ts @@ -1,5 +1,5 @@ /** - * Global analytics bucket endpoint storage and access + * Global analytics bucket endpoint storage and access. */ let globalAnalyticsBucketEndpoint: string | undefined;