Skip to content

Commit

Permalink
Merge branch 'main' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Oct 21, 2023
2 parents 704ed32 + 4393e75 commit ebf04fb
Show file tree
Hide file tree
Showing 7 changed files with 1,742 additions and 1,404 deletions.
426 changes: 213 additions & 213 deletions .yarn/releases/yarn-3.6.1.cjs → .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-3.6.4.cjs
35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,41 @@
},
"dependencies": {
"@material-ui/styles": "^4.11.5",
"@sentry/gatsby": "^7.64.0",
"@sentry/tracing": "^7.64.0",
"@sentry/gatsby": "^7.74.1",
"@sentry/tracing": "^7.74.1",
"babel-plugin-transform-remove-console": "^6.9.4",
"clsx": "^2.0.0",
"crunker": "^2.1.0",
"dayjs": "^1.11.9",
"gatsby": "^5.11.0",
"gatsby-plugin-image": "^3.11.0",
"gatsby-plugin-less": "^7.11.0",
"gatsby-plugin-manifest": "^5.11.0",
"dayjs": "^1.11.10",
"gatsby": "^5.12.8",
"gatsby-plugin-image": "^3.12.2",
"gatsby-plugin-less": "^7.12.0",
"gatsby-plugin-manifest": "^5.12.2",
"gatsby-plugin-material-ui": "^3.0.1",
"gatsby-plugin-react-head": "https://github.com/davwheat/gatsby-plugin-react-head",
"gatsby-plugin-remove-console": "^0.0.2",
"gatsby-plugin-sharp": "^5.11.0",
"gatsby-source-filesystem": "^5.11.0",
"gatsby-transformer-sharp": "^5.11.0",
"mdi-react": "^9.2.0",
"gatsby-plugin-sharp": "^5.12.2",
"gatsby-source-filesystem": "^5.12.0",
"gatsby-transformer-sharp": "^5.12.2",
"mdi-react": "^9.3.0",
"nanoid": "^4.0.2",
"react": "^18.2.0",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18.2.0",
"react-head": "^3.4.2",
"react-select": "^5.7.4",
"react-select": "^5.7.7",
"react-tabs": "^6.0.2",
"recoil": "^0.7.7",
"recoil-persistence": "^0.3.0-beta.1",
"uk-railway-stations": "^1.5.0"
"uk-railway-stations": "^1.5.1"
},
"devDependencies": {
"@sentry/cli": "^2.20.5",
"@types/react-beautiful-dnd": "^13.1.4",
"@types/react-tabs": "^5.0.5",
"@sentry/cli": "^2.21.2",
"@types/react-beautiful-dnd": "^13.1.6",
"cross-env": "^7.0.3",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.31",
"prettier": "^3.0.1",
"typescript": "^5.1.6"
"prettier": "^3.0.3",
"typescript": "^5.2.2"
},
"packageManager": "[email protected]"
}
44 changes: 44 additions & 0 deletions src/announcement-data/systems/rolling-stock/TfWTrainFx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { getStationByCrs } from '@data/StationManipulators'
import { AudioItem, CustomAnnouncementTab } from '../../AnnouncementSystem'
import TrainAnnouncementSystem from '../../TrainAnnouncementSystem'
import crsToStationItemMapper from '@helpers/crsToStationItemMapper'
import CallingAtSelector from '@components/CallingAtSelector'

interface IStartOfJourneyAnnouncementOptions {
callingAtCodes: { crsCode: string; name: string; randomId: string }[]
}

interface IStoppedAtStationAnnouncementOptions {
thisStationCode: string
Expand All @@ -28,6 +33,27 @@ export default class TfWTrainFx extends TrainAnnouncementSystem {
readonly FILE_PREFIX = 'TfW/TrainFX'
readonly SYSTEM_TYPE = 'train'

private async playStartOfJourneyAnnouncement(options: IStartOfJourneyAnnouncementOptions, download: boolean = false): Promise<void> {
const { callingAtCodes } = options

const files: AudioItem[] = []

files.push('conjoiners.welcome aboard', {
id: 'conjoiners.we will be calling at the following principal stations',
opts: { delayStart: 750 },
})

files.push(
...this.pluraliseAudio(
callingAtCodes.map(stn => stn.crsCode),
0,
{ andId: 'conjoiners.and', prefix: 'stations.high.', finalPrefix: 'stations.low.' },
),
)

await this.playAudioFiles(files, download)
}

private async playStoppedAtStationAnnouncement(options: IStoppedAtStationAnnouncementOptions, download: boolean = false): Promise<void> {
const { thisStationCode, terminatesAtCode } = options

Expand Down Expand Up @@ -467,6 +493,24 @@ export default class TfWTrainFx extends TrainAnnouncementSystem {
})

readonly customAnnouncementTabs: Record<string, CustomAnnouncementTab> = {
startOfJourney: {
name: 'Start of journey',
component: CustomAnnouncementPane,
props: {
playHandler: this.playStartOfJourneyAnnouncement.bind(this),
options: {
callingAtCodes: {
name: '',
type: 'custom',
component: CallingAtSelector,
props: {
availableStations: this.AvailableStationNames.high,
},
default: [],
},
},
},
},
stoppedAtStation: {
name: 'At station',
component: CustomAnnouncementPane,
Expand Down
1 change: 1 addition & 0 deletions src/components/CallingAtSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function CallingAtSelector({ onChange, value, availableStations, additionalOptio
onClick={() => {
onChange(value.filter(s => s.randomId !== stop.randomId))
}}
style={{ marginLeft: 'auto' }}
>
<svg viewBox="0 0 24 24">
<path
Expand Down
4 changes: 4 additions & 0 deletions src/data/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ const changelog: IChangelogVersion[] = [
'[TfL Northern Line] Fix next station Goodge Street not working',
],
},
{
date: '2023-10-20',
fixes: ['[TfW - TrainFX] Add start of journey announcement'],
},
]

export default changelog
Loading

0 comments on commit ebf04fb

Please sign in to comment.