Detailed analysis button, loading wheel, birth data change limits
Backend: - own birth data: three corrections within an hour of the first save, then one change per 24 hours (birth_data_changes); 429 birth_data_change_limit with the user-facing message; /v1/me birth_change shows the notice; admins are not limited - admins get detailed analyses free (no unit spent) - POST /v1/payments/mock (MOCK_PAYMENTS): stand-in payment that adds a unit, until Stripe is connected; on in the compose files for now Frontend: - detailed analysis offer: admin starts it free, users with units confirm, others go through the (stand-in) payment step - turning wheel with elapsed time while the summary or the analysis is being written - no "adatok javítása" on the chart page (only in the profile), limit notice there; wheel hover highlighting removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { BigThree, ChartTables } from "@/components/ChartTables";
|
||||
@@ -8,7 +7,7 @@ import { DetailedAnalysis } from "@/components/DetailedAnalysis";
|
||||
import { ChartWheel, WheelLegend } from "@/components/ChartWheel";
|
||||
import { ELEMENTS, MODALITIES, MOON_PHASES, countryName, formatBirthDate, pointName } from "@/lib/astro";
|
||||
import { backendGet, requireMe } from "@/lib/server";
|
||||
import type { Analysis, Chart } from "@/lib/types";
|
||||
import type { Analysis, Chart, PublicConfig } from "@/lib/types";
|
||||
|
||||
export const metadata: Metadata = { title: "Képlet" };
|
||||
|
||||
@@ -19,9 +18,10 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
|
||||
const { id } = await params;
|
||||
const me = await requireMe(`/kepletek/${id}`);
|
||||
if (!UUID.test(id)) notFound();
|
||||
const [chart, analyses] = await Promise.all([
|
||||
const [chart, analyses, config] = await Promise.all([
|
||||
backendGet<Chart>(`/v1/charts/${id}`),
|
||||
backendGet<{ analyses: Analysis[] }>(`/v1/charts/${id}/analyses`),
|
||||
backendGet<PublicConfig>("/v1/config"),
|
||||
]);
|
||||
if (!chart) notFound();
|
||||
const list = analyses?.analyses ?? [];
|
||||
@@ -47,12 +47,6 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
|
||||
{" · "}
|
||||
{place?.name ?? chart.birth_data.place ?? "–"}
|
||||
{country ? `, ${countryName(country)}` : ""}
|
||||
{chart.is_primary && (
|
||||
<>
|
||||
{" · "}
|
||||
<Link href="/profil#birth">adatok javítása</Link>
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -111,7 +105,13 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<DetailedAnalysis chartId={chart.id} initial={detailed} left={me.analyses_left.natal} />
|
||||
<DetailedAnalysis
|
||||
chartId={chart.id}
|
||||
initial={detailed}
|
||||
left={me.analyses_left.natal}
|
||||
isAdmin={me.user.roles.includes("admin")}
|
||||
canPay={config?.mock_payments ?? false}
|
||||
/>
|
||||
|
||||
<section className="card" aria-labelledby="positions">
|
||||
<h2 id="positions">Pozíciók</h2>
|
||||
|
||||
Reference in New Issue
Block a user