Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@
"officialFeed": "Official Feed",
"officialFeedTooltip": "The transit provider has confirmed this feed should be shared with riders. This has been confirmed either by the transit provider providing the feed on their website or from personalized confirmation with the Mobility Database team.",
"officialFeedTooltipShort": "Verified feed: Confirmed by the transit provider or the Mobility Database team for rider use.",
"communityFeed": "Community Feed",
"communityFeedTooltip": "This feed is not created on behalf on the transit authority. It may have been created by a community member or third party.",
Comment thread
Copilot marked this conversation as resolved.
Outdated
"communityFeedTooltipShort": "Community feed: Not officially confirmed by the transit provider.",
"seeDetailPageProviders": "See detail page to view {providersCount} others",
"openFullQualityReport": "Open Full Quality Report",
"subscribe": "Subscribe to get feed update notifications",
Expand Down
3 changes: 3 additions & 0 deletions messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@
"officialFeed": "Official Feed",
"officialFeedTooltip": "The transit provider has confirmed this feed should be shared with riders. This has been confirmed either by the transit provider providing the feed on their website or from personalized confirmation with the Mobility Database team.",
"officialFeedTooltipShort": "Verified feed: Confirmed by the transit provider or the Mobility Database team for rider use.",
"communityFeed": "Community Feed",
"communityFeedTooltip": "This feed has not been officially confirmed by the transit provider. It may have been created by the community or a third party.",
"communityFeedTooltipShort": "Community feed: Not officially confirmed by the transit provider.",
"seeDetailPageProviders": "See detail page to view {providersCount} others",
"openFullQualityReport": "Open Full Quality Report",
"subscribe": "S'abonner",
Expand Down
76 changes: 76 additions & 0 deletions src/app/components/FeedVerificationChip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { Chip, Tooltip } from '@mui/material';
Comment thread
Alessandro100 marked this conversation as resolved.
import { useTranslations } from 'next-intl';
import VerifiedIcon from '@mui/icons-material/Verified';
import GroupsIcon from '@mui/icons-material/Groups';

interface FeedVerificationChipProps {
isLongDisplay?: boolean;
status?: boolean;
}

const officialBadgeStyle = {
background: 'linear-gradient(25deg, var(--mui-palette-primary-light), var(--mui-palette-primary-dark))',

Check failure on line 12 in src/app/components/FeedVerificationChip.tsx

View workflow job for this annotation

GitHub Actions / lint_and_test

Insert `⏎···`
color: 'white',
};

export default function FeedVerificationChip({
isLongDisplay = true,
status,
}: FeedVerificationChipProps): React.ReactElement | null {
const t = useTranslations('feeds');

if (status == undefined) {
return null;
}
Comment thread
Alessandro100 marked this conversation as resolved.

if (status === false) {

Check failure on line 26 in src/app/components/FeedVerificationChip.tsx

View workflow job for this annotation

GitHub Actions / lint_and_test

This expression unnecessarily compares a boolean value to a boolean instead of using it directly
return isLongDisplay ? (
<Tooltip title={t('communityFeedTooltip')} placement='top'>
<Chip
sx={{ opacity: 0.8 }}
icon={<GroupsIcon></GroupsIcon>}
label={t('communityFeed')}
variant='filled'
></Chip>
</Tooltip>
) : (
<Tooltip title={t('communityFeedTooltipShort')} placement='top'>
<GroupsIcon
sx={{
display: 'block',
ml: 0,
mr: 2,
opacity: 0.6,
backgroundColor: 'var(--mui-palette-grey-400)',
color: 'var(--mui-palette-text-primary)',
borderRadius: '50%',
padding: '0.2rem',
}}
></GroupsIcon>
</Tooltip>
);
}

return isLongDisplay ? (
<Tooltip title={t('officialFeedTooltip')} placement='top'>
<Chip
sx={officialBadgeStyle}
icon={<VerifiedIcon sx={{ fill: 'white' }}></VerifiedIcon>}
label={t('officialFeed')}
></Chip>
</Tooltip>
) : (
<Tooltip title={t('officialFeedTooltipShort')} placement='top'>
<VerifiedIcon
sx={{
display: 'block',
borderRadius: '50%',
padding: '0.1rem',
ml: 0,
mr: 2,
...officialBadgeStyle,
}}
></VerifiedIcon>
</Tooltip>
);
}
43 changes: 0 additions & 43 deletions src/app/components/OfficialChip.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions src/app/screens/Feed/FeedView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// Components
import FeedTitle from './components/FeedTitle';
import OfficialChip from '../../components/OfficialChip';
import FeedVerificationChip from '../../components/FeedVerificationChip';
import DataQualitySummary from './components/DataQualitySummary';
import FeedSummary from './components/FeedSummary';
import FeedNavigationControls from './components/FeedNavigationControls';
Expand Down Expand Up @@ -194,14 +194,14 @@
{feed?.data_type === 'gtfs' && (
<DataQualitySummary
feedStatus={feed?.status}
isOfficialFeed={feed.official === true}
isOfficialFeed={feed.official}
latestDataset={latestDataset}
/>
)}

{feed?.data_type === 'gtfs_rt' && feed.official === true && (
<Box sx={{ my: 1 }}>
<OfficialChip></OfficialChip>
<FeedVerificationChip status={feed.official}></FeedVerificationChip>

Check failure on line 204 in src/app/screens/Feed/FeedView.tsx

View workflow job for this annotation

GitHub Actions / lint_and_test

Replace `·status={feed.official}` with `⏎··················status={feed.official}⏎················`
</Box>
)}
Comment thread
Alessandro100 marked this conversation as resolved.
Outdated

Expand Down
6 changes: 3 additions & 3 deletions src/app/screens/Feed/components/DataQualitySummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { type components } from '../../../services/feeds/types';
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
import { WarningContentBox } from '../../../components/WarningContentBox';
import { FeedStatusChip } from '../../../components/FeedStatus';
import OfficialChip from '../../../components/OfficialChip';
import FeedVerificationChip from '../../../components/FeedVerificationChip';
import { getTranslations } from 'next-intl/server';
import { getUserRemoteConfigValues } from '../../../../lib/remote-config.server';

export interface DataQualitySummaryProps {
feedStatus: components['schemas']['Feed']['status'];
isOfficialFeed: boolean;
isOfficialFeed: boolean | undefined;
latestDataset: components['schemas']['GtfsDataset'] | undefined;
}

Expand All @@ -36,7 +36,7 @@ export default async function DataQualitySummary({
{config.enableFeedStatusBadge && (
<FeedStatusChip status={feedStatus ?? ''}></FeedStatusChip>
)}
{isOfficialFeed && <OfficialChip></OfficialChip>}
<FeedVerificationChip status={isOfficialFeed}></FeedVerificationChip>
{latestDataset?.validation_report !== undefined &&
latestDataset.validation_report !== null && (
<>
Expand Down
6 changes: 2 additions & 4 deletions src/app/screens/Feeds/AdvancedSearchTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
import GtfsRtEntities from './GtfsRtEntities';
import { getEmojiFlag, type TCountryCode } from 'countries-list';
import OfficialChip from '../../components/OfficialChip';
import FeedVerificationChip from '../../components/FeedVerificationChip';
import { getFeatureComponentDecorators } from '../../utils/consts';
import PopoverList from './PopoverList';
import ProviderTitle from './ProviderTitle';
Expand Down Expand Up @@ -337,9 +337,7 @@
></ProviderTitle>
</Typography>

{feed.official === true && (
<OfficialChip isLongDisplay={false}></OfficialChip>
)}
<FeedVerificationChip isLongDisplay={false} status={feed.official}></FeedVerificationChip>

Check failure on line 340 in src/app/screens/Feeds/AdvancedSearchTable.tsx

View workflow job for this annotation

GitHub Actions / lint_and_test

Replace `·isLongDisplay={false}·status={feed.official}` with `⏎····················isLongDisplay={false}⏎····················status={feed.official}⏎··················`
{feed.data_type !== 'gbfs' && (
<FeedStatusIndicator
status={feed.status}
Expand Down
6 changes: 2 additions & 4 deletions src/app/screens/Feeds/SearchTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import NextLinkComposed from 'next/link';
import { useRouter } from '../../../i18n/navigation';
import { getEmojiFlag, type TCountryCode } from 'countries-list';
import OfficialChip from '../../components/OfficialChip';
import FeedVerificationChip from '../../components/FeedVerificationChip';
import ProviderTitle from './ProviderTitle';

export interface SearchTableProps {
Expand Down Expand Up @@ -216,9 +216,7 @@
setAnchorEl(el);
}}
></ProviderTitle>
{feed.official === true && (
<OfficialChip isLongDisplay={false}></OfficialChip>
)}
<FeedVerificationChip isLongDisplay={false} status={feed.official}></FeedVerificationChip>

Check failure on line 219 in src/app/screens/Feeds/SearchTable.tsx

View workflow job for this annotation

GitHub Actions / lint_and_test

Replace `·isLongDisplay={false}·status={feed.official}` with `⏎····················isLongDisplay={false}⏎····················status={feed.official}⏎··················`
</Box>
</TableCell>
<TableCell className='feed-column' component={Box}>
Expand Down
9 changes: 0 additions & 9 deletions src/app/styles/VerificationBadge.styles.ts

This file was deleted.

Loading