-
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.
feat(auth-form): add initial form structure
- Loading branch information
Felipe Luna
committed
Feb 5, 2024
1 parent
974bbd7
commit 03ee2b7
Showing
13 changed files
with
142 additions
and
5 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
modules/feature/auth/form/src/lib/auth-form/auth-form-email/auth-form-email.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 @@ | ||
<p>auth-form-email works!</p> |
Empty file.
23 changes: 23 additions & 0 deletions
23
...les/feature/auth/form/src/lib/auth-form/auth-form-email/auth-form-email.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,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { AuthFormEmailComponent } from './auth-form-email.component'; | ||
import { AuthFormComponent } from '../auth-form.component'; | ||
|
||
describe('AuthFormEmailComponent', () => { | ||
let component: AuthFormEmailComponent; | ||
let fixture: ComponentFixture<AuthFormEmailComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [AuthFormEmailComponent], | ||
providers: [AuthFormComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(AuthFormEmailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
modules/feature/auth/form/src/lib/auth-form/auth-form-email/auth-form-email.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,19 @@ | ||
import { AuthFormComponent } from './../auth-form.component'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'lib-auth-form-email', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './auth-form-email.component.html', | ||
styleUrl: './auth-form-email.component.scss', | ||
}) | ||
export class AuthFormEmailComponent implements OnInit { | ||
constructor(private authformComponent: AuthFormComponent) {} | ||
|
||
ngOnInit(): void { | ||
// eslint-disable-next-line no-console | ||
console.log(this.authformComponent.form.value); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
.../feature/auth/form/src/lib/auth-form/auth-form-password/auth-form-password.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 @@ | ||
<p>auth-form-password works!</p> |
Empty file.
21 changes: 21 additions & 0 deletions
21
...ature/auth/form/src/lib/auth-form/auth-form-password/auth-form-password.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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { AuthFormPasswordComponent } from './auth-form-password.component'; | ||
|
||
describe('AuthFormPasswordComponent', () => { | ||
let component: AuthFormPasswordComponent; | ||
let fixture: ComponentFixture<AuthFormPasswordComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [AuthFormPasswordComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(AuthFormPasswordComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
...es/feature/auth/form/src/lib/auth-form/auth-form-password/auth-form-password.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,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'lib-auth-form-password', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './auth-form-password.component.html', | ||
styleUrl: './auth-form-password.component.scss', | ||
}) | ||
export class AuthFormPasswordComponent {} |
6 changes: 5 additions & 1 deletion
6
modules/feature/auth/form/src/lib/auth-form/auth-form.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,5 @@ | ||
<p>auth-form works!</p> | ||
<form class="form" [formGroup]="form"> | ||
<mat-card class="form__card"> | ||
<router-outlet></router-outlet> | ||
</mat-card> | ||
</form> |
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 @@ | ||
.form { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: 80vh; | ||
|
||
&__card { | ||
max-width: 400px; | ||
width: 100%; | ||
padding: 2rem; | ||
} | ||
} |
20 changes: 18 additions & 2 deletions
20
modules/feature/auth/form/src/lib/auth-form/auth-form.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 |
---|---|---|
@@ -1,11 +1,27 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { | ||
FormControl, | ||
FormGroup, | ||
ReactiveFormsModule, | ||
Validators, | ||
} from '@angular/forms'; | ||
import { RouterModule } from '@angular/router'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
|
||
@Component({ | ||
selector: 'lib-auth-form', | ||
standalone: true, | ||
imports: [CommonModule], | ||
imports: [CommonModule, RouterModule, MatCardModule, ReactiveFormsModule], | ||
templateUrl: './auth-form.component.html', | ||
styleUrl: './auth-form.component.scss', | ||
}) | ||
export class AuthFormComponent {} | ||
export class AuthFormComponent { | ||
form = new FormGroup({ | ||
email: new FormControl('', [Validators.required, Validators.email]), | ||
password: new FormControl('', [ | ||
Validators.required, | ||
Validators.minLength(6), | ||
]), | ||
}); | ||
} |
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