commit
55101f50dd
137 changed files with 16705 additions and 2709 deletions
2
.vscode/settings.json
vendored
Normal file
2
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{
|
||||||
|
}
|
2
file
Normal file
2
file
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
truc
|
||||||
|
|
15148
package-lock.json
generated
15148
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -18,14 +18,18 @@
|
||||||
"@angular/platform-browser": "~13.0.0",
|
"@angular/platform-browser": "~13.0.0",
|
||||||
"@angular/platform-browser-dynamic": "~13.0.0",
|
"@angular/platform-browser-dynamic": "~13.0.0",
|
||||||
"@angular/router": "~13.0.0",
|
"@angular/router": "~13.0.0",
|
||||||
|
"@daypilot/daypilot-lite-angular": "^3.2.0",
|
||||||
|
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
||||||
"bootstrap": "^5.1.3",
|
"bootstrap": "^5.1.3",
|
||||||
|
"bootstrap-icons": "^1.8.1",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
|
"ngx-autofocus-fix": "^1.0.4",
|
||||||
"rxjs": "~7.4.0",
|
"rxjs": "~7.4.0",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"zone.js": "~0.11.4"
|
"zone.js": "~0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~13.0.3",
|
"@angular-devkit/build-angular": "^13.1.4",
|
||||||
"@angular/cli": "~13.0.3",
|
"@angular/cli": "~13.0.3",
|
||||||
"@angular/compiler-cli": "~13.0.0",
|
"@angular/compiler-cli": "~13.0.0",
|
||||||
"@types/jasmine": "~3.10.0",
|
"@types/jasmine": "~3.10.0",
|
||||||
|
|
|
@ -4,25 +4,35 @@ import { PageAccountComponent } from './pages/page-account/page-account.componen
|
||||||
import { PageAccueilComponent } from './pages/page-accueil/page-accueil.component';
|
import { PageAccueilComponent } from './pages/page-accueil/page-accueil.component';
|
||||||
import { PageAddMemberComponent } from './pages/page-add-member/page-add-member.component';
|
import { PageAddMemberComponent } from './pages/page-add-member/page-add-member.component';
|
||||||
import { PageAgendaComponent } from './pages/page-agenda/page-agenda.component';
|
import { PageAgendaComponent } from './pages/page-agenda/page-agenda.component';
|
||||||
|
import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component';
|
||||||
|
import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component';
|
||||||
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component';
|
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component';
|
||||||
|
import { PageDeleteAccountComponent } from './pages/page-delete-account/page-delete-account.component';
|
||||||
import { PageDeleteMemberComponent } from './pages/page-delete-member/page-delete-member.component';
|
import { PageDeleteMemberComponent } from './pages/page-delete-member/page-delete-member.component';
|
||||||
import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-forgot-password.component';
|
import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-forgot-password.component';
|
||||||
import { PageMenuSemaineComponent } from './pages/page-menu-semaine/page-menu-semaine.component';
|
import { PageMenuSemaineComponent } from './pages/page-menu-semaine/page-menu-semaine.component';
|
||||||
|
import { PageModifierContactComponent } from './pages/page-modifier-contact/page-modifier-contact.component';
|
||||||
import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.component';
|
import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.component';
|
||||||
import { PageRepertoireComponent } from './pages/page-repertoire/page-repertoire.component';
|
import { PageRepertoireComponent } from './pages/page-repertoire/page-repertoire.component';
|
||||||
import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component';
|
import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component';
|
||||||
import { PageSignupComponent } from './pages/page-signup/page-signup.component';
|
import { PageSignupComponent } from './pages/page-signup/page-signup.component';
|
||||||
import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.component';
|
import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.component';
|
||||||
|
import { PageUpdateAccountComponent } from './pages/page-update-account/page-update-account.component';
|
||||||
import { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component';
|
import { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component';
|
||||||
|
import { PageSupportComponent } from './pages/page-support/page-support.component';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: '', redirectTo: 'accueil', pathMatch: 'full' },
|
{ path: '', redirectTo: 'accueil', pathMatch: 'full' },
|
||||||
|
{ path: 'modifier-contact/:id', component: PageModifierContactComponent },
|
||||||
{ path: 'compte', component: PageAccountComponent },
|
{ path: 'compte', component: PageAccountComponent },
|
||||||
{ path: 'accueil', component: PageAccueilComponent },
|
{ path: 'accueil', component: PageAccueilComponent },
|
||||||
{ path: 'ajout-membre', component: PageAddMemberComponent },
|
{ path: 'ajout-membre', component: PageAddMemberComponent },
|
||||||
{ path: 'agenda', component: PageAgendaComponent },
|
{ path: 'agenda', component: PageAgendaComponent },
|
||||||
{ path: 'tableau-de-bord', component: PageDashboardComponent },
|
{ path: 'tableau-de-bord', component: PageDashboardComponent },
|
||||||
{ path: 'supprimer-membre', component: PageDeleteMemberComponent },
|
{ path: 'supprimer-membre', component: PageDeleteMemberComponent },
|
||||||
|
{ path: 'supprimer-compte', component: PageDeleteAccountComponent },
|
||||||
{ path: 'password-oublie', component: PageForgotPasswordComponent },
|
{ path: 'password-oublie', component: PageForgotPasswordComponent },
|
||||||
{ path: 'menu', component: PageMenuSemaineComponent },
|
{ path: 'menu', component: PageMenuSemaineComponent },
|
||||||
{ path: 'repertoire', component: PageRepertoireComponent },
|
{ path: 'repertoire', component: PageRepertoireComponent },
|
||||||
|
@ -30,6 +40,10 @@ const routes: Routes = [
|
||||||
{ path: 'creation-compte', component: PageSignupComponent },
|
{ path: 'creation-compte', component: PageSignupComponent },
|
||||||
{ path: 'to-do-list', component: PageToDoListComponent },
|
{ path: 'to-do-list', component: PageToDoListComponent },
|
||||||
{ path: 'modifier-membre', component: PageUpdateMemberComponent },
|
{ path: 'modifier-membre', component: PageUpdateMemberComponent },
|
||||||
|
{ path: 'modifier-compte', component: PageUpdateAccountComponent },
|
||||||
|
{ path: 'ajouter-contact', component: PageAjoutContactComponent },
|
||||||
|
{ path: 'creation-team', component: PageCreationTeamComponent },
|
||||||
|
{ path: 'page-support', component: PageSupportComponent},
|
||||||
{ path: '**', component: PageNotFoundComponent },
|
{ path: '**', component: PageNotFoundComponent },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule, LOCALE_ID } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { PageAccueilComponent } from './pages/page-accueil/page-accueil.component';
|
import { PageAccueilComponent } from './pages/page-accueil/page-accueil.component';
|
||||||
|
@ -21,9 +20,7 @@ import { PageUpdateMemberComponent } from './pages/page-update-member/page-updat
|
||||||
import { SigninComponent } from './components/signin/signin.component';
|
import { SigninComponent } from './components/signin/signin.component';
|
||||||
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component';
|
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component';
|
||||||
import { MeteoComponent } from './components/meteo/meteo.component';
|
import { MeteoComponent } from './components/meteo/meteo.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';
|
||||||
|
@ -32,7 +29,18 @@ import { FicheContactComponent } from './components/fiche-contact/fiche-contact.
|
||||||
import { PaginationComponent } from './components/pagination/pagination.component';
|
import { PaginationComponent } from './components/pagination/pagination.component';
|
||||||
import { CreneauComponent } from './components/creneau/creneau.component';
|
import { CreneauComponent } from './components/creneau/creneau.component';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||||
|
import { PageAjoutContactComponent } from './pages/page-ajout-contact/page-ajout-contact.component';
|
||||||
|
import { PageModifierContactComponent } from './pages/page-modifier-contact/page-modifier-contact.component';
|
||||||
|
import { PageCreationTeamComponent } from './pages/page-creation-team/page-creation-team.component';
|
||||||
|
import { AutofocusFixModule } from 'ngx-autofocus-fix';
|
||||||
|
import { FooterComponent } from './components/footer/footer.component';
|
||||||
|
import { PageDeleteAccountComponent } from './pages/page-delete-account/page-delete-account.component';
|
||||||
|
import { PageUpdateAccountComponent } from './pages/page-update-account/page-update-account.component';
|
||||||
|
import { DayPilot, DayPilotModule } from "@daypilot/daypilot-lite-angular";
|
||||||
|
import { registerLocaleData } from '@angular/common';
|
||||||
|
import localeFr from '@angular/common/locales/fr';
|
||||||
|
registerLocaleData(localeFr)
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
@ -55,16 +63,22 @@ import { HttpClientModule } from '@angular/common/http';
|
||||||
SigninComponent,
|
SigninComponent,
|
||||||
PageDashboardComponent,
|
PageDashboardComponent,
|
||||||
MeteoComponent,
|
MeteoComponent,
|
||||||
HumeurComponent,
|
|
||||||
CalendrierComponent,
|
CalendrierComponent,
|
||||||
AvatarComponent,
|
|
||||||
CardMemberComponent,
|
CardMemberComponent,
|
||||||
ToDoListComponent,
|
ToDoListComponent,
|
||||||
TacheComponent,
|
TacheComponent,
|
||||||
|
|
||||||
CardMenuComponent,
|
CardMenuComponent,
|
||||||
FicheContactComponent,
|
FicheContactComponent,
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
CreneauComponent,
|
CreneauComponent,
|
||||||
|
PageAjoutContactComponent,
|
||||||
|
PageModifierContactComponent,
|
||||||
|
PageCreationTeamComponent,
|
||||||
|
FooterComponent,
|
||||||
|
PageDeleteAccountComponent,
|
||||||
|
PageUpdateAccountComponent,
|
||||||
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
@ -72,8 +86,13 @@ import { HttpClientModule } from '@angular/common/http';
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
|
AutofocusFixModule.forRoot(),
|
||||||
|
DayPilotModule,
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
{provide: LOCALE_ID, useValue: "fr-FR" }
|
||||||
|
|
||||||
],
|
],
|
||||||
providers: [],
|
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<p>avatar works!</p>
|
|
|
@ -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 {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,135 @@
|
||||||
<p>card-menu works!</p>
|
<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">
|
||||||
|
<div class="input-group">
|
||||||
|
<input
|
||||||
|
type="date"
|
||||||
|
id="dateMenu"
|
||||||
|
class="form-control"
|
||||||
|
formControlName="dateMenuFc"
|
||||||
|
placeholder="Date"
|
||||||
|
name="date"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<input
|
||||||
|
id="repasMidi"
|
||||||
|
class="form-control"
|
||||||
|
formControlName="repasMidiFc"
|
||||||
|
placeholder="Repas du midi"
|
||||||
|
name="repasMidi"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<input
|
||||||
|
id="repasSoir"
|
||||||
|
class="form-control"
|
||||||
|
formControlName="repasSoirFc"
|
||||||
|
placeholder="Repas du soir"
|
||||||
|
name="repasSoir"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-outline-dark"
|
||||||
|
(click)="modal.close(saveMenu())"
|
||||||
|
>
|
||||||
|
Enregistrer
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-outline-warning" (click)="open(content)">
|
||||||
|
Ajouter un menu
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="container mt-5 menu">
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-md-auto" *ngFor="let menu of listMenus">
|
||||||
|
<div class="card p-3 py-4 align-items" style="width: 14rem">
|
||||||
|
<p class="jour">{{ menu.dateMenu | date: "EEEE":"fr" }}</p>
|
||||||
|
<div class="tag">
|
||||||
|
<p class="repas">Midi</p>
|
||||||
|
<p>{{ menu.repasMidi }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="tag">
|
||||||
|
<p class="repas">Soir</p>
|
||||||
|
<p>{{ menu.repasSoir }}</p>
|
||||||
|
</div>
|
||||||
|
<ng-template #content let-modal>
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="modal-basic-title">
|
||||||
|
Mettre à jour 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]="upMenuForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<input
|
||||||
|
type="date"
|
||||||
|
id="dateMenu"
|
||||||
|
class="form-control"
|
||||||
|
formControlName="dateMenuFc"
|
||||||
|
value="{{ menu.dateMenu }}"
|
||||||
|
placeholder="Date"
|
||||||
|
name="date"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="repasMidi"
|
||||||
|
class="form-control"
|
||||||
|
formControlName="repasMidiFc"
|
||||||
|
value="{{ menu.repasMidi }}"
|
||||||
|
placeholder="Repas du midi"
|
||||||
|
name="repasMidi"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="repasSoir"
|
||||||
|
class="form-control"
|
||||||
|
formControlName="repasSoirFc"
|
||||||
|
value="{{ menu.repasSoir }}"
|
||||||
|
placeholder="Repas du soir"
|
||||||
|
name="repasSoir"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-outline-dark"
|
||||||
|
(click)="modal.close(updateMenu(menu.id))"
|
||||||
|
>
|
||||||
|
Mettre à jour
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
<i class="bi bi-pencil-square" (click)="open(content)"></i>
|
||||||
|
<i class="bi bi-trash3" (click)="deleteMenu(menu.id)"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
.card {
|
||||||
|
min-height: 22rem;
|
||||||
|
margin-left: 75px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
border: 1px solid #f7c02b;
|
||||||
|
border-radius: 8px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 5px 5px 5px gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
margin-top: 20px;
|
||||||
|
background-color: #fad980;
|
||||||
|
margin-left: -8px;
|
||||||
|
width: 13rem;
|
||||||
|
border: 1px solid #fad980;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
.bi {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin-top: 10px;
|
||||||
|
color: black;
|
||||||
|
box-shadow: 5px 5px 5px gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jour {
|
||||||
|
font-weight: bolder;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
.repas {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
|
@ -1,4 +1,16 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { Menu } from 'src/app/models/menu';
|
||||||
|
import { MenusService } from 'src/app/services/menus.service';
|
||||||
|
import {NgbModal, ModalDismissReasons} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormControl,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-card-menu',
|
selector: 'app-card-menu',
|
||||||
|
@ -6,10 +18,134 @@ import { Component, OnInit } from '@angular/core';
|
||||||
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 menuId : any;
|
||||||
|
public menuForm : FormGroup;
|
||||||
|
public upMenuForm : FormGroup;
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
constructor(
|
||||||
|
private menusService: MenusService,
|
||||||
|
private router: Router,
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
private modalService: NgbModal,
|
||||||
|
private fb: FormBuilder
|
||||||
|
) {
|
||||||
|
this.listMenus=[];
|
||||||
|
this.menuForm = new FormGroup({});
|
||||||
|
this.upMenuForm = this.initForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//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']);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//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 menu: Menu = {
|
||||||
|
dateMenu: dateValue,
|
||||||
|
repasMidi: repasMidiValue,
|
||||||
|
repasSoir: repasSoirValue,
|
||||||
|
id: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(id_menu);
|
||||||
|
|
||||||
|
this.menusService.updateMenu(menu, id_menu)?.subscribe((resp) => {
|
||||||
|
console.log("ok");
|
||||||
|
this.router.navigate(['menu']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//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
|
||||||
|
saveMenu(): void {
|
||||||
|
|
||||||
|
const dateValue = this.menuForm.value['dateMenuFc'];
|
||||||
|
const repasMidiValue = this.menuForm.value['repasMidiFc'];
|
||||||
|
const repasSoirValue = this.menuForm.value['repasSoirFc'];
|
||||||
|
|
||||||
|
|
||||||
|
const menu: Menu = {
|
||||||
|
dateMenu: dateValue,
|
||||||
|
repasMidi: repasMidiValue,
|
||||||
|
repasSoir: repasSoirValue,
|
||||||
|
id: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
if (menu.dateMenu !=='') {
|
||||||
|
|
||||||
|
console.log(menu.dateMenu);
|
||||||
|
this.menusService.addMenu(menu)?.subscribe((resp) => {
|
||||||
|
this.router.navigate(['menu']);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
//affichage des menus d'une team
|
||||||
|
this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
|
||||||
|
console.log(listMenus);
|
||||||
|
this.listMenus=listMenus;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.menuForm = this.fb.group(
|
||||||
|
{
|
||||||
|
dateMenuFc: new FormControl('',[Validators.required]),
|
||||||
|
libelleFc: new FormControl('',[Validators.required]),
|
||||||
|
repasFc: 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}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +1,43 @@
|
||||||
<p>fiche-contact works!</p>
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="row d-flex justify-content-end align-items-center flex-row">
|
||||||
|
<div class="couleur col-7" [style.background-color]="personne.couleur"></div>
|
||||||
|
<div class="col-5">
|
||||||
|
<div class="col">
|
||||||
|
<button routerLink="../modifier-contact/{{personne.id}}"
|
||||||
|
class=" btn btn-sm btn-rounded btn-secondary mb-2">
|
||||||
|
Modifier
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<button class=" btn btn-sm btn-rounded btn-secondary" (click)="onClickDelete(personne.id)">
|
||||||
|
Supprimer
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row align-items-center">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="row my-3 d-flex justify-content-center flex-row">
|
||||||
|
<span class="fiche-contact col-7">{{ personne.prenom }} {{ personne.nom }} </span>
|
||||||
|
</div>
|
||||||
|
<div class="row my-3 d-flex justify-content-center flex-row">
|
||||||
|
<span i class="col-4 bi bi-telephone-inbound"></span>
|
||||||
|
<span class="fiche-contact col-7">{{ personne.telephone }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="row my-3 d-flex justify-content-center flex-row">
|
||||||
|
<i class="col-4 bi bi-envelope"></i>
|
||||||
|
<span class="fiche-contact col-7">{{ personne.email }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="row my-3 d-flex justify-content-center flex-row">
|
||||||
|
<i class="col-4 bi bi-calendar-heart"></i>
|
||||||
|
<span class="fiche-contact col-7">{{ personne.dateNaissance }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="row my-3 d-flex justify-content-center flex-row">
|
||||||
|
<i class="col-4 bi bi-map"></i>
|
||||||
|
<span class="fiche-contact col-7">{{ personne.adresse }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,33 @@
|
||||||
|
.btn-secondary {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #5a1e63 !important;
|
||||||
|
min-width: 100px;
|
||||||
|
border-radius: 55px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.couleur{
|
||||||
|
border: none;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 110px;
|
||||||
|
height: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info{
|
||||||
|
display:flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fiche-contact{
|
||||||
|
display:flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
border: 1px solid 8c2e9b;
|
||||||
|
padding: 10px;
|
||||||
|
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px,
|
||||||
|
rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
|
||||||
|
max-height: 1200px;
|
||||||
|
max-width: 350px;
|
||||||
|
}
|
|
@ -1,15 +1,20 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-fiche-contact',
|
selector: 'app-fiche-contact',
|
||||||
templateUrl: './fiche-contact.component.html',
|
templateUrl: './fiche-contact.component.html',
|
||||||
styleUrls: ['./fiche-contact.component.scss']
|
styleUrls: ['./fiche-contact.component.scss'],
|
||||||
})
|
})
|
||||||
export class FicheContactComponent implements OnInit {
|
export class FicheContactComponent implements OnInit {
|
||||||
|
@Input() personne: any;
|
||||||
|
@Output() clickDelete = new EventEmitter();
|
||||||
|
|
||||||
constructor() { }
|
constructor() {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {}
|
||||||
|
|
||||||
|
onClickDelete(numPerson: number){
|
||||||
|
window.alert("Le contact à bien été supprimé!")
|
||||||
|
this.clickDelete.emit(numPerson);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
12
src/app/components/footer/footer.component.html
Normal file
12
src/app/components/footer/footer.component.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="footer text-center" >
|
||||||
|
<h3>Plan du site</h3>
|
||||||
|
<div class="liens">
|
||||||
|
<a routerLink="../accueil" routerLinkActive="active-custom" class="nav-link">Page d'accueil</a>
|
||||||
|
<a routerLink="../tableau-de-bord" routerLinkActive="active-custom" class="nav-link">Tableau de bord</a>
|
||||||
|
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">Ma Team</a>
|
||||||
|
<a routerLink="../repertoire" routerLinkActive="active-custom" class="nav-link">Répertoire</a>
|
||||||
|
<a routerLink="../to-do-list" routerLinkActive="active-custom" class="nav-link">To-Do-List</a>
|
||||||
|
<a routerLink="../agenda" routerLinkActive="active-custom" class="nav-link">Agenda</a>
|
||||||
|
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">Menus</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
10
src/app/components/footer/footer.component.scss
Normal file
10
src/app/components/footer/footer.component.scss
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
.liens {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
color : blue;
|
||||||
|
font-size: smaller;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
|
@ -1,20 +1,20 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { AvatarComponent } from './avatar.component';
|
import { FooterComponent } from './footer.component';
|
||||||
|
|
||||||
describe('AvatarComponent', () => {
|
describe('FooterComponent', () => {
|
||||||
let component: AvatarComponent;
|
let component: FooterComponent;
|
||||||
let fixture: ComponentFixture<AvatarComponent>;
|
let fixture: ComponentFixture<FooterComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ AvatarComponent ]
|
declarations: [ FooterComponent ]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(AvatarComponent);
|
fixture = TestBed.createComponent(FooterComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
15
src/app/components/footer/footer.component.ts
Normal file
15
src/app/components/footer/footer.component.ts
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-footer',
|
||||||
|
templateUrl: './footer.component.html',
|
||||||
|
styleUrls: ['./footer.component.scss']
|
||||||
|
})
|
||||||
|
export class FooterComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||||
<div class="navbar-nav">
|
<div class="navbar-nav">
|
||||||
<img routerLink="accueil" routerLinkActive="active-custom" class="nav-link" style="max-height: 12% ; max-width: 12%" src="../../../assets/images/logo-organizee.png"/>
|
<img id="img" routerLink="accueil" routerLinkActive="active-custom" src="../../../assets/images/logo-organizee.png"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="navbar-brand" href="#">Organizee</a>
|
<a class="navbar-brand" href="#">Organizee</a>
|
||||||
|
|
|
@ -1,4 +1,33 @@
|
||||||
.navbar-brand {
|
.navbar-brand {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin-left: 10%;
|
margin-left: 12%;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 3rem;
|
||||||
|
color: #5d5fef;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited {
|
||||||
|
color: #5d5fef;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:focus {
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
background: #a5a6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #7879f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:active {
|
||||||
|
color: #5d5fef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-nav {
|
||||||
|
height: 6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#img {
|
||||||
|
margin-left: 50%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,22 @@
|
||||||
<p>humeur works!</p>
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<h2>Mon humeur :</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p><img src="{{monHumeurLien}}" alt="{{monHumeurTitle}}" *ngIf="monHumeurLien" ></p>
|
||||||
|
|
||||||
|
<p>Je modifie mon avatar :</p>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="humeur" *ngFor="let humor of tabHumeur; let i=index">
|
||||||
|
<img src="{{humor.lien}}" alt="{{humor.title}}" (click)="onChoixHumeur(i)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div >
|
||||||
|
|
||||||
|
|
||||||
|
</div> </div>
|
|
@ -0,0 +1,18 @@
|
||||||
|
p>img {
|
||||||
|
width: 85px;
|
||||||
|
height: 85px;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.humeur {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
background-color: #87AFC7;
|
||||||
|
text-align: center;
|
||||||
|
}
|
|
@ -7,9 +7,30 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class HumeurComponent implements OnInit {
|
export class HumeurComponent implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
monHumeurLien! : string[];
|
||||||
|
monHumeurTitle! : string[] ;
|
||||||
|
|
||||||
|
|
||||||
|
tabHumeur= [
|
||||||
|
{ title : "Je vais bien", lien : "assets/images/emoticon-heureux.png"},
|
||||||
|
{ title : "Je pleure", lien : "assets/images/emoticon-pleurer.png"},
|
||||||
|
{ title : "Je suis fatigué", lien : "assets/images/emoticon-fatigue.png"},
|
||||||
|
{ title : "Je suis en colère", lien : "assets/images/emoticon-insulter.png"},
|
||||||
|
{ title : "Je suis en joie", lien : "assets/images/emoticon-feter.png"} ]
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void { }
|
||||||
}
|
|
||||||
|
onChoixHumeur(numero: number){
|
||||||
|
this.monHumeurTitle= [this.tabHumeur[numero].title];
|
||||||
|
this.monHumeurLien= [this.tabHumeur[numero].lien];
|
||||||
|
|
||||||
|
console.log("humeur titre est : ", this.monHumeurTitle);
|
||||||
|
console.log("humeur lien est : ", this.monHumeurLien);
|
||||||
|
console.log("index humeur est : ", numero );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
<p>meteo works!</p>
|
<div class="meteo">
|
||||||
|
<iframe id="widget_autocomplete_preview" width="400" height="150" frameborder="1" border-radius="5"
|
||||||
|
src="https://meteofrance.com/widget/prevision/751010"> </iframe>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -1,11 +1,29 @@
|
||||||
<nav class="custom-side-bar flex-shrink-0 bg-white border-end">
|
<nav class="wrapper md-auto position-fixed ">
|
||||||
<div id="navbarNavAltMarkup">
|
<ul class="nav flex-column" id="sticky-sidebar">
|
||||||
<div class="navbar-nav">
|
<li class="nav-item" ngbNavItem="maTeam" >
|
||||||
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">Ma Team</a>
|
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">
|
||||||
<a routerLink="../repertoire" routerLinkActive="active-custom" class="nav-link">Répertoire</a>
|
<i class="bi bi-people-fill"></i>
|
||||||
<a routerLink="../to-do-list" routerLinkActive="active-custom" class="nav-link">To-Do-List</a>
|
Ma Team</a>
|
||||||
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">Menus</a>
|
</li>
|
||||||
<a routerLink="../agenda" routerLinkActive="active-custom" class="nav-link">Agenda</a>
|
<li class="nav-item">
|
||||||
</div>
|
<a routerLink="/repertoire" routerLinkActive="active-custom" class="nav-link">
|
||||||
</div>
|
<i class="bi bi-person-rolodex"></i>
|
||||||
|
Répertoire</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a routerLink="../to-do-list" routerLinkActive="active-custom" class="nav-link">
|
||||||
|
<i class="bi bi-check2-square"></i>
|
||||||
|
To-Do-List</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">
|
||||||
|
<i class='fas fa-pizza-slice'></i>
|
||||||
|
Menus</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a routerLink="../agenda" routerLinkActive="active-custom" class="nav-link">
|
||||||
|
<i class="bi bi-calendar-event"></i>
|
||||||
|
Agenda</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: left;
|
||||||
|
width: auto;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
background-color: rgb(238, 238, 238);
|
||||||
|
}
|
||||||
|
.nav{
|
||||||
|
margin-top: 20px;
|
||||||
|
align-items: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
a{
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
|
@ -1,40 +1,26 @@
|
||||||
|
|
||||||
<div class="signin-form text-center">
|
<div class="signin-form text-center">
|
||||||
<main class="form-signin">
|
<main class="form-signin">
|
||||||
<form (ngSubmit)="onSubmit(signinForm)" #signinForm="ngForm">
|
<form (ngSubmit)="onSubmit(signinForm)" #signinForm="ngForm">
|
||||||
|
<div class="connexion">
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="email"
|
<input type="email" class="form-control" id="floatingInput" placeholder="" name="email" ngModel required
|
||||||
class="form-control"
|
|
||||||
id="floatingInput"
|
|
||||||
placeholder=""
|
|
||||||
name="email"
|
|
||||||
ngModel
|
|
||||||
required
|
|
||||||
[ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['email'] != '' ,
|
[ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['email'] != '' ,
|
||||||
'is-invalid': signinForm.form.touched && signinForm.form.value['email'] == ''}">
|
'is-invalid': signinForm.form.touched && signinForm.form.value['email'] == ''}">
|
||||||
<label for="floatingInput">Adresse email</label>
|
<label for="floatingInput">Adresse email</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="password"
|
<input type="password" class="form-control" id="floatingPassword" placeholder="" name="password" ngModel
|
||||||
class="form-control"
|
required [ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['password'] != '' ,
|
||||||
id="floatingPassword"
|
|
||||||
placeholder=""
|
|
||||||
name="password"
|
|
||||||
ngModel
|
|
||||||
required
|
|
||||||
[ngClass]="{'is-valid': signinForm.form.touched && signinForm.form.value['password'] != '' ,
|
|
||||||
'is-invalid': signinForm.form.touched && signinForm.form.value['password'] == ''}">
|
'is-invalid': signinForm.form.touched && signinForm.form.value['password'] == ''}">
|
||||||
<label for="floatingPassword">Mot de passe</label>
|
<label for="floatingPassword">Mot de passe</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="w-100 btn btn-lg btn-success"
|
<button class="w-100 btn btn-lg btn-outline-success" type="submit" [disabled]="signinForm.invalid">Se
|
||||||
type="submit"
|
connecter</button>
|
||||||
[disabled]="signinForm.invalid">Se connecter</button>
|
</div>
|
||||||
|
|
||||||
|
<button class="w-100 btn btn-lg btn-outline-success" routerLink="../creation-compte"
|
||||||
<button class="w-100 btn btn-lg btn-success"
|
routerLinkActive="active-custom">S'inscrire</button>
|
||||||
routerLink="../creation-compte" routerLinkActive="active-custom"
|
|
||||||
>S'inscrire</button>
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,46 @@
|
||||||
.signin-form {
|
.signin-form {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
padding-top: 40px;
|
padding-top: 40px;
|
||||||
background-color: #f5f5f5;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-signin {
|
.form-signin {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 330px;
|
max-width: 330px;
|
||||||
padding: 15px;
|
margin-top: 50px;
|
||||||
margin: auto;
|
margin-left: auto;
|
||||||
.checkbox {
|
margin-right: auto;
|
||||||
font-weight: 400;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.form-floating:focus-within {
|
.connexion {
|
||||||
|
border: solid 4px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #ffff;
|
||||||
|
border-color: #5d5fef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-floating:focus-within {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="email"] {
|
input[type="email"] {
|
||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
|
margin-right: 50px;
|
||||||
|
padding-right: 10px;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
border-bottom-left-radius: 0;
|
border-bottom-left-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="password"] {
|
input[type="password"] {
|
||||||
|
padding-right: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
.btn-outline-success {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
background-color: #ffff;
|
||||||
|
color: #5d5fef !important;
|
||||||
|
border-color: #5d5fef !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,85 @@
|
||||||
<p>to-do-list works!</p>
|
<input
|
||||||
|
type="text"
|
||||||
|
class="todo-title"
|
||||||
|
placeholder="Titre"
|
||||||
|
value = "{{todo.nom}}"
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
<button (click)="effacerList()">Effacer la To Do List</button>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="todo-input"
|
||||||
|
placeholder="+ Nouvelle Tâche"
|
||||||
|
[(ngModel)]="todoTitle"
|
||||||
|
(keyup.enter)="addTache(todo.id)"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="element" *ngFor="let tache of todo.taches">
|
||||||
|
<div class="element-gauche">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
[(ngModel)]="tache.etat"
|
||||||
|
(change)="doneEdit(tache)"
|
||||||
|
checked="checked"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
*ngIf="!tache.editing; else editingTodo"
|
||||||
|
class="nomTache"
|
||||||
|
[ngClass]="{ completed: tache.etat }"
|
||||||
|
(dblclick)="modifier(tache)"
|
||||||
|
>
|
||||||
|
{{ tache.texte }}
|
||||||
|
</div>
|
||||||
|
<ng-template #editingTodo>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="modifier-element"
|
||||||
|
[(ngModel)]="tache.texte"
|
||||||
|
(blur)="doneEdit(tache)"
|
||||||
|
(keyup.enter)="doneEdit(tache)"
|
||||||
|
(keyup.esc)="cancelEdit(tache)"
|
||||||
|
autofocus
|
||||||
|
/>
|
||||||
|
</ng-template>
|
||||||
|
</div>
|
||||||
|
<div class="deleteTache" (click)="deleteTodo(tache.id)">×</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="extra-container">
|
||||||
|
<div>
|
||||||
|
<label
|
||||||
|
><input
|
||||||
|
type="checkbox"
|
||||||
|
(change)="cocherAllTodoList()"
|
||||||
|
[(ngModel)]="masterSelected"
|
||||||
|
/>Selectionner toutes les tâches</label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div>{{ toDoRest() }} tâches</div>
|
||||||
|
</div>
|
||||||
|
<div class="extra-container">
|
||||||
|
<!-- <div>
|
||||||
|
<button [ngClass]="{ active: filter === 'tous' }" (click)="filter = 'tous'">
|
||||||
|
Toutes la To Do List
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
[ngClass]="{ active: filter === 'active' }"
|
||||||
|
(click)="filter = 'active'"
|
||||||
|
>
|
||||||
|
A Faire
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
[ngClass]="{ active: filter === 'complete' }"
|
||||||
|
(click)="filter = 'complete'"
|
||||||
|
>
|
||||||
|
Terminées
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
.todo-title {
|
||||||
|
width: 25%;
|
||||||
|
padding: 10px 18px;
|
||||||
|
font-size: xx-large;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
&:focus {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.todo-input {
|
||||||
|
width: 20%;
|
||||||
|
padding: 10px 18px;
|
||||||
|
font-size: 18px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
&:focus {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.element {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
animation-duration: 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deleteTache {
|
||||||
|
width: 75%;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-left: 14px;
|
||||||
|
&:hover {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.element-gauche { // later
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nomTache{
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid white;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modifier-element {
|
||||||
|
font-size: 24px;
|
||||||
|
color: #2c3e50;
|
||||||
|
margin-left: 12px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid rgb(204, 204, 204); //override defaults
|
||||||
|
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
background-color:aquamarine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.completed {
|
||||||
|
text-decoration: line-through;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: white;
|
||||||
|
appearance: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: lightgreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
background: lightgreen;
|
||||||
|
}
|
||||||
|
.completed {
|
||||||
|
text-decoration: line-through;
|
||||||
|
color: grey;
|
||||||
|
}
|
|
@ -1,15 +1,140 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Tache} from 'src/app/models/tache';
|
||||||
|
import { ToDoList} from 'src/app/models/to-do-list';
|
||||||
|
import { TodoService } from 'src/app/services/todo.service';
|
||||||
|
import { TodoList } from 'src/app/todo-list';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-to-do-list',
|
selector: 'app-to-do-list',
|
||||||
templateUrl: './to-do-list.component.html',
|
templateUrl: './to-do-list.component.html',
|
||||||
styleUrls: ['./to-do-list.component.scss']
|
styleUrls: ['./to-do-list.component.scss'],
|
||||||
})
|
})
|
||||||
export class ToDoListComponent implements OnInit {
|
export class ToDoListComponent implements OnInit {
|
||||||
|
@Input() todo!: ToDoList;
|
||||||
|
public beforeEditCache: string;
|
||||||
|
//public todos: ToDoList[];
|
||||||
|
public todoTitle: string;
|
||||||
|
public idTodo: number;
|
||||||
|
public filter : string;
|
||||||
|
public casesRestantes : boolean;
|
||||||
|
public masterSelected: boolean;
|
||||||
|
public result : any;
|
||||||
|
public tache : Tache [];
|
||||||
|
|
||||||
constructor() { }
|
constructor(private TodoService : TodoService, private router: Router ) {
|
||||||
|
this.beforeEditCache = '';
|
||||||
ngOnInit(): void {
|
//this.todos = [];
|
||||||
|
this.todoTitle = '';
|
||||||
|
this.idTodo = 0;
|
||||||
|
this.filter ='';
|
||||||
|
this.casesRestantes=true;
|
||||||
|
this.masterSelected= false;
|
||||||
|
this.tache = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
ngOnInit(): void {
|
||||||
|
this.beforeEditCache = '';
|
||||||
|
this.casesRestantes=true;
|
||||||
|
this.filter='tous';
|
||||||
|
this.idTodo = 4;
|
||||||
|
this.todoTitle = '';
|
||||||
|
|
||||||
|
}
|
||||||
|
//ajouter tache
|
||||||
|
|
||||||
|
addTache(idTodoList : number) {//idTodoList id que la todoList que l'on récupère
|
||||||
|
console.log(idTodoList);
|
||||||
|
const tache: Tache = {
|
||||||
|
id : 0,
|
||||||
|
texte: this.todoTitle,
|
||||||
|
etat : false,
|
||||||
|
editing : false,
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log(this.tache);
|
||||||
|
this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
|
||||||
|
window.location.reload();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//modifier par l'input
|
||||||
|
modifier(tache: Tache): void {
|
||||||
|
this.beforeEditCache = tache.texte;
|
||||||
|
tache.editing = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ajouter la modification dans la liste
|
||||||
|
doneEdit(tache: Tache): void {
|
||||||
|
if (tache.texte.trim().length === 0) {
|
||||||
|
tache.texte = this.beforeEditCache;
|
||||||
|
}
|
||||||
|
this.casesRestantes= this.casesQuiRestes();
|
||||||
|
tache.editing = false;
|
||||||
|
this.TodoService.updateTache(tache).subscribe((resp)=>{
|
||||||
|
console.log(tache);
|
||||||
|
window.location.reload();
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// annuler la modification
|
||||||
|
cancelEdit(tache: Tache): void {
|
||||||
|
tache.texte = this.beforeEditCache;
|
||||||
|
tache.editing = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//supprimer la tache
|
||||||
|
deleteTodo(id: number) {
|
||||||
|
this.TodoService.deleteTacheById(id).subscribe(
|
||||||
|
resp =>{
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
);}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//nombre de tâches restantes
|
||||||
|
toDoRest(): number{
|
||||||
|
return this.todo.taches.filter((tache: Tache)=> !tache.etat).length;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Cocher toutes les tâches de la liste
|
||||||
|
listComplete(): boolean {
|
||||||
|
return this.todo.taches.filter((tache: Tache)=> tache).length>0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Effacer la to do list
|
||||||
|
|
||||||
|
effacerList(): void {
|
||||||
|
//this.todo = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
//cocher toutes les cases de la todoList
|
||||||
|
cocherAllTodoList(): void {
|
||||||
|
for (var i = 0; i < this.todo.taches.length; i++) {
|
||||||
|
this.todo.taches[i].etat = this.masterSelected;
|
||||||
|
}
|
||||||
|
this.cocherAllTodoList();
|
||||||
|
}
|
||||||
|
|
||||||
|
casesQuiRestes(): boolean {
|
||||||
|
return this.toDoRest() !== 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//barre de filtre des tâches
|
||||||
|
/* todosFilter(): ToDoList[] {
|
||||||
|
if(this.filter === 'tous'){
|
||||||
|
return this.todo.taches
|
||||||
|
}else if (this.filter === 'active'){
|
||||||
|
return this.todo.taches.filter((tache: Tache)=> !tache.etat)
|
||||||
|
}else if (this.filter === 'complete'){
|
||||||
|
return this.todo.taches.filter((tache: Tache)=>tache.etat)
|
||||||
|
}
|
||||||
|
return this.todo
|
||||||
|
} */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
7
src/app/interfaces/todo.ts
Normal file
7
src/app/interfaces/todo.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
export interface Todo {
|
||||||
|
id : number,
|
||||||
|
texte : string,
|
||||||
|
etat: boolean,
|
||||||
|
// todoListId: number // FK
|
||||||
|
}
|
||||||
|
|
11
src/app/models/contact.ts
Normal file
11
src/app/models/contact.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
export interface Contact {
|
||||||
|
id: string;
|
||||||
|
couleur: string;
|
||||||
|
nom: string;
|
||||||
|
prenom: string;
|
||||||
|
telephone: string;
|
||||||
|
email: string;
|
||||||
|
adresse: string;
|
||||||
|
dateNaissance: Date;
|
||||||
|
team: any;
|
||||||
|
}
|
|
@ -1,10 +1,11 @@
|
||||||
export interface Membre {
|
export interface Membre {
|
||||||
firstName: string;
|
nom: string;
|
||||||
lastName: string;
|
prenom: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
dateNaissance: Date;
|
dateNaissance: Date;
|
||||||
teamName: string;
|
couleur: string;
|
||||||
profil: boolean;
|
|
||||||
passwordConfirm: string;
|
passwordConfirm: string;
|
||||||
|
// smiley: string;
|
||||||
|
roleList: string[];
|
||||||
}
|
}
|
||||||
|
|
9
src/app/models/menu.ts
Normal file
9
src/app/models/menu.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import { Membre } from './membre';
|
||||||
|
import { Team } from './team';
|
||||||
|
|
||||||
|
export interface Menu {
|
||||||
|
dateMenu: string;
|
||||||
|
repasMidi: string;
|
||||||
|
repasSoir: string;
|
||||||
|
id: number;
|
||||||
|
}
|
10
src/app/models/tache.ts
Normal file
10
src/app/models/tache.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
import { ToDoList } from './to-do-list';
|
||||||
|
|
||||||
|
|
||||||
|
export interface Tache {
|
||||||
|
id : number,
|
||||||
|
texte: string,
|
||||||
|
etat : boolean,
|
||||||
|
editing : boolean
|
||||||
|
}
|
3
src/app/models/team.ts
Normal file
3
src/app/models/team.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export interface Team {
|
||||||
|
nom : string;
|
||||||
|
}
|
11
src/app/models/to-do-list.ts
Normal file
11
src/app/models/to-do-list.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { Tache } from './tache';
|
||||||
|
import { Team } from './team';
|
||||||
|
|
||||||
|
export interface ToDoList {
|
||||||
|
nom: string;
|
||||||
|
team: Team;
|
||||||
|
taches: Tache [];
|
||||||
|
id:number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,31 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<app-side-bar></app-side-bar>
|
<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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
button{
|
||||||
|
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,2 +1,24 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="bienvenue">
|
||||||
|
<h2 class="titre">BIENVENUE</h2>
|
||||||
|
<p>
|
||||||
|
Notre service vous offre des outils et des fonctionnalités pour vous aider à gérer la charge mentale de votre foyer.
|
||||||
|
<p>Réunis à un seul endroit pour toute la famille, vous pourrez faire des suggestions de menus, gérer un répertoire de
|
||||||
|
contacts utiles et établir des to-dot-list communes.</p>
|
||||||
|
<p>Plus de conflit, plus d’excuse de pas avoir su ou de ne pas avoir
|
||||||
|
lu, nous sommes là pour vous aider !</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="connexion">
|
||||||
<app-signin></app-signin>
|
<app-signin></app-signin>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pub">
|
||||||
|
<img src="../../../assets/images/menu.png" />
|
||||||
|
<img src="../../../assets/images/repertoire.png" />
|
||||||
|
<img src="../../../assets/images/todo.png" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bienvenue {
|
||||||
|
float: left;
|
||||||
|
// display: inline-block;
|
||||||
|
// height: 300px;
|
||||||
|
border: 4px solid #5d5fef;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-top: 50px;
|
||||||
|
// margin-left: 200px;
|
||||||
|
padding-right: 10px;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titre {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 1em;
|
||||||
|
line-height: 2em;
|
||||||
|
}
|
||||||
|
.connexion {
|
||||||
|
// float: right;
|
||||||
|
height: 350px;
|
||||||
|
display: inline;
|
||||||
|
margin-top: -40px;
|
||||||
|
margin-left: 10px;
|
||||||
|
// margin-right: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pub {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding-top: 100px;
|
||||||
|
padding-right: 200px;
|
||||||
|
padding-left: 200px;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border: 1px solid #d3d3d3;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 6px 6px #d3d3d3;
|
||||||
|
}
|
|
@ -1 +1,141 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<app-side-bar></app-side-bar>
|
||||||
|
<div class="col-9 offset-2" id="main">
|
||||||
|
<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">
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputlastName"
|
||||||
|
placeholder=""
|
||||||
|
name="lastName"
|
||||||
|
formControlName="lastNameFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
addMemberForm.controls['lastNameFc'].touched &&
|
||||||
|
addMemberForm.controls['lastNameFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
addMemberForm.controls['lastNameFc'].touched &&
|
||||||
|
!addMemberForm.controls['lastNameFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputlastName">VOTRE NOM</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputfirstName"
|
||||||
|
placeholder=""
|
||||||
|
name="firstName"
|
||||||
|
formControlName="firstNameFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
addMemberForm.controls['firstNameFc'].touched &&
|
||||||
|
addMemberForm.controls['firstNameFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
addMemberForm.controls['firstNameFc'].touched &&
|
||||||
|
!addMemberForm.controls['firstNameFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputfirstName">VOTRE PRENOM</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input
|
||||||
|
type="date"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputdateNaissance"
|
||||||
|
placeholder=""
|
||||||
|
name="dateNaissance"
|
||||||
|
formControlName="dateNaissanceFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
addMemberForm.controls['dateNaissanceFc'].touched &&
|
||||||
|
addMemberForm.controls['dateNaissanceFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
addMemberForm.controls['dateNaissanceFc'].touched &&
|
||||||
|
!addMemberForm.controls['dateNaissanceFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputdateNaissance">VOTRE DATE DE NAISSANCE</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input
|
||||||
|
type="email"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputemail"
|
||||||
|
placeholder=""
|
||||||
|
name="email"
|
||||||
|
formControlName="emailFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
addMemberForm.controls['emailFc'].touched &&
|
||||||
|
addMemberForm.controls['emailFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
addMemberForm.controls['emailFc'].touched &&
|
||||||
|
!addMemberForm.controls['emailFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputemail">VOTRE EMAIL</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingPassword"
|
||||||
|
placeholder=""
|
||||||
|
name="password"
|
||||||
|
formControlName="passwordFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
addMemberForm.controls['passwordFc'].touched &&
|
||||||
|
addMemberForm.controls['passwordFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
addMemberForm.controls['passwordFc'].touched &&
|
||||||
|
!addMemberForm.controls['passwordFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingPassword">MOT DE PASSE</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingpasswordConfirm"
|
||||||
|
placeholder=""
|
||||||
|
name="passwordConfirm"
|
||||||
|
formControlName="passwordConfirmFc"
|
||||||
|
[ngClass]="{
|
||||||
|
'is-valid':
|
||||||
|
addMemberForm.controls['passwordConfirmFc'].touched &&
|
||||||
|
addMemberForm.controls['passwordConfirmFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
addMemberForm.controls['passwordConfirmFc'].touched &&
|
||||||
|
!addMemberForm.controls['passwordConfirmFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
.login-form {
|
||||||
|
height: 100vh;
|
||||||
|
padding-top: 40px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #fcddec;
|
||||||
|
border-color: #ef5da8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember .checkbox {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember .form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember input[type="email"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember input[type="color"] {
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: -70px;
|
||||||
|
margin-left: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember input[type="color"]::-webkit-color-swatch {
|
||||||
|
border: none;
|
||||||
|
margin-top: -15px;
|
||||||
|
border-radius: 80%;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember input[type="text"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember input[type="date"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-addMember input[type="password"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-outline-success {
|
||||||
|
margin-top: 10px;
|
||||||
|
background-color: #ffff;
|
||||||
|
color: #ef5da8 !important;
|
||||||
|
border-color: #ef5da8 !important;
|
||||||
|
}
|
|
@ -1,4 +1,9 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Membre } from 'src/app/models/membre';
|
||||||
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { MembreService } from 'src/app/services/membre.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-add-member',
|
selector: 'app-page-add-member',
|
||||||
|
@ -7,9 +12,92 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class PageAddMemberComponent implements OnInit {
|
export class PageAddMemberComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
public addMemberForm: FormGroup;
|
||||||
|
constructor(
|
||||||
ngOnInit(): void {
|
private membreService: MembreService,
|
||||||
|
private authService: AuthService,
|
||||||
|
private router: Router,
|
||||||
|
private fb: FormBuilder
|
||||||
|
) {
|
||||||
|
this.addMemberForm = new FormGroup({});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
// *********************************pensser a changer group car déprécié********************************
|
||||||
|
this.addMemberForm = this.fb.group(
|
||||||
|
{
|
||||||
|
firstNameFc: new FormControl('', [Validators.required]),
|
||||||
|
lastNameFc: new FormControl('', [Validators.required]),
|
||||||
|
dateNaissanceFc: new FormControl('', [Validators.required]),
|
||||||
|
couleurFc: new FormControl('', []),
|
||||||
|
emailFc: new FormControl('', [
|
||||||
|
Validators.email,
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern(/^([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/gim),
|
||||||
|
]), // chercher une meilleure regex
|
||||||
|
passwordFc: new FormControl('', [
|
||||||
|
Validators.minLength(8),
|
||||||
|
Validators.required,
|
||||||
|
]),
|
||||||
|
passwordConfirmFc: new FormControl('', [
|
||||||
|
Validators.minLength(8),
|
||||||
|
Validators.required,
|
||||||
|
]),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: this.ConfirmedValidator('passwordFc', 'passwordConfirmFc'),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public onSubmit(): void {
|
||||||
|
console.log('value : ', this.addMemberForm.value);
|
||||||
|
console.log('form : ', this.addMemberForm);
|
||||||
|
const firstNameValue = this.addMemberForm.value['firstNameFc'];
|
||||||
|
const lastNameValue = this.addMemberForm.value['lastNameFc'];
|
||||||
|
const emailValue = this.addMemberForm.value['emailFc'];
|
||||||
|
const passwordValue = this.addMemberForm.value['passwordFc'];
|
||||||
|
const dateNaissanceValue = this.addMemberForm.value['dateNaissanceFc'];
|
||||||
|
const couleurValue = this.addMemberForm.value['couleurFc'];
|
||||||
|
const passwordConfirmValue = this.addMemberForm.value['passwordConfirmFc'];
|
||||||
|
|
||||||
|
|
||||||
|
const membre: Membre = {
|
||||||
|
nom: firstNameValue,
|
||||||
|
prenom: lastNameValue,
|
||||||
|
email: emailValue,
|
||||||
|
password: passwordValue,
|
||||||
|
couleur: couleurValue,
|
||||||
|
dateNaissance: dateNaissanceValue,
|
||||||
|
passwordConfirm: passwordConfirmValue,
|
||||||
|
roleList: ["ROLE_PARENT"]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (membre.email !== '' && membre.password !== '') {
|
||||||
|
this.membreService.addMembre(membre).subscribe((resp) => {
|
||||||
|
this.router.navigate(['compte']);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// affichage erreur
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfirmedValidator(controlName: string, matchingControlName: string) {
|
||||||
|
return (formGroup: FormGroup) => {
|
||||||
|
const control = formGroup.controls[controlName];
|
||||||
|
const matchingControl = formGroup.controls[matchingControlName];
|
||||||
|
if (
|
||||||
|
matchingControl.errors &&
|
||||||
|
!matchingControl.errors['confirmedValidator']
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (control.value !== matchingControl.value) {
|
||||||
|
matchingControl.setErrors({ confirmedValidator: true });
|
||||||
|
} else {
|
||||||
|
matchingControl.setErrors(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,37 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<app-side-bar></app-side-bar>
|
<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">×</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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,43 @@
|
||||||
|
.wrap {
|
||||||
|
display: flex;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons a {
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #3c78d8;
|
||||||
|
border: 1px solid #1155cc;
|
||||||
|
color: #fff;
|
||||||
|
padding: 6px 20px;
|
||||||
|
border-radius: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 5px;
|
||||||
|
width: 80px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-body {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
right: 0px;
|
||||||
|
top: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fullscreen {
|
||||||
|
position: absolute; top:90px; left: 0px; right: 0px; bottom: 0px;
|
||||||
|
}
|
|
@ -1,15 +1,269 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core';
|
||||||
|
import { DayPilot, DayPilotCalendarComponent, DayPilotNavigatorComponent } from "@daypilot/daypilot-lite-angular";
|
||||||
|
import { EvenementService } from 'src/app/services/evenement.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import jwt_decode from 'jwt-decode';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-agenda',
|
selector: 'app-page-agenda',
|
||||||
templateUrl: './page-agenda.component.html',
|
templateUrl: './page-agenda.component.html',
|
||||||
styleUrls: ['./page-agenda.component.scss']
|
styleUrls: ['./page-agenda.component.scss']
|
||||||
})
|
})
|
||||||
export class PageAgendaComponent implements OnInit {
|
export class PageAgendaComponent implements AfterViewInit {
|
||||||
|
|
||||||
constructor() { }
|
userId : any;
|
||||||
|
teamId : any;
|
||||||
|
role:any;
|
||||||
|
isShow: boolean;
|
||||||
|
alert:any;
|
||||||
|
|
||||||
ngOnInit(): void {
|
@ViewChild("navigator") navigator!: DayPilotNavigatorComponent;
|
||||||
|
@ViewChild("calendar") calendar!: DayPilotCalendarComponent;
|
||||||
|
|
||||||
|
constructor(private evenementService:EvenementService) {
|
||||||
|
this.isShow = false;
|
||||||
|
this.alert = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get date(): DayPilot.Date {
|
||||||
|
return this.config.startDate as DayPilot.Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
set date(value: DayPilot.Date) {
|
||||||
|
this.config.startDate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
navigatorConfig: DayPilot.NavigatorConfig = {
|
||||||
|
showMonths: 1,
|
||||||
|
skipMonths: 1,
|
||||||
|
locale: "fr-fr",
|
||||||
|
selectMode: "Week",
|
||||||
|
cellWidth: 30,
|
||||||
|
cellHeight: 30,
|
||||||
|
dayHeaderHeight: 30,
|
||||||
|
titleHeight: 30
|
||||||
|
};
|
||||||
|
|
||||||
|
events: DayPilot.EventData[] = [];
|
||||||
|
|
||||||
|
onClickCloseAlert(){
|
||||||
|
console.log('fermeture');
|
||||||
|
this.isShow = ! this.isShow;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
const token = localStorage.getItem(environment.tokenKey);
|
||||||
|
if(token) {
|
||||||
|
const decodedToken = jwt_decode<any>(token);
|
||||||
|
this.userId = decodedToken.userId;
|
||||||
|
this.teamId = decodedToken.teamId;
|
||||||
|
this.role = decodedToken.auth[0].authority;
|
||||||
|
}else{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// petite triche pour eviter la repetition du nom dans le RDV
|
||||||
|
rdvSplit(rdv:any){
|
||||||
|
let titleRDV = rdv.split('\r');
|
||||||
|
console.log(titleRDV[0]);
|
||||||
|
return titleRDV[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
config: DayPilot.CalendarConfig = {
|
||||||
|
startDate: DayPilot.Date.today(),
|
||||||
|
locale: "fr-fr",
|
||||||
|
viewType: "Week",
|
||||||
|
//heightSpec: "Parent100Pct",
|
||||||
|
cellHeight: 30,
|
||||||
|
headerHeight: 30,
|
||||||
|
hourWidth: 60,
|
||||||
|
onEventMoved: (args) => {
|
||||||
|
console.log("Event moved:"+args.e.id()+" - "+args.e.text()+" - "+args.e.end()+" - "+args.e.start()+' - '+args.e.data.tags.membre);
|
||||||
|
let event = {
|
||||||
|
start: args.e.start(),
|
||||||
|
end: args.e.end(),
|
||||||
|
id: args.e.id(),
|
||||||
|
barColor: "#555555",
|
||||||
|
text: this.rdvSplit(args.e.text()),
|
||||||
|
membre: {id:args.e.data.tags.membre},
|
||||||
|
team: {id:this.teamId}
|
||||||
|
}
|
||||||
|
if( (args.e.data.tags.membre == this.userId) || (this.role == 'ROLE_PARENT')){ // mettre role parent en variable
|
||||||
|
this.evenementService.updateEvenements(event).subscribe(
|
||||||
|
{
|
||||||
|
next: result => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"success", "content":"L'évènement à bien été modifié"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
error: err => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"danger", "content":"Problème lors de la modification de l'évenment"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
complete: () => console.log('DONE!')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"danger", "content":"Vous ne pouvez pas modifié cet évènement !"};
|
||||||
|
this.isShow = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
onTimeRangeSelected: async (args) => {
|
||||||
|
const modal = await DayPilot.Modal.prompt("Create a new event:", "Nouveau RDV");
|
||||||
|
const dp = args.control;
|
||||||
|
dp.clearSelection();
|
||||||
|
if (!modal.result) { return; }
|
||||||
|
let event = {
|
||||||
|
start: args.start,
|
||||||
|
end: args.end,
|
||||||
|
id: DayPilot.guid(),
|
||||||
|
barColor: "#555555",
|
||||||
|
text: modal.result
|
||||||
|
}
|
||||||
|
dp.events.add(event);
|
||||||
|
Object.assign(event, {id: ""});
|
||||||
|
Object.assign(event, {membre: {id:this.userId}});
|
||||||
|
Object.assign(event, {team: {id:this.teamId}});
|
||||||
|
console.log("Event added: " + event);
|
||||||
|
// let data = dp.events;
|
||||||
|
// Object.keys(data).map(function(key, index) {
|
||||||
|
// data[key] = {
|
||||||
|
// barColor:data[key].membre.couleur,
|
||||||
|
// //backColor:data[key].membre.couleur,
|
||||||
|
// "id": data[key].id,
|
||||||
|
// "start": data[key].start,
|
||||||
|
// "end": data[key].end,
|
||||||
|
// "text": data[key].text
|
||||||
|
// };
|
||||||
|
// });
|
||||||
|
this.evenementService.addEvenements(event).subscribe({
|
||||||
|
next: result => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"success", "content":"L'évènement à été correctement ajouté au calendrier"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
error: err => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"danger", "content":"Problème lors de l'ajout de l'évenment"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
complete: () => console.log('DONE!')
|
||||||
|
});
|
||||||
|
},
|
||||||
|
eventDeleteHandling: "Update",
|
||||||
|
onEventDeleted: (args) => {
|
||||||
|
console.log("Event deleted: " + args.e.id());
|
||||||
|
if( (args.e.data.tags.membre == this.userId) || (this.role == 'ROLE_PARENT')){ // mettre role parent en variable
|
||||||
|
this.evenementService.deleteEvenements(Number(args.e.id())).subscribe({
|
||||||
|
next: result => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"success", "content":"L'évènement à été correctement supprimé du calendrier"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
error: err => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"danger", "content":"Problème lors de la suppression de l'évenment"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
complete: () => console.log('DONE!')
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"danger", "content":"Vous ne pouvez pas suprimé cet évènement !"};
|
||||||
|
this.isShow = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
eventResizeHandling: "Update",
|
||||||
|
onEventResized: (args) => {
|
||||||
|
console.log("Event resized: " + args.e.id());
|
||||||
|
let event = {
|
||||||
|
start: args.e.start(),
|
||||||
|
end: args.e.end(),
|
||||||
|
id: args.e.id(),
|
||||||
|
barColor: "#555555",
|
||||||
|
text: args.e.text(),
|
||||||
|
membre: {id:this.userId},
|
||||||
|
team: {id:this.teamId}
|
||||||
|
}
|
||||||
|
this.evenementService.updateEvenements(event).subscribe(
|
||||||
|
{
|
||||||
|
next: result => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"success", "content":"L'évènement à bien été modifié"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
error: err => {
|
||||||
|
this.viewChange();
|
||||||
|
this.alert={"type":"danger", "content":"Problème lors de la modification de l'évenment"};
|
||||||
|
this.isShow = true;
|
||||||
|
},
|
||||||
|
complete: () => console.log('DONE!')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
adjust(color:string, amount:number) {
|
||||||
|
return '#' + color.replace(/^#/, '').replace(/../g, color =>
|
||||||
|
('0' + Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2));
|
||||||
|
}
|
||||||
|
|
||||||
|
viewChange(): void {
|
||||||
|
var from = this.calendar.control.visibleStart();
|
||||||
|
var to = this.calendar.control.visibleEnd();
|
||||||
|
|
||||||
|
console.log("viewChange(): " + from + " " + to);
|
||||||
|
|
||||||
|
// this.ds.getEvents(from, to).subscribe(result => {
|
||||||
|
//this.events = this.evenements;
|
||||||
|
this.evenementService.getEvenementsByIdTeam(this.teamId).subscribe((data: any) => {
|
||||||
|
// this.events = [{
|
||||||
|
// "id": data[0].id,
|
||||||
|
// "start": data[0].eventDebut,
|
||||||
|
// "end": data[0].eventFin,
|
||||||
|
// "text": data[0].libelle,
|
||||||
|
// barColor: data[0].membre.couleur,
|
||||||
|
// //cssClass: "toto"
|
||||||
|
// }];
|
||||||
|
Object.keys(data).map((key, index) => {
|
||||||
|
data[key] = {
|
||||||
|
barColor:data[key].membre.couleur,
|
||||||
|
backColor: this.adjust(data[key].membre.couleur, 90),
|
||||||
|
id: data[key].id,
|
||||||
|
start: data[key].start,
|
||||||
|
end: data[key].end,
|
||||||
|
text: data[key].text.toUpperCase()+'\r('+data[key].membre.prenom+')',
|
||||||
|
tags : {
|
||||||
|
membre: data[key].membre.id
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.events = data;
|
||||||
|
console.log(data);
|
||||||
|
console.log(this.events);
|
||||||
|
});
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
navigatePrevious(event: MouseEvent): void {
|
||||||
|
event.preventDefault();
|
||||||
|
this.config.startDate = (this.config.startDate as DayPilot.Date).addDays(-7);
|
||||||
|
}
|
||||||
|
|
||||||
|
navigateNext(event: MouseEvent): void {
|
||||||
|
event.preventDefault();
|
||||||
|
this.config.startDate = (this.config.startDate as DayPilot.Date).addDays(7);
|
||||||
|
}
|
||||||
|
|
||||||
|
navigateToday(event: MouseEvent): void {
|
||||||
|
event.preventDefault();
|
||||||
|
this.config.startDate = DayPilot.Date.today();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
<div>
|
||||||
|
<app-header></app-header>
|
||||||
|
<app-side-bar></app-side-bar>
|
||||||
|
</div>
|
||||||
|
<div class="ajoutContact-form text-center">
|
||||||
|
<h1>Ajouter un contact</h1>
|
||||||
|
<main class="form-ajoutContact">
|
||||||
|
<form (ngSubmit)="onSubmit()" [formGroup]="ajoutContactForm">
|
||||||
|
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
|
||||||
|
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>
|
||||||
|
<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 class="form-floating">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputAdresse"
|
||||||
|
placeholder=""
|
||||||
|
name="adresse"
|
||||||
|
formControlName="adresseFc">
|
||||||
|
<label for="floatingInputfirstName">Adresse</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="w-100 btn btn-lg btn-secondary"
|
||||||
|
type="submit"
|
||||||
|
[disabled]="ajoutContactForm.invalid">Valider</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
</div>
|
|
@ -0,0 +1,70 @@
|
||||||
|
.login-form {
|
||||||
|
height: 100vh;
|
||||||
|
padding-top: 40px;
|
||||||
|
background-color: #e286d3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #fcddec;
|
||||||
|
border-color: #81164d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact .checkbox {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact .form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact input[type="email"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact input[type="color"] {
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: -70px;
|
||||||
|
margin-left: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact input[type="color"]::-webkit-color-swatch {
|
||||||
|
border: none;
|
||||||
|
margin-top: -15px;
|
||||||
|
border-radius: 80%;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact input[type="text"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-ajoutContact input[type="date"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
margin-top: 10px;
|
||||||
|
background-color: #ffff;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
background-color: #5a1e63 !important;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PageAjoutContactComponent } from './page-ajout-contact.component';
|
||||||
|
|
||||||
|
describe('PageAjoutContactComponent', () => {
|
||||||
|
let component: PageAjoutContactComponent;
|
||||||
|
let fixture: ComponentFixture<PageAjoutContactComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PageAjoutContactComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PageAjoutContactComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,77 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormControl,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { TokenService } from 'src/app/services/token.service';
|
||||||
|
import { Contact } from '../../models/contact';
|
||||||
|
import { RepertoireService } from '../../services/repertoire.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-page-ajout-contact',
|
||||||
|
templateUrl: './page-ajout-contact.component.html',
|
||||||
|
styleUrls: ['./page-ajout-contact.component.scss'],
|
||||||
|
})
|
||||||
|
export class PageAjoutContactComponent implements OnInit {
|
||||||
|
public ajoutContactForm: FormGroup;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private repertoireService: RepertoireService,
|
||||||
|
private tokenService: TokenService,
|
||||||
|
private router: Router,
|
||||||
|
private fb: FormBuilder
|
||||||
|
) {
|
||||||
|
this.ajoutContactForm = new FormGroup({});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
// *********************************pensser à changer group car déprécié********************************
|
||||||
|
this.ajoutContactForm = this.fb.group({
|
||||||
|
couleurFc: new FormControl('', [Validators.required]),
|
||||||
|
lastNameFc: new FormControl('', [Validators.required]),
|
||||||
|
firstNameFc: new FormControl('', [Validators.required]),
|
||||||
|
telephoneFc: new FormControl('', [Validators.required]),
|
||||||
|
emailFc: new FormControl('', [
|
||||||
|
Validators.email,
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern(/^([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/gim),
|
||||||
|
]), // chercher une meilleure regex
|
||||||
|
dateNaissanceFc: new FormControl('', [Validators.required]),
|
||||||
|
adresseFc: new FormControl('', [Validators.required]),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public onSubmit(): void {
|
||||||
|
const couleurValue = this.ajoutContactForm.value['couleurFc'];
|
||||||
|
const firstNameValue = this.ajoutContactForm.value['firstNameFc'];
|
||||||
|
const lastNameValue = this.ajoutContactForm.value['lastNameFc'];
|
||||||
|
const telephoneValue = this.ajoutContactForm.value['telephoneFc'];
|
||||||
|
const emailValue = this.ajoutContactForm.value['emailFc'];
|
||||||
|
const dateNaissanceValue = this.ajoutContactForm.value['dateNaissanceFc'];
|
||||||
|
const adresseValue = this.ajoutContactForm.value['adresseFc'];
|
||||||
|
const teamId = this.tokenService.getCurrentTeamId()
|
||||||
|
|
||||||
|
const contact: Contact = {
|
||||||
|
id: '',
|
||||||
|
couleur: couleurValue,
|
||||||
|
nom: lastNameValue,
|
||||||
|
prenom: firstNameValue,
|
||||||
|
telephone: telephoneValue,
|
||||||
|
email: emailValue,
|
||||||
|
dateNaissance: dateNaissanceValue,
|
||||||
|
adresse: adresseValue,
|
||||||
|
team: { id: teamId }, // changer l'id quand la personne est logé => recuperer l'id de la team du membre
|
||||||
|
};
|
||||||
|
|
||||||
|
if (contact.nom !== '') {
|
||||||
|
this.repertoireService.addContact(contact).subscribe((resp) => {
|
||||||
|
this.router.navigate(['repertoire/']);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
window.alert("Le contact ne peut pas être ajouté!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
<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>
|
|
@ -0,0 +1,41 @@
|
||||||
|
.team-form{
|
||||||
|
margin-top: 20px;
|
||||||
|
align-content: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
button{
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.login-form {
|
||||||
|
height: 100vh;
|
||||||
|
padding-top: 40px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-team {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 500px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-team .checkbox {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-team .form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-team input[type="email"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-team input[type="password"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PageCreationTeamComponent } from './page-creation-team.component';
|
||||||
|
|
||||||
|
describe('PageCreationTeamComponent', () => {
|
||||||
|
let component: PageCreationTeamComponent;
|
||||||
|
let fixture: ComponentFixture<PageCreationTeamComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PageCreationTeamComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PageCreationTeamComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormControl,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Team } from 'src/app/models/team';
|
||||||
|
import { TeamService } from 'src/app/services/team.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-page-creation-team',
|
||||||
|
templateUrl: './page-creation-team.component.html',
|
||||||
|
styleUrls: ['./page-creation-team.component.scss'],
|
||||||
|
})
|
||||||
|
export class PageCreationTeamComponent implements OnInit {
|
||||||
|
public teamForm: FormGroup;
|
||||||
|
constructor(
|
||||||
|
private teamService: TeamService,
|
||||||
|
private router: Router,
|
||||||
|
private fb: FormBuilder
|
||||||
|
) {
|
||||||
|
this.teamForm = new FormGroup({});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
// *********************************penser a changer group car déprécié********************************
|
||||||
|
this.teamForm = new FormGroup({
|
||||||
|
nameFc : new FormControl('', [Validators.required])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public onSubmit(): void {
|
||||||
|
console.log('value : ', this.teamForm.value);
|
||||||
|
console.log('form : ', this.teamForm);
|
||||||
|
const nameValue = this.teamForm.value['nameFc'];
|
||||||
|
|
||||||
|
const team: Team = {
|
||||||
|
nom : nameValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (team.nom !== '' ) {
|
||||||
|
this.teamService.addTeam(team).subscribe((resp) => {
|
||||||
|
this.router.navigate(['compte']);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// affichage erreur
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfirmedValidator(controlName: string, matchingControlName: string) {
|
||||||
|
return (formGroup: FormGroup) => {
|
||||||
|
const control = formGroup.controls[controlName];
|
||||||
|
const matchingControl = formGroup.controls[matchingControlName];
|
||||||
|
if (
|
||||||
|
matchingControl.errors &&
|
||||||
|
!matchingControl.errors['confirmedValidator']
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (control.value !== matchingControl.value) {
|
||||||
|
matchingControl.setErrors({ confirmedValidator: true });
|
||||||
|
} else {
|
||||||
|
matchingControl.setErrors(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,2 +1,13 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
|
<app-meteo></app-meteo>
|
||||||
|
<app-humeur></app-humeur>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<app-footer></app-footer>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
.meteo {
|
||||||
|
display: flex;
|
||||||
|
margin-left: 300px;
|
||||||
|
margin-top: -60px;
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-dashboard',
|
selector: 'app-page-dashboard',
|
||||||
|
@ -12,4 +13,21 @@ export class PageDashboardComponent implements OnInit {
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
<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">
|
||||||
|
<h1>Supprimer votre compte</h1>
|
||||||
|
<main class="contenu-compte">
|
||||||
|
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PageDeleteAccountComponent } from './page-delete-account.component';
|
||||||
|
|
||||||
|
describe('PageDeleteAccountComponent', () => {
|
||||||
|
let component: PageDeleteAccountComponent;
|
||||||
|
let fixture: ComponentFixture<PageDeleteAccountComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PageDeleteAccountComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PageDeleteAccountComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-page-delete-account',
|
||||||
|
templateUrl: './page-delete-account.component.html',
|
||||||
|
styleUrls: ['./page-delete-account.component.scss']
|
||||||
|
})
|
||||||
|
export class PageDeleteAccountComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1 +1,12 @@
|
||||||
<app-header></app-header>
|
<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">
|
||||||
|
<h1>Supprimer ce membre</h1>
|
||||||
|
<main class="contenu-compte">
|
||||||
|
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,2 +1,23 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="signin-form text-center">
|
||||||
|
<main class="form-forgot">
|
||||||
|
<form (ngSubmit)="onSubmit(forgotForm)" #forgotForm="ngForm">
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="email" class="form-control" id="floatingInput" placeholder="" name="email" ngModel required
|
||||||
|
[ngClass]="{'is-valid': forgotForm.form.touched && forgotForm.form.value['email'] != '' ,
|
||||||
|
'is-invalid': forgotForm.form.touched && forgotForm.form.value['email'] == ''}">
|
||||||
|
<label for="floatingInput">Adresse email</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="w-100 btn btn-lg btn-success" type="submit" [disabled]="forgotForm.invalid" routerLink="../reinitialisation-password"
|
||||||
|
routerLinkActive="active-custom">Ré-initialiser mon mot de passe</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<!--
|
||||||
|
<div *ngIf="errorForm">
|
||||||
|
<p class="text-danger">Il manque des informations dans le formulaire...</p>
|
||||||
|
</div> -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
.forgot-form {
|
||||||
|
height: 100vh;
|
||||||
|
padding-top: 40px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-forgot {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
.checkbox {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="email"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,12 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { AuthService } from '../../services/auth.service';
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormControl,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-forgot-password',
|
selector: 'app-page-forgot-password',
|
||||||
|
@ -6,10 +14,20 @@ import { Component, OnInit } from '@angular/core';
|
||||||
styleUrls: ['./page-forgot-password.component.scss']
|
styleUrls: ['./page-forgot-password.component.scss']
|
||||||
})
|
})
|
||||||
export class PageForgotPasswordComponent implements OnInit {
|
export class PageForgotPasswordComponent implements OnInit {
|
||||||
|
constructor(private authService: AuthService, private router: Router) {
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
ngOnInit(): void {}
|
||||||
|
|
||||||
|
public onSubmit(submittedForm: any): void {
|
||||||
|
console.log(submittedForm.form.value);
|
||||||
|
|
||||||
|
// const email = submittedForm.form.value['email'];
|
||||||
|
// console.log(email);
|
||||||
|
window.alert("Vous allez recevoir un email pour re-initialiser votre mot de passe !")
|
||||||
|
// this.router.navigate(['reinitialisation-password']);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,12 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<app-side-bar></app-side-bar>
|
<div class="row">
|
||||||
|
<div class="col-md-auto">
|
||||||
|
<app-side-bar class="sidebarMenu"></app-side-bar>
|
||||||
|
</div>
|
||||||
|
<div class="col menu text-center">
|
||||||
|
<h2>Menu de la semaine</h2>
|
||||||
|
<main class="contenu-menu">
|
||||||
|
<app-card-menu></app-card-menu>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
<div>
|
||||||
|
<app-header></app-header>
|
||||||
|
<app-side-bar></app-side-bar>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modifContact-form text-center">
|
||||||
|
<h1>Modifier ce contact</h1>
|
||||||
|
<main class="form-modifContact">
|
||||||
|
<form (ngSubmit)="onSubmit()" [formGroup]="modifContactForm">
|
||||||
|
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
|
||||||
|
formControlName="couleurFc" value= "{{ listContactInfo.couleur }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputlastName"
|
||||||
|
placeholder=""
|
||||||
|
name="lastName"
|
||||||
|
formControlName="lastNameFc" value= "{{ listContactInfo.nom }}">
|
||||||
|
<label for="floatingInputlastName">Nom</label>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputfirstName"
|
||||||
|
placeholder=""
|
||||||
|
name="firstName"
|
||||||
|
formControlName="firstNameFc" value= "{{ listContactInfo.prenom }}">
|
||||||
|
<label for="floatingInputfirstName">Prénom</label>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputTelephone"
|
||||||
|
placeholder=""
|
||||||
|
name="telephone"
|
||||||
|
formControlName="telephoneFc" value= "{{ listContactInfo.telephone }}">
|
||||||
|
<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" value= "{{ listContactInfo.email }}">
|
||||||
|
<label for="floatingInput">Adresse email</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="date"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputdateNaissance"
|
||||||
|
placeholder=""
|
||||||
|
name="dateNaissance"
|
||||||
|
formControlName="dateNaissanceFc" value= "{{ listContactInfo.dateNaissance }}">
|
||||||
|
<label for="floatingInputfirstName">Date de naissance</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputAdresse"
|
||||||
|
placeholder=""
|
||||||
|
name="adresse"
|
||||||
|
formControlName="adresseFc" value= "{{ listContactInfo.adresse }}">
|
||||||
|
<label for="floatingInputfirstName">Adresse</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="w-100 btn btn-lg btn-secondary"
|
||||||
|
type="submit"
|
||||||
|
[disabled]="modifContactForm.invalid">Valider</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
</div>
|
|
@ -0,0 +1,70 @@
|
||||||
|
.login-form {
|
||||||
|
height: 100vh;
|
||||||
|
padding-top: 40px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #fcddec;
|
||||||
|
border-color: #81164d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact .checkbox {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact .form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact input[type="email"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact input[type="color"] {
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: -70px;
|
||||||
|
margin-left: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact input[type="color"]::-webkit-color-swatch {
|
||||||
|
border: none;
|
||||||
|
margin-top: -15px;
|
||||||
|
border-radius: 80%;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact input[type="text"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-modifContact input[type="date"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
margin-top: 10px;
|
||||||
|
background-color: #ffff;
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
background-color: #5a1e63 !important;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PageModifierContactComponent } from './page-modifier-contact.component';
|
||||||
|
|
||||||
|
describe('PageModifierContactComponent', () => {
|
||||||
|
let component: PageModifierContactComponent;
|
||||||
|
let fixture: ComponentFixture<PageModifierContactComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PageModifierContactComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PageModifierContactComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,99 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormControl,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { Contact } from '../../models/contact';
|
||||||
|
import { RepertoireService } from '../../services/repertoire.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-page-modifier-contact',
|
||||||
|
templateUrl: './page-modifier-contact.component.html',
|
||||||
|
styleUrls: ['./page-modifier-contact.component.scss'],
|
||||||
|
})
|
||||||
|
export class PageModifierContactComponent implements OnInit {
|
||||||
|
public modifContactForm: FormGroup;
|
||||||
|
public contactInfo: FormGroup;
|
||||||
|
public listContactInfo: any;
|
||||||
|
public personneid: any;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private repertoireService: RepertoireService,
|
||||||
|
private router: Router,
|
||||||
|
private fb: FormBuilder,
|
||||||
|
private route: ActivatedRoute
|
||||||
|
) {
|
||||||
|
this.modifContactForm = new FormGroup({});
|
||||||
|
this.contactInfo = this.initForm();
|
||||||
|
this.listContactInfo = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.personneid = this.route.snapshot.paramMap.get('id'); // récupère l'id du contact à modifier
|
||||||
|
console.log(this.personneid);
|
||||||
|
|
||||||
|
this.repertoireService
|
||||||
|
.getContactById(this.personneid)
|
||||||
|
.subscribe((listContactInfo: any) => {
|
||||||
|
console.log(listContactInfo);
|
||||||
|
this.listContactInfo = listContactInfo;
|
||||||
|
});
|
||||||
|
|
||||||
|
// *********************************pensser à changer group car déprécié********************************
|
||||||
|
this.modifContactForm = this.fb.group({
|
||||||
|
couleurFc: new FormControl('', [Validators.required]),
|
||||||
|
lastNameFc: new FormControl('', [Validators.required]),
|
||||||
|
firstNameFc: new FormControl('', [Validators.required]),
|
||||||
|
telephoneFc: new FormControl('', [Validators.required]),
|
||||||
|
emailFc: new FormControl('', [
|
||||||
|
Validators.email,
|
||||||
|
Validators.required,
|
||||||
|
Validators.pattern(/^([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/gim),
|
||||||
|
]), // chercher une meilleure regex
|
||||||
|
dateNaissanceFc: new FormControl('', [Validators.required]),
|
||||||
|
adresseFc: new FormControl('', [Validators.required]),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//Méthode qui initialise les champs du formulaire avec les infos de la BDD
|
||||||
|
private initForm(contact?: Contact): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
firstName: [contact ? contact.nom : ''],
|
||||||
|
lastName: [contact ? contact.prenom : ''],
|
||||||
|
telephone: [contact ? contact.telephone : ''],
|
||||||
|
email: [contact ? contact.email : ''],
|
||||||
|
dateNaissance: [contact ? contact.dateNaissance : ''],
|
||||||
|
adresse: [contact ? contact.adresse : ''],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//Méthode qui envoie les champs modifiés pour mise à jour
|
||||||
|
public onSubmit(): void {
|
||||||
|
const couleurValue = this.modifContactForm.value['couleurFc'];
|
||||||
|
const firstNameValue = this.modifContactForm.value['firstNameFc'];
|
||||||
|
const lastNameValue = this.modifContactForm.value['lastNameFc'];
|
||||||
|
const telephoneValue = this.modifContactForm.value['telephoneFc'];
|
||||||
|
const emailValue = this.modifContactForm.value['emailFc'];
|
||||||
|
const dateNaissanceValue = this.modifContactForm.value['dateNaissanceFc'];
|
||||||
|
const adresseValue = this.modifContactForm.value['adresseFc'];
|
||||||
|
|
||||||
|
const contact: Contact = {
|
||||||
|
id: this.personneid,
|
||||||
|
couleur: couleurValue,
|
||||||
|
nom: lastNameValue,
|
||||||
|
prenom: firstNameValue,
|
||||||
|
telephone: telephoneValue,
|
||||||
|
email: emailValue,
|
||||||
|
dateNaissance: dateNaissanceValue,
|
||||||
|
adresse: adresseValue,
|
||||||
|
team: { id: this.listContactInfo.team.id },
|
||||||
|
};
|
||||||
|
|
||||||
|
this.repertoireService.updateContact(contact).subscribe((resp) => {
|
||||||
|
this.router.navigate(['repertoire/']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,2 +1,20 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<p>Error 404 Page Not FOUND!!!!!!!!!!!</p>
|
<app-side-bar></app-side-bar>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="ctn-link min-vh-100">
|
||||||
|
<div class="text-center">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a routerLink="" routerLinkActive="!active">Je retourne à l'accueil</a>
|
||||||
|
<p></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<img src="/assets/images/404.gif" alt="Page introuvable">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
p{
|
||||||
|
color: black;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.ctn-link > div {
|
||||||
|
padding-top: 7em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.min-vh-100 {
|
||||||
|
font-weight: bold;
|
||||||
|
//background-image: linear-gradient(to left top, #051937, #004d7a, #008793, #e2ebe7, #f8faf5);
|
||||||
|
//max-width: max-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {justify-content: center;
|
||||||
|
}
|
|
@ -23,3 +23,4 @@ describe('PageNotFoundComponent', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-not-found',
|
selector: 'app-page-not-found',
|
||||||
templateUrl: './page-not-found.component.html',
|
templateUrl: './page-not-found.component.html',
|
||||||
|
@ -7,9 +8,28 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class PageNotFoundComponent implements OnInit {
|
export class PageNotFoundComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* version alternative pour mettre une redirection automatique
|
||||||
|
---------------
|
||||||
|
---------------
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
----------------
|
||||||
|
constructor(private routeur: Router) { }
|
||||||
|
----------------
|
||||||
|
ngOnInit(): void {
|
||||||
|
setTimeout(
|
||||||
|
() => {
|
||||||
|
this.routeur.navigate(["accueil"]);
|
||||||
|
}, 3000
|
||||||
|
);
|
||||||
|
} } */
|
||||||
|
|
|
@ -1,2 +1,41 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<app-side-bar></app-side-bar>
|
<div class="row">
|
||||||
|
<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="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>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,34 @@
|
||||||
|
.btn-secondary {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #5a1e63 !important;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 230px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
min-width: 100px;
|
||||||
|
border-radius: 55px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-group.mb-3 {
|
||||||
|
width: 50%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.couleur{
|
||||||
|
border: none;
|
||||||
|
margin-top: -15px;
|
||||||
|
border-radius: 80%;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h4 {
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
|
@ -1,15 +1,73 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { Contact } from 'src/app/models/contact';
|
||||||
|
import { RepertoireService } from 'src/app/services/repertoire.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-repertoire',
|
selector: 'app-page-repertoire',
|
||||||
templateUrl: './page-repertoire.component.html',
|
templateUrl: './page-repertoire.component.html',
|
||||||
styleUrls: ['./page-repertoire.component.scss']
|
styleUrls: ['./page-repertoire.component.scss'],
|
||||||
})
|
})
|
||||||
export class PageRepertoireComponent implements OnInit {
|
export class PageRepertoireComponent implements OnInit {
|
||||||
|
public listContact: any[];
|
||||||
|
public listFull: any[];
|
||||||
|
public listContactInfo: any;
|
||||||
|
public personneid: any;
|
||||||
|
keyword: any;
|
||||||
|
openDetails: any;
|
||||||
|
|
||||||
constructor() { }
|
constructor(
|
||||||
|
private repertoireService: RepertoireService,
|
||||||
ngOnInit(): void {
|
private router: Router,
|
||||||
|
private route: ActivatedRoute
|
||||||
|
) {
|
||||||
|
this.listContact = [];
|
||||||
|
this.listFull = [];
|
||||||
|
this.listContactInfo = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
//récupère tout les contact et leurs info
|
||||||
|
this.repertoireService.getContact().subscribe((listContact: any[]) => {
|
||||||
|
console.log(listContact);
|
||||||
|
this.listContact = listContact;
|
||||||
|
this.listFull = listContact;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Méthode pour récuper ce qui est saisi dans l'input
|
||||||
|
onSearchChange(prenom: string): void {
|
||||||
|
this.keyword = prenom;
|
||||||
|
if (prenom == '') {
|
||||||
|
this.listContact = this.listFull;
|
||||||
|
} else {
|
||||||
|
this.applyFilter(prenom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Méthode qui applique un filtre sur ce qui est récupéré de l'input sur le prénom
|
||||||
|
applyFilter(filter: any) {
|
||||||
|
let prenom = this.listFull.filter((contact) =>
|
||||||
|
contact.prenom.toLowerCase().includes(filter.toLowerCase())
|
||||||
|
);
|
||||||
|
this.listContact = prenom;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Méthode qui au click va ouvrir les détails d'un contact
|
||||||
|
onClick(personne: any) {
|
||||||
|
console.log(personne);
|
||||||
|
this.openDetails = personne;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Méthode qui au click va supprimer un contact
|
||||||
|
onClickDelete(contactId: number){
|
||||||
|
this.repertoireService.deleteContact(contactId).subscribe((resp) => {
|
||||||
|
if(contactId) {
|
||||||
|
this.listContact.forEach(contactId => console.log(contactId))
|
||||||
|
}else{
|
||||||
|
window.alert("Le contact ne peut pas être supprimé!")
|
||||||
|
}
|
||||||
|
this.router.navigate(['repertoire/']);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,25 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="reset-form text-center">
|
||||||
|
<main class="form-reset">
|
||||||
|
<form (ngSubmit)="onSubmit(resetForm)" #resetForm="ngForm">
|
||||||
|
<h3>Entrez ici votre email et votre nouveau mot de passe</h3>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="email" class="form-control" id="floatingEmail" placeholder="" name="email" ngModel required
|
||||||
|
[ngClass]="{'is-valid': resetForm.form.touched && resetForm.form.value['email'] != '' ,
|
||||||
|
'is-invalid': resetForm.form.touched && resetForm.form.value['email'] == ''}">
|
||||||
|
<label for="floatingEmail">Email</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input type="password" class="form-control" id="floatingPassword" placeholder="" name="password" ngModel
|
||||||
|
required [ngClass]="{'is-valid': resetForm.form.touched && resetForm.form.value['password'] != '' ,
|
||||||
|
'is-invalid': resetForm.form.touched && resetForm.form.value['password'] == ''}">
|
||||||
|
<label for="floatingPassword">Mot de passe</label>
|
||||||
|
</div>
|
||||||
|
<button class="w-100 btn btn-outline-success" type="submit" [disabled]="resetForm.invalid">Enregistrer</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
.reset-form {
|
||||||
|
height: 100vh;
|
||||||
|
padding-top: 40px;
|
||||||
|
background-color: #ffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-reset {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #fcddec;
|
||||||
|
border-color: #ef5da8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-reset .checkbox {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-reset .form-floating:focus-within {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-reset input[type="email"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-reset input[type="password"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-outline-success {
|
||||||
|
background-color: #ffff;
|
||||||
|
color: #ef5da8 !important;
|
||||||
|
border-color: #ef5da8 !important;
|
||||||
|
}
|
|
@ -1,4 +1,7 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-reset-password',
|
selector: 'app-page-reset-password',
|
||||||
|
@ -7,9 +10,19 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class PageResetPasswordComponent implements OnInit {
|
export class PageResetPasswordComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
constructor(private authService: AuthService, private router: Router,) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void { }
|
||||||
|
|
||||||
|
public onSubmit(submittedForm: any): void {
|
||||||
|
console.log(submittedForm.form.value);
|
||||||
|
const password = submittedForm.form.value['password'];
|
||||||
|
const email = submittedForm.form.value['email'];
|
||||||
|
console.log(email);
|
||||||
|
this.authService.resetPassword(email, password).subscribe((resp: any) => {
|
||||||
|
window.alert("Votre mot de passe est bien ré-initialisé !")
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,108 +1,134 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<div class="signup-form text-center">
|
<div class="signup-form text-center">
|
||||||
|
<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">
|
||||||
<h1>Merci de vous inscrire</h1>
|
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text"
|
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
|
||||||
|
formControlName="couleurFc">
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputlastName"
|
id="floatingInputlastName"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="lastName"
|
name="lastName"
|
||||||
formControlName="lastNameFc"
|
formControlName="lastNameFc"
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['lastNameFc'].touched && signupForm.controls['lastNameFc'].valid,
|
[ngClass]="{
|
||||||
'is-invalid': signupForm.controls['lastNameFc'].touched && !signupForm.controls['lastNameFc'].valid}">
|
'is-valid':
|
||||||
<label for="floatingInputlastName">Nom</label>
|
signupForm.controls['lastNameFc'].touched &&
|
||||||
|
signupForm.controls['lastNameFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
signupForm.controls['lastNameFc'].touched &&
|
||||||
|
!signupForm.controls['lastNameFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputlastName">VOTRE NOM</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text"
|
<input
|
||||||
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputfirstName"
|
id="floatingInputfirstName"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="firstName"
|
name="firstName"
|
||||||
formControlName="firstNameFc"
|
formControlName="firstNameFc"
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['firstNameFc'].touched && signupForm.controls['firstNameFc'].valid,
|
[ngClass]="{
|
||||||
'is-invalid': signupForm.controls['firstNameFc'].touched && !signupForm.controls['firstNameFc'].valid}">
|
'is-valid':
|
||||||
<label for="floatingInputfirstName">Prénom</label>
|
signupForm.controls['firstNameFc'].touched &&
|
||||||
|
signupForm.controls['firstNameFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
signupForm.controls['firstNameFc'].touched &&
|
||||||
|
!signupForm.controls['firstNameFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputfirstName">VOTRE PRENOM</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="date"
|
<input
|
||||||
|
type="date"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputdateNaissance"
|
id="floatingInputdateNaissance"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="dateNaissance"
|
name="dateNaissance"
|
||||||
formControlName="dateNaissanceFc"
|
formControlName="dateNaissanceFc"
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['dateNaissanceFc'].touched && signupForm.controls['dateNaissanceFc'].valid,
|
[ngClass]="{
|
||||||
'is-invalid': signupForm.controls['dateNaissanceFc'].touched && !signupForm.controls['dateNaissanceFc'].valid}">
|
'is-valid':
|
||||||
<label for="floatingInputfirstName">Date de naissance</label>
|
signupForm.controls['dateNaissanceFc'].touched &&
|
||||||
|
signupForm.controls['dateNaissanceFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
signupForm.controls['dateNaissanceFc'].touched &&
|
||||||
|
!signupForm.controls['dateNaissanceFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputdateNaissance">VOTRE DATE DE NAISSANCE</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text"
|
<input
|
||||||
|
type="email"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputteamName"
|
id="floatingInputemail"
|
||||||
placeholder=""
|
|
||||||
name="teamName"
|
|
||||||
formControlName="teamNameFc"
|
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['teamNameFc'].touched && signupForm.controls['teamNameFc'].valid,
|
|
||||||
'is-invalid': signupForm.controls['teamNameFc'].touched && !signupForm.controls['teamNameFc'].valid}">
|
|
||||||
<label for="floatingInputfirstName">Ma team</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-floating">
|
|
||||||
<select type="text"
|
|
||||||
class="form-control"
|
|
||||||
id="floatingInputprofil"
|
|
||||||
name="profil"
|
|
||||||
formControlName="profilFc"
|
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['profilFc'].touched && signupForm.controls['profilFc'].valid,
|
|
||||||
'is-invalid': signupForm.controls['profilFc'].touched && !signupForm.controls['profilFc'].valid}">
|
|
||||||
<option>Adulte</option>
|
|
||||||
<option>Enfant</option>
|
|
||||||
</select>
|
|
||||||
<label for="floatingInputfirstName">Profil</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-floating">
|
|
||||||
<input type="email"
|
|
||||||
class="form-control"
|
|
||||||
id="floatingInput"
|
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="email"
|
name="email"
|
||||||
formControlName="emailFc"
|
formControlName="emailFc"
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['emailFc'].touched && signupForm.controls['emailFc'].valid,
|
[ngClass]="{
|
||||||
'is-invalid': signupForm.controls['emailFc'].touched && !signupForm.controls['emailFc'].valid}">
|
'is-valid':
|
||||||
<label for="floatingInput">Adresse email</label>
|
signupForm.controls['emailFc'].touched &&
|
||||||
|
signupForm.controls['emailFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
signupForm.controls['emailFc'].touched &&
|
||||||
|
!signupForm.controls['emailFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingInputemail">VOTRE EMAIL</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="password"
|
<input
|
||||||
|
type="password"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingPassword"
|
id="floatingPassword"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="password"
|
name="password"
|
||||||
formControlName="passwordFc"
|
formControlName="passwordFc"
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['passwordFc'].touched && signupForm.controls['passwordFc'].valid,
|
[ngClass]="{
|
||||||
'is-invalid': signupForm.controls['passwordFc'].touched && !signupForm.controls['passwordFc'].valid}">
|
'is-valid':
|
||||||
<label for="floatingPassword">Mot de passe</label>
|
signupForm.controls['passwordFc'].touched &&
|
||||||
|
signupForm.controls['passwordFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
signupForm.controls['passwordFc'].touched &&
|
||||||
|
!signupForm.controls['passwordFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingPassword">MOT DE PASSE</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="passwordConfirm"
|
<input
|
||||||
|
type="password"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingpasswordConfirm"
|
id="floatingpasswordConfirm"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="passwordConfirm"
|
name="passwordConfirm"
|
||||||
formControlName="passwordConfirmFc"
|
formControlName="passwordConfirmFc"
|
||||||
[ngClass]="{'is-valid' : signupForm.controls['passwordConfirmFc'].touched && signupForm.controls['passwordConfirmFc'].valid,
|
[ngClass]="{
|
||||||
'is-invalid': signupForm.controls['passwordConfirmFc'].touched && !signupForm.controls['passwordConfirmFc'].valid}">
|
'is-valid':
|
||||||
<label for="floatingPassword">Confirmer mot de passe</label>
|
signupForm.controls['passwordConfirmFc'].touched &&
|
||||||
|
signupForm.controls['passwordConfirmFc'].valid,
|
||||||
|
'is-invalid':
|
||||||
|
signupForm.controls['passwordConfirmFc'].touched &&
|
||||||
|
!signupForm.controls['passwordConfirmFc'].valid
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<label for="floatingPasswordConfirm">CONFIRMEZ VOTRE MOT DE PASSE</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="w-100 btn btn-lg btn-success"
|
<button
|
||||||
|
class="w-100 btn btn-lg btn-outline-success"
|
||||||
type="submit"
|
type="submit"
|
||||||
[disabled]="signupForm.invalid">Je m'inscris !</button>
|
[disabled]="signupForm.invalid">
|
||||||
<p>
|
CREER MON COMPTE
|
||||||
Value : {{ signupForm.value | json }}
|
</button>
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Form valid : {{ signupForm.valid }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -8,7 +8,13 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 330px;
|
max-width: 330px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
margin: auto;
|
margin-top: 50px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #fcddec;
|
||||||
|
border-color: #ef5da8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-signup .checkbox {
|
.form-signup .checkbox {
|
||||||
|
@ -20,7 +26,37 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-signup input[type="email"] {
|
.form-signup input[type="email"] {
|
||||||
margin-bottom: -1px;
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup input[type="color"] {
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: -70px;
|
||||||
|
margin-left: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup input[type="color"]::-webkit-color-swatch {
|
||||||
|
border: none;
|
||||||
|
margin-top: -15px;
|
||||||
|
border-radius: 80%;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup input[type="text"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signup input[type="date"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
border-bottom-left-radius: 0;
|
border-bottom-left-radius: 0;
|
||||||
}
|
}
|
||||||
|
@ -30,3 +66,10 @@
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-outline-success {
|
||||||
|
margin-top: 10px;
|
||||||
|
background-color: #ffff;
|
||||||
|
color: #ef5da8 !important;
|
||||||
|
border-color: #ef5da8 !important;
|
||||||
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
FormGroup,
|
FormGroup,
|
||||||
Validators,
|
Validators,
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router, RouterLink } from '@angular/router';
|
||||||
import { Membre } from '../../models/membre';
|
import { Membre } from '../../models/membre';
|
||||||
import { AuthService } from '../../services/auth.service';
|
import { AuthService } from '../../services/auth.service';
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ export class PageSignupComponent implements OnInit {
|
||||||
firstNameFc: new FormControl('', [Validators.required]),
|
firstNameFc: new FormControl('', [Validators.required]),
|
||||||
lastNameFc: new FormControl('', [Validators.required]),
|
lastNameFc: new FormControl('', [Validators.required]),
|
||||||
dateNaissanceFc: new FormControl('', [Validators.required]),
|
dateNaissanceFc: new FormControl('', [Validators.required]),
|
||||||
teamNameFc: new FormControl('', [Validators.required]),
|
roleFc: new FormControl(''),
|
||||||
profilFc: new FormControl('', [Validators.required]),
|
couleurFc: new FormControl('', Validators.required),
|
||||||
emailFc: new FormControl('', [
|
emailFc: new FormControl('', [
|
||||||
Validators.email,
|
Validators.email,
|
||||||
Validators.required,
|
Validators.required,
|
||||||
|
@ -56,29 +56,29 @@ export class PageSignupComponent implements OnInit {
|
||||||
public onSubmit(): void {
|
public onSubmit(): void {
|
||||||
console.log('value : ', this.signupForm.value);
|
console.log('value : ', this.signupForm.value);
|
||||||
console.log('form : ', this.signupForm);
|
console.log('form : ', this.signupForm);
|
||||||
const firstNameValue = this.signupForm.value['firstNameFc'];
|
const prenomValue = this.signupForm.value['firstNameFc'];
|
||||||
const lastNameValue = this.signupForm.value['lastNameFc'];
|
const nomValue = this.signupForm.value['lastNameFc'];
|
||||||
const emailValue = this.signupForm.value['emailFc'];
|
const emailValue = this.signupForm.value['emailFc'];
|
||||||
const passwordValue = this.signupForm.value['passwordFc'];
|
const passwordValue = this.signupForm.value['passwordFc'];
|
||||||
const dateNaissanceValue = this.signupForm.value['dateNaissanceFc'];
|
const dateNaissanceValue = this.signupForm.value['dateNaissanceFc'];
|
||||||
const teamNameValue = this.signupForm.value['teamNameFc'];
|
|
||||||
const profilValue = this.signupForm.value['profilFc'];
|
|
||||||
const passwordConfirmValue = this.signupForm.value['passwordConfirmFc'];
|
const passwordConfirmValue = this.signupForm.value['passwordConfirmFc'];
|
||||||
|
const couleurValue = this.signupForm.value['couleurFc'];
|
||||||
|
const roleValue = ['ROLE_PARENT'];
|
||||||
|
|
||||||
const membre: Membre = {
|
const membre: Membre = {
|
||||||
firstName: firstNameValue,
|
nom: nomValue,
|
||||||
lastName: lastNameValue,
|
prenom: prenomValue,
|
||||||
email: emailValue,
|
email: emailValue,
|
||||||
password: passwordValue,
|
password: passwordValue,
|
||||||
|
couleur: couleurValue,
|
||||||
dateNaissance: dateNaissanceValue,
|
dateNaissance: dateNaissanceValue,
|
||||||
teamName: teamNameValue,
|
|
||||||
profil: profilValue,
|
|
||||||
passwordConfirm: passwordConfirmValue,
|
passwordConfirm: passwordConfirmValue,
|
||||||
|
roleList: roleValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (membre.email !== '' && membre.password !== '') {
|
if (membre.email !== '' && membre.password !== '') {
|
||||||
this.authService.signup(membre).subscribe((resp) => {
|
this.authService.signup(membre).subscribe((resp) => {
|
||||||
this.router.navigate(['account/signin']);
|
this.router.navigate(['accueil']);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// affichage erreur
|
// affichage erreur
|
||||||
|
|
31
src/app/pages/page-support/page-support.component.html
Normal file
31
src/app/pages/page-support/page-support.component.html
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<!-- <div>
|
||||||
|
<app-header></app-header>
|
||||||
|
<app-side-bar></app-side-bar>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2>Demande support</h2>
|
||||||
|
<form action="/demande_support" method="post">
|
||||||
|
|
||||||
|
<label for="name">Nom :</label>
|
||||||
|
<div>
|
||||||
|
<input type="text" id="name" value="Votre nom" name="user_name">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label for="mail">E-mail :</label>
|
||||||
|
<div>
|
||||||
|
<input type="email" id="mail" name="user_mail" value="Votre adresse mail">
|
||||||
|
</div>
|
||||||
|
<label for="msg">Message :</label>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<textarea id="msg" name="user_message">Formulez votre demande ici</textarea>
|
||||||
|
</div>
|
||||||
|
<div class="button">
|
||||||
|
|
||||||
|
<button class="btn btn-primary">Envoyez votre message</button>
|
||||||
|
<button type="button" class="btn btn-danger">Effacer</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
39
src/app/pages/page-support/page-support.component.scss
Normal file
39
src/app/pages/page-support/page-support.component.scss
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
form {
|
||||||
|
background-color: rgb(184, 202, 235);
|
||||||
|
width: 600px;
|
||||||
|
border: 3px solid blue;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-radius: 1em;
|
||||||
|
padding:3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, textarea {
|
||||||
|
width: 500px;
|
||||||
|
color :rgb(153, 171, 208)
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-left: .9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2{
|
||||||
|
text-align: center;
|
||||||
|
color : blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
color : rgb(65, 47, 221);
|
||||||
|
text-align: left;
|
||||||
|
width: 90px;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
height: 8em;
|
||||||
|
color :rgb(153, 171, 208)
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
25
src/app/pages/page-support/page-support.component.spec.ts
Normal file
25
src/app/pages/page-support/page-support.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PageSupportComponent } from './page-support.component';
|
||||||
|
|
||||||
|
describe('PageSupportComponent', () => {
|
||||||
|
let component: PageSupportComponent;
|
||||||
|
let fixture: ComponentFixture<PageSupportComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PageSupportComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PageSupportComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
19
src/app/pages/page-support/page-support.component.ts
Normal file
19
src/app/pages/page-support/page-support.component.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
//DRIVEN FORM
|
||||||
|
@Component({
|
||||||
|
selector: 'app-page-support',
|
||||||
|
templateUrl: './page-support.component.html',
|
||||||
|
styleUrls: ['./page-support.component.scss']
|
||||||
|
})
|
||||||
|
export class PageSupportComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,9 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
|
<div class="d-flex align-items-stretch">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col" *ngFor="let todos of result">
|
||||||
|
<app-to-do-list [todo]="todos"> </app-to-do-list>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { TodoService } from 'src/app/services/todo.service';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-to-do-list',
|
selector: 'app-page-to-do-list',
|
||||||
|
@ -6,10 +9,18 @@ import { Component, OnInit } from '@angular/core';
|
||||||
styleUrls: ['./page-to-do-list.component.scss']
|
styleUrls: ['./page-to-do-list.component.scss']
|
||||||
})
|
})
|
||||||
export class PageToDoListComponent implements OnInit {
|
export class PageToDoListComponent implements OnInit {
|
||||||
|
public result : any;
|
||||||
|
|
||||||
constructor() { }
|
constructor(private TodoService : TodoService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.TodoService.getToDoListByTeamId().subscribe((data :any)=>{
|
||||||
|
|
||||||
|
this.result = data;
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<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">
|
||||||
|
<h1>Modifier votre compte</h1>
|
||||||
|
<main class="contenu-compte">
|
||||||
|
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { PageUpdateAccountComponent } from './page-update-account.component';
|
||||||
|
|
||||||
|
describe('PageUpdateAccountComponent', () => {
|
||||||
|
let component: PageUpdateAccountComponent;
|
||||||
|
let fixture: ComponentFixture<PageUpdateAccountComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ PageUpdateAccountComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(PageUpdateAccountComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue