fix(catalog): make source preflight advisory
This commit is contained in:
1 parent
2d14e02a68
commit
775d14f861
1 file changed
+5
-15
@@ -37,9 +37,6 @@ export function ImportReview({
|
|||||||
items.map((item) => item.classname),
|
items.map((item) => item.classname),
|
||||||
);
|
);
|
||||||
const assets = useSourceAssetChecks(items, sourceId, inspection);
|
const assets = useSourceAssetChecks(items, sourceId, inspection);
|
||||||
const assetsByName = new Map(
|
|
||||||
assets.items.map((item) => [item.classname, item]),
|
|
||||||
);
|
|
||||||
const unavailable = assets.items.filter((item) => item.state === "missing");
|
const unavailable = assets.items.filter((item) => item.state === "missing");
|
||||||
const [expanded, setExpanded] = useState(items[0]?.classname ?? "");
|
const [expanded, setExpanded] = useState(items[0]?.classname ?? "");
|
||||||
const [step, setStep] = useState<"review" | "confirm">("review");
|
const [step, setStep] = useState<"review" | "confirm">("review");
|
||||||
@@ -50,11 +47,7 @@ export function ImportReview({
|
|||||||
const complete = items.every((item) => localByName.has(item.classname));
|
const complete = items.every((item) => localByName.has(item.classname));
|
||||||
const ready = items.filter((item) => {
|
const ready = items.filter((item) => {
|
||||||
const local = localByName.get(item.classname);
|
const local = localByName.get(item.classname);
|
||||||
return (
|
return local && compareFurniture(item, local).state !== "conflict";
|
||||||
local &&
|
|
||||||
assetsByName.get(item.classname)?.state !== "missing" &&
|
|
||||||
compareFurniture(item, local).state !== "conflict"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
const blocked = items.filter((item) => {
|
const blocked = items.filter((item) => {
|
||||||
const local = localByName.get(item.classname);
|
const local = localByName.get(item.classname);
|
||||||
@@ -135,12 +128,11 @@ export function ImportReview({
|
|||||||
className="rounded-lg border border-[var(--admin-border)] p-3 space-y-2"
|
className="rounded-lg border border-[var(--admin-border)] p-3 space-y-2"
|
||||||
>
|
>
|
||||||
<p className="text-sm font-medium">
|
<p className="text-sm font-medium">
|
||||||
Source files unavailable: {check.classname}
|
Source files not found by preliminary check: {check.classname}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs text-[var(--admin-text-muted)]">
|
<p className="text-xs text-[var(--admin-text-muted)]">
|
||||||
The source has no downloadable files for this furniture. It
|
You can continue. The importer will try the original furniture
|
||||||
cannot be imported until its original .nitro or source files are
|
files and verify them before creating its SQL entry.
|
||||||
available.
|
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
))}
|
))}
|
||||||
@@ -162,7 +154,7 @@ export function ImportReview({
|
|||||||
<p role="status" className="text-sm">
|
<p role="status" className="text-sm">
|
||||||
{ready.length} ready to import · {existing} already in SQL
|
{ready.length} ready to import · {existing} already in SQL
|
||||||
(complete missing data) · {blocked} conflicts ·{" "}
|
(complete missing data) · {blocked} conflicts ·{" "}
|
||||||
{unavailable.length} unavailable (skipped)
|
{unavailable.length} source file warnings
|
||||||
</p>
|
</p>
|
||||||
{inspection.items.some(
|
{inspection.items.some(
|
||||||
(item) =>
|
(item) =>
|
||||||
@@ -304,8 +296,6 @@ export function ImportReview({
|
|||||||
}}
|
}}
|
||||||
disabled={
|
disabled={
|
||||||
inspection.loading ||
|
inspection.loading ||
|
||||||
assets.loading ||
|
|
||||||
!!assets.error ||
|
|
||||||
!!inspection.error ||
|
!!inspection.error ||
|
||||||
!complete ||
|
!complete ||
|
||||||
ready.length === 0
|
ready.length === 0
|
||||||
|
|||||||
Reference in new issue
Block a user