From 2eeb29ec8787ca6d8b425d7333f832d1b6ea6ce3 Mon Sep 17 00:00:00 2001 From: danielhep Date: Fri, 14 Aug 2026 12:33:00 -0700 Subject: [PATCH 1/2] add new icons for fares v2 editor --- lib/editor/components/EntityDetailsHeader.js | 8 +++---- lib/editor/util/ui.js | 23 +++++++++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/lib/editor/components/EntityDetailsHeader.js b/lib/editor/components/EntityDetailsHeader.js index 0ad9aa39e..6b6d9bfa3 100644 --- a/lib/editor/components/EntityDetailsHeader.js +++ b/lib/editor/components/EntityDetailsHeader.js @@ -9,7 +9,7 @@ import * as activeActions from '../actions/active' import * as mapActions from '../actions/map' import {getEntityBounds, getEntityName} from '../util/gtfs' import {entityIsNew} from '../util/objects' -import {GTFS_ICONS} from '../util/ui' +import {getGtfsIconName} from '../util/ui' import type {Entity, Feed, GtfsRoute, GtfsStop, Pattern} from '../../types' import type {MapState} from '../../types/reducers' import type {EditorValidationIssue} from '../util/validation' @@ -129,11 +129,10 @@ export default class EntityDetailsHeader extends Component { const entityName = activeComponent === 'feedinfo' ? this.messages('feedInfo') : getEntityName(activeEntity) - const icon = GTFS_ICONS.find(i => i.id === activeComponent) const zoomDisabled = activeEntity && !subComponent ? mapState.target === activeEntity.id : mapState.target === subEntity - const iconName = icon ? icon.icon : null + const iconName = getGtfsIconName(activeComponent) const nameWidth = activeComponent === 'stop' || activeComponent === 'route' ? '176px' : '210px' @@ -199,8 +198,7 @@ export default class EntityDetailsHeader extends Component { - // schedule exception icon if no icon found - // FARE-TODO: Replace with appropriate FARES v2 icon. Address constant GTFS_ICONS in lib/editor/util.js? + // fallback icon for an unregistered component : diff --git a/lib/editor/util/ui.js b/lib/editor/util/ui.js index a539df801..377b976f5 100644 --- a/lib/editor/util/ui.js +++ b/lib/editor/util/ui.js @@ -77,13 +77,34 @@ export const GTFS_ICONS = [ { id: 'fareproduct', tableName: 'fareproduct', - icon: 'credit-card', + icon: 'ticket', addable: true, title: messages('faresv2.title'), label: messages('faresv2.label') } ] +// Fares v2 tables are selected through the Fares v2 table selector rather +// than individual sidebar entries, so keep their icons separate from the +// navigation metadata above. +export const FARES_V2_ICONS = [ + {id: 'fareproduct', icon: 'ticket'}, + {id: 'faremedia', icon: 'credit-card'}, + {id: 'faretransferrule', icon: 'exchange'}, + {id: 'farelegrule', icon: 'road'}, + {id: 'farelegjoinrule', icon: 'link'}, + {id: 'ridercategory', icon: 'users'}, + {id: 'area', icon: 'map'}, + {id: 'network', icon: 'sitemap'}, + {id: 'timeframe', icon: 'clock-o'} +] + +export function getGtfsIconName (component: string): ?string { + const icon = FARES_V2_ICONS.find(i => i.id === component) || + GTFS_ICONS.find(i => i.id === component) + return icon ? icon.icon : null +} + /** * Returns the editor status * @param {*} feedSource From 0bf7d21d2a255f06fc3e5f8afc742c87ea4c896a Mon Sep 17 00:00:00 2001 From: danielhep Date: Fri, 25 Sep 2026 16:51:19 -0700 Subject: [PATCH 2/2] keep separate icons for faresv2 panel --- lib/editor/util/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/editor/util/ui.js b/lib/editor/util/ui.js index 377b976f5..47e30f1b1 100644 --- a/lib/editor/util/ui.js +++ b/lib/editor/util/ui.js @@ -77,7 +77,7 @@ export const GTFS_ICONS = [ { id: 'fareproduct', tableName: 'fareproduct', - icon: 'ticket', + icon: 'credit-card', addable: true, title: messages('faresv2.title'), label: messages('faresv2.label')