fix de bugs
This commit is contained in:
parent
caaca29da9
commit
d0b83d99e7
14
README.md
14
README.md
@ -2,16 +2,12 @@
|
|||||||
|
|
||||||
## Liste des améliorations
|
## Liste des améliorations
|
||||||
|
|
||||||
- [ ] Bouton "Voir les posts de l'utilisateur" à enlever (un seul écrivain donc inutile...)
|
- [x] Bug CSS concernant le footer
|
||||||
- [ ] Bug CSS concernant le footer
|
- [x] Problème d'actualisation des commentaires quand on écrit au moins 2 commentaires à la suite
|
||||||
- [ ] Mauvaise actualisation du pseudo quand on se renomme
|
- [x] Responsive des commentaires
|
||||||
- [ ] Support d'un dark thème (à réflechir...)
|
- [x] Garder l'avatar de l'utilisateur quand il met à jour uniquement son pseudo
|
||||||
- [ ] Erreur 403 quand on modifie le pseudo mais pas l'image d'un utilisateur
|
- [x] Ne pas avoir à confirmer son mot de passe lors de la connexion
|
||||||
- [ ] Garder l'avatar de l'utilisateur quand il met à jour uniquement son pseudo
|
|
||||||
- [ ] Ne pas avoir à confirmer son mot de passe lors de la connexion
|
|
||||||
- [ ] Pouvoir modifier son commentaire
|
|
||||||
- [x] L'avatar s'affiche pas quand on upload un commentaire (il faut recharger la page)
|
- [x] L'avatar s'affiche pas quand on upload un commentaire (il faut recharger la page)
|
||||||
- [ ] Faire des meilleurs modal
|
|
||||||
- [ ] Terminer l'interface admin
|
- [ ] Terminer l'interface admin
|
||||||
- [x] Bug (de temps en temps) pour stocker les données utilisateur
|
- [x] Bug (de temps en temps) pour stocker les données utilisateur
|
||||||
|
|
||||||
|
BIN
public/icon.jpg
BIN
public/icon.jpg
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
BIN
public/icon.png
Normal file
BIN
public/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
@ -42,6 +42,7 @@ export class CommentFormComponent {
|
|||||||
// get l'image de profile après avoir créé le commentaire
|
// get l'image de profile après avoir créé le commentaire
|
||||||
this.subs.push(this.commentService.create(this.commentForm.value.content, this.postId, author.id, token).pipe(
|
this.subs.push(this.commentService.create(this.commentForm.value.content, this.postId, author.id, token).pipe(
|
||||||
switchMap((comment: Comment) => {
|
switchMap((comment: Comment) => {
|
||||||
|
this.createdComment = { ... this.createdComment } // attention a bien mettre à jour la ref sinon ça casse
|
||||||
this.createdComment.authorId = author.id;
|
this.createdComment.authorId = author.id;
|
||||||
this.createdComment.content = comment.content;
|
this.createdComment.content = comment.content;
|
||||||
this.createdComment.id = comment.id;
|
this.createdComment.id = comment.id;
|
||||||
@ -53,10 +54,9 @@ export class CommentFormComponent {
|
|||||||
})
|
})
|
||||||
).subscribe({
|
).subscribe({
|
||||||
next: (profilePicture: string) => {
|
next: (profilePicture: string) => {
|
||||||
this.createdComment.profilePicture = profilePicture; // c'est de la merde
|
this.createdComment.profilePicture = profilePicture;
|
||||||
this.commentForm.value.content = "";
|
this.commentForm.value.content = "";
|
||||||
this.commentToEmit.emit(this.createdComment);
|
this.commentToEmit.emit(this.createdComment);
|
||||||
console.log(this.createdComment)
|
|
||||||
this.successMessage("Succès", "Commentaire créé avec succès");
|
this.successMessage("Succès", "Commentaire créé avec succès");
|
||||||
},
|
},
|
||||||
error: (error) => {
|
error: (error) => {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<div>
|
<div>
|
||||||
<img src="./assets/icon.jpg" alt="loadign">
|
<img src="./assets/icon.png" alt="loadign">
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,16 +58,6 @@ em {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.commentaires {
|
|
||||||
margin: auto;
|
|
||||||
width: 45%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 2rem;
|
|
||||||
flex-direction: column;
|
|
||||||
margin-top: 5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-dialog {
|
.delete-dialog {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -75,10 +65,48 @@ em {
|
|||||||
gap: 3em;
|
gap: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-div {
|
.commentaires {
|
||||||
|
margin: auto;
|
||||||
|
margin-top: 5rem;
|
||||||
|
width: 45%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 2.5rem;
|
||||||
|
padding: 0 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.comment-div {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 1rem;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1200px) {
|
||||||
|
.body-content,
|
||||||
|
.commentaires {
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-div {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-meta-header {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-button {
|
||||||
|
position: static;
|
||||||
|
align-self: flex-end;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -68,15 +68,8 @@ export class PostComponent {
|
|||||||
next: res => {
|
next: res => {
|
||||||
res.post.body = res.post.body.replace(/ /g, ' ')
|
res.post.body = res.post.body.replace(/ /g, ' ')
|
||||||
this.concernedPost = res.post;
|
this.concernedPost = res.post;
|
||||||
this.sortCommentList(res.comment)
|
this.comments = res.comment
|
||||||
this.comments = res.comment.sort((a, b) => {
|
this.sortCommentList()
|
||||||
if (a.commentDate > b.commentDate) {
|
|
||||||
return -1
|
|
||||||
} else if (a.commentDate < b.commentDate) {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
});
|
|
||||||
this.comments.forEach(comment => this.commentDeleteDialogMap.set(comment.id, false));
|
this.comments.forEach(comment => this.commentDeleteDialogMap.set(comment.id, false));
|
||||||
},
|
},
|
||||||
error: err => this.failureMessage("Erreur", err.error.message)
|
error: err => this.failureMessage("Erreur", err.error.message)
|
||||||
@ -90,7 +83,8 @@ export class PostComponent {
|
|||||||
|
|
||||||
addNewCommentToList(comment: Comment) {
|
addNewCommentToList(comment: Comment) {
|
||||||
this.comments.push(comment);
|
this.comments.push(comment);
|
||||||
this.sortCommentList(this.comments);
|
console.log(this.comments)
|
||||||
|
this.sortCommentList();
|
||||||
}
|
}
|
||||||
|
|
||||||
setCommentDialogVisible(commentId: bigint) {
|
setCommentDialogVisible(commentId: bigint) {
|
||||||
@ -118,15 +112,15 @@ export class PostComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sortCommentList(comments: Comment[]) {
|
sortCommentList() {
|
||||||
comments.sort((a, b) => {
|
this.comments = this.comments.sort((a, b) => {
|
||||||
if (a.commentDate > b.commentDate) {
|
if (a.commentDate > b.commentDate) {
|
||||||
return -1
|
return -1
|
||||||
} else if (a.commentDate < b.commentDate) {
|
} else if (a.commentDate < b.commentDate) {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
successMessage(summary: string, detail: string): void {
|
successMessage(summary: string, detail: string): void {
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p-button label="Voir les posts de l'utilisateur"></p-button>
|
|
||||||
@if (actualAuthor) {
|
@if (actualAuthor) {
|
||||||
@if (concernedAuthor.id === actualAuthor.id) {
|
@if (concernedAuthor.id === actualAuthor.id) {
|
||||||
<p-button label="Mettre à jour les données du profil" (onClick)="updateProfileDialog=true"/>
|
<p-button label="Mettre à jour les données du profil" (onClick)="updateProfileDialog=true"/>
|
||||||
|
@ -33,7 +33,6 @@ export class ProfileComponent implements OnDestroy {
|
|||||||
authorName: string = "";
|
authorName: string = "";
|
||||||
subs: Subscription[] = [];
|
subs: Subscription[] = [];
|
||||||
updateProfileDialog: boolean = false;
|
updateProfileDialog: boolean = false;
|
||||||
changePasswordDialog: boolean = false;
|
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private authorService: AuthorService,
|
private authorService: AuthorService,
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
BIN
src/assets/icon.png
Normal file
BIN
src/assets/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
@ -6,7 +6,7 @@
|
|||||||
<title>A BON ENTENDEUR</title>
|
<title>A BON ENTENDEUR</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="icon.jpg">
|
<link rel="icon" type="image/x-icon" href="icon.png">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
|
@ -11,7 +11,6 @@ body {
|
|||||||
background-color: #1c1c1c;
|
background-color: #1c1c1c;
|
||||||
color: #f1f1f1;
|
color: #f1f1f1;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
text-align: center;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,6 +19,7 @@ body {
|
|||||||
.footer-follow,
|
.footer-follow,
|
||||||
.footer-links,
|
.footer-links,
|
||||||
.footer-copyright {
|
.footer-copyright {
|
||||||
|
text-align: center;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,14 +36,6 @@ app-root {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
padding: 10px;
|
|
||||||
background: #222;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-link {
|
.footer-link {
|
||||||
color: #1e90ff;
|
color: #1e90ff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@ -54,5 +46,11 @@ app-root {
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
html, body { height: 100%; }
|
html, body {
|
||||||
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: Roboto, "Helvetica Neue", sans-serif;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user