7 changed files with 123 additions and 4 deletions
@ -0,0 +1,16 @@ |
|||||
|
<div class="signInForm"> |
||||
|
<input type="file" accept=".gbx" class="file-input" (change)="onFileSelected($event)" #fileUpload> |
||||
|
<h1 mat-dialog-title>Replay Upload</h1> |
||||
|
<div mat-dialog-content class="full-width"> |
||||
|
<mat-label>File</mat-label> |
||||
|
{{fileName || "No file uploaded yet."}} |
||||
|
<button mat-fab color="primary" class="upload-btn" |
||||
|
(click)="fileUpload.click()"> |
||||
|
<mat-icon>attach_file</mat-icon> |
||||
|
</button> |
||||
|
</div> |
||||
|
<mat-dialog-actions align="end"> |
||||
|
<button mat-button mat-dialog-close>Cancel</button> |
||||
|
<button mat-button mat-dialog-close (click)="onClickSubmit()">Submit</button> |
||||
|
</mat-dialog-actions> |
||||
|
</div> |
||||
@ -0,0 +1,16 @@ |
|||||
|
.file-input { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
.signInForm { |
||||
|
width: 400px; |
||||
|
padding: 12px 24px 24px; |
||||
|
|
||||
|
igx-input-group + igx-input-group { |
||||
|
margin-top: 24px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.full-width { |
||||
|
width: 100%; |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
|
||||
|
import { UploadReplayDialogComponent } from './upload-replay-dialog.component'; |
||||
|
|
||||
|
describe('UploadReplayDialogComponent', () => { |
||||
|
let component: UploadReplayDialogComponent; |
||||
|
let fixture: ComponentFixture<UploadReplayDialogComponent>; |
||||
|
|
||||
|
beforeEach(async () => { |
||||
|
await TestBed.configureTestingModule({ |
||||
|
imports: [UploadReplayDialogComponent] |
||||
|
}) |
||||
|
.compileComponents(); |
||||
|
|
||||
|
fixture = TestBed.createComponent(UploadReplayDialogComponent); |
||||
|
component = fixture.componentInstance; |
||||
|
fixture.detectChanges(); |
||||
|
}); |
||||
|
|
||||
|
it('should create', () => { |
||||
|
expect(component).toBeTruthy(); |
||||
|
}); |
||||
|
}); |
||||
@ -0,0 +1,58 @@ |
|||||
|
import { Component } from '@angular/core'; |
||||
|
import { CommonModule } from '@angular/common'; |
||||
|
import { ReactiveFormsModule, FormControl } from '@angular/forms'; |
||||
|
import { FormsModule } from '@angular/forms'; |
||||
|
|
||||
|
import { MatDialog, MAT_DIALOG_DATA, MatDialogRef, MatDialogTitle, |
||||
|
MatDialogContent, MatDialogActions, MatDialogClose,} from '@angular/material/dialog'; |
||||
|
|
||||
|
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 { MatIconModule } from '@angular/material/icon'; |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'app-upload-replay-dialog', |
||||
|
standalone: true, |
||||
|
imports: [ |
||||
|
CommonModule, |
||||
|
ReactiveFormsModule, |
||||
|
MatButtonModule, |
||||
|
MatDialogModule, |
||||
|
MatInputModule, |
||||
|
MatFormFieldModule, |
||||
|
FormsModule, |
||||
|
MatDialogTitle, |
||||
|
MatDialogContent, |
||||
|
MatDialogActions, |
||||
|
MatDialogClose, |
||||
|
MatIconModule, |
||||
|
], |
||||
|
templateUrl: './upload-replay-dialog.component.html', |
||||
|
styleUrl: './upload-replay-dialog.component.scss' |
||||
|
}) |
||||
|
export class UploadReplayDialogComponent { |
||||
|
fileName: string = ""; |
||||
|
file?: File; |
||||
|
|
||||
|
onFileSelected(event: any) { |
||||
|
const file: File = event.target.files[0]; |
||||
|
if (file) |
||||
|
{ |
||||
|
this.fileName = file.name; |
||||
|
this.file = file; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
onClickSubmit() { |
||||
|
/* |
||||
|
let formData = new FormData(); |
||||
|
formData.append("file", file); |
||||
|
let local = this.seasonId.seasonId; |
||||
|
formData.append("seasonId", local); |
||||
|
const upload$ = this.apiService.postReplayUpload(formData); |
||||
|
upload$.subscribe(); |
||||
|
*/ |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue