Skip to content

Commit e38e7b1

Browse files
feat: 1346 license details UI (#1519)
* license store setup * License detail UI * GBFS Feed Info UI consolidation * updated info and warning colors for accessibility color contrast * enhance license display in feed summary and refactor license dialog for improved rule presentation and responsiveness * lint fixes * feat: add i18n keys for feed summary, license details, and validators, and update FeedSummary component to use them. * gbfs wording * refactor: Refine license saga types, improve internal link rendering, and standardize null/undefined checks in FeedSummary. * update license styling
1 parent 6f4095f commit e38e7b1

File tree

18 files changed

+878
-368
lines changed

18 files changed

+878
-368
lines changed
Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
{
2-
"copyToClipboard": "Copy to clipboard",
3-
"copied": "Copied!",
4-
"name": "Name",
5-
"email": "Email",
6-
"organization": "Organization",
7-
"signOut": "Sign out",
8-
"unknown": "Unknown",
9-
"search": "Search",
10-
"feeds": "Feeds",
11-
"gtfsSchedule": "GTFS Schedule",
12-
"gtfsRealtime": "GTFS Realtime",
13-
"gtfs": "GTFS Schedule",
14-
"gtfs_rt": "GTFS Realtime",
15-
"gbfs": "GBFS",
16-
"gtfsRealtimeEntities": {
17-
"tripUpdates": "Trip Updates",
18-
"vehiclePositions": "Vehicle Positions",
19-
"serviceAlerts": "Service Alerts"
20-
},
21-
"loading": "Loading...",
22-
"download": "Download",
23-
"updated": "Updated",
24-
"errors": {
25-
"generic": "We are unable to complete your request at the moment."
26-
},
27-
"others": "others",
28-
"apiKey": "API Key",
29-
"httpHeader": "HTTP Header",
30-
"back": "Back",
31-
"and": "and",
32-
"next": "Next",
33-
"form": {
34-
"yes": "Yes",
35-
"no": "No",
36-
"required": "This field is required",
37-
"submit": "Submit",
38-
"select": "Select",
39-
"notSure": "Not sure"
40-
},
41-
"country": "Country",
42-
"chooseCountry": "Choose a country",
43-
"region": "Region",
44-
"municipality": "Municipality",
45-
"feedback": {
46-
"errors": "errors",
47-
"noErrors": "No errors",
48-
"noWarnings": "No warnings",
49-
"warnings": "warnings",
50-
"infoNotices": "info notices"
51-
},
2+
"copyToClipboard": "Copy to clipboard",
3+
"copied": "Copied!",
4+
"name": "Name",
5+
"email": "Email",
6+
"organization": "Organization",
7+
"signOut": "Sign out",
8+
"unknown": "Unknown",
9+
"search": "Search",
10+
"feeds": "Feeds",
11+
"gtfsSchedule": "GTFS Schedule",
12+
"gtfsRealtime": "GTFS Realtime",
13+
"gtfs": "GTFS Schedule",
14+
"gtfs_rt": "GTFS Realtime",
15+
"gbfs": "GBFS",
16+
"gtfsRealtimeEntities": {
17+
"tripUpdates": "Trip Updates",
18+
"vehiclePositions": "Vehicle Positions",
19+
"serviceAlerts": "Service Alerts"
20+
},
21+
"loading": "Loading...",
22+
"download": "Download",
23+
"updated": "Updated",
24+
"errors": {
25+
"generic": "We are unable to complete your request at the moment."
26+
},
27+
"others": "others",
28+
"apiKey": "API Key",
29+
"httpHeader": "HTTP Header",
30+
"back": "Back",
31+
"and": "and",
32+
"next": "Next",
33+
"form": {
34+
"yes": "Yes",
35+
"no": "No",
36+
"required": "This field is required",
37+
"submit": "Submit",
38+
"select": "Select",
39+
"notSure": "Not sure"
40+
},
41+
"country": "Country",
42+
"chooseCountry": "Choose a country",
43+
"region": "Region",
44+
"municipality": "Municipality",
45+
"feedback": {
46+
"errors": "errors",
47+
"noErrors": "No errors",
48+
"noWarnings": "No warnings",
49+
"warnings": "warnings",
50+
"infoNotices": "info notices"
51+
},
5252
"gtfsSpec": {
5353
"routeType": {
5454
"0": {
@@ -96,5 +96,11 @@
9696
"validators": "Validators",
9797
"gbfsValidator": "GBFS Validator",
9898
"gtfsValidator": "GTFS Validator",
99-
"gtfsRtValidator": "GTFS RT Validator"
99+
"gtfsRtValidator": "GTFS RT Validator",
100+
"start": "Start",
101+
"end": "End",
102+
"showLess": "Show less",
103+
"showMore": "Show {{count}} more",
104+
"moreInfo": "More Info",
105+
"license": "License"
100106
}

web-app/public/locales/en/feeds.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"seeFullList": "See full list",
5555
"hideFullList": "Hide full list",
5656
"producer": "Producer",
57+
"agency": "Agency",
5758
"producerDownloadUrl": "Producer download URL",
5859
"copyDownloadUrl": "Copy download URL",
5960
"producerUrlCopied": "Producer url copied to clipboard",
@@ -233,5 +234,37 @@
233234
"tfs": "Automatically imported from old TransitFeeds website. Pattern is tfs-<feed_id>",
234235
"tld": "Imported from https://www.transit.land/documentation/rest-api/feeds. Pattern is tld-<feed_id>"
235236
}
237+
},
238+
"license": {
239+
"dialogTitle": "License Details",
240+
"loadingError": "Error loading license details",
241+
"spdxTooltip": "The Software Package Data Exchange (SPDX) is an open standard for communicating software bill of material information, including licenses.",
242+
"licenseTooltip": "License was added by the Mobility Database team based on either 1) a submission authorized by the transit provider 2) review of the transit providers website.",
243+
"permission": "Permission",
244+
"permissionSubtitle": "What you can do with this license",
245+
"condition": "Condition",
246+
"conditionSubtitle": "What you must do to comply",
247+
"limitation": "Limitation",
248+
"limitationSubtitle": "What this license does not provide",
249+
"noPermission": "No permissions",
250+
"noCondition": "No conditions",
251+
"noLimitation": "No limitations",
252+
"noRules": "No usage rules specified.",
253+
"contributeMessage": "To contribute to the clarity of the rules for this license entry, please submit a pull request to:"
254+
},
255+
"noAgencyProvided": "No agency provided",
256+
"feedSummary": {
257+
"viewAllAgencies": "View All {{count}} Agencies",
258+
"andMore": "and more",
259+
"plusMore": "+ {{count}} more",
260+
"showLocationDetails": "Show Details ({{count}} Locations)",
261+
"routes": "Routes",
262+
"routesCount": "{{count}} routes",
263+
"viewOnMap": "View On Map",
264+
"autoDiscoveryUrl": "Auto-Discovery URL",
265+
"producerUrl": "Producer URL",
266+
"providerUrl": "Provider URL",
267+
"systemId": "System ID",
268+
"feedAuthentication": "Feed Authentication"
236269
}
237270
}

web-app/src/app/Theme.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ const palette = {
7171
light: '#D7D4FF',
7272
contrastText: '#FFFFFF',
7373
},
74+
info: {
75+
main: '#01579B',
76+
},
77+
warning: {
78+
main: '#E65100',
79+
},
7480
background: {
7581
default: '#ffffff',
7682
paper: '#F8F5F5',
@@ -98,6 +104,12 @@ const darkPalette = {
98104
dark: '#3846A6',
99105
contrastText: '#FFFFFF',
100106
},
107+
info: {
108+
main: '#4FC3F7',
109+
},
110+
warning: {
111+
main: '#FFB74D',
112+
},
101113
background: {
102114
default: '#121212',
103115
paper: '#1E1E1E',

web-app/src/app/components/CoveredAreaMap.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,7 @@ const CoveredAreaMap: React.FC<CoveredAreaMapProps> = ({
280280
p: 2,
281281
backgroundColor: theme.palette.background.default,
282282
borderRadius: '5px',
283-
border:
284-
feed?.data_type === 'gbfs'
285-
? `2px solid ${theme.palette.primary.dark}`
286-
: 'none', // Temporary until gbfs summary redesign
283+
border: 'none',
287284
}}
288285
>
289286
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}>

web-app/src/app/screens/Feed/FeedSummary.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const FeedLinkElement = styled(Box)(({ theme }) => ({
2222
width: 'calc(100% - 16px)',
2323
marginLeft: '16px',
2424
marginBottom: '16px',
25-
'&:last-child': {
25+
'&:last-of-type': {
2626
marginBottom: 0,
2727
},
2828
}));

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

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ import EmailIcon from '@mui/icons-material/Email';
1717
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
1818

1919
export interface CopyLinkElementProps {
20-
title: string;
20+
title?: string;
2121
url: string;
22-
linkType?: 'download' | 'external' | 'email';
22+
linkType?: 'download' | 'external' | 'email' | 'internal' | 'label';
2323
titleInfo?: string;
24+
internalClickAction?: () => void;
2425
}
2526

2627
export default function CopyLinkElement({
2728
title,
2829
url,
2930
linkType,
3031
titleInfo,
32+
internalClickAction,
3133
}: CopyLinkElementProps): ReactElement {
3234
const [snackbarOpen, setSnackbarOpen] = useState(false);
3335

@@ -51,36 +53,60 @@ export default function CopyLinkElement({
5153

5254
return (
5355
<FeedLinkElement>
54-
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
55-
<Button
56-
variant='text'
57-
sx={{ pl: 0, py: 0.5 }}
58-
component={Link}
59-
href={formattedUrl}
60-
target='_blank'
61-
rel='noreferrer'
62-
>
63-
{title}
64-
</Button>
65-
{titleInfo != undefined && (
66-
<Tooltip title={titleInfo} placement='top'>
67-
<InfoOutlinedIcon fontSize='inherit' />
68-
</Tooltip>
69-
)}
70-
{chipIcon != undefined && chipLabel != undefined && (
71-
<Chip
72-
clickable
73-
component={Link}
74-
href={formattedUrl}
75-
target='_blank'
76-
rel='noreferrer'
77-
size='small'
78-
label={chipLabel}
79-
icon={chipIcon}
80-
sx={{ color: 'text.secondary', fontWeight: 400 }}
81-
></Chip>
82-
)}
83-
</Box>
56+
{title != null && (
57+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
58+
{linkType === 'label' ? (
59+
<Typography
60+
sx={{
61+
fontWeight: 700,
62+
minWidth: 'auto',
63+
color: 'text.primary',
64+
pr: 1.5,
65+
fontSize: 'medium',
66+
}}
67+
>
68+
{title}
69+
</Typography>
70+
) : linkType === 'internal' && internalClickAction != undefined ? (
71+
<Button
72+
variant='text'
73+
sx={{ pl: 0, py: 0.5 }}
74+
onClick={internalClickAction}
75+
>
76+
{title}
77+
</Button>
78+
) : (
79+
<Button
80+
variant='text'
81+
sx={{ pl: 0, py: 0.5 }}
82+
component={Link}
83+
href={formattedUrl}
84+
target='_blank'
85+
rel='noreferrer'
86+
>
87+
{title}
88+
</Button>
89+
)}
90+
{titleInfo != undefined && (
91+
<Tooltip title={titleInfo} placement='top'>
92+
<InfoOutlinedIcon fontSize='inherit' />
93+
</Tooltip>
94+
)}
95+
{chipIcon != undefined && chipLabel != undefined && (
96+
<Chip
97+
clickable
98+
component={Link}
99+
href={formattedUrl}
100+
target='_blank'
101+
rel='noreferrer'
102+
size='small'
103+
label={chipLabel}
104+
icon={chipIcon}
105+
sx={{ color: 'text.secondary', fontWeight: 400 }}
106+
></Chip>
107+
)}
108+
</Box>
109+
)}
84110
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
85111
<Typography
86112
variant='subtitle2'

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

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)