-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
CerealKiller97
committed
Sep 2, 2019
1 parent
ac7eec3
commit c31d8b9
Showing
15 changed files
with
278 additions
and
29 deletions.
There are no files selected for viewing
21 changes: 20 additions & 1 deletion
21
src/app/modules/contact/components/contact/contact.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
<h1>Contact page</h1> | ||
<mat-grid-list cols="1" rowHeight="2:1"> | ||
<form [formGroup]="contactForm" (ngSubmit)="onSubmitContactForm();"> | ||
<mat-form-field> | ||
<input matInput formControlName="name" placeholder="Enter your first name..." /> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<input matInput formControlName="email" placeholder="Enter your email..." /> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<input matInput formControlName="subject" placeholder="Enter your subject..." /> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<textarea matInput formControlName="body" placeholder="Message body..."></textarea> | ||
</mat-form-field> | ||
<button mat-raised-button color="primary" type="submit">Submit</button> | ||
</form> | ||
</mat-grid-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...pp/modules/shared-components/components/bug-report-dialog/bug-report-dialog.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.text-center { | ||
text-align: center !important; | ||
} | ||
|
||
.example-form { | ||
min-width: 150px; | ||
max-width: 500px; | ||
width: 100%; | ||
} | ||
|
||
.example-full-width { | ||
width: 100%; | ||
} |
17 changes: 17 additions & 0 deletions
17
...p/modules/shared-components/components/bug-report-dialog/bug-report-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<h1 mat-dialog-title class="text-center">Bug Report</h1> | ||
<div mat-dialog-content class="text-center"> | ||
<form class="example-form"> | ||
<mat-form-field class="example-full-width"> | ||
<input matInput placeholder="Favorite food" [(ngModel)]="data.fullName"> | ||
</mat-form-field> | ||
|
||
<mat-form-field class="example-full-width"> | ||
<textarea matInput placeholder="Report a bug..." [(ngModel)]="data.bug"></textarea> | ||
</mat-form-field> | ||
</form> | ||
|
||
</div> | ||
<div mat-dialog-actions> | ||
<button mat-raised-button color="primary" [mat-dialog-close]="data.fullName" cdkFocusInitial>Submit bug</button> | ||
<button mat-raised-button color="warn" (click)="onNoClick()">Cancel</button> | ||
</div> |
25 changes: 25 additions & 0 deletions
25
...odules/shared-components/components/bug-report-dialog/bug-report-dialog.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { BugReportDialogComponent } from './bug-report-dialog.component'; | ||
|
||
describe('BugReportDialogComponent', () => { | ||
let component: BugReportDialogComponent; | ||
let fixture: ComponentFixture<BugReportDialogComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ BugReportDialogComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(BugReportDialogComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
...app/modules/shared-components/components/bug-report-dialog/bug-report-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Component, OnInit, Inject } from '@angular/core'; | ||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { HeaderComponent } from '..'; | ||
import { FormGroup, Validators, FormControl } from '@angular/forms'; | ||
|
||
export interface BugReport { | ||
fullName: string; | ||
bug: string; | ||
} | ||
|
||
@Component({ | ||
selector: 'app-bug-report-dialog', | ||
templateUrl: './bug-report-dialog.component.html', | ||
styleUrls: ['./bug-report-dialog.component.css'] | ||
}) | ||
export class BugReportDialogComponent implements OnInit { | ||
public readonly bugReportForm: FormGroup = new FormGroup({ | ||
fullName: new FormControl('', [Validators.required]), | ||
bug: new FormControl('', [Validators.required, Validators.minLength(5)]) | ||
}); | ||
|
||
constructor( | ||
public readonly dialogRef: MatDialogRef<HeaderComponent>, | ||
@Inject(MAT_DIALOG_DATA) public data: BugReport | ||
) {} | ||
|
||
ngOnInit() {} | ||
|
||
onNoClick(): void { | ||
this.dialogRef.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.