Fix request user select
							parent
							
								
									5d69a04379
								
							
						
					
					
						commit
						c1e666ebbc
					
				|  | @ -10,6 +10,7 @@ | |||
|             [compareWith]="equals" | ||||
|             (change)="toggleUser(decoPreview, decoDescription)" | ||||
|             required> | ||||
|       <option [ngValue]="{_id: '0'}">Auswählen...</option> | ||||
|       <option *ngFor="let user of users" [ngValue]="user"> | ||||
|         {{user.username}} | ||||
|       </option> | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ export class RequestAwardComponent { | |||
| 
 | ||||
|   showSuccessLabel = false; | ||||
| 
 | ||||
|   user: User = {}; | ||||
|   user: User = {_id: '0'}; | ||||
| 
 | ||||
|   decoration: Decoration = null; | ||||
| 
 | ||||
|  | @ -49,19 +49,23 @@ export class RequestAwardComponent { | |||
|   } | ||||
| 
 | ||||
|   toggleUser(previewImage, decoDescription) { | ||||
|     this.decoration = null; | ||||
|     if (previewImage && decoDescription) { | ||||
|       previewImage.src = decoDescription.innerHTML = ''; | ||||
|     if (this.user._id != '0') { | ||||
|       this.decoration = null; | ||||
|       if (previewImage && decoDescription) { | ||||
|         previewImage.src = decoDescription.innerHTML = ''; | ||||
|       } | ||||
|       this.decorationService.findDecorations('', this.user.squad.fraction).subscribe(decorations => { | ||||
|         this.decorations = decorations; | ||||
|       }); | ||||
| 
 | ||||
|       this.awardingService.getUserAwardings(this.user._id).subscribe(awards => { | ||||
|         this.awards = awards; | ||||
|       }); | ||||
| 
 | ||||
|       this.showForm = true; | ||||
|     } else { | ||||
|       this.showForm = false; | ||||
|     } | ||||
|     this.decorationService.findDecorations('', this.user.squad.fraction).subscribe(decorations => { | ||||
|       this.decorations = decorations; | ||||
|     }); | ||||
| 
 | ||||
|     this.awardingService.getUserAwardings(this.user._id).subscribe(awards => { | ||||
|       this.awards = awards; | ||||
|     }); | ||||
| 
 | ||||
|     this.showForm = true; | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -10,6 +10,7 @@ | |||
|             [compareWith]="equals" | ||||
|             required | ||||
|             (change)="toggleUser()"> | ||||
|       <option [ngValue]="{_id: '0'}">Auswählen...</option> | ||||
|       <option *ngFor="let user of users" [ngValue]="user"> | ||||
|         {{user.username}} | ||||
|       </option> | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ export class RequestPromotionComponent { | |||
| 
 | ||||
|   showSuccessLabel = false; | ||||
| 
 | ||||
|   user: User = {}; | ||||
|   user: User = {_id: '0'}; | ||||
| 
 | ||||
|   newLevel: number; | ||||
| 
 | ||||
|  | @ -52,8 +52,12 @@ export class RequestPromotionComponent { | |||
|   } | ||||
| 
 | ||||
|   toggleUser() { | ||||
|     this.showForm = true; | ||||
|     this.newLevel = this.user.rank.level; | ||||
|     if (this.user._id != '0') { | ||||
|       this.showForm = true; | ||||
|       this.newLevel = this.user.rank.level; | ||||
|     } else { | ||||
|       this.showForm = false; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue