mirror of
				https://github.com/public-transport/db-vendo-client.git
				synced 2025-11-04 10:06:32 +02:00 
			
		
		
		
	parseLint: use addName, add todos
This commit is contained in:
		
							parent
							
								
									707fd292d7
								
							
						
					
					
						commit
						1e0182f8f6
					
				
					 2 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
					@ -5,6 +5,13 @@ const codesByIcon = Object.assign(Object.create(null), {
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// todo: is passing in profile necessary?
 | 
					// todo: is passing in profile necessary?
 | 
				
			||||||
 | 
					// todo: pass in tag list from hint reference, e.g.:
 | 
				
			||||||
 | 
					// "tagL": [
 | 
				
			||||||
 | 
					// 	"RES_JNY_H3" // H3 = level 3 heading? shown on overview
 | 
				
			||||||
 | 
					// ]
 | 
				
			||||||
 | 
					// "tagL": [
 | 
				
			||||||
 | 
					// 	"RES_JNY_DTL" // only shown in journey detail
 | 
				
			||||||
 | 
					// ]
 | 
				
			||||||
const parseHint = (profile, h, icons) => {
 | 
					const parseHint = (profile, h, icons) => {
 | 
				
			||||||
	// todo: C
 | 
						// todo: C
 | 
				
			||||||
	// todo:
 | 
						// todo:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,7 @@ const createParseLine = (profile, opt, {operators}) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const parseLine = (p) => {
 | 
						const parseLine = (p) => {
 | 
				
			||||||
		if (!p) return null // todo: handle this upstream
 | 
							if (!p) return null // todo: handle this upstream
 | 
				
			||||||
		const name = p.line || p.name || null
 | 
							const name = p.line || p.addName || p.name || null // wtf
 | 
				
			||||||
		const res = {
 | 
							const res = {
 | 
				
			||||||
			type: 'line',
 | 
								type: 'line',
 | 
				
			||||||
			// This is terrible, but FPTF demands an ID. Let's pray for HAFAS.
 | 
								// This is terrible, but FPTF demands an ID. Let's pray for HAFAS.
 | 
				
			||||||
| 
						 | 
					@ -21,6 +21,7 @@ const createParseLine = (profile, opt, {operators}) => {
 | 
				
			||||||
				|| name && slugg(name.trim())
 | 
									|| name && slugg(name.trim())
 | 
				
			||||||
				|| null
 | 
									|| null
 | 
				
			||||||
			),
 | 
								),
 | 
				
			||||||
 | 
								// todo: what is p.prodCtx.matchId? use as `id`? expose it.
 | 
				
			||||||
			fahrtNr: p.prodCtx && p.prodCtx.num || null,
 | 
								fahrtNr: p.prodCtx && p.prodCtx.num || null,
 | 
				
			||||||
			name,
 | 
								name,
 | 
				
			||||||
			public: true
 | 
								public: true
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue