| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  | import Combine from "../Base/Combine"; | 
					
						
							|  |  |  | import {FlowStep} from "./FlowStep"; | 
					
						
							|  |  |  | import {UIEventSource} from "../../Logic/UIEventSource"; | 
					
						
							|  |  |  | import Link from "../Base/Link"; | 
					
						
							|  |  |  | import CheckBoxes from "../Input/Checkboxes"; | 
					
						
							|  |  |  | import Title from "../Base/Title"; | 
					
						
							| 
									
										
										
										
											2022-04-14 03:01:54 +02:00
										 |  |  | import Translations from "../i18n/Translations"; | 
					
						
							| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-24 03:11:29 +01:00
										 |  |  | export class ConfirmProcess extends Combine implements FlowStep<{ features: any[], theme: string }> { | 
					
						
							| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public IsValid: UIEventSource<boolean> | 
					
						
							| 
									
										
										
										
											2022-04-14 03:01:54 +02:00
										 |  |  |     public Value: UIEventSource<{ features: any[], theme: string }> | 
					
						
							| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-14 03:01:54 +02:00
										 |  |  |     constructor(v: { features: any[], theme: string }) { | 
					
						
							|  |  |  |         const t = Translations.t.importHelper.confirmProcess; | 
					
						
							| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  |         const toConfirm = [ | 
					
						
							| 
									
										
										
										
											2022-04-14 03:01:54 +02:00
										 |  |  |             new Link(t.readImportGuidelines, "https://wiki.openstreetmap.org/wiki/Import_guidelines", true), | 
					
						
							|  |  |  |             t.contactedCommunity, | 
					
						
							|  |  |  |             t.licenseIsCompatible, | 
					
						
							|  |  |  |             t.wikipageIsMade | 
					
						
							| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  |         ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         super([ | 
					
						
							| 
									
										
										
										
											2022-04-14 03:01:54 +02:00
										 |  |  |             new Title(t.titleLong), | 
					
						
							|  |  |  |             new CheckBoxes(toConfirm), | 
					
						
							| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  |         ]); | 
					
						
							|  |  |  |         this.SetClass("link-underline") | 
					
						
							| 
									
										
										
										
											2022-04-14 03:01:54 +02:00
										 |  |  |         this.IsValid = new CheckBoxes(toConfirm).GetValue().map(selected => toConfirm.length == selected.length) | 
					
						
							| 
									
										
										
										
											2022-03-24 03:11:29 +01:00
										 |  |  |         this.Value = new UIEventSource<{ features: any[], theme: string }>(v) | 
					
						
							| 
									
										
										
										
											2022-01-21 01:57:16 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | } |