Skip to content

Commit 6f4095f

Browse files
updated transitfeeds source (#1520)
1 parent 4dc80ba commit 6f4095f

File tree

3 files changed

+36
-21
lines changed

3 files changed

+36
-21
lines changed

web-app/src/app/screens/Feed/components/ExternalIds.tsx

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,40 @@ export default function ExternalIds({
4545
key={idx}
4646
sx={{ display: 'flex', gap: 1, alignItems: 'center' }}
4747
>
48-
<Button
49-
variant='text'
50-
sx={{
51-
fontWeight: 700,
52-
minWidth: 'auto',
53-
color: 'text.primary',
54-
textTransform: 'none',
55-
p: 0,
56-
px: 1.5,
57-
ml: -1.5,
58-
fontSize: 'medium',
59-
}}
60-
component={Link}
61-
href={info.docsUrl}
62-
target='_blank'
63-
rel='noopener noreferrer'
64-
>
65-
{info?.label ?? externalId.source}
66-
</Button>
48+
{info.docsUrl != null ? (
49+
<Button
50+
variant='text'
51+
sx={{
52+
fontWeight: 700,
53+
minWidth: 'auto',
54+
color: 'text.primary',
55+
textTransform: 'none',
56+
p: 0,
57+
px: 1.5,
58+
ml: -1.5,
59+
fontSize: 'medium',
60+
}}
61+
component={Link}
62+
href={info.docsUrl}
63+
target='_blank'
64+
rel='noopener noreferrer'
65+
>
66+
{info?.label ?? externalId.source}
67+
</Button>
68+
) : (
69+
<Typography
70+
sx={{
71+
fontWeight: 700,
72+
minWidth: 'auto',
73+
color: 'text.primary',
74+
pr: 1.5,
75+
fontSize: 'medium',
76+
}}
77+
>
78+
{info?.label ?? externalId.source}
79+
</Typography>
80+
)}
81+
6782
<Typography
6883
variant='body1'
6984
sx={{ wordBreak: 'break-all', lineHeight: 1.2 }}

web-app/src/app/utils/externalIds.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('filterFeedExternalIdsToSourceMap', () => {
5252
it('externalIdSourceMap should contain expected keys', () => {
5353
// ensure the map includes the keys we depend on
5454
expect(Object.keys(externalIdSourceMap)).toEqual(
55-
expect.arrayContaining(['jbda', 'tdg', 'ntd', 'tfs', 'tld']),
55+
expect.arrayContaining(['jbda', 'tdg', 'ntd', 'transitfeeds', 'tld']),
5656
);
5757
});
5858
});

web-app/src/app/utils/externalIds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const externalIdSourceMap: Record<
2323
docsUrl:
2424
'https://www.transit.dot.gov/ntd/data-product/2023-annual-database-general-transit-feed-specification-gtfs-weblinks',
2525
},
26-
tfs: {
26+
transitfeeds: {
2727
label: 'TransitFeeds',
2828
translationKey: 'externalIds.tooltips.tfs',
2929
},

0 commit comments

Comments
 (0)