forked from MapComplete/MapComplete
		
	Fix: move validation error to validateLayer, make only a warning
This commit is contained in:
		
							parent
							
								
									79d43aef40
								
							
						
					
					
						commit
						75e8f40645
					
				
					 2 changed files with 7 additions and 3 deletions
				
			
		|  | @ -878,6 +878,13 @@ export class ValidateLayer extends Conversion< | ||||||
|                 ) |                 ) | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         if (typeof json.allowMove === "object") { | ||||||
|  | 
 | ||||||
|  |             if (!(json.allowMove.enableRelocation || json.allowMove.enableImproveAccuracy)) { | ||||||
|  |                 context.warn("MoveConfig: At least one default move reason should be allowed (at " + context + "); both 'enableImproveAccuracy and enableRelocation are falsy. If you don't want to allow moving points, set `allowMove: false` instead. Full config is: " + JSON.stringify(json.allowMove)) | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|         return { raw: json, parsed: layerConfig } |         return { raw: json, parsed: layerConfig } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -7,8 +7,5 @@ export default class MoveConfig { | ||||||
|     constructor(json: MoveConfigJson, context: string) { |     constructor(json: MoveConfigJson, context: string) { | ||||||
|         this.enableImproveAccuracy = json.enableImproveAccuracy ?? true |         this.enableImproveAccuracy = json.enableImproveAccuracy ?? true | ||||||
|         this.enableRelocation = json.enableRelocation ?? true |         this.enableRelocation = json.enableRelocation ?? true | ||||||
|         if (!(this.enableRelocation || this.enableImproveAccuracy)) { |  | ||||||
|             throw "At least one default move reason should be allowed (at " + context + ")" |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue