fixed login session for user name, and updated the api calls on the product detials pages.
CI / test (push) Successful in 6s
CI / test (push) Successful in 6s
This commit is contained in:
@@ -1470,6 +1470,11 @@ function GunbuilderPageContent() {
|
||||
|
||||
if (groupCategories.length === 0) return null;
|
||||
|
||||
// Check if there are locked/conflicting parts in this group
|
||||
const hasConflicts = tableRows.some(
|
||||
(row) => row.kind === "category" && row.locked
|
||||
);
|
||||
|
||||
return (
|
||||
<div
|
||||
id={`group-${group.id}`}
|
||||
@@ -1489,6 +1494,23 @@ function GunbuilderPageContent() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{hasConflicts && (
|
||||
<div className="rounded-md border border-amber-500/30 bg-amber-500/10 p-3">
|
||||
<div className="flex items-start gap-2">
|
||||
<span className="text-amber-400 text-sm">⚠</span>
|
||||
<div className="flex-1">
|
||||
<p className="text-sm font-medium text-amber-300">
|
||||
Part Conflict Detected
|
||||
</p>
|
||||
<p className="text-xs text-zinc-300 mt-1">
|
||||
Some parts below are disabled because you've selected a complete assembly that already includes them. To customize individual parts, remove the complete assembly first.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="overflow-x-auto rounded-md border border-zinc-800 bg-zinc-950/80">
|
||||
<table className="min-w-full text-xs md:text-sm">
|
||||
<thead>
|
||||
@@ -1635,8 +1657,27 @@ function GunbuilderPageContent() {
|
||||
<td className="px-3 py-2 align-top">
|
||||
<div className="flex justify-end gap-2">
|
||||
{isLocked ? (
|
||||
<div className="text-[0.7rem] text-zinc-500">
|
||||
—
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-[0.7rem] text-amber-400/70">
|
||||
⚠ Disabled
|
||||
</span>
|
||||
<div className="group relative">
|
||||
<button
|
||||
type="button"
|
||||
className="text-zinc-500 hover:text-zinc-300 text-xs"
|
||||
title="Why is this disabled?"
|
||||
>
|
||||
ⓘ
|
||||
</button>
|
||||
<div className="invisible group-hover:visible absolute right-0 top-6 z-10 w-64 rounded-md border border-zinc-800 bg-zinc-950 p-3 text-xs text-zinc-300 shadow-xl">
|
||||
<p className="font-semibold text-amber-300 mb-1">
|
||||
Part Conflict
|
||||
</p>
|
||||
<p>
|
||||
You've selected a complete assembly which already includes this part. Remove the complete assembly to select individual parts.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : selectedPart ? (
|
||||
<>
|
||||
|
||||
@@ -238,8 +238,11 @@ export default function ProductDetailsPage() {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
|
||||
const url = `${API_BASE_URL}/api/v1/products/${numericId}`;
|
||||
const res = await fetch(url, { signal: controller.signal });
|
||||
const url = `/api/catalog/products/${numericId}`;
|
||||
const res = await fetch(url, {
|
||||
signal: controller.signal,
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`Failed to load product (${res.status})`);
|
||||
@@ -272,8 +275,11 @@ export default function ProductDetailsPage() {
|
||||
try {
|
||||
setOffersLoading(true);
|
||||
|
||||
const url = `${API_BASE_URL}/api/v1/products/${numericId}/offers`;
|
||||
const res = await fetch(url, { signal: controller.signal });
|
||||
const url = `/api/catalog/products/${numericId}/offers`;
|
||||
const res = await fetch(url, {
|
||||
signal: controller.signal,
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`Failed to load offers (${res.status})`);
|
||||
|
||||
Reference in New Issue
Block a user