tracking files
This commit is contained in:
parent
cce97527b5
commit
9b3c02f6c1
|
@ -16,6 +16,7 @@
|
||||||
"@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",
|
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
||||||
"bootstrap": "^5.1.3",
|
"bootstrap": "^5.1.3",
|
||||||
"bootstrap-icons": "^1.8.1",
|
"bootstrap-icons": "^1.8.1",
|
||||||
|
@ -2371,6 +2372,18 @@
|
||||||
"postcss": "^8.3"
|
"postcss": "^8.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@daypilot/daypilot-lite-angular": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@daypilot/daypilot-lite-angular/-/daypilot-lite-angular-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-tpxwGZOL7Jdm4ACvuHIdWUkEu0iMk4gKznRB+8BUsNeo+gfP+Wx4xEgoeuKEFdA4lSxsrufjjPjK3B6azgZUOg==",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.3.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/common": ">=12.0.0",
|
||||||
|
"@angular/core": ">=12.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@discoveryjs/json-ext": {
|
"node_modules/@discoveryjs/json-ext": {
|
||||||
"version": "0.5.6",
|
"version": "0.5.6",
|
||||||
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz",
|
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz",
|
||||||
|
@ -12943,6 +12956,14 @@
|
||||||
"postcss-value-parser": "^4.2.0"
|
"postcss-value-parser": "^4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@daypilot/daypilot-lite-angular": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@daypilot/daypilot-lite-angular/-/daypilot-lite-angular-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-tpxwGZOL7Jdm4ACvuHIdWUkEu0iMk4gKznRB+8BUsNeo+gfP+Wx4xEgoeuKEFdA4lSxsrufjjPjK3B6azgZUOg==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@discoveryjs/json-ext": {
|
"@discoveryjs/json-ext": {
|
||||||
"version": "0.5.6",
|
"version": "0.5.6",
|
||||||
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz",
|
"resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz",
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
"@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",
|
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
||||||
"bootstrap": "^5.1.3",
|
"bootstrap": "^5.1.3",
|
||||||
"bootstrap-icons": "^1.8.1",
|
"bootstrap-icons": "^1.8.1",
|
||||||
|
|
|
@ -13,42 +13,43 @@ import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-f
|
||||||
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 { 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 { PageHumeurComponent} from './pages/page-humeur/page-humeur.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 { 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';
|
||||||
import { FooterComponent } from './components/footer/footer.component';
|
import { FooterComponent } from './components/footer/footer.component';
|
||||||
|
import { AuthGuard } from './auth.guard';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: '', redirectTo: 'accueil', pathMatch: 'full' },
|
{ path: '', redirectTo: 'accueil', pathMatch: 'full' },
|
||||||
{ path: 'modifier-contact/:id', component: PageModifierContactComponent },
|
{ path: 'modifier-contact/:id', canActivate: [AuthGuard], component: PageModifierContactComponent },
|
||||||
{ path: 'compte', component: PageAccountComponent },
|
{ path: 'compte', canActivate: [AuthGuard], component: PageAccountComponent },
|
||||||
{ path: 'accueil', component: PageAccueilComponent },
|
{ path: 'accueil', component: PageAccueilComponent },
|
||||||
{ path: 'ajout-membre', component: PageAddMemberComponent },
|
{ path: 'ajout-membre', canActivate: [AuthGuard], component: PageAddMemberComponent },
|
||||||
{ path: 'agenda', component: PageAgendaComponent },
|
{ path: 'agenda', canActivate: [AuthGuard], component: PageAgendaComponent },
|
||||||
{ path: 'tableau-de-bord', component: PageDashboardComponent },
|
{ path: 'tableau-de-bord', canActivate: [AuthGuard], component: PageDashboardComponent },
|
||||||
{ path: 'supprimer-membre', component: PageDeleteMemberComponent },
|
{ path: 'supprimer-membre', canActivate: [AuthGuard], component: PageDeleteMemberComponent },
|
||||||
{ path: 'supprimer-compte', component: PageDeleteAccountComponent },
|
{ path: 'supprimer-compte', canActivate: [AuthGuard], component: PageDeleteAccountComponent },
|
||||||
{ path: 'password-oublie', component: PageForgotPasswordComponent },
|
{ path: 'password-oublie', component: PageForgotPasswordComponent },
|
||||||
{ path: 'menu', component: PageMenuSemaineComponent },
|
{ path: 'menu', canActivate: [AuthGuard], component: PageMenuSemaineComponent },
|
||||||
{ path: 'repertoire', component: PageRepertoireComponent },
|
{ path: 'repertoire', canActivate: [AuthGuard], component: PageRepertoireComponent },
|
||||||
{ path: 'reinitialisation-password', component: PageResetPasswordComponent },
|
{ path: 'reinitialisation-password', component: PageResetPasswordComponent },
|
||||||
{ path: 'creation-compte', component: PageSignupComponent },
|
{ path: 'creation-compte', component: PageSignupComponent },
|
||||||
{ path: 'to-do-list', component: PageToDoListComponent },
|
{ path: 'page-support', component: PageSupportComponent},
|
||||||
{ path: 'modifier-membre', component: PageUpdateMemberComponent },
|
{ path: 'to-do-list', canActivate: [AuthGuard], component: PageToDoListComponent },
|
||||||
{ path: 'modifier-compte', component: PageUpdateAccountComponent },
|
{ path: 'modifier-membre', canActivate: [AuthGuard], component: PageUpdateMemberComponent },
|
||||||
{ path: 'ajouter-contact', component: PageAjoutContactComponent },
|
{ path: 'modifier-compte', canActivate: [AuthGuard], component: PageUpdateAccountComponent },
|
||||||
{ path: 'creation-team', component: PageCreationTeamComponent },
|
{ path: 'ajouter-contact', canActivate: [AuthGuard], component: PageAjoutContactComponent },
|
||||||
{ path: 'humeur', component: PageHumeurComponent },
|
{ path: 'creation-team', canActivate: [AuthGuard], component: PageCreationTeamComponent },
|
||||||
{ path: 'footer', component: FooterComponent},
|
{ path: 'footer', component: FooterComponent},
|
||||||
{ path: '**', component: PageNotFoundComponent },
|
{ path: '**', component: PageNotFoundComponent },
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forRoot(routes)],
|
imports: [RouterModule.forRoot(routes, {onSameUrlNavigation:'reload'})],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class AppRoutingModule {}
|
export class AppRoutingModule {}
|
||||||
|
|
|
@ -1,94 +0,0 @@
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
|
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
|
||||||
import { AppComponent } from './app.component';
|
|
||||||
import { PageAccueilComponent } from './pages/page-accueil/page-accueil.component';
|
|
||||||
import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.component';
|
|
||||||
import { PageAgendaComponent } from './pages/page-agenda/page-agenda.component';
|
|
||||||
import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.component';
|
|
||||||
import { PageRepertoireComponent } from './pages/page-repertoire/page-repertoire.component';
|
|
||||||
import { PageMenuSemaineComponent } from './pages/page-menu-semaine/page-menu-semaine.component';
|
|
||||||
import { HeaderComponent } from './components/header/header.component';
|
|
||||||
import { SideBarComponent } from './components/side-bar/side-bar.component';
|
|
||||||
import { PageAccountComponent } from './pages/page-account/page-account.component';
|
|
||||||
import { PageSignupComponent } from './pages/page-signup/page-signup.component';
|
|
||||||
import { PageForgotPasswordComponent } from './pages/page-forgot-password/page-forgot-password.component';
|
|
||||||
import { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component';
|
|
||||||
import { PageAddMemberComponent } from './pages/page-add-member/page-add-member.component';
|
|
||||||
import { PageDeleteMemberComponent } from './pages/page-delete-member/page-delete-member.component';
|
|
||||||
import { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component';
|
|
||||||
import { SigninComponent } from './components/signin/signin.component';
|
|
||||||
import { PageDashboardComponent } from './pages/page-dashboard/page-dashboard.component';
|
|
||||||
import { MeteoComponent } from './components/meteo/meteo.component';
|
|
||||||
import { CalendrierComponent } from './components/calendrier/calendrier.component';
|
|
||||||
import { CardMemberComponent } from './components/card-member/card-member.component';
|
|
||||||
import { ToDoListComponent } from './components/to-do-list/to-do-list.component';
|
|
||||||
import { TacheComponent } from './components/tache/tache.component';
|
|
||||||
import { CardMenuComponent } from './components/card-menu/card-menu.component';
|
|
||||||
import { FicheContactComponent } from './components/fiche-contact/fiche-contact.component';
|
|
||||||
import { PaginationComponent } from './components/pagination/pagination.component';
|
|
||||||
import { CreneauComponent } from './components/creneau/creneau.component';
|
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
||||||
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 { PageHumeurComponent } from './pages/page-humeur/page-humeur.component';
|
|
||||||
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';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [
|
|
||||||
AppComponent,
|
|
||||||
HeaderComponent,
|
|
||||||
SideBarComponent,
|
|
||||||
PageAccueilComponent,
|
|
||||||
PageNotFoundComponent,
|
|
||||||
PageAgendaComponent,
|
|
||||||
PageMenuSemaineComponent,
|
|
||||||
PageToDoListComponent,
|
|
||||||
PageRepertoireComponent,
|
|
||||||
PageAccountComponent,
|
|
||||||
PageSignupComponent,
|
|
||||||
PageForgotPasswordComponent,
|
|
||||||
PageResetPasswordComponent,
|
|
||||||
PageAddMemberComponent,
|
|
||||||
PageDeleteMemberComponent,
|
|
||||||
PageUpdateMemberComponent,
|
|
||||||
SigninComponent,
|
|
||||||
PageDashboardComponent,
|
|
||||||
MeteoComponent,
|
|
||||||
PageHumeurComponent,
|
|
||||||
CalendrierComponent,
|
|
||||||
CardMemberComponent,
|
|
||||||
ToDoListComponent,
|
|
||||||
TacheComponent,
|
|
||||||
CardMenuComponent,
|
|
||||||
FicheContactComponent,
|
|
||||||
PaginationComponent,
|
|
||||||
CreneauComponent,
|
|
||||||
PageAjoutContactComponent,
|
|
||||||
PageModifierContactComponent,
|
|
||||||
PageCreationTeamComponent,
|
|
||||||
PageHumeurComponent,
|
|
||||||
FooterComponent,
|
|
||||||
PageDeleteAccountComponent,
|
|
||||||
PageUpdateAccountComponent,
|
|
||||||
],
|
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
AppRoutingModule,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
HttpClientModule,
|
|
||||||
FormsModule,
|
|
||||||
AutofocusFixModule.forRoot(),
|
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
|
|
||||||
],
|
|
||||||
bootstrap: [AppComponent],
|
|
||||||
})
|
|
||||||
export class AppModule {}
|
|
|
@ -39,7 +39,7 @@ export class AuthGuard implements CanActivate {
|
||||||
const dateExp = new Date(decodedToken.exp * 1000);
|
const dateExp = new Date(decodedToken.exp * 1000);
|
||||||
if (new Date() >= dateExp) {
|
if (new Date() >= dateExp) {
|
||||||
// le token a expiré, je n'autorise pas l'accès
|
// le token a expiré, je n'autorise pas l'accès
|
||||||
this.router.navigate(['account/signin']);
|
this.router.navigate(['accueil']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ export class AuthGuard implements CanActivate {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.log('You shall not pass !!!!');
|
console.log('You shall not pass !!!!');
|
||||||
this.router.navigate(['account/signin']); // redirection de notre utilisateur vers une url de notre application (dans notre code TS)
|
this.router.navigate(['accueil']); // redirection de notre utilisateur vers une url de notre application (dans notre code TS)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<div class="container mt-5 membre">
|
||||||
|
<div class="row d-flex justify-content-center">
|
||||||
|
<div class="col-md-auto">
|
||||||
|
<div class="card p-3 py-4 align-items">
|
||||||
|
<!-- récuperer couleur du back-->
|
||||||
|
<div class="text-center"><div class="rounded-circle"id="couleur"[style.background-color]="membre.couleur"></div></div>
|
||||||
|
<div class="text-center mt-3">
|
||||||
|
<h3 class="mt-2 mb-0">{{membre.prenom }} {{membre.nom }}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,20 @@
|
||||||
|
#couleur{
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background: black;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
min-height: 8px;
|
||||||
|
border: none;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 8px;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: small;
|
||||||
|
}
|
|
@ -1,20 +1,20 @@
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { PageHumeurComponent } from './page-humeur.component';
|
import { CardAvatarComponent } from './card-avatar.component';
|
||||||
|
|
||||||
describe('PageHumeurComponent', () => {
|
describe('CardAvatarComponent', () => {
|
||||||
let component: PageHumeurComponent;
|
let component: CardAvatarComponent;
|
||||||
let fixture: ComponentFixture<PageHumeurComponent>;
|
let fixture: ComponentFixture<CardAvatarComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ PageHumeurComponent ]
|
declarations: [ CardAvatarComponent ]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(PageHumeurComponent);
|
fixture = TestBed.createComponent(CardAvatarComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-card-avatar',
|
||||||
|
templateUrl: './card-avatar.component.html',
|
||||||
|
styleUrls: ['./card-avatar.component.scss']
|
||||||
|
})
|
||||||
|
export class CardAvatarComponent implements OnInit {
|
||||||
|
@Input() membre: any;
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,46 +1,135 @@
|
||||||
<div class="menu">
|
|
||||||
<div *ngFor="let menu of listMenus">
|
|
||||||
<p>{{ menu.dateMenu }} {{ menu.libelle }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ng-template #content let-modal>
|
<ng-template #content let-modal>
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="modal-basic-title">
|
<h4 class="modal-title" id="modal-basic-title">Ajouter un menu</h4>
|
||||||
Ajouter un menu
|
<button
|
||||||
</h4>
|
type="button"
|
||||||
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
|
class="close"
|
||||||
|
aria-label="Close"
|
||||||
<span aria-hidden="true">
|
(click)="modal.dismiss('Cross click')"
|
||||||
×
|
>
|
||||||
</span>
|
<span aria-hidden="true"> × </span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form [formGroup]="menuForm">
|
<form [formGroup]="menuForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="dateMenu">
|
|
||||||
Date
|
|
||||||
</label>
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="dateMenu" class="form-control" formControlName="dateMenuFc" placeholder="yyyy-mm-dd" name="date"
|
<input
|
||||||
>
|
type="date"
|
||||||
<input id="libelle" class="form-control" formControlName="libelleFc" placeholder="" name="libelle"
|
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>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-outline-dark" (click)="modal.close(saveMenu())">
|
<button
|
||||||
Save
|
type="button"
|
||||||
|
class="btn btn-outline-warning"
|
||||||
|
(click)="modal.close(saveMenu())"
|
||||||
|
>
|
||||||
|
Enregistrer
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<button class="btn btn-lg btn-outline-primary" (click)="open(content)">
|
<button type="button" class="btn btn-outline-warning" (click)="open(content)">
|
||||||
Ajouter un menu
|
Ajouter un menu
|
||||||
</button>
|
</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-warning"
|
||||||
|
(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>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,36 @@
|
||||||
.menu {
|
.card {
|
||||||
margin-left: 500px;
|
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,4 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Menu } from 'src/app/models/menu';
|
import { Menu } from 'src/app/models/menu';
|
||||||
import { MenusService } from 'src/app/services/menus.service';
|
import { MenusService } from 'src/app/services/menus.service';
|
||||||
|
@ -22,6 +22,8 @@ closeResult = '';
|
||||||
public listMenus:any[];
|
public listMenus:any[];
|
||||||
public menuId : any;
|
public menuId : any;
|
||||||
public menuForm : FormGroup;
|
public menuForm : FormGroup;
|
||||||
|
public upMenuForm : FormGroup;
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private menusService: MenusService,
|
private menusService: MenusService,
|
||||||
|
@ -31,8 +33,51 @@ public menuForm : FormGroup;
|
||||||
private fb: FormBuilder
|
private fb: FormBuilder
|
||||||
) {
|
) {
|
||||||
this.listMenus=[];
|
this.listMenus=[];
|
||||||
this.menuId=0;
|
|
||||||
this.menuForm = new FormGroup({});
|
this.menuForm = new FormGroup({});
|
||||||
|
this.upMenuForm = new FormGroup({});
|
||||||
|
this.upMenuForm = this.initForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Méthode qui initialise les champs du formulaire avec les infos de la BDD
|
||||||
|
private initForm(menu?: Menu): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
dateMenu: [menu ? menu.dateMenu : ''],
|
||||||
|
repasMidi: [menu ? menu.repasMidi : ''],
|
||||||
|
repasSoir: [menu ? menu.repasSoir : ''],
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//delete d'un menu
|
||||||
|
deleteMenu(id_menu : number): void {
|
||||||
|
window.alert("Le menu a bien été supprimé!")
|
||||||
|
this.menusService.deleteMenu(id_menu)?.subscribe((resp) => {
|
||||||
|
// this.router.navigate(['menu']);
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
//updateMenu
|
||||||
|
updateMenu(id_menu : number): void {
|
||||||
|
|
||||||
|
const dateValue = this.upMenuForm.value['dateMenuFc'];
|
||||||
|
const repasMidiValue = this.upMenuForm.value['repasMidiFc'];
|
||||||
|
const repasSoirValue = this.upMenuForm.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(menu, id_menu);
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,22 +86,27 @@ public menuForm : FormGroup;
|
||||||
saveMenu(): void {
|
saveMenu(): void {
|
||||||
|
|
||||||
const dateValue = this.menuForm.value['dateMenuFc'];
|
const dateValue = this.menuForm.value['dateMenuFc'];
|
||||||
const libelleValue = this.menuForm.value['libelleFc'];
|
const repasMidiValue = this.menuForm.value['repasMidiFc'];
|
||||||
|
const repasSoirValue = this.menuForm.value['repasSoirFc'];
|
||||||
|
|
||||||
|
|
||||||
const menu: Menu = {
|
const menu: Menu = {
|
||||||
dateMenu: dateValue,
|
dateMenu: dateValue,
|
||||||
libelle: libelleValue,
|
repasMidi: repasMidiValue,
|
||||||
|
repasSoir: repasSoirValue,
|
||||||
|
id: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
// if (menu.dateMenu != undefined && menu.libelle != '') {
|
if (menu.dateMenu !=='') {
|
||||||
|
|
||||||
console.log(dateValue);
|
console.log(menu.dateMenu);
|
||||||
this.menusService.addMenu(menu)?.subscribe((resp) => {
|
this.menusService.addMenu(menu)?.subscribe((resp) => {
|
||||||
this.router.navigate(['menu']);
|
window.location.reload();
|
||||||
|
|
||||||
});
|
});
|
||||||
// } else {
|
} else {
|
||||||
// this.router.navigate(['menu']);
|
this.router.navigate(['accueil']);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,14 +116,29 @@ saveMenu(): void {
|
||||||
this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
|
this.menusService.getMenu()?.subscribe((listMenus: any[])=>{
|
||||||
console.log(listMenus);
|
console.log(listMenus);
|
||||||
this.listMenus=listMenus;
|
this.listMenus=listMenus;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.menuForm = this.fb.group(
|
this.menuForm = this.fb.group(
|
||||||
{
|
{
|
||||||
dateMenuFc: new FormControl('',[Validators.required]),
|
dateMenuFc: new FormControl('',[Validators.required]),
|
||||||
libelleFc: new FormControl('',[Validators.required]),
|
repasMidiFc: new FormControl('',[Validators.required]),
|
||||||
|
repasSoirFc: new FormControl('',[Validators.required]),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
this.upMenuForm = this.fb.group(
|
||||||
|
{
|
||||||
|
dateMenuFc: new FormControl('',[Validators.required]),
|
||||||
|
repasMidiFc: new FormControl('',[Validators.required]),
|
||||||
|
repasSoirFc: new FormControl('',[Validators.required]),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open(content: any) {
|
open(content: any) {
|
||||||
|
@ -99,11 +164,3 @@ open(content: any) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//modif d'un menu
|
|
||||||
// this.menuId=this.route.snapshot.paramMap.get('id');
|
|
||||||
// this.menusService.getMenuById(this.menuId)
|
|
||||||
// .subscribe((this.listMenus:any)=>)
|
|
||||||
|
|
||||||
//delete d'un menu
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-outline-primary btn-circle btn-xl"
|
||||||
|
(click)="onClickDeco()"
|
||||||
|
>
|
||||||
|
Se déconnecter
|
||||||
|
</button>
|
|
@ -0,0 +1,10 @@
|
||||||
|
.btn-circle.btn-xl {
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
padding: 10px 16px;
|
||||||
|
border-radius: 40px;
|
||||||
|
font-size: 10px;
|
||||||
|
text-align: center;
|
||||||
|
float: right;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { DeconnexionComponent } from './deconnexion.component';
|
||||||
|
|
||||||
|
describe('DeconnexionComponent', () => {
|
||||||
|
let component: DeconnexionComponent;
|
||||||
|
let fixture: ComponentFixture<DeconnexionComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ DeconnexionComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(DeconnexionComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,26 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { TokenService } from 'src/app/services/token.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-deconnexion',
|
||||||
|
templateUrl: './deconnexion.component.html',
|
||||||
|
styleUrls: ['./deconnexion.component.scss']
|
||||||
|
})
|
||||||
|
export class DeconnexionComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(private tokenService: TokenService,
|
||||||
|
private router: Router,
|
||||||
|
private route: ActivatedRoute) { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onClickDeco(){
|
||||||
|
this.tokenService.eraseToken();
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,19 +1,12 @@
|
||||||
<body>
|
<div class="footer text-center" >
|
||||||
|
<h3>Plan du site</h3>
|
||||||
<p>footer works!</p>
|
<div class="liens">
|
||||||
<h2>PLAN DU SITE</h2>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a routerLink="../accueil" routerLinkActive="active-custom" class="nav-link">Page d'accueil</a>
|
<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="../compte" routerLinkActive="active-custom" class="nav-link">Ma Team</a>
|
||||||
<a routerLink="../repertoire" routerLinkActive="active-custom" class="nav-link">Répertoire</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="../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>
|
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">Menus</a>
|
||||||
<a routerLink="../compte" routerLinkActive="active-custom" class="nav-link">Ma Team</a>
|
</div>
|
||||||
<a routerLink="../repertoire" routerLinkActive="active-custom" class="nav-link">Répertoire</a>
|
</div>
|
||||||
<a routerLink="../to-do-list" routerLinkActive="active-custom" class="nav-link">To-Do-List</a>
|
|
||||||
<a routerLink="../menu" routerLinkActive="active-custom" class="nav-link">Menus</a>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
|
@ -1,7 +1,10 @@
|
||||||
body {
|
.liens {
|
||||||
background-color: pink;
|
display: flex;
|
||||||
text-align: left;
|
justify-content: center;
|
||||||
|
color : blue;
|
||||||
|
font-size: smaller;
|
||||||
}
|
}
|
||||||
h2 {
|
|
||||||
color : blue
|
.footer {
|
||||||
|
margin-top: 20px;
|
||||||
}
|
}
|
|
@ -1,8 +1,15 @@
|
||||||
<nav class="navbar sticky-top navbar-expand-lg navbar-light bg-light shadow py-0 ">
|
<nav
|
||||||
|
class="navbar sticky-top navbar-expand-lg navbar-light bg-light shadow py-0"
|
||||||
|
>
|
||||||
<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 id="img" routerLink="accueil" routerLinkActive="active-custom" 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,6 +1,6 @@
|
||||||
.navbar-brand {
|
.navbar-brand {
|
||||||
position: absolute;
|
position: relative;
|
||||||
margin-left: 12%;
|
margin-right: 70%;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 3rem;
|
font-size: 3rem;
|
||||||
|
@ -29,5 +29,8 @@ a:active {
|
||||||
}
|
}
|
||||||
|
|
||||||
#img {
|
#img {
|
||||||
margin-left: 50%;
|
position: absolute;
|
||||||
|
max-width: 5%;
|
||||||
|
margin-left: 5%;
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
templateUrl: './header.component.html',
|
templateUrl: './header.component.html',
|
||||||
|
@ -7,9 +8,12 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class HeaderComponent implements OnInit {
|
export class HeaderComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
constructor(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
<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>
|
|
@ -1,6 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
p>img {
|
p>img {
|
||||||
width: 85px;
|
width: 85px;
|
||||||
height: 85px;
|
height: 85px;
|
||||||
|
@ -9,15 +6,13 @@ p>img {
|
||||||
img {
|
img {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.humeur {
|
.humeur {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
div {
|
||||||
background-color: grey;
|
background-color: #87AFC7;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { HumeurComponent } from './humeur.component';
|
||||||
|
|
||||||
|
describe('HumeurComponent', () => {
|
||||||
|
let component: HumeurComponent;
|
||||||
|
let fixture: ComponentFixture<HumeurComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ HumeurComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(HumeurComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,12 +1,12 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-humeur',
|
selector: 'app-humeur',
|
||||||
templateUrl: './page-humeur.component.html',
|
templateUrl: './humeur.component.html',
|
||||||
styleUrls: ['./page-humeur.component.scss']
|
styleUrls: ['./humeur.component.scss']
|
||||||
})
|
})
|
||||||
|
export class HumeurComponent implements OnInit {
|
||||||
|
|
||||||
export class PageHumeurComponent implements OnInit {
|
|
||||||
|
|
||||||
monHumeurLien! : string[];
|
monHumeurLien! : string[];
|
||||||
monHumeurTitle! : string[] ;
|
monHumeurTitle! : string[] ;
|
||||||
|
@ -17,7 +17,7 @@ export class PageHumeurComponent implements OnInit {
|
||||||
{ title : "Je pleure", lien : "assets/images/emoticon-pleurer.png"},
|
{ title : "Je pleure", lien : "assets/images/emoticon-pleurer.png"},
|
||||||
{ title : "Je suis fatigué", lien : "assets/images/emoticon-fatigue.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 colère", lien : "assets/images/emoticon-insulter.png"},
|
||||||
{ title : "Je suis malade", lien : "assets/images/emoticon-vomir.png"} ]
|
{ title : "Je suis en joie", lien : "assets/images/emoticon-feter.png"} ]
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
|
@ -31,9 +31,6 @@ console.log("humeur titre est : ", this.monHumeurTitle);
|
||||||
console.log("humeur lien est : ", this.monHumeurLien);
|
console.log("humeur lien est : ", this.monHumeurLien);
|
||||||
console.log("index humeur est : ", numero );
|
console.log("index humeur est : ", numero );
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -28,7 +28,12 @@ export class SigninComponent implements OnInit {
|
||||||
if (email !== '' && password !== '') {
|
if (email !== '' && password !== '') {
|
||||||
this.authService.signin(email, password).subscribe((resp) => {
|
this.authService.signin(email, password).subscribe((resp) => {
|
||||||
console.log('Component Signin: ', resp);
|
console.log('Component Signin: ', resp);
|
||||||
|
//if(resp == ){
|
||||||
this.router.navigate(['tableau-de-bord']);
|
this.router.navigate(['tableau-de-bord']);
|
||||||
|
//}else{
|
||||||
|
// window.alert("Votre identifiant/mot de passe est erroné");
|
||||||
|
//}
|
||||||
|
console.log('Component Signin: ', resp);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// afficher une erreur à l'utilisateur
|
// afficher une erreur à l'utilisateur
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
export interface Mail {
|
||||||
|
recipient: string;
|
||||||
|
subject: string;
|
||||||
|
message: string;
|
||||||
|
}
|
|
@ -2,6 +2,8 @@ import { Membre } from './membre';
|
||||||
import { Team } from './team';
|
import { Team } from './team';
|
||||||
|
|
||||||
export interface Menu {
|
export interface Menu {
|
||||||
libelle: string;
|
dateMenu: string;
|
||||||
dateMenu: Date;
|
repasMidi: string;
|
||||||
|
repasSoir: string;
|
||||||
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,48 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<app-deconnexion></app-deconnexion>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
<div class="col-9 offset-2" id="main">
|
<div class="col-9 offset-2" id="main">
|
||||||
<h1>Ma team</h1>
|
<h1>Ma team</h1>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
<button button type="button" class="btn btn-primary btn-lg"
|
<button
|
||||||
|
button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary btn-lg"
|
||||||
routerLink="../modifier-compte"
|
routerLink="../modifier-compte"
|
||||||
routerLinkActive="active-custom">Modifier mon compte</button>
|
routerLinkActive="active-custom"
|
||||||
|
>
|
||||||
|
Modifier mon compte
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
<button button type="button" class="btn btn-primary btn-lg"
|
<button
|
||||||
|
button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary btn-lg"
|
||||||
routerLink="../supprimer-compte"
|
routerLink="../supprimer-compte"
|
||||||
routerLinkActive="active-custom">Supprimer mon compte</button>
|
routerLinkActive="active-custom"
|
||||||
|
>
|
||||||
|
Supprimer mon compte
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
<button button type="button" class="btn btn-primary btn-lg"
|
<button
|
||||||
|
button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary btn-lg"
|
||||||
routerLink="../ajout-membre"
|
routerLink="../ajout-membre"
|
||||||
routerLinkActive="active-custom">Ajouter un membre</button>
|
routerLinkActive="active-custom"
|
||||||
|
>
|
||||||
|
Ajouter un membre
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col" *ngFor="let membreData of listMembres">
|
<div class="col" *ngFor="let membreData of listMembres">
|
||||||
<app-card-member [membre]="membreData">
|
<app-card-member [membre]="membreData"> </app-card-member>
|
||||||
</app-card-member>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { MembreService } from 'src/app/services/membre.service';
|
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',
|
||||||
|
@ -10,14 +10,15 @@ import { TeamService } from 'src/app/services/team.service';
|
||||||
export class PageAccountComponent implements OnInit {
|
export class PageAccountComponent implements OnInit {
|
||||||
public listMembres: any[];
|
public listMembres: any[];
|
||||||
|
|
||||||
constructor(private teamService: TeamService, private membreService: MembreService) {
|
constructor(private membreService: MembreService) {
|
||||||
this.listMembres = [];
|
this.listMembres = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.membreService.getMembres().subscribe((membres: any[]) => {
|
this.membreService.getMembresByTeamId()?.subscribe((membres: any[]) => {
|
||||||
|
console.log(membres);
|
||||||
this.listMembres = membres;
|
this.listMembres = membres;
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
|
@ -6,12 +7,14 @@
|
||||||
<div class="form-addMember">
|
<div class="form-addMember">
|
||||||
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="addMemberForm">
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="color"
|
<input
|
||||||
|
type="color"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputcouleur"
|
id="floatingInputcouleur"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="couleur"
|
name="couleur"
|
||||||
formControlName="couleurFc">
|
formControlName="couleurFc"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input
|
<input
|
||||||
|
@ -68,7 +71,9 @@
|
||||||
!addMemberForm.controls['dateNaissanceFc'].valid
|
!addMemberForm.controls['dateNaissanceFc'].valid
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<label for="floatingInputdateNaissance">VOTRE DATE DE NAISSANCE</label>
|
<label for="floatingInputdateNaissance"
|
||||||
|
>VOTRE DATE DE NAISSANCE</label
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input
|
<input
|
||||||
|
@ -87,7 +92,20 @@
|
||||||
!addMemberForm.controls['emailFc'].valid
|
!addMemberForm.controls['emailFc'].valid
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<label for="floatingInputemail">VOTRE EMAIL</label>
|
<label for="floatingInputemail">Votre Email</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-floating">
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputRole"
|
||||||
|
placeholder=""
|
||||||
|
name="Role"
|
||||||
|
formControlName="roleFc"
|
||||||
|
>
|
||||||
|
<option value="ROLE_PARENT">Adulte</option>
|
||||||
|
<option value="ROLE_ENFANT">Enfant</option>
|
||||||
|
</select>
|
||||||
|
<label value="ROLE_PARENT">Sélectionner un profil</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input
|
<input
|
||||||
|
@ -125,17 +143,20 @@
|
||||||
!addMemberForm.controls['passwordConfirmFc'].valid
|
!addMemberForm.controls['passwordConfirmFc'].valid
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<label for="floatingPasswordConfirm">CONFIRMEZ VOTRE MOT DE PASSE</label>
|
<label for="floatingPasswordConfirm"
|
||||||
|
>CONFIRMEZ VOTRE MOT DE PASSE</label
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="w-100 btn btn-lg btn-outline-success"
|
class="w-100 btn btn-lg btn-outline-success"
|
||||||
type="submit"
|
type="submit"
|
||||||
[disabled]="addMemberForm.invalid"
|
[disabled]="addMemberForm.invalid"
|
||||||
>Ajouter le membre</button>
|
>
|
||||||
|
Ajouter le membre
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { Mail } from 'src/app/models/mail';
|
||||||
import { Membre } from 'src/app/models/membre';
|
import { Membre } from 'src/app/models/membre';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { MailService } from 'src/app/services/mail.service';
|
||||||
import { MembreService } from 'src/app/services/membre.service';
|
import { MembreService } from 'src/app/services/membre.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -15,6 +17,7 @@ export class PageAddMemberComponent implements OnInit {
|
||||||
public addMemberForm: FormGroup;
|
public addMemberForm: FormGroup;
|
||||||
constructor(
|
constructor(
|
||||||
private membreService: MembreService,
|
private membreService: MembreService,
|
||||||
|
private mailService: MailService,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private fb: FormBuilder
|
private fb: FormBuilder
|
||||||
|
@ -29,6 +32,7 @@ export class PageAddMemberComponent 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]),
|
||||||
|
roleFc: new FormControl('', []),
|
||||||
couleurFc: new FormControl('', []),
|
couleurFc: new FormControl('', []),
|
||||||
emailFc: new FormControl('', [
|
emailFc: new FormControl('', [
|
||||||
Validators.email,
|
Validators.email,
|
||||||
|
@ -53,9 +57,10 @@ export class PageAddMemberComponent implements OnInit {
|
||||||
public onSubmit(): void {
|
public onSubmit(): void {
|
||||||
console.log('value : ', this.addMemberForm.value);
|
console.log('value : ', this.addMemberForm.value);
|
||||||
console.log('form : ', this.addMemberForm);
|
console.log('form : ', this.addMemberForm);
|
||||||
const firstNameValue = this.addMemberForm.value['firstNameFc'];
|
|
||||||
const lastNameValue = this.addMemberForm.value['lastNameFc'];
|
const lastNameValue = this.addMemberForm.value['lastNameFc'];
|
||||||
|
const firstNameValue = this.addMemberForm.value['firstNameFc'];
|
||||||
const emailValue = this.addMemberForm.value['emailFc'];
|
const emailValue = this.addMemberForm.value['emailFc'];
|
||||||
|
const roleValue = this.addMemberForm.value['roleFc'];
|
||||||
const passwordValue = this.addMemberForm.value['passwordFc'];
|
const passwordValue = this.addMemberForm.value['passwordFc'];
|
||||||
const dateNaissanceValue = this.addMemberForm.value['dateNaissanceFc'];
|
const dateNaissanceValue = this.addMemberForm.value['dateNaissanceFc'];
|
||||||
const couleurValue = this.addMemberForm.value['couleurFc'];
|
const couleurValue = this.addMemberForm.value['couleurFc'];
|
||||||
|
@ -63,19 +68,31 @@ export class PageAddMemberComponent implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
const membre: Membre = {
|
const membre: Membre = {
|
||||||
nom: firstNameValue,
|
nom: lastNameValue,
|
||||||
prenom: lastNameValue,
|
prenom: firstNameValue,
|
||||||
email: emailValue,
|
email: emailValue,
|
||||||
password: passwordValue,
|
password: passwordValue,
|
||||||
couleur: couleurValue,
|
couleur: couleurValue,
|
||||||
dateNaissance: dateNaissanceValue,
|
dateNaissance: dateNaissanceValue,
|
||||||
passwordConfirm: passwordConfirmValue,
|
passwordConfirm: passwordConfirmValue,
|
||||||
roleList: ["ROLE_PARENT"]
|
roleList: [roleValue]
|
||||||
|
};
|
||||||
|
|
||||||
|
const mail: Mail = {
|
||||||
|
recipient: emailValue,
|
||||||
|
subject: "Votre mot de passe Organizee",
|
||||||
|
//message: 'Votre mot de passe'
|
||||||
|
message: `Bonjour ${firstNameValue}!\n Voici vos identifiants de connexion : \n
|
||||||
|
Identifiant : ${emailValue}
|
||||||
|
Mot de passe : ${passwordValue}`
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (membre.email !== '' && membre.password !== '') {
|
if (membre.email !== '' && membre.password !== '') {
|
||||||
this.membreService.addMembre(membre).subscribe((resp) => {
|
this.membreService.addMembre(membre)?.subscribe((resp) => {
|
||||||
|
this.mailService.envoiMailText(mail)?.subscribe((respMail) =>{
|
||||||
|
console.log("Mail envoyé");
|
||||||
|
})
|
||||||
this.router.navigate(['compte']);
|
this.router.navigate(['compte']);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,2 +1,80 @@
|
||||||
<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;
|
||||||
|
|
||||||
|
@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 {
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,86 +1,147 @@
|
||||||
<div>
|
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
</div>
|
</div>
|
||||||
<div class="ajoutContact-form text-center">
|
<div class="ajoutContact-form text-center">
|
||||||
<h1>Ajouter un contact</h1>
|
<h3>Ajouter un contact</h3>
|
||||||
<main class="form-ajoutContact">
|
<main class="form-ajoutContact">
|
||||||
<form (ngSubmit)="onSubmit()" [formGroup]="ajoutContactForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="ajoutContactForm">
|
||||||
|
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="color" class="form-control" id="floatingInputcouleur" placeholder="" name="couleur"
|
<input
|
||||||
formControlName="couleurFc">
|
type="color"
|
||||||
|
class="form-control"
|
||||||
|
id="floatingInputcouleur"
|
||||||
|
placeholder=""
|
||||||
|
name="couleur"
|
||||||
|
formControlName="couleurFc"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text"
|
<input
|
||||||
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputlastName"
|
id="floatingInputlastName"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="lastName"
|
name="lastName"
|
||||||
formControlName="lastNameFc">
|
formControlName="lastNameFc"
|
||||||
|
/>
|
||||||
<label for="floatingInputlastName">Nom</label>
|
<label for="floatingInputlastName">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"
|
||||||
|
/>
|
||||||
<label for="floatingInputfirstName">Prénom</label>
|
<label for="floatingInputfirstName">Pré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="floatingInputTelephone"
|
id="floatingInputTelephone"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="telephone"
|
name="telephone"
|
||||||
formControlName="telephoneFc">
|
formControlName="telephoneFc"
|
||||||
|
/>
|
||||||
<label for="floatingInputfirstName">Téléphone</label>
|
<label for="floatingInputfirstName">Téléphone</label>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="email"
|
<input
|
||||||
|
type="email"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInput"
|
id="floatingInput"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="email"
|
name="email"
|
||||||
formControlName="emailFc">
|
formControlName="emailFc"
|
||||||
|
/>
|
||||||
<label for="floatingInput">Adresse email</label>
|
<label for="floatingInput">Adresse email</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"
|
||||||
|
/>
|
||||||
<label for="floatingInputfirstName">Date de naissance</label>
|
<label for="floatingInputfirstName">Date de naissance</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text"
|
<input
|
||||||
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputAdresse"
|
id="floatingInputAdresse"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="adresse"
|
name="adresse"
|
||||||
formControlName="adresseFc">
|
formControlName="adresseFc"
|
||||||
|
/>
|
||||||
<label for="floatingInputfirstName">Adresse</label>
|
<label for="floatingInputfirstName">Adresse</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="w-100 btn btn-lg btn-secondary"
|
<div class="form-floating">
|
||||||
type="submit"
|
<input
|
||||||
[disabled]="ajoutContactForm.invalid">Valider</button>
|
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>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
|
@ -8,19 +9,31 @@
|
||||||
<main class="form-team">
|
<main class="form-team">
|
||||||
<form (ngSubmit)="onSubmit()" [formGroup]="teamForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="teamForm">
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
<input type="text"
|
<input
|
||||||
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
id="floatingInputName"
|
id="floatingInputName"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
name="name"
|
name="name"
|
||||||
formControlName="nameFc"
|
formControlName="nameFc"
|
||||||
[ngClass]="{'is-valid' : teamForm.controls['nameFc'].touched && teamForm.controls['nameFc'].valid,
|
[ngClass]="{
|
||||||
'is-invalid': teamForm.controls['nameFc'].touched && !teamForm.controls['nameFc'].valid}">
|
'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>
|
<label for="floatingInputName">Nom</label>
|
||||||
</div>
|
</div>
|
||||||
<button class="w-100 btn btn-lg btn-success"
|
<button
|
||||||
|
class="w-100 btn btn-lg btn-success"
|
||||||
type="submit"
|
type="submit"
|
||||||
[disabled]="teamForm.invalid">Je crée ma team</button>
|
[disabled]="teamForm.invalid"
|
||||||
|
>
|
||||||
|
Je crée ma team
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Team } from 'src/app/models/team';
|
import { Team } from 'src/app/models/team';
|
||||||
|
import { MembreService } from 'src/app/services/membre.service';
|
||||||
import { TeamService } from 'src/app/services/team.service';
|
import { TeamService } from 'src/app/services/team.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -18,6 +19,7 @@ export class PageCreationTeamComponent implements OnInit {
|
||||||
public teamForm: FormGroup;
|
public teamForm: FormGroup;
|
||||||
constructor(
|
constructor(
|
||||||
private teamService: TeamService,
|
private teamService: TeamService,
|
||||||
|
private membreService: MembreService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private fb: FormBuilder
|
private fb: FormBuilder
|
||||||
) {
|
) {
|
||||||
|
@ -39,9 +41,6 @@ export class PageCreationTeamComponent implements OnInit {
|
||||||
const team: Team = {
|
const team: Team = {
|
||||||
nom : nameValue,
|
nom : nameValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (team.nom !== '' ) {
|
if (team.nom !== '' ) {
|
||||||
this.teamService.addTeam(team).subscribe((resp) => {
|
this.teamService.addTeam(team).subscribe((resp) => {
|
||||||
this.router.navigate(['compte']);
|
this.router.navigate(['compte']);
|
||||||
|
|
|
@ -1,9 +1,35 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
<app-meteo></app-meteo>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="d-flex justify-content-center">
|
<app-deconnexion></app-deconnexion>
|
||||||
<button button type="button" class="btn btn-primary btn-lg" routerLink="../creation-team"
|
|
||||||
routerLinkActive="active-custom">Créer ma team</button>
|
<div class="container">
|
||||||
|
<div>
|
||||||
|
<h3 class="titre">Bienvenue {{ conectedUser.prenom }}!!</h3>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row d-flex align-items-center flex-row">
|
||||||
|
<div class="col-sm-3 col-xs-6 box border" id="boxThree">
|
||||||
|
<app-meteo></app-meteo>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3 col-xs-6 box border" id="boxTwo">
|
||||||
|
<app-calendrier>A venir</app-calendrier>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3 col-xs-6 box border" id="boxFour">
|
||||||
|
<div>
|
||||||
|
<app-humeur></app-humeur>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row avatar">
|
||||||
|
<div class="col" *ngFor="let membreData of listMembres">
|
||||||
|
<app-card-avatar [membre]="membreData"> </app-card-avatar>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<app-footer></app-footer>
|
||||||
|
|
|
@ -1,5 +1,50 @@
|
||||||
|
.titre{
|
||||||
|
display: inline-flex;
|
||||||
|
margin-left: 20px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.meteo {
|
.meteo {
|
||||||
display: flex;
|
margin-left: 500px;
|
||||||
margin-left: 300px;
|
|
||||||
margin-top: -60px;
|
margin-top: -60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
button{
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendrier{
|
||||||
|
align-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
#boxFour{
|
||||||
|
height: 150px;
|
||||||
|
margin-top: -70px;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
#boxThree{
|
||||||
|
margin-top: -85px;
|
||||||
|
height: 150px;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
#boxTwo{
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: 150px;
|
||||||
|
height: 50%;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar{
|
||||||
|
margin-top: -50px;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 0;
|
||||||
|
}
|
|
@ -1,4 +1,8 @@
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { MembreService } from 'src/app/services/membre.service';
|
||||||
|
import { TokenService } from 'src/app/services/token.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-page-dashboard',
|
selector: 'app-page-dashboard',
|
||||||
|
@ -7,9 +11,27 @@ import { Component, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class PageDashboardComponent implements OnInit {
|
export class PageDashboardComponent implements OnInit {
|
||||||
|
|
||||||
constructor() { }
|
conectedUser: any;
|
||||||
|
listMembres: any[];
|
||||||
|
|
||||||
|
constructor(private membreService: MembreService,
|
||||||
|
private http: HttpClient,
|
||||||
|
private router: Router,
|
||||||
|
private tokenService: TokenService) {
|
||||||
|
this.listMembres = [];
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.membreService.getMembreId(this.tokenService.getCurrentMembreId()).subscribe((result) => {
|
||||||
|
this.conectedUser = result ;
|
||||||
|
console.log(result);
|
||||||
|
})
|
||||||
|
|
||||||
|
this.membreService.getMembresByTeamId()?.subscribe((membres: any[]) => {
|
||||||
|
console.log(membres);
|
||||||
|
this.listMembres = membres;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
</div>
|
</div>
|
||||||
<div class="col compte text-center">
|
<div class="col compte text-center">
|
||||||
<h1>Supprimer ce membre</h1>
|
<h1>Supprimer ce membre</h1>
|
||||||
<main class="contenu-compte">
|
<main class="contenu-compte"></main>
|
||||||
|
|
||||||
</main>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,29 +1,13 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar class="sidebarMenu"></app-side-bar>
|
||||||
</div>
|
</div>
|
||||||
<div class=" col compte text-center">
|
<div class="col menu text-center">
|
||||||
<h1>Menu de la semaine</h1>
|
<h2>Menu de la semaine</h2>
|
||||||
<main class="contenu-compte">
|
<main class="contenu-menu">
|
||||||
<app-card-menu></app-card-menu>
|
<app-card-menu></app-card-menu>
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<div>
|
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modifContact-form text-center">
|
<div class="modifContact-form text-center">
|
||||||
<h1>Modifier ce contact</h1>
|
<h3>Modifier ce contact</h3>
|
||||||
<main class="form-modifContact">
|
<main class="form-modifContact">
|
||||||
<form (ngSubmit)="onSubmit()" [formGroup]="modifContactForm">
|
<form (ngSubmit)="onSubmit()" [formGroup]="modifContactForm">
|
||||||
|
|
||||||
|
@ -85,3 +86,4 @@
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
|
@ -23,3 +23,4 @@ describe('PageNotFoundComponent', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
|
@ -6,16 +7,26 @@
|
||||||
|
|
||||||
<div class="col compte text-center py-3 border">
|
<div class="col compte text-center py-3 border">
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-sm btn-rounded btn-secondary m-3" type="submit">Tous les contacts
|
<button class="btn btn-sm btn-rounded btn-secondary m-3" type="submit">
|
||||||
|
Tous les contacts
|
||||||
</button>
|
</button>
|
||||||
<button routerLink="/ajouter-contact" class="btn btn-sm btn-rounded btn-secondary m-3">
|
<button
|
||||||
|
routerLink="/ajouter-contact"
|
||||||
|
class="btn btn-sm btn-rounded btn-secondary m-3"
|
||||||
|
>
|
||||||
Ajouter un contact
|
Ajouter un contact
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="input-group mb-3 d-flex justify-content-center">
|
<div class="input-group mb-3 d-flex justify-content-center">
|
||||||
<input type="text" class="form-control" placeholder="Rechercher un contact"
|
<input
|
||||||
aria-label="Rechercher un contact" aria-describedby="basic-addon2" #word
|
type="text"
|
||||||
(keyup)="onSearchChange(word.value)">
|
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 class="input-group-append"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,15 +35,26 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-evenly">
|
<div class="row justify-content-evenly">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="row my-3 d-flex justify-content-center flex-row" *ngFor="let personne of listContact"
|
<div
|
||||||
(click)="onClick(personne)">
|
class="row my-3 d-flex justify-content-center flex-row"
|
||||||
<div class="couleur col-4" [style.background-color]="personne.couleur"></div>
|
*ngFor="let personne of listContact"
|
||||||
<span class="fiche-contact col-7">{{ personne.prenom }} {{ personne.nom }}</span>
|
(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>
|
</div>
|
||||||
|
|
||||||
<div class="col-4" *ngIf="openDetails">
|
<div class="col-4" *ngIf="openDetails">
|
||||||
<app-fiche-contact [personne]="openDetails" (clickDelete)="onClickDelete($event)">
|
<app-fiche-contact
|
||||||
|
[personne]="openDetails"
|
||||||
|
(clickDelete)="onClickDelete($event)"
|
||||||
|
>
|
||||||
</app-fiche-contact>
|
</app-fiche-contact>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -69,5 +69,6 @@ export class PageRepertoireComponent implements OnInit {
|
||||||
}
|
}
|
||||||
this.router.navigate(['repertoire/']);
|
this.router.navigate(['repertoire/']);
|
||||||
});
|
});
|
||||||
|
window.location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
});
|
||||||
|
});
|
|
@ -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,5 +1,6 @@
|
||||||
<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="d-flex align-items-stretch">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col" *ngFor="let todos of result">
|
<div class="col" *ngFor="let todos of result">
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
</div>
|
</div>
|
||||||
<div class="col compte text-center">
|
<div class="col compte text-center">
|
||||||
<h1>Modifier votre compte</h1>
|
<h1>Modifier votre compte</h1>
|
||||||
<main class="contenu-compte">
|
<main class="contenu-compte"></main>
|
||||||
|
|
||||||
</main>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-auto">
|
<div class="col-md-auto">
|
||||||
<app-side-bar></app-side-bar>
|
<app-side-bar></app-side-bar>
|
||||||
</div>
|
</div>
|
||||||
<div class="col compte text-center">
|
<div class="col compte text-center">
|
||||||
<h1>Modifier ce membre</h1>
|
<h1>Modifier ce membre</h1>
|
||||||
<main class="contenu-compte">
|
<main class="contenu-compte"></main>
|
||||||
|
|
||||||
</main>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AuthInterceptor } from './auth.interceptor';
|
||||||
|
|
||||||
|
describe('AuthInterceptor', () => {
|
||||||
|
beforeEach(() => TestBed.configureTestingModule({
|
||||||
|
providers: [
|
||||||
|
AuthInterceptor
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
const interceptor: AuthInterceptor = TestBed.inject(AuthInterceptor);
|
||||||
|
expect(interceptor).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import {
|
||||||
|
HttpRequest,
|
||||||
|
HttpHandler,
|
||||||
|
HttpEvent,
|
||||||
|
HttpInterceptor
|
||||||
|
} from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { TokenService } from './token.service';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class AuthInterceptor implements HttpInterceptor {
|
||||||
|
|
||||||
|
constructor(private tokenService: TokenService) {}
|
||||||
|
|
||||||
|
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||||
|
console.log('Coucou je suis le videur ! ');
|
||||||
|
const token = this.tokenService.getToken();
|
||||||
|
if(token) {
|
||||||
|
|
||||||
|
const authReq = request.clone(
|
||||||
|
{
|
||||||
|
headers : request.headers.set('Authorization', `Bearer ${token}`)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return next.handle(authReq);
|
||||||
|
} else {
|
||||||
|
return next.handle(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ export class AuthService {
|
||||||
private tokenKey: string;
|
private tokenKey: string;
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient) {
|
||||||
// On se sert des variables d'environnement de notre application
|
|
||||||
this.apiUrl = environment.apiUrl;
|
this.apiUrl = environment.apiUrl;
|
||||||
this.tokenKey = environment.tokenKey;
|
this.tokenKey = environment.tokenKey;
|
||||||
}
|
}
|
||||||
|
@ -34,19 +34,14 @@ export class AuthService {
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('Mon body : ', body);
|
console.log('Mon body : ', body);
|
||||||
|
|
||||||
// Modifier cette partie ci-dessous :
|
|
||||||
// - pour pouvoir stocker dans le localstorage notre accesstoken
|
|
||||||
// - Sous la clé "TOKEN-LBP"
|
|
||||||
|
|
||||||
return this.http.post(`${this.apiUrl}/membres/sign-in`, body).pipe(
|
return this.http.post(`${this.apiUrl}/membres/sign-in`, body).pipe(
|
||||||
map((x: any) => {
|
map((x: any) => {
|
||||||
console.log('Service : ', x.token);
|
console.log('Service : ', x.token);
|
||||||
// Modification à faire ici
|
|
||||||
localStorage.setItem(this.tokenKey, x.token);
|
localStorage.setItem(this.tokenKey, x.token);
|
||||||
return x; // permet de renvoyer la réponse à l'initiateur (page Signin) après le traitement du map
|
return x; // permet de renvoyer la réponse à l'initiateur (page Signin) après le traitement du map
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forgotPassword(email: string): Observable<any> {
|
forgotPassword(email: string): Observable<any> {
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EvenementService } from './evenement.service';
|
||||||
|
|
||||||
|
describe('EvenementService', () => {
|
||||||
|
let service: EvenementService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(EvenementService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,36 @@
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class EvenementService {
|
||||||
|
apiUrl: string;
|
||||||
|
tokenKey: string;
|
||||||
|
|
||||||
|
constructor(private http: HttpClient) {
|
||||||
|
// On se sert des variables d'environnement de notre application
|
||||||
|
this.apiUrl = environment.apiUrl;
|
||||||
|
this.tokenKey = environment.tokenKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
getEvenementsByIdTeam(id: any): Observable<any> {
|
||||||
|
return this.http.get(`${this.apiUrl}/evenements/team/` + id);
|
||||||
|
}
|
||||||
|
|
||||||
|
addEvenements(evenement: any): Observable<any> {
|
||||||
|
console.log(evenement);
|
||||||
|
|
||||||
|
return this.http.post(`${this.apiUrl}/evenements/add`, evenement);
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteEvenements(id: any): Observable<any> {
|
||||||
|
return this.http.delete(`${this.apiUrl}/evenements/delete/`+id,{responseType: 'text'});
|
||||||
|
}
|
||||||
|
|
||||||
|
updateEvenements(evenement:any): Observable<any> {
|
||||||
|
return this.http.put(`${this.apiUrl}/evenements/update/1`, evenement);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { MailService } from './mail.service';
|
||||||
|
|
||||||
|
describe('MailService', () => {
|
||||||
|
let service: MailService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(MailService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,29 @@
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { Mail } from '../models/mail';
|
||||||
|
import { TokenService } from './token.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class MailService {
|
||||||
|
apiUrl: string;
|
||||||
|
tokenKey: string;
|
||||||
|
|
||||||
|
constructor(private http: HttpClient, private tokenService: TokenService, private router: Router) {
|
||||||
|
this.apiUrl = environment.apiUrl;
|
||||||
|
this.tokenKey = environment.tokenKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
envoiMailText(mail: Mail): Observable<any> | void{
|
||||||
|
return this.http.post(`${this.apiUrl}/sendmail/text`, mail, {
|
||||||
|
responseType: "text"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { Membre } from '../models/membre';
|
import { Membre } from '../models/membre';
|
||||||
|
import { TokenService } from './token.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -11,7 +13,7 @@ export class MembreService {
|
||||||
apiUrl: string;
|
apiUrl: string;
|
||||||
tokenKey: string;
|
tokenKey: string;
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient, private tokenService: TokenService, private router: Router) {
|
||||||
this.apiUrl = environment.apiUrl;
|
this.apiUrl = environment.apiUrl;
|
||||||
this.tokenKey = environment.tokenKey;
|
this.tokenKey = environment.tokenKey;
|
||||||
}
|
}
|
||||||
|
@ -20,14 +22,27 @@ export class MembreService {
|
||||||
return this.http.get(`${this.apiUrl}/membres/all`);
|
return this.http.get(`${this.apiUrl}/membres/all`);
|
||||||
}
|
}
|
||||||
|
|
||||||
getMembreId(id: any): Observable<any> {
|
getMembresByTeamId(): Observable<any> | void{
|
||||||
return this.http.get(`${this.apiUrl}/membres/1` + id);
|
const teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
if (teamId){
|
||||||
|
return this.http.get(`${this.apiUrl}/membres/team/${teamId}`);
|
||||||
|
}else {
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
}
|
}
|
||||||
|
|
||||||
addMembre(membre: Membre): Observable<any> {
|
}
|
||||||
console.log(membre);
|
|
||||||
|
|
||||||
return this.http.post(`${this.apiUrl}/membres/sign-up`, membre);
|
getMembreId(id: any): Observable<any> {
|
||||||
|
return this.http.get(`${this.apiUrl}/membres/` + id);
|
||||||
|
}
|
||||||
|
|
||||||
|
addMembre(membre: Membre): Observable<any> | void{
|
||||||
|
const teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
if (teamId){
|
||||||
|
return this.http.post(`${this.apiUrl}/membres/add/${teamId}`, membre);
|
||||||
|
}else {
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMembre(membre: Membre): Observable<any> {
|
deleteMembre(membre: Membre): Observable<any> {
|
||||||
|
|
|
@ -44,13 +44,18 @@ apiUrl: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMenu(id: any): Observable<any> {
|
deleteMenu(id:number): Observable<any> {
|
||||||
return this.http.delete(`${this.apiUrl}/menus/delete/`+ id);
|
return this.http.delete(`${this.apiUrl}/menus/delete/${id}`);
|
||||||
}
|
|
||||||
|
|
||||||
updateMenu(menu: Menu): Observable<any> {
|
|
||||||
return this.http.put(`${this.apiUrl}/contacts/update/`, menu);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateMenu(menu: Menu, id:number): Observable<any> | void {
|
||||||
|
const teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
if (teamId){
|
||||||
|
return this.http.put(`${this.apiUrl}/menus/update/${teamId}/${id}`, menu);
|
||||||
|
}else {
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { Team } from '../models/team';
|
import { Team } from '../models/team';
|
||||||
|
import { TokenService } from './token.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -12,7 +14,7 @@ export class TeamService {
|
||||||
tokenKey: string;
|
tokenKey: string;
|
||||||
|
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient, private tokenService: TokenService, private router: Router) {
|
||||||
this.apiUrl = environment.apiUrl;
|
this.apiUrl = environment.apiUrl;
|
||||||
this.tokenKey = environment.tokenKey;
|
this.tokenKey = environment.tokenKey;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +22,13 @@ export class TeamService {
|
||||||
return this.http.get(`${this.apiUrl}/teams/all`);
|
return this.http.get(`${this.apiUrl}/teams/all`);
|
||||||
}
|
}
|
||||||
|
|
||||||
getTeamById(id: any): Observable<any> {
|
getTeamById(): Observable<any> | void {
|
||||||
return this.http.get(`${this.apiUrl}/teams/1` + id);
|
const teamId = this.tokenService.getCurrentTeamId();
|
||||||
|
if (teamId){
|
||||||
|
return this.http.get(`${this.apiUrl}/teams/${teamId}`);
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['accueil']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addTeam(team: Team): Observable<any> {
|
addTeam(team: Team): Observable<any> {
|
||||||
|
|
|
@ -20,11 +20,22 @@ tokenKey = environment.tokenKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public eraseToken(): string | null {
|
||||||
|
const token = localStorage.getItem(this.tokenKey);
|
||||||
|
if(token) {
|
||||||
|
this.tokenKey = '';
|
||||||
|
return token;
|
||||||
|
}else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public getCurrentMembreId(): number | null {
|
public getCurrentMembreId(): number | null {
|
||||||
const token = this.getToken();
|
const token = this.getToken();
|
||||||
if(token) {
|
if(token) {
|
||||||
const decodedToken = jwt_decode<any>(token);
|
const decodedToken = jwt_decode<any>(token);
|
||||||
const userId = decodedToken.sub;
|
const userId = decodedToken.userId;
|
||||||
return userId;
|
return userId;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 75 KiB |
Binary file not shown.
Before Width: | Height: | Size: 443 KiB After Width: | Height: | Size: 123 KiB |
Binary file not shown.
After Width: | Height: | Size: 443 KiB |
Binary file not shown.
Before Width: | Height: | Size: 54 KiB |
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
apiUrl: 'http://localhost:8080',
|
apiUrl: 'http://localhost:8088',
|
||||||
tokenKey: 'TOKEN-ORGANIZEE',
|
tokenKey: 'TOKEN-ORGANIZEE',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
@import "~bootstrap/scss/bootstrap.scss";
|
@import "~bootstrap/scss/bootstrap.scss";
|
||||||
//Pour utiliser les icons ne fonctionne que si vous avez fait cette commande : npm i bootstrap-icons --save
|
//Pour utiliser les icons ne fonctionne que si vous avez fait cette commande : npm i bootstrap-icons --save
|
||||||
@import "~bootstrap-icons/font/bootstrap-icons.scss";
|
@import "~bootstrap-icons/font/bootstrap-icons.scss";
|
||||||
|
|
||||||
|
// pour surpasser le CSS par defaut
|
||||||
|
.calendar_default_event_inner{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar_default_event{
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
Loading…
Reference in New Issue