mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
feat: add RssService for managing feeds and articles
This commit is contained in:
1 parent
91bc543845
commit
a7251dfe5a
6 files changed
+25
-7
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogDescription,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
interface PomodoroModalProps {
|
||||
@@ -18,6 +19,9 @@ export function PomodoroModal({ open, onOpenChange, children }: PomodoroModalPro
|
||||
<DialogContent className="max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-2xl">Pomodoro Timer</DialogTitle>
|
||||
<DialogDescription className="sr-only">
|
||||
Gérez vos sessions de travail et de pause.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="mt-4">
|
||||
{children}
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogDescription,
|
||||
} from "@/components/ui/dialog";
|
||||
import { StatsDashboard } from "./StatsDashboard";
|
||||
import { Note } from "@/services/NotesService";
|
||||
@@ -21,6 +22,9 @@ export function StatsModal({ open, onOpenChange, notes, todos }: StatsModalProps
|
||||
<DialogContent className="max-w-2xl max-h-[80vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-2xl">Statistiques</DialogTitle>
|
||||
<DialogDescription className="sr-only">
|
||||
Tableau de bord de vos statistiques notes et tâches.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="mt-4">
|
||||
<StatsDashboard notes={notes} todos={todos} />
|
||||
|
||||
@@ -59,7 +59,11 @@ export function InputModal({
|
||||
<DialogContent className="sm:max-w-[425px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
{description && <DialogDescription>{description}</DialogDescription>}
|
||||
{description ? (
|
||||
<DialogDescription>{description}</DialogDescription>
|
||||
) : (
|
||||
<DialogDescription className="sr-only">{title}</DialogDescription>
|
||||
)}
|
||||
</DialogHeader>
|
||||
<div className="grid gap-4 py-4">
|
||||
<div className="grid gap-2">
|
||||
|
||||
+2
-2
@@ -667,8 +667,8 @@ const Index = () => {
|
||||
showSuccess("Flux RSS ajouté");
|
||||
loadRssArticles();
|
||||
}
|
||||
} catch (error) {
|
||||
showError("Erreur lors de l'ajout du flux");
|
||||
} catch (error: any) {
|
||||
showError(error.message || "Erreur lors de l'ajout du flux");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog";
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DialogDescription } from "@/components/ui/dialog";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { MobileFAB } from "@/components/mobile/MobileFAB";
|
||||
import { MobileCard } from "@/components/mobile/MobileCard";
|
||||
@@ -57,8 +57,8 @@ export default function RssPage() {
|
||||
setFeedTitle("");
|
||||
setAddFeedModal(false);
|
||||
await handleRefresh();
|
||||
} catch (error) {
|
||||
showError("Erreur lors de l'ajout du flux");
|
||||
} catch (error: any) {
|
||||
showError(error.message || "Erreur lors de l'ajout du flux");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -155,6 +155,9 @@ export default function RssPage() {
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Ajouter un flux RSS</DialogTitle>
|
||||
<DialogDescription className="sr-only">
|
||||
Saisissez l'URL du flux RSS à ajouter.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
|
||||
@@ -45,8 +45,11 @@ class RssService {
|
||||
try {
|
||||
const response = await axios.post(`${this.baseURL}/feeds`, { url, title }, this.getAuthHeader());
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error('Error adding RSS feed:', error);
|
||||
if (error.response && error.response.data && error.response.data.error) {
|
||||
throw new Error(error.response.data.error);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user