Merge branch 'dev' into aline

This commit is contained in:
AlineRinquin 2022-02-25 16:31:53 +01:00 committed by GitHub
commit 2e36982415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 418 additions and 171 deletions

View File

@ -42,6 +42,7 @@ import { DayPilot, DayPilotModule } from "@daypilot/daypilot-lite-angular";
import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr';
import { CardAvatarComponent } from './components/card-avatar/card-avatar.component';
import { DeconnexionComponent } from './components/deconnexion/deconnexion.component';
registerLocaleData(localeFr)
@NgModule({
@ -82,6 +83,7 @@ registerLocaleData(localeFr)
PageDeleteAccountComponent,
PageUpdateAccountComponent,
CardAvatarComponent,
DeconnexionComponent,
],
imports: [

View File

@ -0,0 +1,7 @@
<button
type="button"
class="btn btn-outline-primary btn-circle btn-xl"
(click)="onClickDeco()"
>
Se déconnecter
</button>

View 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;
}

View 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();
});
});

View 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']);
}
}

View File

@ -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>

View File

@ -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;
}

View File

@ -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 {
}
}
}

View File

@ -1,31 +1,48 @@
<app-header></app-header>
<app-deconnexion></app-deconnexion>
<div class="container-fluid">
<div class="row">
<app-side-bar></app-side-bar>
<div class="col-9 offset-2" id="main">
<h1>Ma team</h1>
<div class="d-flex justify-content-center">
<button button type="button" class="btn btn-primary btn-lg"
routerLink="../modifier-compte"
routerLinkActive="active-custom">Modifier mon compte</button>
</div>
<div class="d-flex justify-content-center">
<button button type="button" class="btn btn-primary btn-lg"
routerLink="../supprimer-compte"
routerLinkActive="active-custom">Supprimer mon compte</button>
</div>
<div class="d-flex justify-content-center">
<button button type="button" class="btn btn-primary btn-lg"
routerLink="../ajout-membre"
routerLinkActive="active-custom">Ajouter un membre</button>
</div>
<div class="row">
<div class="col" *ngFor="let membreData of listMembres">
<app-card-member [membre]="membreData">
</app-card-member>
</div>
</div>
<h1>Ma team</h1>
<div class="d-flex justify-content-center">
<button
button
type="button"
class="btn btn-primary btn-lg"
routerLink="../modifier-compte"
routerLinkActive="active-custom"
>
Modifier mon compte
</button>
</div>
<div class="d-flex justify-content-center">
<button
button
type="button"
class="btn btn-primary btn-lg"
routerLink="../supprimer-compte"
routerLinkActive="active-custom"
>
Supprimer mon compte
</button>
</div>
<div class="d-flex justify-content-center">
<button
button
type="button"
class="btn btn-primary btn-lg"
routerLink="../ajout-membre"
routerLinkActive="active-custom"
>
Ajouter un membre
</button>
</div>
<div class="row">
<div class="col" *ngFor="let membreData of listMembres">
<app-card-member [membre]="membreData"> </app-card-member>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,5 @@
<app-header></app-header>
<div class="container-fluid">
<div class="row">
<app-side-bar></app-side-bar>
@ -6,12 +7,14 @@
<div class="form-addMember">
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm">
<div class="form-floating">
<input type="color"
class="form-control"
id="floatingInputcouleur"
placeholder=""
name="couleur"
formControlName="couleurFc">
<input
type="color"
class="form-control"
id="floatingInputcouleur"
placeholder=""
name="couleur"
formControlName="couleurFc"
/>
</div>
<div class="form-floating">
<input
@ -68,7 +71,9 @@
!addMemberForm.controls['dateNaissanceFc'].valid
}"
/>
<label for="floatingInputdateNaissance">VOTRE DATE DE NAISSANCE</label>
<label for="floatingInputdateNaissance"
>VOTRE DATE DE NAISSANCE</label
>
</div>
<div class="form-floating">
<input
@ -97,8 +102,8 @@
name="Role"
formControlName="roleFc"
>
<option value="ROLE_PARENT">Adulte</option>
<option value="ROLE_ENFANT">Enfant</option>
<option value="ROLE_PARENT">Adulte</option>
<option value="ROLE_ENFANT">Enfant</option>
</select>
<label value="ROLE_PARENT">Sélectionner un profil</label>
</div>
@ -138,17 +143,20 @@
!addMemberForm.controls['passwordConfirmFc'].valid
}"
/>
<label for="floatingPasswordConfirm">CONFIRMEZ VOTRE MOT DE PASSE</label>
<label for="floatingPasswordConfirm"
>CONFIRMEZ VOTRE MOT DE PASSE</label
>
</div>
<button
class="w-100 btn btn-lg btn-outline-success"
type="submit"
[disabled]="addMemberForm.invalid"
>Ajouter le membre</button>
>
Ajouter le membre
</button>
</form>
</div>
</div>
</div>
</div>

View File

@ -1,37 +1,80 @@
<app-header></app-header>
<app-side-bar></app-side-bar>
<div class="alert alert-{{alert.type}}" role="alert" style="position:absolute;z-index:999;top:50%;left:40%; width: 500px;" *ngIf="isShow" id="showAlert">
{{alert.content}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close" (click)="onClickCloseAlert()">
<span aria-hidden="true">&times;</span>
</button>
<div
class="alert alert-{{ alert.type }}"
role="alert"
style="position: absolute; z-index: 999; top: 50%; left: 40%; width: 500px"
*ngIf="isShow"
id="showAlert"
>
{{ alert.content }}
<button
type="button"
class="close"
data-dismiss="alert"
aria-label="Close"
(click)="onClickCloseAlert()"
>
<span aria-hidden="true">&times;</span>
</button>
</div>
<div style="display: flex;">
<div style="width:150px;">
<app-side-bar></app-side-bar>
</div>
<div style="width: 100%;">
<div class="wrap">
<div class="left">
<daypilot-navigator [config]="navigatorConfig" [(date)]="date" #navigator></daypilot-navigator>
</div>
<div class="main">
<div style="width:100%; margin:10px">
<a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;" (click)="navigatePrevious($event)">Previous</a>
<a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;" (click)="navigateToday($event)">Today</a>
<a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;" (click)="navigateNext($event)">Next</a>
team : {{teamId}} - user: {{userId}} - role: {{role}}
<span style="float:right"><a href="#" class="btn btn-sm btn-primary" style="margin-right:5px;">Ajouter un évènement</a></span>
</div>
<daypilot-calendar [config]="config" [events]="events" #calendar (viewChange)="viewChange()"></daypilot-calendar>
</div>
<div style="display: flex">
<div style="width: 150px">
<app-side-bar></app-side-bar>
</div>
<div style="width: 100%">
<div class="wrap">
<div class="left">
<daypilot-navigator
[config]="navigatorConfig"
[(date)]="date"
#navigator
></daypilot-navigator>
</div>
<div class="main">
<div style="width: 100%; margin: 10px">
<a
href="#"
class="btn btn-sm btn-primary"
style="margin-right: 5px"
(click)="navigatePrevious($event)"
>Previous</a
>
<a
href="#"
class="btn btn-sm btn-primary"
style="margin-right: 5px"
(click)="navigateToday($event)"
>Today</a
>
<a
href="#"
class="btn btn-sm btn-primary"
style="margin-right: 5px"
(click)="navigateNext($event)"
>Next</a
>
team : {{ teamId }} - user: {{ userId }} - role: {{ role }}
<span style="float: right"
><a
href="#"
class="btn btn-sm btn-primary"
style="margin-right: 5px"
>Ajouter un évènement</a
></span
>
</div>
<daypilot-calendar
[config]="config"
[events]="events"
#calendar
(viewChange)="viewChange()"
></daypilot-calendar>
</div>
</div>
</div>
</div>
</div>

View File

@ -13,25 +13,74 @@
formControlName="couleurFc">
</div>
<div class="form-floating">
<input type="text"
class="form-control"
id="floatingInputlastName"
placeholder=""
name="lastName"
formControlName="lastNameFc">
<label for="floatingInputlastName">Nom</label>
<div class="form-floating">
<input
type="text"
class="form-control"
id="floatingInputlastName"
placeholder=""
name="lastName"
formControlName="lastNameFc"
/>
<label for="floatingInputlastName">Nom</label>
</div>
<div class="form-floating">
<input
type="text"
class="form-control"
id="floatingInputfirstName"
placeholder=""
name="firstName"
formControlName="firstNameFc"
/>
<label for="floatingInputfirstName">Prénom</label>
</div>
<div class="form-floating">
<input
type="text"
class="form-control"
id="floatingInputTelephone"
placeholder=""
name="telephone"
formControlName="telephoneFc"
/>
<label for="floatingInputfirstName">Téléphone</label>
</div>
<div class="form-floating">
<input
type="email"
class="form-control"
id="floatingInput"
placeholder=""
name="email"
formControlName="emailFc"
/>
<label for="floatingInput">Adresse email</label>
</div>
<div class="form-floating">
<input
type="date"
class="form-control"
id="floatingInputdateNaissance"
placeholder=""
name="dateNaissance"
formControlName="dateNaissanceFc"
/>
<label for="floatingInputfirstName">Date de naissance</label>
</div>
</div>
<div class="form-floating">
<input type="text"
class="form-control"
id="floatingInputfirstName"
placeholder=""
name="firstName"
formControlName="firstNameFc">
<label for="floatingInputfirstName">Prénom</label>
<div class="form-floating">
<input
type="text"
class="form-control"
id="floatingInputAdresse"
placeholder=""
name="adresse"
formControlName="adresseFc"
/>
<label for="floatingInputfirstName">Adresse</label>
</div>
</div>
@ -85,4 +134,5 @@
</form>
</main>
</div>
</div>
</div>

View File

@ -1,27 +1,40 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col team-form text-center">
<h1>Créer votre team</h1>
<main class="form-team">
<form (ngSubmit)="onSubmit()" [formGroup]="teamForm">
<div class="form-floating">
<input type="text"
class="form-control"
id="floatingInputName"
placeholder=""
name="name"
formControlName="nameFc"
[ngClass]="{'is-valid' : teamForm.controls['nameFc'].touched && teamForm.controls['nameFc'].valid,
'is-invalid': teamForm.controls['nameFc'].touched && !teamForm.controls['nameFc'].valid}">
<label for="floatingInputName">Nom</label>
</div>
<button class="w-100 btn btn-lg btn-success"
type="submit"
[disabled]="teamForm.invalid">Je crée ma team</button>
</form>
</main>
</div>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class="col team-form text-center">
<h1>Créer votre team</h1>
<main class="form-team">
<form (ngSubmit)="onSubmit()" [formGroup]="teamForm">
<div class="form-floating">
<input
type="text"
class="form-control"
id="floatingInputName"
placeholder=""
name="name"
formControlName="nameFc"
[ngClass]="{
'is-valid':
teamForm.controls['nameFc'].touched &&
teamForm.controls['nameFc'].valid,
'is-invalid':
teamForm.controls['nameFc'].touched &&
!teamForm.controls['nameFc'].valid
}"
/>
<label for="floatingInputName">Nom</label>
</div>
<button
class="w-100 btn btn-lg btn-success"
type="submit"
[disabled]="teamForm.invalid"
>
Je crée ma team
</button>
</form>
</main>
</div>
</div>

View File

@ -1,11 +1,10 @@
<app-header></app-header>
<app-side-bar></app-side-bar>
<app-deconnexion></app-deconnexion>
<div class="container">
<div>
<h3 class="titre">Bienvenue {{conectedUser.prenom}}!!</h3>
<h3 class="titre">Bienvenue {{ conectedUser.prenom }}!!</h3>
</div>
<div class="row d-flex align-items-center flex-row">
@ -36,4 +35,5 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -1,12 +1,11 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<div class="col compte text-center">
<h1>Supprimer ce membre</h1>
<main class="contenu-compte">
</main>
<main class="contenu-compte"></main>
</div>
</div>

View File

@ -1,4 +1,5 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar class="sidebarMenu"></app-side-bar>

View File

@ -1,41 +1,63 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center py-3 border">
<div>
<button class="btn btn-sm btn-rounded btn-secondary m-3" type="submit">Tous les contacts
</button>
<button routerLink="/ajouter-contact" class="btn btn-sm btn-rounded btn-secondary m-3">
Ajouter un contact
</button>
<div class="col compte text-center py-3 border">
<div>
<button class="btn btn-sm btn-rounded btn-secondary m-3" type="submit">
Tous les contacts
</button>
<button
routerLink="/ajouter-contact"
class="btn btn-sm btn-rounded btn-secondary m-3"
>
Ajouter un contact
</button>
<div class="input-group mb-3 d-flex justify-content-center">
<input type="text" class="form-control" placeholder="Rechercher un contact"
aria-label="Rechercher un contact" aria-describedby="basic-addon2" #word
(keyup)="onSearchChange(word.value)">
<div class="input-group mb-3 d-flex justify-content-center">
<input
type="text"
class="form-control"
placeholder="Rechercher un contact"
aria-label="Rechercher un contact"
aria-describedby="basic-addon2"
#word
(keyup)="onSearchChange(word.value)"
/>
<div class="input-group-append"></div>
</div>
<div>
<h4>Liste des Contacts</h4>
</div>
<div class="row justify-content-evenly">
<div class="col-4">
<div class="row my-3 d-flex justify-content-center flex-row" *ngFor="let personne of listContact"
(click)="onClick(personne)">
<div class="couleur col-4" [style.background-color]="personne.couleur"></div>
<span class="fiche-contact col-7">{{ personne.prenom }} {{ personne.nom }}</span>
</div>
</div>
<div class="col-4" *ngIf="openDetails">
<app-fiche-contact [personne]="openDetails" (clickDelete)="onClickDelete($event)">
</app-fiche-contact>
</div>
</div>
<div class="input-group-append"></div>
</div>
<div>
<h4>Liste des Contacts</h4>
</div>
<div class="row justify-content-evenly">
<div class="col-4">
<div
class="row my-3 d-flex justify-content-center flex-row"
*ngFor="let personne of listContact"
(click)="onClick(personne)"
>
<div
class="couleur col-4"
[style.background-color]="personne.couleur"
></div>
<span class="fiche-contact col-7"
>{{ personne.prenom }} {{ personne.nom }}</span
>
</div>
</div>
<div class="col-4" *ngIf="openDetails">
<app-fiche-contact
[personne]="openDetails"
(clickDelete)="onClickDelete($event)"
>
</app-fiche-contact>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,5 +1,6 @@
<app-header></app-header>
<app-side-bar></app-side-bar>
<div class="d-flex align-items-stretch">
<div class="row">
<div class="col" *ngFor="let todos of result">

View File

@ -1,12 +1,11 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<div class="col compte text-center">
<h1>Modifier votre compte</h1>
<main class="contenu-compte">
</main>
<main class="contenu-compte"></main>
</div>
</div>

View File

@ -1,12 +1,11 @@
<app-header></app-header>
<div class="row">
<div class="col-md-auto">
<app-side-bar></app-side-bar>
</div>
<div class=" col compte text-center">
<div class="col compte text-center">
<h1>Modifier ce membre</h1>
<main class="contenu-compte">
</main>
<main class="contenu-compte"></main>
</div>
</div>

View File

@ -20,6 +20,17 @@ tokenKey = environment.tokenKey;
}
}
public eraseToken(): string | null {
const token = localStorage.getItem(this.tokenKey);
if(token) {
this.tokenKey = '';
return token;
}else {
return null;
}
}
public getCurrentMembreId(): number | null {
const token = this.getToken();
if(token) {