Merge branch 'dev' into aline
This commit is contained in:
commit
44d00b0217
28 changed files with 485 additions and 11858 deletions
11608
package-lock.json
generated
11608
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -23,7 +23,6 @@ import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.co
|
||||||
import { MeteoComponent } from './components/meteo/meteo.component';
|
import { MeteoComponent } from './components/meteo/meteo.component';
|
||||||
import { HumeurComponent } from './components/humeur/humeur.component';
|
import { HumeurComponent } from './components/humeur/humeur.component';
|
||||||
import { CalendrierComponent } from './components/calendrier/calendrier.component';
|
import { CalendrierComponent } from './components/calendrier/calendrier.component';
|
||||||
import { AvatarComponent } from './components/avatar/avatar.component';
|
|
||||||
import { CardMemberComponent } from './components/card-member/card-member.component';
|
import { CardMemberComponent } from './components/card-member/card-member.component';
|
||||||
import { ToDoListComponent } from './components/to-do-list/to-do-list.component';
|
import { ToDoListComponent } from './components/to-do-list/to-do-list.component';
|
||||||
import { TacheComponent } from './components/tache/tache.component';
|
import { TacheComponent } from './components/tache/tache.component';
|
||||||
|
@ -66,7 +65,6 @@ import { EmoticonComponent } from './emoticon/emoticon.component';
|
||||||
MeteoComponent,
|
MeteoComponent,
|
||||||
HumeurComponent,
|
HumeurComponent,
|
||||||
CalendrierComponent,
|
CalendrierComponent,
|
||||||
AvatarComponent,
|
|
||||||
CardMemberComponent,
|
CardMemberComponent,
|
||||||
ToDoListComponent,
|
ToDoListComponent,
|
||||||
TacheComponent,
|
TacheComponent,
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<p>avatar works!</p>
|
|
|
@ -1,25 +0,0 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { AvatarComponent } from './avatar.component';
|
|
||||||
|
|
||||||
describe('AvatarComponent', () => {
|
|
||||||
let component: AvatarComponent;
|
|
||||||
let fixture: ComponentFixture<AvatarComponent>;
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
await TestBed.configureTestingModule({
|
|
||||||
declarations: [ AvatarComponent ]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(AvatarComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,15 +0,0 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-avatar',
|
|
||||||
templateUrl: './avatar.component.html',
|
|
||||||
styleUrls: ['./avatar.component.scss']
|
|
||||||
})
|
|
||||||
export class AvatarComponent implements OnInit {
|
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1 +1,23 @@
|
||||||
<p>card-member works!</p>
|
<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 class="buttons text-center"><button button type="button" class="btn btn-outline-primary px-4"
|
||||||
|
routerLink="../modifier-membre"
|
||||||
|
routerLinkActive="active-custom">
|
||||||
|
Modifier
|
||||||
|
</button><button button type="button" class="btn btn-primary px-4"
|
||||||
|
routerLink="../supprimer-membre"
|
||||||
|
routerLinkActive="active-custom">
|
||||||
|
Supprimer
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
#couleur{
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background: black;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
min-height: 22rem;
|
||||||
|
border: none;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.fonts {
|
||||||
|
font-size: 11px
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons button:nth-child(1) {
|
||||||
|
margin-top: 5px;
|
||||||
|
border: 1px solid #7879F1 !important;
|
||||||
|
color: #7879F1;
|
||||||
|
height: 40px;
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons button:nth-child(1):hover {
|
||||||
|
margin-top: 5px;
|
||||||
|
border: 1px solid #7879F1 !important;
|
||||||
|
color: #fff;
|
||||||
|
height: 40px;
|
||||||
|
width: 150px;
|
||||||
|
background-color: #7879F1
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons button:nth-child(2) {
|
||||||
|
margin-top: 5px;
|
||||||
|
border: 1px solid #7879F1 !important;
|
||||||
|
background-color: #7879F1;
|
||||||
|
color: #fff;
|
||||||
|
height: 40px;
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons button:nth-child(2):hover {
|
||||||
|
margin-top: 5px;
|
||||||
|
border: 1px solid #bd4646 !important;
|
||||||
|
background-color: #bd4646;
|
||||||
|
color: #fff;
|
||||||
|
height: 40px;
|
||||||
|
width: 150px;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-card-member',
|
selector: 'app-card-member',
|
||||||
|
@ -6,10 +6,12 @@ import { Component, OnInit } from '@angular/core';
|
||||||
styleUrls: ['./card-member.component.scss']
|
styleUrls: ['./card-member.component.scss']
|
||||||
})
|
})
|
||||||
export class CardMemberComponent implements OnInit {
|
export class CardMemberComponent implements OnInit {
|
||||||
|
@Input() membre: any;
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,45 @@
|
||||||
<div *ngFor="let menu of listMenus">
|
<div *ngFor="let menu of listMenus">
|
||||||
<p>{{ menu.dateMenu }} {{ menu.libelle }}</p>
|
<p>{{ menu.dateMenu }} {{ menu.libelle }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ng-template #content let-modal>
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="modal-basic-title">
|
||||||
|
Ajouter un menu
|
||||||
|
</h4>
|
||||||
|
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
|
||||||
|
|
||||||
|
<span aria-hidden="true">
|
||||||
|
×
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form [formGroup]="menuForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="dateMenu">
|
||||||
|
Date
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="dateMenu" class="form-control" formControlName="dateMenuFc" placeholder="yyyy-mm-dd" name="date"
|
||||||
|
>
|
||||||
|
<input id="libelle" class="form-control" formControlName="libelleFc" placeholder="" name="libelle"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-outline-dark" (click)="modal.close(saveMenu())">
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<button class="btn btn-lg btn-outline-primary" (click)="open(content)">
|
||||||
|
Ajouter un menu
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,6 +2,13 @@ import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Menu } from 'src/app/models/menu';
|
import { Menu } from 'src/app/models/menu';
|
||||||
import { MenusService } from 'src/app/services/menus.service';
|
import { MenusService } from 'src/app/services/menus.service';
|
||||||
|
import {NgbModal, ModalDismissReasons} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormControl,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,16 +18,49 @@ import { MenusService } from 'src/app/services/menus.service';
|
||||||
styleUrls: ['./card-menu.component.scss']
|
styleUrls: ['./card-menu.component.scss']
|
||||||
})
|
})
|
||||||
export class CardMenuComponent implements OnInit {
|
export class CardMenuComponent implements OnInit {
|
||||||
|
closeResult = '';
|
||||||
public listMenus:any[];
|
public listMenus:any[];
|
||||||
|
public menuId : any;
|
||||||
|
public menuForm : FormGroup;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private menusService: MenusService,
|
private menusService: MenusService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute
|
private route: ActivatedRoute,
|
||||||
|
private modalService: NgbModal,
|
||||||
|
private fb: FormBuilder
|
||||||
) {
|
) {
|
||||||
this.listMenus=[];
|
this.listMenus=[];
|
||||||
|
this.menuId=0;
|
||||||
|
this.menuForm = new FormGroup({});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//ajout d'un menu
|
||||||
|
saveMenu(): void {
|
||||||
|
|
||||||
|
const dateValue = this.menuForm.value['dateMenuFc'];
|
||||||
|
const libelleValue = this.menuForm.value['libelleFc'];
|
||||||
|
|
||||||
|
const menu: Menu = {
|
||||||
|
dateMenu: dateValue,
|
||||||
|
libelle: libelleValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
// if (menu.dateMenu != undefined && menu.libelle != '') {
|
||||||
|
|
||||||
|
console.log(dateValue);
|
||||||
|
this.menusService.addMenu(menu)?.subscribe((resp) => {
|
||||||
|
this.router.navigate(['menu']);
|
||||||
|
});
|
||||||
|
// } else {
|
||||||
|
// this.router.navigate(['menu']);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
//affichage des menus d'une team
|
//affichage des menus d'une team
|
||||||
this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
|
this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
|
||||||
|
@ -28,6 +68,42 @@ this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
|
||||||
this.listMenus=listMenus;
|
this.listMenus=listMenus;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.menuForm = this.fb.group(
|
||||||
|
{
|
||||||
|
dateMenuFc: new FormControl('',[Validators.required]),
|
||||||
|
libelleFc: new FormControl('',[Validators.required]),
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open(content: any) {
|
||||||
|
this.modalService.open(content,
|
||||||
|
{ariaLabelledBy: 'menu'}).result.then((result)=> {
|
||||||
|
this.closeResult = `Closed with: ${result}`;
|
||||||
|
}, (reason) => {
|
||||||
|
this.closeResult =
|
||||||
|
`Dismissed ${this.getDismissReason(reason)}`;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getDismissReason(reason: any): string {
|
||||||
|
if (reason === ModalDismissReasons.ESC) {
|
||||||
|
return 'by pressing ESC';
|
||||||
|
} else if (reason === ModalDismissReasons.BACKDROP_CLICK) {
|
||||||
|
return 'by clicking on a backdrop';
|
||||||
|
} else {
|
||||||
|
return `with: ${reason}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//modif d'un menu
|
||||||
|
// this.menuId=this.route.snapshot.paramMap.get('id');
|
||||||
|
// this.menusService.getMenuById(this.menuId)
|
||||||
|
// .subscribe((this.listMenus:any)=>)
|
||||||
|
|
||||||
|
//delete d'un menu
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<nav class="wrapper">
|
<nav class="wrapper md-auto position-fixed ">
|
||||||
<ul class="nav flex-column">
|
<ul class="nav flex-column" id="sticky-sidebar">
|
||||||
<li class="nav-item" ngbNavItem="maTeam" >
|
<li class="nav-item" ngbNavItem="maTeam" >
|
||||||
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">
|
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">
|
||||||
<i class="bi bi-people-fill"></i>
|
<i class="bi bi-people-fill"></i>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
align-items: stretch;
|
align-items: left;
|
||||||
width: auto;
|
width: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: rgb(238, 238, 238);
|
background-color: rgb(238, 238, 238);
|
||||||
|
|
||||||
}
|
}
|
||||||
.nav{
|
.nav{
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
(keyup.enter)="addTache(todo.id)"
|
(keyup.enter)="addTache(todo.id)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{todo}}
|
|
||||||
|
|
||||||
<div class="element" *ngFor="let tache of todo.taches">
|
<div class="element" *ngFor="let tache of todo.taches">
|
||||||
<div class="element-gauche">
|
<div class="element-gauche">
|
||||||
|
|
|
@ -34,32 +34,12 @@ export class ToDoListComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
//this.refreshTodo();
|
|
||||||
this.beforeEditCache = '';
|
this.beforeEditCache = '';
|
||||||
this.casesRestantes=true;
|
this.casesRestantes=true;
|
||||||
this.filter='tous';
|
this.filter='tous';
|
||||||
this.idTodo = 4;
|
this.idTodo = 4;
|
||||||
this.todoTitle = '';
|
this.todoTitle = '';
|
||||||
/* this.todos = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
texte: 'Finish Angular Screencast',
|
|
||||||
etat: false,
|
|
||||||
editing: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
texte: 'Take over world',
|
|
||||||
etat: false,
|
|
||||||
editing: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
texte: 'One more thing',
|
|
||||||
etat: false,
|
|
||||||
editing: false,
|
|
||||||
},
|
|
||||||
]; */
|
|
||||||
}
|
}
|
||||||
//ajouter tache
|
//ajouter tache
|
||||||
|
|
||||||
|
@ -76,38 +56,28 @@ console.log(idTodoList);
|
||||||
this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
|
this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
})
|
})
|
||||||
/* if (this.todoTitle.trim().length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.todos.push({
|
|
||||||
id: this.idTodo,
|
|
||||||
title: this.todoTitle,
|
|
||||||
completed: false,
|
|
||||||
editing: false,
|
|
||||||
});
|
|
||||||
this.todoTitle = '';
|
|
||||||
this.idTodo++; */
|
|
||||||
}
|
|
||||||
/* if (contact.nom !== '') {
|
|
||||||
this.repertoireService.addContact(contact).subscribe((resp) => {
|
|
||||||
this.router.navigate(['repertoire/']);
|
|
||||||
}); */
|
|
||||||
|
|
||||||
|
|
||||||
//modifier la tâche
|
//modifier par l'input
|
||||||
modifier(tache: Tache): void {
|
modifier(tache: Tache): void {
|
||||||
this.beforeEditCache = tache.texte;
|
this.beforeEditCache = tache.texte;
|
||||||
tache.editing = true;
|
tache.editing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// modifier l'apparence focus
|
// ajouter la modification dans la liste
|
||||||
doneEdit(tache: Tache): void {
|
doneEdit(tache: Tache): void {
|
||||||
if (tache.texte.trim().length === 0) {
|
if (tache.texte.trim().length === 0) {
|
||||||
tache.texte = this.beforeEditCache;
|
tache.texte = this.beforeEditCache;
|
||||||
}
|
}
|
||||||
this.casesRestantes= this.casesQuiRestes();
|
this.casesRestantes= this.casesQuiRestes();
|
||||||
tache.editing = false;
|
tache.editing = false;
|
||||||
|
this.TodoService.updateTache(tache).subscribe((resp)=>{
|
||||||
|
console.log(tache);
|
||||||
|
window.location.reload();
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// annuler la modification
|
// annuler la modification
|
||||||
|
|
|
@ -4,6 +4,4 @@ import { Team } from './team';
|
||||||
export interface Menu {
|
export interface Menu {
|
||||||
libelle: string;
|
libelle: string;
|
||||||
dateMenu: Date;
|
dateMenu: Date;
|
||||||
membre: Membre;
|
|
||||||
team: Team;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
</div>
|
<div class="col-9 offset-2" id="main">
|
||||||
<div class=" col compte text-center">
|
<h1>Ma team</h1>
|
||||||
<h1>Ma Team</h1>
|
|
||||||
<main class="contenu-compte">
|
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
<button button type="button" class="btn btn-primary btn-lg"
|
|
||||||
routerLink="../creation-team"
|
|
||||||
routerLinkActive="active-custom">Créer ma team</button>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
<button button type="button" class="btn btn-primary btn-lg"
|
<button button type="button" class="btn btn-primary btn-lg"
|
||||||
routerLink="../modifier-compte"
|
routerLink="../modifier-compte"
|
||||||
|
@ -26,15 +19,13 @@
|
||||||
routerLink="../ajout-membre"
|
routerLink="../ajout-membre"
|
||||||
routerLinkActive="active-custom">Ajouter un membre</button>
|
routerLinkActive="active-custom">Ajouter un membre</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="row">
|
||||||
<button button type="button" class="btn btn-primary btn-lg"
|
<div class="col" *ngFor="let membreData of listMembres">
|
||||||
routerLink="../modifier-membre"
|
<app-card-member [membre]="membreData">
|
||||||
routerLinkActive="active-custom">Modifier ce membre</button>
|
</app-card-member>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
<button button type="button" class="btn btn-primary btn-lg"
|
|
||||||
routerLink="../supprimer-membre"
|
|
||||||
routerLinkActive="active-custom">Supprimer ce membre</button>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
.contenu.compte{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
button{
|
button{
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { MembreService } from 'src/app/services/membre.service';
|
||||||
|
import { TeamService } from 'src/app/services/team.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-account',
|
selector: 'app-page-account',
|
||||||
|
@ -6,10 +8,16 @@ import { Component, OnInit } from '@angular/core';
|
||||||
styleUrls: ['./page-account.component.scss']
|
styleUrls: ['./page-account.component.scss']
|
||||||
})
|
})
|
||||||
export class PageAccountComponent implements OnInit {
|
export class PageAccountComponent implements OnInit {
|
||||||
|
public listMembres: any[];
|
||||||
|
|
||||||
constructor() { }
|
constructor(private teamService: TeamService, private membreService: MembreService) {
|
||||||
|
this.listMembres = [];
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.membreService.getMembres().subscribe((membres: any[]) => {
|
||||||
|
this.listMembres = membres;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
</div>
|
<div class="col-9 offset-2" id="main">
|
||||||
|
<div class="form-addMember">
|
||||||
<div class=" col addMember-form text-center">
|
|
||||||
<h1>Ajouter un membre</h1>
|
|
||||||
<main class="form-addMember">
|
|
||||||
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm">
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="color"
|
<input type="color"
|
||||||
|
@ -137,6 +134,8 @@
|
||||||
[disabled]="addMemberForm.invalid"
|
[disabled]="addMemberForm.invalid"
|
||||||
>Ajouter le membre</button>
|
>Ajouter le membre</button>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ export class PageAddMemberComponent implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
if (membre.email !== '' && membre.password !== '') {
|
if (membre.email !== '' && membre.password !== '') {
|
||||||
this.authService.signup(membre).subscribe((resp) => {
|
this.membreService.addMembre(membre).subscribe((resp) => {
|
||||||
this.router.navigate(['compte']);
|
this.router.navigate(['compte']);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,3 +1,29 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
|
</div>
|
||||||
|
<div class=" col compte text-center">
|
||||||
|
<h1>Menu de la semaine</h1>
|
||||||
|
<main class="contenu-compte">
|
||||||
<app-card-menu></app-card-menu>
|
<app-card-menu></app-card-menu>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<div class="signup-form text-center">
|
<div class="signup-form text-center">
|
||||||
<h1>Inscrivez-vous !</h1>
|
<h1>Inscrivez-vous !</h1>
|
||||||
|
<label for="floatingInputcouleur">Choisissez une couleur</label>
|
||||||
<main class="form-signup">
|
<main class="form-signup">
|
||||||
<form (ngSubmit)="onSubmit()" [formGroup]="signupForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="signupForm">
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
|
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
|
||||||
formControlName="couleurFc">
|
formControlName="couleurFc">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -27,7 +27,7 @@ export class MembreService {
|
||||||
addMembre(membre: Membre): Observable<any> {
|
addMembre(membre: Membre): Observable<any> {
|
||||||
console.log(membre);
|
console.log(membre);
|
||||||
|
|
||||||
return this.http.post(`${this.apiUrl}/membres/add`, membre);
|
return this.http.post(`${this.apiUrl}/membres/sign-up`, membre);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMembre(membre: Membre): Observable<any> {
|
deleteMembre(membre: Membre): Observable<any> {
|
||||||
|
|
|
@ -33,10 +33,15 @@ apiUrl: string;
|
||||||
return this.http.get(`${this.apiUrl}/menus/` + id);
|
return this.http.get(`${this.apiUrl}/menus/` + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
addMenu(menu: Menu): Observable<any> {
|
addMenu(menu: Menu): Observable<any> | void {
|
||||||
console.log(menu);
|
console.log(menu);
|
||||||
|
const teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
if (teamId){
|
||||||
|
return this.http.post(`${this.apiUrl}/menus/add/${teamId}`, menu);
|
||||||
|
}else {
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.post(`${this.apiUrl}/menus/add`, menu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMenu(id: any): Observable<any> {
|
deleteMenu(id: any): Observable<any> {
|
||||||
|
|
|
@ -21,11 +21,18 @@ export class TodoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteTacheById(idTache: any): Observable<any> {
|
deleteTacheById(idTache: any): Observable<any> {
|
||||||
return this.http.delete(`${this.apiUrl}/taches/delete/${idTache}`,{responseType:'text'});
|
return this.http.delete(`${this.apiUrl}/taches/delete/${idTache}`, {
|
||||||
|
responseType: 'text',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
addTache(newtache: Tache, idTodoList: number): Observable<any> {
|
addTache(newtache: Tache, idTodoList: number): Observable<any> {
|
||||||
console.log(newtache);
|
// console.log(newtache);
|
||||||
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
|
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateTache(tache: Tache): Observable<any> {
|
||||||
|
console.log(tache);
|
||||||
|
return this.http.put(`${this.apiUrl}/taches/update/1`, tache);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import jwt_decode from 'jwt-decode';
|
import jwt_decode from 'jwt-decode';
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
|
@ -42,4 +43,17 @@ return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getRole(): string | null {
|
||||||
|
const token = this.getToken();
|
||||||
|
if(token){
|
||||||
|
const decodedToken = jwt_decode<any>(token);
|
||||||
|
const role= decodedToken.auth[0].authority;
|
||||||
|
return role;
|
||||||
|
}else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>OrganizeeFront</title>
|
<title>Organizee</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
|
Loading…
Add table
Reference in a new issue