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 Feb 12, 2024
2 parents 2439a4f + 137aaf2 commit 5880035
Show file tree
Hide file tree
Showing 12 changed files with 2,510 additions and 2,486 deletions.
672 changes: 336 additions & 336 deletions .yarn/releases/yarn-4.0.2.cjs → .yarn/releases/yarn-4.1.0.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
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cf-workers/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs
11 changes: 6 additions & 5 deletions cf-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
"format:check": "prettier --check \"**/*.{js,ts,json,md}\""
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240117.0",
"@cloudflare/workers-types": "^4.20240208.0",
"@types/uuid": "^9.0.8",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"typescript": "^5.3.3",
"wrangler": "^3.24.0"
"wrangler": "^3.28.1"
},
"dependencies": {
"@cfworker/json-schema": "^1.12.7",
"@cfworker/json-schema": "^1.12.8",
"dayjs": "^1.11.10",
"itty-cors": "^0.3.6",
"itty-router": "^4.0.27",
"uuid": "^9.0.1"
}
},
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions cf-workers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
},
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}
433 changes: 219 additions & 214 deletions cf-workers/yarn.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@reach/tabs": "^0.18.0",
"@sentry/gatsby": "^7.98.0",
"@sentry/tracing": "^7.98.0",
"@sentry/gatsby": "^7.100.1",
"@sentry/tracing": "^7.100.1",
"clsx": "^2.1.0",
"copy-to-clipboard": "^3.3.3",
"crunker": "^2.4.0",
Expand Down Expand Up @@ -59,17 +59,17 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@sentry/cli": "^2.26.0",
"@sentry/cli": "^2.28.5",
"@types/gatsbyjs__reach-router": "^2.0.4",
"@types/node": "^20.11.7",
"@types/react": "^18.2.48",
"@types/node": "^20.11.17",
"@types/react": "^18.2.55",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "^18.2.18",
"@types/react-dom": "^18.2.19",
"@types/uuid": "^9.0.8",
"cross-env": "^7.0.3",
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.32",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"typescript": "^5.3.3"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@4.1.0"
}
16 changes: 15 additions & 1 deletion src/components/AmeyLiveTrainAnnouncements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,20 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
enabledAnnouncements,
])

const iframeQueryParams = new URLSearchParams({
type: displayType,
station: selectedCrs,
noBg: '1',
hideSettings: '1',
useLegacyTocNames: useLegacyTocNames ? '1' : '0',
})

Object.entries(systemKeyForPlatform)
.filter(([_, system]) => system !== null)
.forEach(([p]) => {
iframeQueryParams.append('platform', p)
})

return (
<div style={{ width: '100%' }}>
<label className="option-select" htmlFor="station-select">
Expand Down Expand Up @@ -1448,7 +1462,7 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
height: '100%',
},
}}
src={`https://raildotmatrix.co.uk/board/?type=${encodeURIComponent(displayType)}&station=${selectedCrs}&noBg=1&hideSettings=1`}
src={`https://raildotmatrix.co.uk/board/?${iframeQueryParams}`}
/>
</FullScreen>

Expand Down
8 changes: 6 additions & 2 deletions src/helpers/crsToStationItemMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ import { getStationByCrs } from '@data/StationManipulators'
import { nanoid } from 'nanoid'

export default function crsToStationItemMapper(crs: string): CallingAtPoint {
const stn = getStationByCrs(crs)

return {
crsCode: crs,
name: getStationByCrs(crs)?.stationName ?? null,
name: stn ? `${stn.stationName} (${crs})` : `Unknown (${crs})`,
randomId: nanoid(),
}
}

export function stationItemCompleter(point: string | (Partial<CallingAtPoint> & { crsCode: string })): CallingAtPoint {
const p = typeof point === 'string' ? { crsCode: point } : point

const stn = getStationByCrs(p.crsCode)

return {
crsCode: p.crsCode,
name: p.name ?? getStationByCrs(p.crsCode)?.stationName ?? null,
name: stn ? `${stn.stationName} (${p.crsCode})` : `Unknown (${p.crsCode})`,
shortPlatform: p.shortPlatform ?? '',
requestStop: p.requestStop ?? false,
splitType: p.splitType ?? 'none',
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@helpers/*": ["./src/helpers/*"],
"@announcement-data/*": ["./src/announcement-data/*"],
"@hooks/*": ["./src/hooks/*"],
"@assets/*": ["./src/assets/*"],
},
"@assets/*": ["./src/assets/*"]
}
},
"include": ["./src/**/*", "./gatsby-node.ts", "./gatsby-config.ts", "./gatsby-browser.tsx", "./gatsby-ssr.tsx", "./plugins/**/*"],
"include": ["./src/**/*", "./gatsby-node.ts", "./gatsby-config.ts", "./gatsby-browser.tsx", "./gatsby-ssr.tsx", "./plugins/**/*"]
}
Loading

0 comments on commit 5880035

Please sign in to comment.