7 changed files with 142 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||||
|
<div class="signInForm"> |
||||
|
<h1 mat-dialog-title>Login</h1> |
||||
|
<div mat-dialog-content> |
||||
|
<mat-form-field class="full-width"> |
||||
|
<mat-label>Map UID</mat-label> |
||||
|
<input matInput type="text" id="mapUID" [formControl]="mapUID" name="mapUID" required> |
||||
|
</mat-form-field> |
||||
|
<br/> |
||||
|
<mat-form-field class="full-width"> |
||||
|
<mat-label>Start Date</mat-label> |
||||
|
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="picker" [formControl]="startDate" name="startDate" id="startDate" required> |
||||
|
<mat-hint>MM/DD/YYYY</mat-hint> |
||||
|
<mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle> |
||||
|
<mat-datepicker #picker></mat-datepicker> |
||||
|
</mat-form-field> |
||||
|
<mat-form-field class="full-width"> |
||||
|
<mat-label>End Date</mat-label> |
||||
|
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="endpicker" [formControl]="endDate" name="endDate" id="endDate" required> |
||||
|
<mat-hint>MM/DD/YYYY</mat-hint> |
||||
|
<mat-datepicker-toggle matIconSuffix [for]="endpicker"></mat-datepicker-toggle> |
||||
|
<mat-datepicker #endpicker></mat-datepicker> |
||||
|
</mat-form-field> |
||||
|
</div> |
||||
|
<mat-dialog-actions align="end"> |
||||
|
<button mat-button mat-dialog-close>Cancel</button> |
||||
|
<button mat-button mat-dialog-close (click)="submit()">Submit</button> |
||||
|
</mat-dialog-actions> |
||||
|
</div> |
||||
@ -0,0 +1,23 @@ |
|||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
|
||||
|
import { NewRaceDialogComponent } from './new-race-dialog.component'; |
||||
|
|
||||
|
describe('NewRaceDialogComponent', () => { |
||||
|
let component: NewRaceDialogComponent; |
||||
|
let fixture: ComponentFixture<NewRaceDialogComponent>; |
||||
|
|
||||
|
beforeEach(async () => { |
||||
|
await TestBed.configureTestingModule({ |
||||
|
imports: [NewRaceDialogComponent] |
||||
|
}) |
||||
|
.compileComponents(); |
||||
|
|
||||
|
fixture = TestBed.createComponent(NewRaceDialogComponent); |
||||
|
component = fixture.componentInstance; |
||||
|
fixture.detectChanges(); |
||||
|
}); |
||||
|
|
||||
|
it('should create', () => { |
||||
|
expect(component).toBeTruthy(); |
||||
|
}); |
||||
|
}); |
||||
@ -0,0 +1,70 @@ |
|||||
|
import { Component, Inject } from '@angular/core'; |
||||
|
import { CommonModule } from '@angular/common'; |
||||
|
import { ReactiveFormsModule, FormControl } from '@angular/forms'; |
||||
|
import { FormsModule } from '@angular/forms'; |
||||
|
|
||||
|
import { MatButtonModule } from '@angular/material/button'; |
||||
|
import { MatDialogModule } from '@angular/material/dialog'; |
||||
|
import { MatInputModule } from '@angular/material/input'; |
||||
|
import { MatFormFieldModule } from '@angular/material/form-field'; |
||||
|
import { MatDatepickerModule } from '@angular/material/datepicker'; |
||||
|
import { MatNativeDateModule } from '@angular/material/core'; |
||||
|
|
||||
|
import { MatDialog, MAT_DIALOG_DATA, MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; |
||||
|
|
||||
|
import * as TMIO from 'trackmania.io'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'app-new-race-dialog', |
||||
|
standalone: true, |
||||
|
imports: [ |
||||
|
CommonModule, |
||||
|
ReactiveFormsModule, |
||||
|
MatButtonModule, |
||||
|
MatDialogModule, |
||||
|
MatInputModule, |
||||
|
MatFormFieldModule, |
||||
|
FormsModule, |
||||
|
MatDialogTitle, |
||||
|
MatDialogContent, |
||||
|
MatDialogActions, |
||||
|
MatDialogClose, |
||||
|
MatDatepickerModule, |
||||
|
MatNativeDateModule |
||||
|
], |
||||
|
providers: [ |
||||
|
MatDatepickerModule, MatNativeDateModule |
||||
|
], |
||||
|
templateUrl: './new-race-dialog.component.html', |
||||
|
styleUrl: './new-race-dialog.component.scss' |
||||
|
}) |
||||
|
export class NewRaceDialogComponent { |
||||
|
mapUID = new FormControl(''); |
||||
|
startDate = new FormControl(''); |
||||
|
endDate = new FormControl(''); |
||||
|
|
||||
|
minDate: Date; |
||||
|
maxDate: Date; |
||||
|
|
||||
|
seasonId: string; |
||||
|
|
||||
|
tmio: any; |
||||
|
|
||||
|
constructor( |
||||
|
@Inject(MAT_DIALOG_DATA) additionalData: any, |
||||
|
) |
||||
|
{ |
||||
|
this.seasonId = additionalData.seasonId; |
||||
|
const currentYear = new Date().getFullYear(); |
||||
|
this.minDate = new Date(Date.now()); |
||||
|
this.maxDate = new Date(currentYear + 1, 11, 31); |
||||
|
//this.tmio = new TMIO.Client();
|
||||
|
|
||||
|
//this.mapUID.registerOnChange()
|
||||
|
} |
||||
|
|
||||
|
submit() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue