feat(imports): Access Pass products through the importer's signed-in account (#20)
Co-authored-by: dhkatz <[email protected]>
This commit was merged in pull request #20.
This commit is contained in:
1 parent
56d25f7507
commit
cc6959082c
12 files changed
+4871
-51
No files matched your search
@@ -157,7 +157,7 @@ export function ImporterAccountForm({
|
||||
<p className="truncate font-medium">{found.username}</p>
|
||||
<p className="text-xs text-muted-foreground">IMVU ID {found.imvuId}</p>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{found.accessPass ? <Tag tone="adult">Access Pass</Tag> : <Tag>No Access Pass</Tag>}
|
||||
{found.accessPass ? <Tag tone="adult">Access Pass</Tag> : <Tag>Access Pass not shown</Tag>}
|
||||
{found.ageVerified ? <Tag tone="adult">Age verified</Tag> : <Tag>Not age verified</Tag>}
|
||||
</div>
|
||||
</div>
|
||||
@@ -165,8 +165,8 @@ export function ImporterAccountForm({
|
||||
)}
|
||||
{found && !found.accessPass && (
|
||||
<p className="text-sm text-amber-700 dark:text-amber-400">
|
||||
Without Access Pass, the importer can't see AP products, so it can't import them with this
|
||||
account.
|
||||
IMVU shows Access Pass publicly only if the member chooses to; the importer checks when it signs in.
|
||||
Without Access Pass, it can't import Access Pass products with this account.
|
||||
</p>
|
||||
)}
|
||||
<p className="text-xs text-muted-foreground">
|
||||
|
||||
@@ -45,6 +45,7 @@ const accountState = {
|
||||
needs_password: { tone: "danger", label: "needs its password" },
|
||||
} as const;
|
||||
const imvuPage = (id: number) => `https://www.imvu.com/shop/product.php?products_id=${id}`;
|
||||
const imvuShop = (creator: number) => `https://www.imvu.com/shop/web_search.php?manufacturers_id=${creator}`;
|
||||
|
||||
export default async function CatalogImports({
|
||||
params,
|
||||
@@ -178,7 +179,11 @@ export default async function CatalogImports({
|
||||
<span className="font-medium">{a.username}</span>
|
||||
<span className="text-muted-foreground">(IMVU {a.imvuId})</span>
|
||||
<Tag tone={st.tone}>{st.label}</Tag>
|
||||
{a.accessPass ? <Tag tone="adult">Access Pass</Tag> : <Tag>No Access Pass</Tag>}
|
||||
{a.accessPass ? (
|
||||
<Tag tone="adult">Access Pass</Tag>
|
||||
) : (
|
||||
<Tag>{a.state === "ok" ? "No Access Pass" : "Access Pass not checked"}</Tag>
|
||||
)}
|
||||
{a.stateMessage && <span className="text-xs text-muted-foreground">{a.stateMessage}</span>}
|
||||
</div>
|
||||
{can.run && (
|
||||
@@ -372,17 +377,28 @@ export default async function CatalogImports({
|
||||
{data.jobs.map((j) => (
|
||||
<TableRow key={j.id}>
|
||||
<TableCell>
|
||||
<a
|
||||
href={imvuPage(j.imvuProduct)}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="underline-offset-4 hover:underline"
|
||||
>
|
||||
{j.name || j.imvuProduct}
|
||||
</a>
|
||||
{j.kind === "list" ? (
|
||||
<a
|
||||
href={imvuShop(j.imvuProduct)}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="underline-offset-4 hover:underline"
|
||||
>
|
||||
IMVU shop {j.imvuProduct}
|
||||
</a>
|
||||
) : (
|
||||
<a
|
||||
href={imvuPage(j.imvuProduct)}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="underline-offset-4 hover:underline"
|
||||
>
|
||||
{j.name || j.imvuProduct}
|
||||
</a>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="text-muted-foreground">
|
||||
{j.kind}
|
||||
{j.kind === "list" ? "listing, signed in" : j.kind}
|
||||
{j.imvuRevision ? ` · revision ${j.imvuRevision}` : ""}
|
||||
</TableCell>
|
||||
<TableCell className="whitespace-normal">
|
||||
|
||||
@@ -4,16 +4,22 @@ import { DateTime } from "@/components/time";
|
||||
export function ShopListing({
|
||||
grant: g,
|
||||
}: {
|
||||
grant: { scope: string; status: string; shopListedAt: string | null; shopListed: number };
|
||||
grant: {
|
||||
scope: string;
|
||||
status: string;
|
||||
shopListedAt: string | null;
|
||||
shopListed: number;
|
||||
shopListedSignedIn: boolean;
|
||||
};
|
||||
}) {
|
||||
if (g.scope !== "shop" || g.status !== "active") return null;
|
||||
if (!g.shopListedAt) return <> Not checked on IMVU yet.</>;
|
||||
return (
|
||||
<>
|
||||
{" "}
|
||||
On IMVU: {g.shopListed} general-rated product{g.shopListed === 1 ? "" : "s"} (checked{" "}
|
||||
<DateTime iso={g.shopListedAt} />
|
||||
).
|
||||
On IMVU: {g.shopListed} {g.shopListedSignedIn ? "" : "general-rated "}product{g.shopListed === 1 ? "" : "s"}{" "}
|
||||
(checked <DateTime iso={g.shopListedAt} />
|
||||
{g.shopListedSignedIn ? " by the importer, with Access Pass" : ""}).
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user