Skip to content

Fares V2 Network UI improvements - #1071

Open
josh-willis-arcadis wants to merge 13 commits into
devfrom
network-ui-improvements
Open

josh-willis-arcadis wants to merge 13 commits into
devfrom
network-ui-improvements

Conversation

@josh-willis-arcadis

@josh-willis-arcadis josh-willis-arcadis commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing
  • The description lists all relevant PRs included in this release (remove this if not merging to master)
  • e2e tests are all passing (remove this if not merging to master)

Description

Adds new dropdown to the editor for routes, fare_leg_rule, fare_leg_join_rules. Also adds validation to enforce the conditionally forbidden networks.txt file.

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but I'm confused as to why we're introducing a new pattern for adding new entries. There's also some opportunities for cleanup!

const [availableOptions, setOptions] = useState(options.map(o => createOption(o)) || [])

return (
<Creatable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool, but why are we doing this instead of following the pattern we already have for creating new entries?

)
case 'NETWORK_SELECTOR':
let availableNetworks = getTableById(tableData, 'network').map(network => ({
label: `${network.network_id}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label: `${network.network_id}`,
label: network.network_id,

Why not this?

value: network.network_id
}))
if (availableNetworks.length === 0) {
const uniqueNetworks = [...new Set(getTableById(tableData, 'route').map(r => r.network_id).filter(Boolean))]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do this on line 582, then you only need to convert to the label/value format once!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants