Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/app/[locale]/feeds/components/FeedsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ import {
buildSearchUrl,
} from '../lib/useFeedsSearch';
import { toFeatureAnchor } from '../../../utils/featureAnchor';
import { useRemoteConfig } from '../../../context/RemoteConfigProvider';

export default function FeedsScreen(): React.ReactElement {
const theme = useTheme();
const t = useTranslations('feeds');
const tCommon = useTranslations('common');
const { config } = useRemoteConfig();
const searchParams = useSearchParams();
const router = useRouter();
const pathname = usePathname();
Expand Down Expand Up @@ -570,7 +572,8 @@ export default function FeedsScreen(): React.ReactElement {
>
{getSearchResultNumbers()}
</Typography>
{selectedFeatures.length > 0 &&
{config.gtfsFeatureTracker &&
selectedFeatures.length > 0 &&
areFeatureFiltersEnabled && (
<Button
component={NextLink}
Expand Down
8 changes: 5 additions & 3 deletions src/app/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ const Footer: React.FC = () => {
<OpenInNew sx={{ fontSize: '1rem', verticalAlign: 'middle' }} />
</FooterLink>
)}
<FooterLink href='/gtfs-feature-tracker'>
{t('links.gtfsFeatureTracker')}
</FooterLink>
{config.gtfsFeatureTracker && (
<FooterLink href='/gtfs-feature-tracker'>
{t('links.gtfsFeatureTracker')}
</FooterLink>
)}
</Box>

{/* Company column */}
Expand Down
48 changes: 26 additions & 22 deletions src/app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,28 +394,32 @@ export default function DrawerAppBar(): React.ReactElement {
)}
</MenuList>
</Box>
<Divider
orientation='vertical'
flexItem
sx={{ my: 2, opacity: 0.5 }}
/>
{/* Analytics column */}
<Box sx={{ minWidth: 220 }}>
<Typography
variant='overline'
sx={headerDropdownMenuHeader}
>
{tCommon('analytics')}
</Typography>
<MenuList dense>
<HeaderMenuItem
component='a'
href='/gtfs-feature-tracker'
>
{tCommon('gtfsFeatureTracker')}
</HeaderMenuItem>
</MenuList>
</Box>
{config.gtfsFeatureTracker && (
<>
<Divider
orientation='vertical'
flexItem
sx={{ my: 2, opacity: 0.5 }}
/>
{/* Analytics column */}
<Box sx={{ minWidth: 220 }}>
<Typography
variant='overline'
sx={headerDropdownMenuHeader}
>
{tCommon('analytics')}
</Typography>
<MenuList dense>
<HeaderMenuItem
component='a'
href='/gtfs-feature-tracker'
>
{tCommon('gtfsFeatureTracker')}
</HeaderMenuItem>
</MenuList>
</Box>
</>
)}
{/* Metrics column — admin only */}
{metricsOptionsEnabled ? (
<>
Expand Down
54 changes: 29 additions & 25 deletions src/app/components/HeaderMobileDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,31 +231,35 @@ export default function DrawerContent({
</Button>
)}

{/* Analytics sub-section */}
<Typography
variant='caption'
fontWeight={700}
sx={{
px: 2,
pt: 1.5,
pb: 0.5,
display: 'block',
textTransform: 'uppercase',
letterSpacing: 0.5,
color: 'text.secondary',
}}
>
{t('analytics')}
</Typography>
<Button
variant='text'
sx={mobileNavElementStyle}
component={LocaleLink}
href='/gtfs-feature-tracker'
onClick={onClose}
>
{t('gtfsFeatureTracker')}
</Button>
{config.gtfsFeatureTracker && (
<>
{/* Analytics sub-section */}
<Typography
variant='caption'
fontWeight={700}
sx={{
px: 2,
pt: 1.5,
pb: 0.5,
display: 'block',
textTransform: 'uppercase',
letterSpacing: 0.5,
color: 'text.secondary',
}}
>
{t('analytics')}
</Typography>
<Button
variant='text'
sx={mobileNavElementStyle}
component={LocaleLink}
href='/gtfs-feature-tracker'
onClick={onClose}
>
{t('gtfsFeatureTracker')}
</Button>
</>
)}
</AccordionDetails>
</Accordion>
{metricsOptionsEnabled && (
Expand Down
2 changes: 2 additions & 0 deletions src/app/interface/RemoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface RemoteConfigValues {
// 2- use bounding box view for GBFS instead of full covered area map
enableDetailedCoveredArea: boolean;
gbfsValidator: boolean;
gtfsFeatureTracker: boolean;
}

const gbfsVersionsDefault: GbfsVersionConfig = [];
Expand All @@ -46,6 +47,7 @@ export const defaultRemoteConfigValues: RemoteConfigValues = {
visualizationMapPreviewDataLimit: 3,
enableDetailedCoveredArea: false,
gbfsValidator: false,
gtfsFeatureTracker: false,
};

/**
Expand Down
Loading