@mohasinac/appkit 4.42.18 → 4.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/client/features/lottery/LotteryDetailView.js +22 -1
- package/dist/_internal/server/features/categories/adapters.d.ts +47 -0
- package/dist/_internal/server/features/categories/adapters.js +235 -0
- package/dist/_internal/server/features/checkout/actions.js +161 -22
- package/dist/_internal/server/features/checkout/expand-order-items.js +34 -0
- package/dist/_internal/server/features/orders/adapters.js +21 -0
- package/dist/_internal/server/features/products/list-public.d.ts +24 -0
- package/dist/_internal/server/features/products/list-public.js +10 -2
- package/dist/_internal/server/features/refunds/actions.js +1 -1
- package/dist/_internal/server/features/seo/sitemap.js +54 -15
- package/dist/_internal/server/features/stores/adapters.d.ts +1 -1
- package/dist/_internal/server/features/stores/adapters.js +6 -0
- package/dist/_internal/server/functions/scheduled.d.ts +4 -2
- package/dist/_internal/server/functions/scheduled.js +64 -6
- package/dist/_internal/server/jobs/core/adminAnalytics.d.ts +0 -1
- package/dist/_internal/server/jobs/core/adminAnalytics.js +9 -1
- package/dist/_internal/server/jobs/core/analyticsAlertEvaluate.d.ts +47 -0
- package/dist/_internal/server/jobs/core/analyticsAlertEvaluate.js +468 -0
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +14 -1
- package/dist/_internal/server/jobs/core/countersReconcile.js +24 -8
- package/dist/_internal/server/jobs/core/onCategoryWrite.js +59 -0
- package/dist/_internal/server/jobs/core/onProductWrite.js +31 -0
- package/dist/_internal/server/jobs/core/onReviewWrite.js +8 -0
- package/dist/_internal/server/jobs/core/onStoreWrite.d.ts +1 -1
- package/dist/_internal/server/jobs/core/onStoreWrite.js +8 -2
- package/dist/_internal/server/jobs/core/priceIndexRollup.d.ts +47 -0
- package/dist/_internal/server/jobs/core/priceIndexRollup.js +234 -0
- package/dist/_internal/server/jobs/core/revalidateNotify.d.ts +28 -0
- package/dist/_internal/server/jobs/core/revalidateNotify.js +125 -0
- package/dist/_internal/server/jobs/core/{testerSandboxCleanup.d.ts → testDataCleanup.d.ts} +3 -3
- package/dist/_internal/server/jobs/core/{testerSandboxCleanup.js → testDataCleanup.js} +3 -3
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +5 -1
- package/dist/_internal/server/jobs/handlers/analyticsAlertEvaluate.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/analyticsAlertEvaluate.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +3 -1
- package/dist/_internal/server/jobs/handlers/index.js +3 -1
- package/dist/_internal/server/jobs/handlers/messages.d.ts +5 -2
- package/dist/_internal/server/jobs/handlers/messages.js +5 -2
- package/dist/_internal/server/jobs/handlers/priceIndexRollup.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/priceIndexRollup.js +2 -0
- package/dist/_internal/server/jobs/handlers/testDataCleanup.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/testDataCleanup.js +2 -0
- package/dist/_internal/shared/actions/action-registry.js +34 -0
- package/dist/_internal/shared/cache/revalidate-targets.d.ts +49 -0
- package/dist/_internal/shared/cache/revalidate-targets.js +157 -0
- package/dist/_internal/shared/checkout/order-math.d.ts +113 -3
- package/dist/_internal/shared/checkout/order-math.js +194 -7
- package/dist/_internal/shared/features/categories/price-guidance.d.ts +110 -0
- package/dist/_internal/shared/features/categories/price-guidance.js +136 -0
- package/dist/_internal/shared/features/site-settings/gst-registration.d.ts +90 -0
- package/dist/_internal/shared/features/site-settings/gst-registration.js +126 -0
- package/dist/_internal/shared/fees/calculator.d.ts +105 -0
- package/dist/_internal/shared/fees/calculator.js +143 -0
- package/dist/_internal/shared/listing-types/art/config.d.ts +0 -6
- package/dist/_internal/shared/listing-types/classified/config.d.ts +0 -6
- package/dist/_internal/shared/listing-types/digital-code/config.d.ts +0 -6
- package/dist/_internal/shared/listing-types/live/config.d.ts +0 -6
- package/dist/_internal/shared/listing-types/standard/config.d.ts +0 -6
- package/dist/_internal/shared/listing-types/stickers/config.d.ts +0 -6
- package/dist/_internal/shared/templating/placeholders.d.ts +70 -0
- package/dist/_internal/shared/templating/placeholders.js +73 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1 -0
- package/dist/constants/api-endpoints.d.ts +42 -0
- package/dist/constants/api-endpoints.js +14 -0
- package/dist/features/admin/actions/admin-actions.d.ts +1 -1
- package/dist/features/admin/actions/admin-actions.js +1 -1
- package/dist/features/admin/components/AdminCategoryEditorView.js +269 -3
- package/dist/features/admin/components/AdminProductEditorView.js +8 -1
- package/dist/features/admin/components/AdminProductsView.js +78 -7
- package/dist/features/admin/components/AdminSiteSettingsView.js +20 -1
- package/dist/features/admin/components/AdminTaxCodeEditorView.d.ts +10 -0
- package/dist/features/admin/components/AdminTaxCodeEditorView.js +160 -0
- package/dist/features/admin/components/AdminTaxCodesView.d.ts +13 -0
- package/dist/features/admin/components/AdminTaxCodesView.js +86 -0
- package/dist/features/admin/components/AdminTesterChecklistView.js +1 -1
- package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -1
- package/dist/features/auctions/components/AuctionBottomActions.js +10 -1
- package/dist/features/auctions/components/AuctionDetailPageView.js +2 -1
- package/dist/features/auctions/components/AuctionLiveStatusBadge.d.ts +20 -0
- package/dist/features/auctions/components/AuctionLiveStatusBadge.js +21 -0
- package/dist/features/auctions/components/PlaceBidFormClient.d.ts +1 -1
- package/dist/features/auctions/components/PlaceBidFormClient.js +20 -2
- package/dist/features/auctions/hooks/useIsAuctionEnded.d.ts +41 -0
- package/dist/features/auctions/hooks/useIsAuctionEnded.js +76 -0
- package/dist/features/auth/schemas/firestore.d.ts +0 -1
- package/dist/features/blog/api/route.js +16 -1
- package/dist/features/blog/schemas/firestore.d.ts +2 -2
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +14 -3
- package/dist/features/categories/actions/category-actions.d.ts +2 -2
- package/dist/features/categories/actions/category-actions.js +22 -10
- package/dist/features/categories/api/[id]/description-template/route.d.ts +45 -0
- package/dist/features/categories/api/[id]/description-template/route.js +252 -0
- package/dist/features/categories/api/route.js +156 -11
- package/dist/features/categories/components/CategoriesIndexListing.d.ts +1 -3
- package/dist/features/categories/components/CategoriesIndexListing.js +1 -1
- package/dist/features/categories/components/CategoriesIndexPageView.d.ts +27 -1
- package/dist/features/categories/components/CategoriesIndexPageView.js +24 -33
- package/dist/features/categories/components/CategoryDetailPageView.js +43 -10
- package/dist/features/categories/components/CategoryTemplatePicker.d.ts +65 -0
- package/dist/features/categories/components/CategoryTemplatePicker.js +170 -0
- package/dist/features/categories/constants/listing-categories.d.ts +17 -0
- package/dist/features/categories/constants/listing-categories.js +53 -0
- package/dist/features/categories/hooks/useCategoryTree.js +28 -2
- package/dist/features/categories/repository/categories.repository.d.ts +73 -12
- package/dist/features/categories/repository/categories.repository.js +203 -42
- package/dist/features/categories/repository/price-index.repository.d.ts +115 -0
- package/dist/features/categories/repository/price-index.repository.js +85 -0
- package/dist/features/categories/schemas/category-content.d.ts +206 -0
- package/dist/features/categories/schemas/category-content.js +28 -0
- package/dist/features/categories/schemas/firestore.d.ts +74 -5
- package/dist/features/categories/schemas/firestore.js +74 -3
- package/dist/features/categories/schemas/index.d.ts +1047 -0
- package/dist/features/categories/schemas/index.js +96 -0
- package/dist/features/categories/server.d.ts +1 -0
- package/dist/features/categories/server.js +7 -0
- package/dist/features/categories/types/index.d.ts +9 -0
- package/dist/features/events/schemas/firestore.d.ts +2 -2
- package/dist/features/faq/schemas/firestore.d.ts +2 -1
- package/dist/features/faq/schemas/firestore.js +20 -8
- package/dist/features/faq/utils/getHomepageFaqsCached.d.ts +20 -0
- package/dist/features/faq/utils/getHomepageFaqsCached.js +22 -0
- package/dist/features/homepage/components/MarketplaceHomepageView.js +13 -3
- package/dist/features/homepage/lib/live-stats.js +18 -8
- package/dist/features/media/MediaImage.js +19 -2
- package/dist/features/orders/schemas/firestore.d.ts +70 -0
- package/dist/features/orders/types/index.d.ts +55 -0
- package/dist/features/products/actions/product-actions.d.ts +0 -9
- package/dist/features/products/actions/product-actions.js +25 -0
- package/dist/features/products/columns/index.d.ts +0 -1
- package/dist/features/products/columns/index.js +5 -1
- package/dist/features/products/components/ArtStickersListView.js +7 -1
- package/dist/features/products/components/PrizeDrawsSection.js +5 -0
- package/dist/features/products/components/ProductFilters.d.ts +0 -9
- package/dist/features/products/components/ProductForm.d.ts +27 -1
- package/dist/features/products/components/ProductForm.js +26 -12
- package/dist/features/products/components/ProductsIndexPageView.js +1 -1
- package/dist/features/products/constants/sieve.d.ts +0 -6
- package/dist/features/products/constants/sieve.js +35 -2
- package/dist/features/products/repository/products.repository.d.ts +115 -1
- package/dist/features/products/repository/products.repository.js +491 -39
- package/dist/features/products/schemas/firestore.d.ts +65 -5
- package/dist/features/products/schemas/firestore.js +9 -0
- package/dist/features/products/schemas/product-features.d.ts +140 -2
- package/dist/features/products/schemas/product-features.js +62 -1
- package/dist/features/promotions/repository/coupons.repository.js +6 -1
- package/dist/features/promotions/schemas/firestore.d.ts +44 -1
- package/dist/features/promotions/schemas/firestore.js +76 -2
- package/dist/features/reviews/repository/reviews.repository.d.ts +22 -0
- package/dist/features/reviews/repository/reviews.repository.js +35 -0
- package/dist/features/seller/actions/seller-actions.js +17 -2
- package/dist/features/seller/components/PrintCenterView.d.ts +3 -2
- package/dist/features/seller/components/PrintCenterView.js +3 -2
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +21 -11
- package/dist/features/seller/components/SellerOrdersView.js +6 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +19 -3
- package/dist/features/seller/components/SellerProductShell.d.ts +50 -2
- package/dist/features/seller/components/SellerProductShell.js +101 -9
- package/dist/features/seller/components/SellerProductsFilterDrawer.d.ts +13 -1
- package/dist/features/seller/components/SellerProductsFilterDrawer.js +2 -2
- package/dist/features/seller/components/SellerProductsView.js +108 -3
- package/dist/features/seller/types/index.d.ts +17 -0
- package/dist/features/seller/utils/product-draft-mapping.d.ts +13 -0
- package/dist/features/seller/utils/product-draft-mapping.js +17 -0
- package/dist/features/store-extensions/constants/alert-metrics.d.ts +86 -0
- package/dist/features/store-extensions/constants/alert-metrics.js +142 -0
- package/dist/features/store-extensions/schemas/firestore.d.ts +19 -1
- package/dist/features/stores/schemas/firestore.d.ts +31 -2
- package/dist/features/tax-codes/repository/tax-codes.repository.d.ts +55 -0
- package/dist/features/tax-codes/repository/tax-codes.repository.js +131 -0
- package/dist/features/tax-codes/schemas/firestore.d.ts +125 -0
- package/dist/features/tax-codes/schemas/firestore.js +82 -0
- package/dist/features/tax-codes/schemas/tax-code-form.d.ts +63 -0
- package/dist/features/tax-codes/schemas/tax-code-form.js +152 -0
- package/dist/features/tax-codes/schemas/tax-codes.validators.d.ts +107 -0
- package/dist/features/tax-codes/schemas/tax-codes.validators.js +85 -0
- package/dist/features/tester/actions/index.d.ts +0 -1
- package/dist/features/tester/actions/index.js +0 -1
- package/dist/features/tester/components/AdminTesterFeedbackIssuesView.js +1 -1
- package/dist/features/tester/components/AdminTesterFeedbackListView.js +1 -1
- package/dist/features/tester/components/index.d.ts +0 -4
- package/dist/features/tester/components/index.js +0 -2
- package/dist/features/tester/repository/tester-checklist-item.repository.d.ts +1 -20
- package/dist/features/tester/repository/tester-checklist-item.repository.js +0 -52
- package/dist/features/tester/schemas/firestore.d.ts +0 -6
- package/dist/features/tester/seed-data/authored/admin__admin-detail-round-trips.js +3 -3
- package/dist/features/tester/seed-data/authored/admin__site-system.js +4 -5
- package/dist/features/tester/seed-data/authored/content-discovery__category-counts-and-rollup.js +2 -2
- package/dist/features/tester/seed-data/authored/index.js +0 -2
- package/dist/features/tester/seed-data/authored/page-wiring__reachability.js +0 -19
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +10 -29
- package/dist/index.d.ts +21 -7
- package/dist/index.js +53 -7
- package/dist/next/routing/route-map.d.ts +2 -4
- package/dist/next/routing/route-map.js +1 -2
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.js +1 -0
- package/dist/schemas/registry.d.ts +506 -0
- package/dist/seed/_helpers/brand-rows.d.ts +35 -0
- package/dist/seed/_helpers/brand-rows.js +576 -0
- package/dist/seed/_helpers/category-content.d.ts +39 -0
- package/dist/seed/_helpers/category-content.js +634 -0
- package/dist/seed/_helpers/category-forest.d.ts +2 -0
- package/dist/seed/_helpers/category-forest.js +585 -243
- package/dist/seed/_helpers/category-models.d.ts +5 -0
- package/dist/seed/_helpers/category-models.js +1364 -0
- package/dist/seed/_helpers/category-tree.js +17 -1
- package/dist/seed/_helpers/character-features.d.ts +10 -0
- package/dist/seed/_helpers/character-features.js +118 -0
- package/dist/seed/_helpers/media.d.ts +1 -1
- package/dist/seed/_helpers/media.js +44 -8
- package/dist/seed/_helpers/search-txt-wrappers.d.ts +10 -0
- package/dist/seed/_helpers/search-txt-wrappers.js +12 -1
- package/dist/seed/categories-seed-data.js +147 -169
- package/dist/seed/index.d.ts +1 -0
- package/dist/seed/index.js +1 -0
- package/dist/seed/manifest.d.ts +1 -1
- package/dist/seed/manifest.js +5 -0
- package/dist/seed/orders-seed-data.js +5 -3
- package/dist/seed/product-features-seed-data.d.ts +1 -8
- package/dist/seed/product-features-seed-data.js +358 -154
- package/dist/seed/products-art-seed-data.js +16 -4
- package/dist/seed/products-auctions-seed-data.js +6 -6
- package/dist/seed/products-classifieds-seed-data.js +17 -7
- package/dist/seed/products-digital-codes-seed-data.js +12 -12
- package/dist/seed/products-preorders-seed-data.js +8 -8
- package/dist/seed/products-prize-draws-seed-data.js +25 -8
- package/dist/seed/products-standard-seed-data.js +10 -60
- package/dist/seed/products-stickers-seed-data.js +6 -6
- package/dist/seed/site-settings-seed-data.js +24 -0
- package/dist/seed/store-extensions-seed-data.js +10 -4
- package/dist/seed/tax-codes-seed-data.d.ts +34 -0
- package/dist/seed/tax-codes-seed-data.js +100 -0
- package/dist/seed/test-data-ttl.d.ts +29 -0
- package/dist/seed/test-data-ttl.js +31 -0
- package/dist/server-entry.d.ts +1 -1
- package/dist/server-entry.js +6 -1
- package/dist/server.d.ts +4 -1
- package/dist/server.js +11 -2
- package/dist/styles.css +40 -0
- package/dist/ui/components/PaginatedSelect.d.ts +14 -0
- package/dist/ui/components/PaginatedSelect.js +0 -0
- package/dist/ui/components/PaginatedSelect.style.css +40 -0
- package/dist/utils/media-url.d.ts +26 -0
- package/dist/utils/media-url.js +144 -0
- package/dist/utils/physical-location.d.ts +23 -0
- package/dist/utils/physical-location.js +52 -0
- package/dist/utils/search-txt-builders.d.ts +20 -0
- package/dist/utils/search-txt-builders.js +36 -0
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +4 -1
- package/dist/_internal/server/jobs/handlers/testerSandboxCleanup.d.ts +0 -2
- package/dist/_internal/server/jobs/handlers/testerSandboxCleanup.js +0 -2
- package/dist/features/tester/actions/leaderboard-actions.d.ts +0 -3
- package/dist/features/tester/actions/leaderboard-actions.js +0 -5
- package/dist/features/tester/components/BugHunterLeaderboardView.d.ts +0 -23
- package/dist/features/tester/components/BugHunterLeaderboardView.js +0 -18
- package/dist/features/tester/components/TesterHubView.d.ts +0 -5
- package/dist/features/tester/components/TesterHubView.js +0 -110
- package/dist/features/tester/seed-data/authored/public-pages__bug-hunters.d.ts +0 -2
- package/dist/features/tester/seed-data/authored/public-pages__bug-hunters.js +0 -78
- package/dist/features/tester/seed-data/tester-ttl.d.ts +0 -4
- package/dist/features/tester/seed-data/tester-ttl.js +0 -6
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { BugHunterLeaderboardEntry } from "../schemas/firestore";
|
|
3
|
-
export interface BugHunterLeaderboardViewProps {
|
|
4
|
-
isLoading?: boolean;
|
|
5
|
-
isEmpty?: boolean;
|
|
6
|
-
/** Render the full ranked list — caller provides entries via hook */
|
|
7
|
-
renderList?: () => React.ReactNode;
|
|
8
|
-
/** Render a single row; used when caller wants item-level control */
|
|
9
|
-
renderEntry?: (entry: BugHunterLeaderboardEntry, index: number) => React.ReactNode;
|
|
10
|
-
/** Entries — used only when renderEntry is provided */
|
|
11
|
-
entries?: BugHunterLeaderboardEntry[];
|
|
12
|
-
/** Empty state node */
|
|
13
|
-
renderEmpty?: () => React.ReactNode;
|
|
14
|
-
/** Loading spinner / skeleton */
|
|
15
|
-
renderSkeleton?: () => React.ReactNode;
|
|
16
|
-
labels?: {
|
|
17
|
-
title?: string;
|
|
18
|
-
noEntries?: string;
|
|
19
|
-
bugs?: string;
|
|
20
|
-
};
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
export declare function BugHunterLeaderboardView({ isLoading, isEmpty, renderList, renderEntry, entries, renderEmpty, renderSkeleton, labels, className, }: BugHunterLeaderboardViewProps): React.JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Div, Row, Span, Stack, Text } from "../../../ui";
|
|
4
|
-
export function BugHunterLeaderboardView({ isLoading = false, isEmpty = false, renderList, renderEntry, entries = [], renderEmpty, renderSkeleton, labels = {}, className = "", }) {
|
|
5
|
-
if (isLoading) {
|
|
6
|
-
if (renderSkeleton)
|
|
7
|
-
return _jsx(_Fragment, { children: renderSkeleton() });
|
|
8
|
-
return _jsx(Row, { justify: "center", padding: "y-xl", children: "Loading\u2026" });
|
|
9
|
-
}
|
|
10
|
-
if (isEmpty) {
|
|
11
|
-
if (renderEmpty)
|
|
12
|
-
return _jsx(_Fragment, { children: renderEmpty() });
|
|
13
|
-
return (_jsx(Text, { paddingY: "md", variant: "secondary", size: "sm", align: "start", children: labels.noEntries ?? "No confirmed bugs yet." }));
|
|
14
|
-
}
|
|
15
|
-
if (renderList)
|
|
16
|
-
return _jsx(Div, { className: className, children: renderList() });
|
|
17
|
-
return (_jsx(Stack, { className: `${className}`, gap: "sm", children: entries.map((entry, i) => renderEntry ? (_jsx(React.Fragment, { children: renderEntry(entry, i) }, entry.hunterId)) : (_jsxs(Div, { layout: "flex", align: "center", justify: "between", rounded: "xl", padding: "sm", className: "border", "data-section": "bughunterleaderboard-div", children: [_jsxs(Span, { weight: "medium", children: ["#", entry.rank, " ", entry.hunterName] }), _jsxs(Span, { children: [entry.bugCount, " ", labels.bugs ?? "bugs"] })] }, entry.hunterId))) }));
|
|
18
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { Alert, Details, Div, FieldInput, Heading, Stack, Summary, Text, TextLink } from "../../../ui";
|
|
6
|
-
import { apiClient } from "../../../http";
|
|
7
|
-
import { useApiMutation } from "../../../client";
|
|
8
|
-
import { useSession } from "../../../react";
|
|
9
|
-
import { ACCOUNT_ENDPOINTS } from "../../../constants/api-endpoints";
|
|
10
|
-
import { ROUTES } from "../../../next/routing/route-map";
|
|
11
|
-
import { TesterChecklistStepRow } from "./TesterChecklistStepRow";
|
|
12
|
-
function matchesQuery(item, query) {
|
|
13
|
-
if (!query)
|
|
14
|
-
return true;
|
|
15
|
-
const haystack = `${item.label} ${item.description ?? ""} ${item.groupLabel} ${item.pageLabel} ${item.href ?? ""}`.toLowerCase();
|
|
16
|
-
return haystack.includes(query.toLowerCase());
|
|
17
|
-
}
|
|
18
|
-
function TesterChecklistPageSection({ page, testerDisplayName, onAnswer, onSaveNote }) {
|
|
19
|
-
const answeredCount = page.items.filter((i) => i.answer).length;
|
|
20
|
-
return (_jsxs(Details, { tone: "card", defaultOpen: false, children: [_jsxs(Summary, { children: [page.pageLabel, " (", answeredCount, "/", page.items.length, " answered)"] }), _jsx(Div, { padding: "t-sm", children: _jsx(Stack, { gap: "sm", children: page.items
|
|
21
|
-
.slice()
|
|
22
|
-
.sort((a, b) => a.order - b.order)
|
|
23
|
-
.map((item) => (_jsx(TesterChecklistStepRow, { testerDisplayName: testerDisplayName, item: {
|
|
24
|
-
checklistItemId: item.id,
|
|
25
|
-
label: item.label,
|
|
26
|
-
description: item.description,
|
|
27
|
-
href: item.href,
|
|
28
|
-
roles: item.roles,
|
|
29
|
-
startPage: item.startPage,
|
|
30
|
-
steps: item.steps,
|
|
31
|
-
inputs: item.inputs,
|
|
32
|
-
expectedBehaviour: item.expectedBehaviour,
|
|
33
|
-
expectedUiState: item.expectedUiState,
|
|
34
|
-
expectedData: item.expectedData,
|
|
35
|
-
endResult: item.endResult,
|
|
36
|
-
answer: item.answer,
|
|
37
|
-
comment: item.comment,
|
|
38
|
-
screenshotUrl: item.screenshotUrl,
|
|
39
|
-
}, onAnswer: onAnswer, onSaveNote: onSaveNote }, item.id))) }) })] }));
|
|
40
|
-
}
|
|
41
|
-
export function TesterHubView({ sandboxExpiresAt }) {
|
|
42
|
-
const { user } = useSession();
|
|
43
|
-
const queryClient = useQueryClient();
|
|
44
|
-
const [search, setSearch] = React.useState("");
|
|
45
|
-
const query = useQuery({
|
|
46
|
-
queryKey: ["user", "tester-checklist"],
|
|
47
|
-
queryFn: async () => {
|
|
48
|
-
const res = await apiClient.get(ACCOUNT_ENDPOINTS.TESTER_CHECKLIST);
|
|
49
|
-
return res?.data ?? res;
|
|
50
|
-
},
|
|
51
|
-
// The API route resolves isTester/canTestAdmin fresh from Firestore on
|
|
52
|
-
// every request, so retrying a 403 (a role that genuinely lacks access)
|
|
53
|
-
// wastes calls for no benefit — but a real access grant should still be
|
|
54
|
-
// visible on the very next request, not cached as a permanent failure.
|
|
55
|
-
retry: false,
|
|
56
|
-
});
|
|
57
|
-
const upsertMutation = useApiMutation({
|
|
58
|
-
mutationFn: async (vars) => apiClient.put(ACCOUNT_ENDPOINTS.TESTER_CHECKLIST_ITEM_BY_ID(vars.checklistItemId), vars.patch),
|
|
59
|
-
onSuccess: () => {
|
|
60
|
-
void queryClient.invalidateQueries({ queryKey: ["user", "tester-checklist"] });
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
// Gate on the live API response, not the client-cached session snapshot.
|
|
64
|
-
// SessionContext only refreshes role/isTester/canTestAdmin periodically
|
|
65
|
-
// (every 5 minutes) or on a hard reload/re-login — never on ordinary
|
|
66
|
-
// client-side navigation — so a flag an admin just granted would
|
|
67
|
-
// otherwise still read as "Testers only" here for up to 5 minutes even
|
|
68
|
-
// though the same request already succeeds server-side. The tester-
|
|
69
|
-
// checklist API resolves these fields fresh from Firestore on every call,
|
|
70
|
-
// so trusting its actual response is both more accurate and immediate.
|
|
71
|
-
const isForbidden = query.isError && query.error?.status === 403;
|
|
72
|
-
if (isForbidden) {
|
|
73
|
-
return (_jsx(Alert, { variant: "warning", title: "Testers only", children: "This page is only available to accounts flagged as testers (and admins). Contact an admin if you believe this is a mistake." }));
|
|
74
|
-
}
|
|
75
|
-
if (query.isLoading) {
|
|
76
|
-
return _jsx(Text, { color: "muted", children: "Loading checklist\u2026" });
|
|
77
|
-
}
|
|
78
|
-
// Items arrive pre-sorted by catalog `order` (listActive() orders by it).
|
|
79
|
-
const items = query.data?.items ?? [];
|
|
80
|
-
const filtered = items.filter((item) => matchesQuery(item, search));
|
|
81
|
-
const phases = new Map();
|
|
82
|
-
for (const item of filtered) {
|
|
83
|
-
if (!phases.has(item.phase))
|
|
84
|
-
phases.set(item.phase, new Map());
|
|
85
|
-
const groups = phases.get(item.phase);
|
|
86
|
-
if (!groups.has(item.groupKey))
|
|
87
|
-
groups.set(item.groupKey, { groupLabel: item.groupLabel, pages: new Map() });
|
|
88
|
-
const group = groups.get(item.groupKey);
|
|
89
|
-
if (!group.pages.has(item.pageKey))
|
|
90
|
-
group.pages.set(item.pageKey, { pageLabel: item.pageLabel, items: [] });
|
|
91
|
-
group.pages.get(item.pageKey).items.push(item);
|
|
92
|
-
}
|
|
93
|
-
const sortedPhaseNumbers = Array.from(phases.keys()).sort((a, b) => a - b);
|
|
94
|
-
const handleAnswer = (checklistItemId, answer) => {
|
|
95
|
-
upsertMutation.mutate({ checklistItemId, patch: { answer } });
|
|
96
|
-
};
|
|
97
|
-
const handleSaveNote = async (checklistItemId, comment, screenshotUrl) => {
|
|
98
|
-
await upsertMutation.mutateAsync({ checklistItemId, patch: { comment, screenshotUrl } });
|
|
99
|
-
};
|
|
100
|
-
return (_jsxs(Stack, { gap: "lg", children: [_jsx(Heading, { level: 1, children: "Tester Hub" }), _jsx(Text, { color: "muted", children: "Work through the checklist below and answer Yes/No for each test case. Add a comment and screenshot wherever something looks off \u2014 colors, styles, readability, bugs. Your answers save automatically." }), _jsx(TextLink, { href: String(ROUTES.PUBLIC.BUG_HUNTERS), variant: "underline", weight: "medium", children: "View Bug Hunters Leaderboard \u2192" }), sandboxExpiresAt && (_jsxs(Alert, { variant: "info", title: "Shared test sandbox", children: ["The shared test store/products/categories expire on ", new Date(sandboxExpiresAt).toLocaleDateString(), "."] })), _jsx(FieldInput, { name: "checklist-search", label: "Search test cases", value: search, onChange: setSearch, placeholder: "Search by title or route, e.g. checkout, /store/payouts..." }), sortedPhaseNumbers.map((phaseNumber) => {
|
|
101
|
-
const groups = phases.get(phaseNumber);
|
|
102
|
-
const phaseItemCount = Array.from(groups.values())
|
|
103
|
-
.flatMap((g) => Array.from(g.pages.values()))
|
|
104
|
-
.reduce((sum, page) => sum + page.items.length, 0);
|
|
105
|
-
const phaseAnswered = Array.from(groups.values())
|
|
106
|
-
.flatMap((g) => Array.from(g.pages.values()))
|
|
107
|
-
.reduce((sum, page) => sum + page.items.filter((i) => i.answer).length, 0);
|
|
108
|
-
return (_jsxs(Details, { tone: "card", defaultOpen: false, children: [_jsxs(Summary, { size: "lg", weight: "bold", children: ["Phase ", phaseNumber, " (", phaseAnswered, "/", phaseItemCount, " answered)"] }), _jsx(Div, { padding: "t-sm", children: _jsx(Stack, { gap: "md", children: Array.from(groups.entries()).map(([groupKey, group]) => (_jsxs(Stack, { gap: "sm", children: [_jsx(Heading, { level: 4, children: group.groupLabel }), Array.from(group.pages.entries()).map(([pageKey, page]) => (_jsx(TesterChecklistPageSection, { page: page, testerDisplayName: user?.displayName ?? user?.email ?? "tester", onAnswer: handleAnswer, onSaveNote: handleSaveNote }, pageKey)))] }, groupKey))) }) })] }, phaseNumber));
|
|
109
|
-
})] }));
|
|
110
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* WHY: Authored six-part procedures for the public-pages/bug-hunters page.
|
|
3
|
-
* WHAT: 3 case(s), keyed by full checklist id.
|
|
4
|
-
*
|
|
5
|
-
* Written by hand, case by case, against the label each one states. There is no
|
|
6
|
-
* generator: the authoring scripts were deleted once it was clear they were
|
|
7
|
-
* scaffolding around work that is simply writing.
|
|
8
|
-
*
|
|
9
|
-
* The leaderboard exists to credit PEOPLE, which is why the bot account carries
|
|
10
|
-
* isBot and must not appear on it — a runner that works all 994 cases would top
|
|
11
|
-
* the board permanently and make it worthless as recognition.
|
|
12
|
-
*
|
|
13
|
-
* @tag domain:tester
|
|
14
|
-
* @tag layer:seed
|
|
15
|
-
* @tag pattern:none
|
|
16
|
-
* @tag access:server-only
|
|
17
|
-
* @tag consumers:seed-data/authored/index.ts
|
|
18
|
-
* @tag sideEffects:none
|
|
19
|
-
*/
|
|
20
|
-
export const authored = {
|
|
21
|
-
"checklist-public-pages-bug-hunters-leaderboard-loads": {
|
|
22
|
-
roles: ["guest"],
|
|
23
|
-
startPage: "/bug-hunters",
|
|
24
|
-
steps: [
|
|
25
|
-
"Open /bug-hunters in a private window with no session.",
|
|
26
|
-
"Read the rows from the top and note each name and confirmed-bug count.",
|
|
27
|
-
"Check that the counts descend from the first row to the last.",
|
|
28
|
-
/*
|
|
29
|
-
* 'Mock User 3' — the demo fixture's bugHunterName, matching
|
|
30
|
-
* bugHunterId "user-yugi-muto". This said 'Mock User 18', and there is no
|
|
31
|
-
* such persona: the seed runs Mock User 1–17 plus two Mock Employees.
|
|
32
|
-
*
|
|
33
|
-
* So the tester looked for a name that cannot be on the board, found
|
|
34
|
-
* nothing, and the case failed for a reason that is not a bug — while
|
|
35
|
-
* the leaderboard's real behaviour went unchecked.
|
|
36
|
-
*/
|
|
37
|
-
"Look for 'Mock User 3' and read the count beside it.",
|
|
38
|
-
"Look for the Claude tester account by name anywhere in the list.",
|
|
39
|
-
],
|
|
40
|
-
inputs: { seededHunter: "Mock User 3", seededBugCount: 1 },
|
|
41
|
-
expectedBehaviour: "The board ranks testers by confirmed-bug count, highest first, and is fed by the demo fixture under Admin (Testing) → Bug Hunter Rewards. The bot account is excluded because it carries isBot — credit belongs to people, and a runner working the whole checklist would otherwise sit at the top forever.",
|
|
42
|
-
expectedUiState: "'Mock User 3' appears with 1 confirmed bug. Counts never increase as you read down the list. The Claude tester account does not appear at all.",
|
|
43
|
-
expectedData: { botAccountOnLeaderboard: 0 },
|
|
44
|
-
endResult: "Read-only; nothing persists. A bot row on the board is a fail even if the ordering is otherwise correct.",
|
|
45
|
-
},
|
|
46
|
-
"checklist-public-pages-bug-hunters-leaderboard-empty-state": {
|
|
47
|
-
roles: ["admin", "guest"],
|
|
48
|
-
startPage: "/bug-hunters",
|
|
49
|
-
steps: [
|
|
50
|
-
"Sign in as admin@letitrip.in / TempPass123!.",
|
|
51
|
-
"Open /admin/tester-feedback and find the confirmed bug credited to 'Mock User 3'.",
|
|
52
|
-
"Un-confirm it, so no confirmed bugs remain.",
|
|
53
|
-
"Open /bug-hunters in a private window with no session.",
|
|
54
|
-
"Read the page.",
|
|
55
|
-
"Return to /admin/tester-feedback and confirm the bug again.",
|
|
56
|
-
"Reload /bug-hunters in the private window.",
|
|
57
|
-
],
|
|
58
|
-
expectedBehaviour: "With nothing to rank the page shows a named empty state rather than a blank container or an error. Zero rows is a normal condition for this page on a new install, not a failure.",
|
|
59
|
-
expectedUiState: "With no confirmed bugs the page reads 'No confirmed bugs yet' or equivalent, inside the normal site chrome. It is not a blank white page, not an error boundary, and not a heading with nothing under it. After re-confirming, 'Mock User 3' is back.",
|
|
60
|
-
expectedData: { emptyStateShown: true },
|
|
61
|
-
endResult: "The confirmation is restored by the final step, so the leaderboard-loads case above still has its fixture. Leaving it un-confirmed silently breaks that case.",
|
|
62
|
-
},
|
|
63
|
-
"checklist-public-pages-bug-hunters-leaderboard-footer-link": {
|
|
64
|
-
roles: ["guest"],
|
|
65
|
-
startPage: "/",
|
|
66
|
-
steps: [
|
|
67
|
-
"Open / in a private window with no session.",
|
|
68
|
-
"Scroll to the footer and find the Support column.",
|
|
69
|
-
"Read the links in that column.",
|
|
70
|
-
"Click 'Bug Hunters'.",
|
|
71
|
-
"Read the address bar and the page.",
|
|
72
|
-
],
|
|
73
|
-
expectedBehaviour: "The leaderboard is reachable from the footer. A page with no nav entry is exactly as unfinished as a nav entry with no page — this is the first half of that pair.",
|
|
74
|
-
expectedUiState: "A 'Bug Hunters' link is present in the footer's Support column and clicking it lands on /bug-hunters with the leaderboard rendered. Not a 404 and not a redirect to /.",
|
|
75
|
-
expectedData: { footerLinkHref: "/bug-hunters" },
|
|
76
|
-
endResult: "Read-only; nothing persists.",
|
|
77
|
-
},
|
|
78
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Shared 7-day TTL stamp for tester sandbox seed fixtures — recomputed fresh every seed run,
|
|
2
|
-
* so re-seeding naturally refreshes the expiry (matches TESTER_SANDBOX_TTL_DAYS). */
|
|
3
|
-
export declare const TESTER_SANDBOX_TTL_DAYS = 7;
|
|
4
|
-
export declare function testDataExpiresAt(): Date;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Shared 7-day TTL stamp for tester sandbox seed fixtures — recomputed fresh every seed run,
|
|
2
|
-
* so re-seeding naturally refreshes the expiry (matches TESTER_SANDBOX_TTL_DAYS). */
|
|
3
|
-
export const TESTER_SANDBOX_TTL_DAYS = 7;
|
|
4
|
-
export function testDataExpiresAt() {
|
|
5
|
-
return new Date(Date.now() + TESTER_SANDBOX_TTL_DAYS * 24 * 60 * 60 * 1000);
|
|
6
|
-
}
|