Merge branch 'dev' into cecile
This commit is contained in:
commit
03ec7ffe92
44 changed files with 782 additions and 273 deletions
13
src/app/components/card-avatar/card-avatar.component.html
Normal file
13
src/app/components/card-avatar/card-avatar.component.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<div class="container mt-5 membre">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-md-auto">
|
||||
<div class="card p-3 py-4 align-items">
|
||||
<!-- récuperer couleur du back-->
|
||||
<div class="text-center"><div class="rounded-circle"id="couleur"[style.background-color]="membre.couleur"></div></div>
|
||||
<div class="text-center mt-3">
|
||||
<h3 class="mt-2 mb-0">{{membre.prenom }} {{membre.nom }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
20
src/app/components/card-avatar/card-avatar.component.scss
Normal file
20
src/app/components/card-avatar/card-avatar.component.scss
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#couleur{
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin: 0 auto;
|
||||
background: black;
|
||||
|
||||
}
|
||||
|
||||
.card {
|
||||
min-height: 8px;
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
h3 {
|
||||
font-size: small;
|
||||
}
|
||||
25
src/app/components/card-avatar/card-avatar.component.spec.ts
Normal file
25
src/app/components/card-avatar/card-avatar.component.spec.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CardAvatarComponent } from './card-avatar.component';
|
||||
|
||||
describe('CardAvatarComponent', () => {
|
||||
let component: CardAvatarComponent;
|
||||
let fixture: ComponentFixture<CardAvatarComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ CardAvatarComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CardAvatarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
17
src/app/components/card-avatar/card-avatar.component.ts
Normal file
17
src/app/components/card-avatar/card-avatar.component.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-card-avatar',
|
||||
templateUrl: './card-avatar.component.html',
|
||||
styleUrls: ['./card-avatar.component.scss']
|
||||
})
|
||||
export class CardAvatarComponent implements OnInit {
|
||||
@Input() membre: any;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
<div class="modal-footer">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-dark"
|
||||
class="btn btn-outline-warning"
|
||||
(click)="modal.close(saveMenu())"
|
||||
>
|
||||
Enregistrer
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
<div class="modal-footer">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-dark"
|
||||
class="btn btn-outline-warning"
|
||||
(click)="modal.close(updateMenu(menu.id))"
|
||||
>
|
||||
Mettre à jour
|
||||
|
|
|
|||
|
|
@ -34,24 +34,35 @@ public upMenuForm : FormGroup;
|
|||
) {
|
||||
this.listMenus=[];
|
||||
this.menuForm = new FormGroup({});
|
||||
this.upMenuForm = new FormGroup({});
|
||||
this.upMenuForm = this.initForm();
|
||||
}
|
||||
|
||||
//Méthode qui initialise les champs du formulaire avec les infos de la BDD
|
||||
private initForm(menu?: Menu): FormGroup {
|
||||
return this.fb.group({
|
||||
dateMenu: [menu ? menu.dateMenu : ''],
|
||||
repasMidi: [menu ? menu.repasMidi : ''],
|
||||
repasSoir: [menu ? menu.repasSoir : ''],
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//delete d'un menu
|
||||
deleteMenu(id_menu : number): void {
|
||||
window.alert("Le menu a bien été supprimé!")
|
||||
this.menusService.deleteMenu(id_menu)?.subscribe((resp) => {
|
||||
this.router.navigate(['menu']);
|
||||
// this.router.navigate(['menu']);
|
||||
});
|
||||
|
||||
}
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
//updateMenu
|
||||
updateMenu(id_menu : number): void {
|
||||
|
||||
const dateValue = this.menuForm.value['dateMenuFc'];
|
||||
const repasMidiValue = this.menuForm.value['repasMidiFc'];
|
||||
const repasSoirValue = this.menuForm.value['repasSoirFc'];
|
||||
const dateValue = this.upMenuForm.value['dateMenuFc'];
|
||||
const repasMidiValue = this.upMenuForm.value['repasMidiFc'];
|
||||
const repasSoirValue = this.upMenuForm.value['repasSoirFc'];
|
||||
|
||||
|
||||
const menu: Menu = {
|
||||
|
|
@ -64,20 +75,11 @@ updateMenu(id_menu : number): void {
|
|||
console.log(id_menu);
|
||||
|
||||
this.menusService.updateMenu(menu, id_menu)?.subscribe((resp) => {
|
||||
console.log("ok");
|
||||
this.router.navigate(['menu']);
|
||||
console.log(menu, id_menu);
|
||||
});
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
//Méthode qui initialise les champs du formulaire avec les infos de la BDD
|
||||
private initForm(menu?: Menu): FormGroup {
|
||||
return this.fb.group({
|
||||
dateMenu: [menu ? menu.dateMenu : ''],
|
||||
libelle: [menu ? menu.repasMidi : ''],
|
||||
repas: [menu ? menu.repasSoir : ''],
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//ajout d'un menu
|
||||
|
|
@ -99,7 +101,8 @@ saveMenu(): void {
|
|||
|
||||
console.log(menu.dateMenu);
|
||||
this.menusService.addMenu(menu)?.subscribe((resp) => {
|
||||
this.router.navigate(['menu']);
|
||||
window.location.reload();
|
||||
|
||||
});
|
||||
} else {
|
||||
this.router.navigate(['accueil']);
|
||||
|
|
@ -120,10 +123,22 @@ this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
|
|||
this.menuForm = this.fb.group(
|
||||
{
|
||||
dateMenuFc: new FormControl('',[Validators.required]),
|
||||
libelleFc: new FormControl('',[Validators.required]),
|
||||
repasFc: new FormControl('',[Validators.required]),
|
||||
repasMidiFc: new FormControl('',[Validators.required]),
|
||||
repasSoirFc: new FormControl('',[Validators.required]),
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
this.upMenuForm = this.fb.group(
|
||||
{
|
||||
dateMenuFc: new FormControl('',[Validators.required]),
|
||||
repasMidiFc: new FormControl('',[Validators.required]),
|
||||
repasSoirFc: new FormControl('',[Validators.required]),
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
open(content: any) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary btn-circle btn-xl"
|
||||
(click)="onClickDeco()"
|
||||
>
|
||||
Se déconnecter
|
||||
</button>
|
||||
10
src/app/components/deconnexion/deconnexion.component.scss
Normal file
10
src/app/components/deconnexion/deconnexion.component.scss
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
.btn-circle.btn-xl {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
padding: 10px 16px;
|
||||
border-radius: 40px;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
}
|
||||
25
src/app/components/deconnexion/deconnexion.component.spec.ts
Normal file
25
src/app/components/deconnexion/deconnexion.component.spec.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DeconnexionComponent } from './deconnexion.component';
|
||||
|
||||
describe('DeconnexionComponent', () => {
|
||||
let component: DeconnexionComponent;
|
||||
let fixture: ComponentFixture<DeconnexionComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ DeconnexionComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DeconnexionComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
26
src/app/components/deconnexion/deconnexion.component.ts
Normal file
26
src/app/components/deconnexion/deconnexion.component.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { TokenService } from 'src/app/services/token.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-deconnexion',
|
||||
templateUrl: './deconnexion.component.html',
|
||||
styleUrls: ['./deconnexion.component.scss']
|
||||
})
|
||||
export class DeconnexionComponent implements OnInit {
|
||||
|
||||
constructor(private tokenService: TokenService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
|
||||
onClickDeco(){
|
||||
this.tokenService.eraseToken();
|
||||
this.router.navigate(['accueil']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,17 @@
|
|||
<nav class="navbar sticky-top navbar-expand-lg navbar-light bg-light shadow py-0 ">
|
||||
<div class="container-fluid">
|
||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||
<div class="navbar-nav">
|
||||
<img id="img" routerLink="accueil" routerLinkActive="active-custom" src="../../../assets/images/logo-organizee.png"/>
|
||||
</div>
|
||||
</div>
|
||||
<a class="navbar-brand" href="#">Organizee</a>
|
||||
<nav
|
||||
class="navbar sticky-top navbar-expand-lg navbar-light bg-light shadow py-0"
|
||||
>
|
||||
<div class="container-fluid">
|
||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||
<div class="navbar-nav">
|
||||
<img
|
||||
id="img"
|
||||
routerLink="accueil"
|
||||
routerLinkActive="active-custom"
|
||||
src="../../../assets/images/logo-organizee.png"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<a class="navbar-brand" href="#">Organizee</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.navbar-brand {
|
||||
position: absolute;
|
||||
margin-left: 12%;
|
||||
position: relative;
|
||||
margin-right: 70%;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 3rem;
|
||||
|
|
@ -29,5 +29,8 @@ a:active {
|
|||
}
|
||||
|
||||
#img {
|
||||
margin-left: 50%;
|
||||
position: absolute;
|
||||
max-width: 5%;
|
||||
margin-left: 5%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
templateUrl: './header.component.html',
|
||||
|
|
@ -7,9 +8,12 @@ import { Component, OnInit } from '@angular/core';
|
|||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
constructor(){
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -28,7 +28,12 @@ export class SigninComponent implements OnInit {
|
|||
if (email !== '' && password !== '') {
|
||||
this.authService.signin(email, password).subscribe((resp) => {
|
||||
console.log('Component Signin: ', resp);
|
||||
this.router.navigate(['tableau-de-bord']);
|
||||
//if(resp == ){
|
||||
this.router.navigate(['tableau-de-bord']);
|
||||
//}else{
|
||||
// window.alert("Votre identifiant/mot de passe est erroné");
|
||||
//}
|
||||
console.log('Component Signin: ', resp);
|
||||
});
|
||||
} else {
|
||||
// afficher une erreur à l'utilisateur
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue