Skip to content

Commit 049cc48

Browse files
author
*rkeita31*
committed
formulaire d'inscription
1 parent a1e2ccb commit 049cc48

14 files changed

+172
-18
lines changed

src/app/app.module.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
22
import { NgModule } from '@angular/core';
33
import { FormsModule, ReactiveFormsModule} from '@angular/forms';
44
import { HttpClientModule } from '@angular/common/http';
5-
import { RouterModule } from '@angular/router';
5+
import { Route, RouterModule, Routes } from '@angular/router';
66
import { AppRoutingModule } from './app.routing';
77
import { ComponentsModule } from './components/components.module';
88
import { AppComponent } from './app.component';
@@ -18,6 +18,9 @@ import { GarageService } from './services/garage.service';
1818
import { TerrainService } from './services/terrain.service';
1919
import { VisiteService } from './services/visite.service';
2020
import { AppService } from './app.service';
21+
import { RegistrationComponent } from './registration/registration.component';
22+
23+
2124

2225
@NgModule({
2326
imports: [

src/app/app.routing.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ import { UtilisateurComponent } from './components/utilisateur/utilisateur.compo
1616
import { VisiteComponent } from './components/visite/visite.component';
1717
import { LoginComponent } from './components/login/login.component';
1818
import { DashboardComponent } from './dashboard/dashboard.component';
19+
import { RegistrationComponent } from './registration/registration.component';
1920

2021
const routes: Routes =[
2122
{
2223
path: '',
23-
redirectTo: 'login',
24+
component : LoginComponent,
2425
pathMatch: 'full',
2526
}, {
2627
path: '',
@@ -59,7 +60,8 @@ const routes: Routes =[
5960
}, {
6061
path: 'visites',
6162
component: VisiteComponent
62-
}
63+
}
64+
6365
];
6466

6567
@NgModule({

src/app/components/components.module.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
3-
import { RouterModule } from '@angular/router';
3+
import { Route, RouterModule, Routes } from '@angular/router';
44

55
import { FooterComponent } from './footer/footer.component';
66
import { NavbarComponent } from './navbar/navbar.component';
@@ -17,6 +17,8 @@ import { TerrainComponent } from './terrain/terrain.component';
1717
import { VisiteComponent } from './visite/visite.component';
1818
import { LoginComponent } from 'app/components/login/login.component';
1919
import { FormsModule } from '@angular/forms';
20+
import { RegistrationComponent } from 'app/registration/registration.component';
21+
2022

2123
@NgModule({
2224
imports: [
@@ -39,6 +41,7 @@ import { FormsModule } from '@angular/forms';
3941
TerrainComponent,
4042
VisiteComponent,
4143
LoginComponent,
44+
RegistrationComponent
4245
],
4346
exports: [
4447
FooterComponent,
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
<h1>Connectez-vous</h1>
1+
<style>
2+
body{
3+
margin-top : 25%;
4+
margin-left: 25%;
5+
}
6+
h1{
7+
color: rgb(114, 40, 40, 0.48);
8+
font-size: 70px;
9+
font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif
10+
}
11+
12+
13+
</style>
14+
15+
<div>
16+
<img src="src/app/components/sidebar/image/6372241.jpg" alt="photoAgence">
17+
</div>
18+
<body>
19+
<div class="form-group col-md-8" style="text-align: center" >
20+
<h1>Connectez vous</h1>
221
<form (submit)="login()">
322
<div>
423
<label for="username">Nom d'utilisateur</label>
@@ -7,6 +26,11 @@ <h1>Connectez-vous</h1>
726
<div>
827
<label for="password">Mot de passe</label>
928
<input type="text" class="form-control" [(ngModel)]="credentials.password" name="password">
29+
<br>
1030
</div>
11-
<button type="submit">Se connecter</button>
31+
<button class="btn btn-primary"type="submit">Se connecter</button>
32+
33+
<p>Pas encore de compte ?<a routerLink="/registration">Inscrivez-vous</a></p>
1234
</form>
35+
</div>
36+
</body>

src/app/components/navbar/navbar.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
</p>
3838
</a>
3939
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
40-
<a class="dropdown-item" href="javascript:void(0)">Mike John responded to your email</a>
41-
<a class="dropdown-item" href="javascript:void(0)">You have 5 new tasks</a>
42-
<a class="dropdown-item" href="javascript:void(0)">You're now friend with Andrew</a>
40+
<a class="dropdown-item" href="javascript:void(0)">5 nouveaux bien disponible sur Paris</a>
41+
<a class="dropdown-item" href="javascript:void(0)">Monsieur T a repondu à votre question</a>
42+
<!--<a class="dropdown-item" href="javascript:void(0)">You're now friend with Andrew</a>
4343
<a class="dropdown-item" href="javascript:void(0)">Another Notification</a>
44-
<a class="dropdown-item" href="javascript:void(0)">Another One</a>
44+
<a class="dropdown-item" href="javascript:void(0)">Another One</a> -->
4545
</div>
4646
</li>
4747
<li class="nav-item">
314 KB
Loading
42.9 KB
Loading

src/app/components/sidebar/sidebar.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
</p>
3838
</a>
3939
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
40-
<a class="dropdown-item" href="#">Mike John responded to your email</a>
41-
<a class="dropdown-item" href="#">You have 5 new tasks</a>
42-
<a class="dropdown-item" href="#">You're now friend with Andrew</a>
43-
<a class="dropdown-item" href="#">Another Notification</a>
44-
<a class="dropdown-item" href="#">Another One</a>
45-
</div>
40+
<a class="dropdown-item" href="javascript:void(0)">5 nouveaux bien disponible sur Paris</a>
41+
<a class="dropdown-item" href="javascript:void(0)">Monsieur T a repondu à votre question</a>
42+
<!--<a class="dropdown-item" href="javascript:void(0)">You're now friend with Andrew</a>
43+
<a class="dropdown-item" href="javascript:void(0)">Another Notification</a>
44+
<a class="dropdown-item" href="javascript:void(0)">Another One</a> -->
45+
</div>
4646
</li>
4747
<li class="nav-item">
4848
<a class="nav-link" href="javascript:void(0)">

src/app/layouts/admin-layout/admin-layout.routing.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { IconsComponent } from '../../icons/icons.component';
99
import { MapsComponent } from '../../maps/maps.component';
1010
import { NotificationsComponent } from '../../notifications/notifications.component';
1111
import { UpgradeComponent } from '../../upgrade/upgrade.component';
12+
import { RegistrationComponent } from 'app/registration/registration.component';
1213

1314
export const AdminLayoutRoutes: Routes = [
1415
// {
@@ -63,4 +64,5 @@ export const AdminLayoutRoutes: Routes = [
6364
{ path: 'maps', component: MapsComponent },
6465
{ path: 'notifications', component: NotificationsComponent },
6566
{ path: 'upgrade', component: UpgradeComponent },
67+
{ path: 'registration', component: RegistrationComponent}
6668
];

src/app/model/offre.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Avis } from "./avis";
22
import { Visite } from "./visite";
33

4-
export enum enumEtatOffre {
4+
export enum EtatOffre {
55
RENOVE = "RENOVE",
66
NEUF = "NEUF",
77
BON_ETAT = "BON_ETAT",
@@ -19,7 +19,7 @@ export class Offre {
1919
imageOffre!: File;
2020
disponibiliteOffre!: boolean;
2121
orientationOffre!: string;
22-
etatOffre!: enumEtatOffre;
22+
etatOffre!: EtatOffre;
2323
typeOffre!: string;
2424
visite!: Visite[];
2525
avis!: Avis[];
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
3+
4+
5+
<h2>Créer un compte</h2>
6+
<div class="row">
7+
<div class="col-md-8">
8+
<div class="card card-user">
9+
<div class="card-header">
10+
<h3 class="card-title">Creer un compte</h3>
11+
</div>
12+
<div class="card-body">
13+
<form (ngSubmit)="saveUtilisateur()">
14+
<div class="row">
15+
<div class="col-md-6 pr-1">
16+
<div class="form-group">
17+
<label>Nom</label>
18+
<input type="text" class="form-control" [(ngModel)]="utilisateur.nomUtilisateur" name="nomUtilisateur">
19+
</div>
20+
<div class="form-group">
21+
<label>Prénom</label>
22+
<input type="text" class="form-control" [(ngModel)]="utilisateur.prenomUtilisateur" name="prenomUtilisateur">
23+
</div>
24+
<div class="form-group">
25+
<label>Email</label>
26+
<input type="email" class="form-control" [(ngModel)]="utilisateur.emailUtilisateur" name="emailUtilisateur">
27+
</div>
28+
<div class="form-group">
29+
<label>Date de Naissance</label>
30+
<input type="date" class="form-control" [(ngModel)]="utilisateur.dateNaissanceUtilisateur" name="dateNaissanceUtilisateur">
31+
</div>
32+
<div class="form-group">
33+
<label>Telephone</label>
34+
<input type="tel" class="form-control" [(ngModel)]="utilisateur.numTelUtilisateur" name="numTelUtilisateur">
35+
</div>
36+
<div class="form-group">
37+
<label>Nom d'utilisateur</label>
38+
<input type="text" class="form-control" [(ngModel)]="utilisateur.username" name="username">
39+
</div>
40+
<div class="form-group">
41+
<label>Mot de passe</label>
42+
<input type="text" class="form-control" [(ngModel)]="utilisateur.password" name="password">
43+
</div>
44+
<div class="form-group">
45+
<label>Role</label>
46+
<select [(ngModel)]="utilisateur.roles" name="roles">
47+
<option value="">Client</option>
48+
</select>
49+
</div>
50+
</div>
51+
</div>
52+
<div class="row">
53+
<div class="update ml-auto mr-auto">
54+
<button class="btn btn-primary btn-round">Valider</button>
55+
</div>
56+
</div>
57+
</form>
58+
</div>
59+
</div>
60+
</div>
61+
62+

src/app/registration/registration.component.scss

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { RegistrationComponent } from './registration.component';
4+
5+
describe('RegistrationComponent', () => {
6+
let component: RegistrationComponent;
7+
let fixture: ComponentFixture<RegistrationComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ RegistrationComponent ]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(RegistrationComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { Router } from '@angular/router';
3+
import { Utilisateur } from 'app/model/utilisateur';
4+
import { UtilisateurService } from 'app/services/utilisateur.service';
5+
6+
@Component({
7+
selector: 'app-registration',
8+
templateUrl: './registration.component.html',
9+
styleUrls: ['./registration.component.scss']
10+
})
11+
export class RegistrationComponent implements OnInit {
12+
13+
14+
users!:any[]
15+
roles!:any[];
16+
utilisateur:Utilisateur = new Utilisateur();
17+
constructor(private utilisateurService:UtilisateurService, private router:Router){}
18+
19+
ngOnInit(): void {
20+
this.findAllUtilisateurs();
21+
22+
}
23+
findAllUtilisateurs(){
24+
this.utilisateurService.findAll().subscribe(data => {this.users = data});
25+
}
26+
27+
saveUtilisateur(){
28+
this.utilisateurService.save(this.utilisateur).subscribe(
29+
() => {
30+
this.findAllUtilisateurs();
31+
this.utilisateur = new Utilisateur();
32+
}
33+
)
34+
}
35+
}

0 commit comments

Comments
 (0)