diff --git a/README.md b/README.md index 3575a6e..68f1ce0 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ - [ ] L'avatar s'affiche pas quand on upload un commentaire (il faut recharger la page) - [ ] Faire des meilleurs modal - [ ] Terminer l'interface admin -- [ ] Bug (de temps en temps) pour stocker les cookies utilisateur +- [x] Bug (de temps en temps) pour stocker les cookies utilisateur pour run le docker : ``` diff --git a/package.json b/package.json index 501d495..38566fc 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,13 @@ "@angular/platform-browser-dynamic": "^18.2.0", "@angular/platform-server": "^18.2.0", "@angular/router": "^18.2.0", - "@angular/ssr": "^18.2.12", + "@angular/ssr": "^18.2.18", + "@primeng/themes": "^19.1.0", "express": "^4.18.2", "luxon": "^3.5.0", "ngx-cookie-service": "^18.0.0", "primeicons": "^7.0.0", - "primeng": "^17.18.10", + "primeng": "^18.0.2", "quill": "^2.0.3", "review-front": "file:", "rxjs": "~7.8.0", @@ -35,8 +36,8 @@ "zone.js": "~0.14.10" }, "devDependencies": { - "@angular-devkit/build-angular": "^18.2.12", - "@angular/cli": "^18.2.12", + "@angular-devkit/build-angular": "^18.2.18", + "@angular/cli": "^18.2.18", "@angular/compiler-cli": "^18.2.0", "@types/express": "^4.17.17", "@types/jasmine": "~5.1.0", @@ -51,4 +52,4 @@ "karma-jasmine-html-reporter": "~2.1.0", "typescript": "~5.5.2" } -} \ No newline at end of file +} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b609473..823f68b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,12 +7,12 @@ import {DialogModule} from 'primeng/dialog'; import {isPlatformBrowser} from '@angular/common'; import {Button} from 'primeng/button'; import {AuthService} from './auth.service'; -import {Router} from '@angular/router'; +import {Router, RouterOutlet} from '@angular/router'; @Component({ selector: 'app-root', standalone: true, - imports: [MenubarModule, FloatLabelModule, ToastModule, DialogModule, Button], + imports: [MenubarModule, FloatLabelModule, ToastModule, DialogModule, Button, RouterOutlet], providers: [ MessageService, ], @@ -28,7 +28,7 @@ export class AppComponent implements OnInit { } isBrowser(): boolean { - return isPlatformBrowser(this.platformId); + return isPlatformBrowser(this.platformId) } setSessionExpiredFalse(): void { diff --git a/src/app/app.config.ts b/src/app/app.config.ts index becc995..ef61b55 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,11 +1,12 @@ import {ApplicationConfig, importProvidersFrom, provideZoneChangeDetection} from '@angular/core'; import {provideRouter} from '@angular/router'; - import {routes} from './app.routes'; import {provideClientHydration} from '@angular/platform-browser'; import {provideHttpClient, withFetch} from '@angular/common/http'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; +import {provideAnimationsAsync} from '@angular/platform-browser/animations/async'; +import {providePrimeNG} from 'primeng/config'; +import {myPreset} from './preset' export const appConfig: ApplicationConfig = { providers: [ @@ -13,5 +14,14 @@ export const appConfig: ApplicationConfig = { provideRouter(routes), provideClientHydration(), provideHttpClient(withFetch()), + provideAnimationsAsync(), + providePrimeNG({ + theme: { + preset: myPreset, + options: { + darkModeSelector: '.my-app-dark' // class css pour activer le dark mode + } + } + }), importProvidersFrom([BrowserAnimationsModule]), provideAnimationsAsync()] }; diff --git a/src/app/components/comment-form/comment-form.component.ts b/src/app/components/comment-form/comment-form.component.ts index 964c803..50e783a 100644 --- a/src/app/components/comment-form/comment-form.component.ts +++ b/src/app/components/comment-form/comment-form.component.ts @@ -1,9 +1,7 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms'; -import {InputTextareaModule} from 'primeng/inputtextarea'; import {Button} from 'primeng/button'; import {CommentService} from '../../services/comment.service'; -import {Author} from '../../models/author'; import {Subscription} from 'rxjs'; import {Comment} from '../../models/comment'; import {MessageService} from 'primeng/api'; @@ -15,7 +13,6 @@ import {AuthService} from '../../auth.service'; standalone: true, imports: [ ReactiveFormsModule, - InputTextareaModule, Button, NgStyle ], diff --git a/src/app/components/post-form/post-form.component.ts b/src/app/components/post-form/post-form.component.ts index 0ff8b47..7941088 100644 --- a/src/app/components/post-form/post-form.component.ts +++ b/src/app/components/post-form/post-form.component.ts @@ -1,7 +1,6 @@ import {Component, Input, OnDestroy} from '@angular/core'; import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms'; import {InputTextModule} from 'primeng/inputtext'; -import {InputTextareaModule} from 'primeng/inputtextarea'; import {FileSelectEvent, FileUploadModule} from 'primeng/fileupload'; import {mergeMap, Subscription} from 'rxjs'; import {PostService} from '../../services/post.service'; @@ -11,6 +10,7 @@ import {Router} from '@angular/router'; import {Author} from '../../models/author'; import {AuthorService} from '../../services/author.service'; import {AuthService} from '../../auth.service'; +import {Button} from 'primeng/button'; @Component({ selector: 'app-post-form', @@ -18,9 +18,9 @@ import {AuthService} from '../../auth.service'; imports: [ ReactiveFormsModule, InputTextModule, - InputTextareaModule, FileUploadModule, - EditorModule + EditorModule, + Button ], templateUrl: './post-form.component.html', styleUrls: ['./post-form.component.css'] diff --git a/src/app/components/post-home/post-home.component.html b/src/app/components/post-home/post-home.component.html index 6aaabc2..9afc6f8 100644 --- a/src/app/components/post-home/post-home.component.html +++ b/src/app/components/post-home/post-home.component.html @@ -5,7 +5,7 @@ {{ category }} Publié le {{ date | date : "dd/MM/yyyy à HH:mm" }} {{ description }} - + Lire la suite @if (authorProfilePicture) { {{ author.role }} - diff --git a/src/app/pages/my-posts/my-posts.component.html b/src/app/pages/my-posts/my-posts.component.html index cde8d1f..1ac4c4d 100644 --- a/src/app/pages/my-posts/my-posts.component.html +++ b/src/app/pages/my-posts/my-posts.component.html @@ -35,7 +35,7 @@ -