Checkpoint: Correction de l'encodage Unicode du bouton "Vérifier maintenant" et ajout du rafraîchissement automatique de l'interface après démarrage/arrêt des services d'import.
This commit is contained in:
@@ -191,6 +191,7 @@ export default function ImportSettings() {
|
|||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
await stopFolderServiceMutation.mutateAsync();
|
await stopFolderServiceMutation.mutateAsync();
|
||||||
|
await utils.folderImportService.status.invalidate();
|
||||||
toast.success("Service arrêté", {
|
toast.success("Service arrêté", {
|
||||||
description: "L'import automatique depuis dossier a été arrêté.",
|
description: "L'import automatique depuis dossier a été arrêté.",
|
||||||
});
|
});
|
||||||
@@ -212,13 +213,14 @@ export default function ImportSettings() {
|
|||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
const result = await startFolderServiceMutation.mutateAsync();
|
const result = await startFolderServiceMutation.mutateAsync();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
toast.success("Service démarré", {
|
await utils.folderImportService.status.invalidate();
|
||||||
description: "L'import automatique depuis dossier est maintenant actif.",
|
toast.success("Service démarré", {
|
||||||
});
|
description: "L'import automatique depuis dossier est maintenant actif.",
|
||||||
} else {
|
});
|
||||||
|
} else {
|
||||||
toast.error("Erreur", {
|
toast.error("Erreur", {
|
||||||
description: "Impossible de démarrer le service. Vérifiez la configuration.",
|
description: "Impossible de démarrer le service. Vérifiez la configuration.",
|
||||||
});
|
});
|
||||||
@@ -361,6 +363,7 @@ export default function ImportSettings() {
|
|||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
await stopEmailServiceMutation.mutateAsync();
|
await stopEmailServiceMutation.mutateAsync();
|
||||||
|
await utils.emailImportService.status.invalidate();
|
||||||
toast.success("Service arrêté", {
|
toast.success("Service arrêté", {
|
||||||
description: "L'import automatique par email a été arrêté.",
|
description: "L'import automatique par email a été arrêté.",
|
||||||
});
|
});
|
||||||
@@ -385,6 +388,7 @@ export default function ImportSettings() {
|
|||||||
try {
|
try {
|
||||||
const result = await startEmailServiceMutation.mutateAsync();
|
const result = await startEmailServiceMutation.mutateAsync();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
await utils.emailImportService.status.invalidate();
|
||||||
toast.success("Service démarré", {
|
toast.success("Service démarré", {
|
||||||
description: "L'import automatique par email est maintenant actif.",
|
description: "L'import automatique par email est maintenant actif.",
|
||||||
});
|
});
|
||||||
@@ -421,13 +425,13 @@ export default function ImportSettings() {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
toast.info("V\u00e9rification en cours...", {
|
toast.info("Vérification en cours...", {
|
||||||
description: "Connexion au serveur IMAP et recherche de nouveaux emails.",
|
description: "Connexion au serveur IMAP et recherche de nouveaux emails.",
|
||||||
});
|
});
|
||||||
const result = await checkNowEmailMutation.mutateAsync();
|
const result = await checkNowEmailMutation.mutateAsync();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
await utils.importLogs.getByUser.invalidate();
|
await utils.importLogs.getByUser.invalidate();
|
||||||
toast.success("V\u00e9rification termin\u00e9e", {
|
toast.success("Vérification terminée", {
|
||||||
description: result.message,
|
description: result.message,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -437,7 +441,7 @@ export default function ImportSettings() {
|
|||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
toast.error("Erreur", {
|
toast.error("Erreur", {
|
||||||
description: error.message || "Impossible de v\u00e9rifier les emails.",
|
description: error.message || "Impossible de vérifier les emails.",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -448,7 +452,7 @@ export default function ImportSettings() {
|
|||||||
) : (
|
) : (
|
||||||
<Mail className="mr-2 h-4 w-4" />
|
<Mail className="mr-2 h-4 w-4" />
|
||||||
)}
|
)}
|
||||||
V\u00e9rifier maintenant
|
Vérifier maintenant
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
4
todo.md
4
todo.md
@@ -191,3 +191,7 @@
|
|||||||
- [x] Ajouter fonction triggerEmailCheck dans emailImportService
|
- [x] Ajouter fonction triggerEmailCheck dans emailImportService
|
||||||
- [x] Ajouter route tRPC emailImportService.checkNow
|
- [x] Ajouter route tRPC emailImportService.checkNow
|
||||||
- [ ] Tester avec un email réel et diagnostiquer les erreurs IMAP
|
- [ ] Tester avec un email réel et diagnostiquer les erreurs IMAP
|
||||||
|
|
||||||
|
## Bugs interface ImportSettings
|
||||||
|
- [x] Corriger l'encodage Unicode du bouton "Vérifier maintenant"
|
||||||
|
- [x] Ajouter rafraîchissement automatique du statut du service après démarrage/arrêt (email et dossier)
|
||||||
|
|||||||
Reference in New Issue
Block a user