From 9b3c02f6c1292c517fd29ac67c6f6bc1feb34440 Mon Sep 17 00:00:00 2001 From: Hedi MJID Date: Sat, 26 Feb 2022 14:19:27 +0100 Subject: [PATCH] tracking files --- package-lock.json | 21 ++ package.json | 1 + src/app/app-routing.module.ts | 35 +-- src/app/app.module.ts | 94 ------- src/app/auth.guard.ts | 4 +- .../card-avatar/card-avatar.component.html | 13 + .../card-avatar/card-avatar.component.scss | 20 ++ .../card-avatar.component.spec.ts} | 12 +- .../card-avatar/card-avatar.component.ts | 17 ++ .../card-menu/card-menu.component.html | 141 ++++++++-- .../card-menu/card-menu.component.scss | 37 ++- .../card-menu/card-menu.component.ts | 97 +++++-- .../deconnexion/deconnexion.component.html | 7 + .../deconnexion/deconnexion.component.scss | 10 + .../deconnexion/deconnexion.component.spec.ts | 25 ++ .../deconnexion/deconnexion.component.ts | 26 ++ .../components/footer/footer.component.html | 23 +- .../components/footer/footer.component.scss | 13 +- .../components/header/header.component.html | 23 +- .../components/header/header.component.scss | 9 +- src/app/components/header/header.component.ts | 8 +- .../components/humeur/humeur.component.html | 22 ++ .../humeur/humeur.component.scss} | 9 +- .../humeur/humeur.component.spec.ts | 25 ++ .../humeur/humeur.component.ts} | 19 +- src/app/components/meteo/meteo.component.scss | 1 - src/app/components/signin/signin.component.ts | 7 +- src/app/models/mail.ts | 5 + src/app/models/menu.ts | 6 +- .../page-account/page-account.component.html | 63 +++-- .../page-account/page-account.component.ts | 11 +- .../page-add-member.component.html | 43 ++- .../page-add-member.component.ts | 27 +- .../page-agenda/page-agenda.component.html | 80 +++++- .../page-agenda/page-agenda.component.scss | 43 +++ .../page-agenda/page-agenda.component.ts | 262 +++++++++++++++++- .../page-ajout-contact.component.html | 213 +++++++++----- .../page-creation-team.component.html | 63 +++-- .../page-creation-team.component.ts | 5 +- .../page-dashboard.component.html | 34 ++- .../page-dashboard.component.scss | 49 +++- .../page-dashboard.component.ts | 24 +- .../page-delete-member.component.html | 7 +- .../page-menu-semaine.component.html | 28 +- .../page-menu-semaine.component.scss | 1 + .../page-modifier-contact.component.html | 12 +- .../page-not-found.component.spec.ts | 1 + .../page-repertoire.component.html | 90 +++--- .../page-repertoire.component.ts | 1 + .../page-support/page-support.component.html | 31 +++ .../page-support/page-support.component.scss | 39 +++ .../page-support.component.spec.ts | 25 ++ .../page-support/page-support.component.ts | 19 ++ .../page-to-do-list.component.html | 1 + .../page-update-account.component.html | 7 +- .../page-update-member.component.html | 7 +- src/app/services/auth.interceptor.spec.ts | 16 ++ src/app/services/auth.interceptor.ts | 31 +++ src/app/services/auth.service.ts | 9 +- src/app/services/evenement.service.spec.ts | 16 ++ src/app/services/evenement.service.ts | 36 +++ src/app/services/mail.service.spec.ts | 16 ++ src/app/services/mail.service.ts | 29 ++ src/app/services/membre.service.ts | 27 +- src/app/services/menus.service.ts | 17 +- src/app/services/team.service.ts | 13 +- src/app/services/token.service.ts | 13 +- src/assets/images/emoticon-feter.png | Bin 0 -> 76761 bytes src/assets/images/emoticon-heureux.png | Bin 453889 -> 125968 bytes src/assets/images/emoticon-heureux2.png | Bin 0 -> 453889 bytes src/assets/images/emoticon-vomir.png | Bin 54958 -> 0 bytes src/environments/environment.ts | 2 +- src/styles.scss | 9 + 73 files changed, 1671 insertions(+), 479 deletions(-) delete mode 100644 src/app/app.module.ts create mode 100644 src/app/components/card-avatar/card-avatar.component.html create mode 100644 src/app/components/card-avatar/card-avatar.component.scss rename src/app/{pages/page-humeur/page-humeur.component.spec.ts => components/card-avatar/card-avatar.component.spec.ts} (54%) create mode 100644 src/app/components/card-avatar/card-avatar.component.ts create mode 100644 src/app/components/deconnexion/deconnexion.component.html create mode 100644 src/app/components/deconnexion/deconnexion.component.scss create mode 100644 src/app/components/deconnexion/deconnexion.component.spec.ts create mode 100644 src/app/components/deconnexion/deconnexion.component.ts create mode 100644 src/app/components/humeur/humeur.component.html rename src/app/{pages/page-humeur/page-humeur.component.scss => components/humeur/humeur.component.scss} (76%) create mode 100644 src/app/components/humeur/humeur.component.spec.ts rename src/app/{pages/page-humeur/page-humeur.component.ts => components/humeur/humeur.component.ts} (73%) create mode 100644 src/app/models/mail.ts create mode 100644 src/app/pages/page-support/page-support.component.html create mode 100644 src/app/pages/page-support/page-support.component.scss create mode 100644 src/app/pages/page-support/page-support.component.spec.ts create mode 100644 src/app/pages/page-support/page-support.component.ts create mode 100644 src/app/services/auth.interceptor.spec.ts create mode 100644 src/app/services/auth.interceptor.ts create mode 100644 src/app/services/evenement.service.spec.ts create mode 100644 src/app/services/evenement.service.ts create mode 100644 src/app/services/mail.service.spec.ts create mode 100644 src/app/services/mail.service.ts create mode 100644 src/assets/images/emoticon-feter.png create mode 100644 src/assets/images/emoticon-heureux2.png delete mode 100644 src/assets/images/emoticon-vomir.png diff --git a/package-lock.json b/package-lock.json index 3a59d04..fb625c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@angular/platform-browser": "~13.0.0", "@angular/platform-browser-dynamic": "~13.0.0", "@angular/router": "~13.0.0", + "@daypilot/daypilot-lite-angular": "^3.2.0", "@ng-bootstrap/ng-bootstrap": "^12.0.0", "bootstrap": "^5.1.3", "bootstrap-icons": "^1.8.1", @@ -2371,6 +2372,18 @@ "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": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", @@ -12943,6 +12956,14 @@ "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": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", diff --git a/package.json b/package.json index c17bf17..ecaf75d 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@angular/platform-browser": "~13.0.0", "@angular/platform-browser-dynamic": "~13.0.0", "@angular/router": "~13.0.0", + "@daypilot/daypilot-lite-angular": "^3.2.0", "@ng-bootstrap/ng-bootstrap": "^12.0.0", "bootstrap": "^5.1.3", "bootstrap-icons": "^1.8.1", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4bdcac1..cd90cda 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -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 { PageModifierContactComponent } from './pages/page-modifier-contact/page-modifier-contact.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 { PageResetPasswordComponent } from './pages/page-reset-password/page-reset-password.component'; import { PageSignupComponent } from './pages/page-signup/page-signup.component'; import { PageToDoListComponent } from './pages/page-to-do-list/page-to-do-list.component'; import { PageUpdateAccountComponent } from './pages/page-update-account/page-update-account.component'; import { PageUpdateMemberComponent } from './pages/page-update-member/page-update-member.component'; +import { PageSupportComponent } from './pages/page-support/page-support.component'; import { FooterComponent } from './components/footer/footer.component'; +import { AuthGuard } from './auth.guard'; const routes: Routes = [ { path: '', redirectTo: 'accueil', pathMatch: 'full' }, - { path: 'modifier-contact/:id', component: PageModifierContactComponent }, - { path: 'compte', component: PageAccountComponent }, + { path: 'modifier-contact/:id', canActivate: [AuthGuard], component: PageModifierContactComponent }, + { path: 'compte', canActivate: [AuthGuard], component: PageAccountComponent }, { path: 'accueil', component: PageAccueilComponent }, - { path: 'ajout-membre', component: PageAddMemberComponent }, - { path: 'agenda', component: PageAgendaComponent }, - { path: 'tableau-de-bord', component: PageDashboardComponent }, - { path: 'supprimer-membre', component: PageDeleteMemberComponent }, - { path: 'supprimer-compte', component: PageDeleteAccountComponent }, + { path: 'ajout-membre', canActivate: [AuthGuard], component: PageAddMemberComponent }, + { path: 'agenda', canActivate: [AuthGuard], component: PageAgendaComponent }, + { path: 'tableau-de-bord', canActivate: [AuthGuard], component: PageDashboardComponent }, + { path: 'supprimer-membre', canActivate: [AuthGuard], component: PageDeleteMemberComponent }, + { path: 'supprimer-compte', canActivate: [AuthGuard], component: PageDeleteAccountComponent }, { path: 'password-oublie', component: PageForgotPasswordComponent }, - { path: 'menu', component: PageMenuSemaineComponent }, - { path: 'repertoire', component: PageRepertoireComponent }, + { path: 'menu', canActivate: [AuthGuard], component: PageMenuSemaineComponent }, + { path: 'repertoire', canActivate: [AuthGuard], component: PageRepertoireComponent }, { path: 'reinitialisation-password', component: PageResetPasswordComponent }, { path: 'creation-compte', component: PageSignupComponent }, - { path: 'to-do-list', component: PageToDoListComponent }, - { path: 'modifier-membre', component: PageUpdateMemberComponent }, - { path: 'modifier-compte', component: PageUpdateAccountComponent }, - { path: 'ajouter-contact', component: PageAjoutContactComponent }, - { path: 'creation-team', component: PageCreationTeamComponent }, - { path: 'humeur', component: PageHumeurComponent }, + { path: 'page-support', component: PageSupportComponent}, + { path: 'to-do-list', canActivate: [AuthGuard], component: PageToDoListComponent }, + { path: 'modifier-membre', canActivate: [AuthGuard], component: PageUpdateMemberComponent }, + { path: 'modifier-compte', canActivate: [AuthGuard], component: PageUpdateAccountComponent }, + { path: 'ajouter-contact', canActivate: [AuthGuard], component: PageAjoutContactComponent }, + { path: 'creation-team', canActivate: [AuthGuard], component: PageCreationTeamComponent }, { path: 'footer', component: FooterComponent}, { path: '**', component: PageNotFoundComponent }, ]; @NgModule({ - imports: [RouterModule.forRoot(routes)], + imports: [RouterModule.forRoot(routes, {onSameUrlNavigation:'reload'})], exports: [RouterModule], }) export class AppRoutingModule {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts deleted file mode 100644 index 92d674d..0000000 --- a/src/app/app.module.ts +++ /dev/null @@ -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 {} diff --git a/src/app/auth.guard.ts b/src/app/auth.guard.ts index 86d4f28..c457e30 100644 --- a/src/app/auth.guard.ts +++ b/src/app/auth.guard.ts @@ -39,7 +39,7 @@ export class AuthGuard implements CanActivate { const dateExp = new Date(decodedToken.exp * 1000); if (new Date() >= dateExp) { // le token a expiré, je n'autorise pas l'accès - this.router.navigate(['account/signin']); + this.router.navigate(['accueil']); return false; } } @@ -48,7 +48,7 @@ export class AuthGuard implements CanActivate { return true; } else { 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; } } diff --git a/src/app/components/card-avatar/card-avatar.component.html b/src/app/components/card-avatar/card-avatar.component.html new file mode 100644 index 0000000..4591621 --- /dev/null +++ b/src/app/components/card-avatar/card-avatar.component.html @@ -0,0 +1,13 @@ +
+
+
+
+ +
+
+

{{membre.prenom }} {{membre.nom }}

+
+
+
+
+
diff --git a/src/app/components/card-avatar/card-avatar.component.scss b/src/app/components/card-avatar/card-avatar.component.scss new file mode 100644 index 0000000..91c7e56 --- /dev/null +++ b/src/app/components/card-avatar/card-avatar.component.scss @@ -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; +} diff --git a/src/app/pages/page-humeur/page-humeur.component.spec.ts b/src/app/components/card-avatar/card-avatar.component.spec.ts similarity index 54% rename from src/app/pages/page-humeur/page-humeur.component.spec.ts rename to src/app/components/card-avatar/card-avatar.component.spec.ts index 01c84db..b966873 100644 --- a/src/app/pages/page-humeur/page-humeur.component.spec.ts +++ b/src/app/components/card-avatar/card-avatar.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { PageHumeurComponent } from './page-humeur.component'; +import { CardAvatarComponent } from './card-avatar.component'; -describe('PageHumeurComponent', () => { - let component: PageHumeurComponent; - let fixture: ComponentFixture; +describe('CardAvatarComponent', () => { + let component: CardAvatarComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ PageHumeurComponent ] + declarations: [ CardAvatarComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(PageHumeurComponent); + fixture = TestBed.createComponent(CardAvatarComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/components/card-avatar/card-avatar.component.ts b/src/app/components/card-avatar/card-avatar.component.ts new file mode 100644 index 0000000..1f9ac37 --- /dev/null +++ b/src/app/components/card-avatar/card-avatar.component.ts @@ -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 { + } + + +} diff --git a/src/app/components/card-menu/card-menu.component.html b/src/app/components/card-menu/card-menu.component.html index a6a566b..76793e5 100644 --- a/src/app/components/card-menu/card-menu.component.html +++ b/src/app/components/card-menu/card-menu.component.html @@ -1,46 +1,135 @@ -