Release 2.4.0: bulk download rework, toasts and Sakani polish
- ZIP download from the Merkzettel: every photo is a new usage by default; only already downloaded photos offer "Neu / Bereits genutzt" (SegmentedControl), with thumbnails and a cost summary. "Bild auslassen" is gone. - Toasts (Sakani Toaster) for admin saves, deletes and errors; billing errors are readable and use router.refresh instead of reloads. Errors inside modal dialogs stay inline (a toast would sit behind the backdrop). - Album overview in blog-listing style, Sakani Pagination for albums, search and usage history, skeleton loading states. - Registration stepper; verification mail lands on step 3. - Editorials as a searchable, filterable table; audit log with event picker, German labels and collapsible details. - Release notes 2.4.0 seeded (migration 0009). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2775b406bf
commit
cba70310f9
48 files changed
+3474
-454
No files matched your search
@@ -2,12 +2,13 @@
|
||||
|
||||
import { useId, useState, useTransition } from "react";
|
||||
|
||||
import { Alert, Input } from "@sakaniui/react";
|
||||
import { Input } from "@sakaniui/react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, FormSelect } from "@/components/ui/sakani";
|
||||
|
||||
import type { CalendarActionResult } from "./actions";
|
||||
import { notifyResult } from "@/components/ui/feedback";
|
||||
|
||||
export function CalendarEventForm({
|
||||
action,
|
||||
@@ -22,14 +23,13 @@ export function CalendarEventForm({
|
||||
}>) {
|
||||
const titleId = useId();
|
||||
const dateId = useId();
|
||||
const [state, setState] = useState<CalendarActionResult>({ ok: true, message: "" });
|
||||
const [pending, startTransition] = useTransition();
|
||||
const [title, setTitle] = useState("");
|
||||
|
||||
const handleSubmit = (formData: FormData) => {
|
||||
startTransition(async () => {
|
||||
const result = await action({ ok: true, message: "" }, formData);
|
||||
setState(result);
|
||||
notifyResult(result);
|
||||
if (result.ok) {
|
||||
setTitle("");
|
||||
}
|
||||
@@ -80,11 +80,6 @@ export function CalendarEventForm({
|
||||
{pending ? "Wird angelegt …" : "Termin anlegen"}
|
||||
</Button>
|
||||
</div>
|
||||
{state.message ? (
|
||||
<div aria-live="polite">
|
||||
<Alert color={state.ok ? "success" : "danger"} description={state.message} />
|
||||
</div>
|
||||
) : null}
|
||||
</form>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useTransition } from "react";
|
||||
import { useTransition } from "react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
import type { CalendarActionResult } from "./actions";
|
||||
import { notifyResult } from "@/components/ui/feedback";
|
||||
|
||||
// Deleting an event also revokes self-service grants on its linked album, so
|
||||
// the admin confirms once before the action runs.
|
||||
@@ -15,7 +16,6 @@ export function DeleteCalendarEventButton({
|
||||
action: (state: CalendarActionResult, formData: FormData) => Promise<CalendarActionResult>;
|
||||
eventId: string;
|
||||
}>) {
|
||||
const [state, setState] = useState<CalendarActionResult>({ ok: true, message: "" });
|
||||
const [pending, startTransition] = useTransition();
|
||||
|
||||
const handleClick = () => {
|
||||
@@ -25,7 +25,7 @@ export function DeleteCalendarEventButton({
|
||||
const formData = new FormData();
|
||||
formData.set("eventId", eventId);
|
||||
startTransition(async () => {
|
||||
setState(await action({ ok: true, message: "" }, formData));
|
||||
notifyResult(await action({ ok: true, message: "" }, formData), "Termin gelöscht.");
|
||||
});
|
||||
};
|
||||
|
||||
@@ -34,11 +34,6 @@ export function DeleteCalendarEventButton({
|
||||
<Button type="button" variant="outline" size="sm" disabled={pending} onClick={handleClick}>
|
||||
{pending ? "…" : "Löschen"}
|
||||
</Button>
|
||||
{state.ok ? null : (
|
||||
<p role="alert" className="text-xs text-destructive">
|
||||
{state.message}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useId, useState, useTransition } from "react";
|
||||
import { Alert, Input } from "@sakaniui/react";
|
||||
import { Input } from "@sakaniui/react";
|
||||
|
||||
import { CategoryDot } from "@/components/calendar/category-legend";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -9,6 +9,7 @@ import { Card } from "@/components/ui/sakani";
|
||||
import { CATEGORY_COLOR_LABELS, CATEGORY_COLORS, type CategoryColor } from "@/modules/calendar/colors";
|
||||
|
||||
import type { CategoryActionResult } from "./actions";
|
||||
import { notifyResult } from "@/components/ui/feedback";
|
||||
|
||||
export function CategoryForm({
|
||||
action,
|
||||
@@ -16,13 +17,12 @@ export function CategoryForm({
|
||||
const nameId = useId();
|
||||
const [name, setName] = useState("");
|
||||
const [color, setColor] = useState<CategoryColor>("blue");
|
||||
const [state, setState] = useState<CategoryActionResult>({ ok: true, message: "" });
|
||||
const [pending, startTransition] = useTransition();
|
||||
|
||||
const handleSubmit = (formData: FormData) => {
|
||||
startTransition(async () => {
|
||||
const result = await action({ ok: true, message: "" }, formData);
|
||||
setState(result);
|
||||
notifyResult(result);
|
||||
if (result.ok) setName("");
|
||||
});
|
||||
};
|
||||
@@ -73,11 +73,6 @@ export function CategoryForm({
|
||||
{pending ? "Wird gespeichert …" : "Kategorie speichern"}
|
||||
</Button>
|
||||
</div>
|
||||
{state.message ? (
|
||||
<div aria-live="polite">
|
||||
<Alert color={state.ok ? "success" : "danger"} description={state.message} />
|
||||
</div>
|
||||
) : null}
|
||||
</form>
|
||||
</Card>
|
||||
);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useTransition } from "react";
|
||||
import { useTransition } from "react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
import type { CategoryActionResult } from "./actions";
|
||||
import { notifyResult } from "@/components/ui/feedback";
|
||||
|
||||
export function DeleteCategoryButton({
|
||||
action,
|
||||
@@ -15,13 +16,12 @@ export function DeleteCategoryButton({
|
||||
categoryId: string;
|
||||
inUse: boolean;
|
||||
}>) {
|
||||
const [state, setState] = useState<CategoryActionResult>({ ok: true, message: "" });
|
||||
const [pending, startTransition] = useTransition();
|
||||
|
||||
const handleClick = () => {
|
||||
const formData = new FormData();
|
||||
formData.set("categoryId", categoryId);
|
||||
startTransition(async () => setState(await action({ ok: true, message: "" }, formData)));
|
||||
startTransition(async () => notifyResult(await action({ ok: true, message: "" }, formData), "Kategorie gelöscht."));
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -36,11 +36,6 @@ export function DeleteCategoryButton({
|
||||
>
|
||||
{pending ? "…" : "Löschen"}
|
||||
</Button>
|
||||
{state.ok ? null : (
|
||||
<p className="text-xs text-[var(--color-danger-fg)]" role="alert">
|
||||
{state.message}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user