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