mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-27 08:25:50 +00:00
*PR Created by the Glary-Bot Agent* --- ## Summary Recreate the two payment status pages that were never migrated from Framer (they weren't in the sitemap, so were missed). The Stripe checkout flow in `comfy-api` redirects to `https://www.comfy.org/payment/{success,failed}` after a checkout session, so users currently hit a 404 on completion or cancel. ## Changes - **What**: New static Astro pages at `/payment/success`, `/payment/failed` and their `/zh-CN/` variants, sharing a `PaymentStatusSection.vue` component built from the existing `BrandButton` / `SectionLabel` primitives. Translation keys live in `src/i18n/translations.ts` for both locales. Pages are `noindex` and explicitly excluded from the generated sitemap. Adds a Playwright e2e spec covering both pages in both locales. - **Dependencies**: none ## Review Focus - **URL slug**: matches production Stripe config (`STRIPE_CANCEL_URL=…/payment/failed` in `comfy-api/run-service-{prod,staging}.yaml`), not `/payment/failure`. - **Primary CTA target**: links to `externalLinks.apiKeys` (`platform.comfy.org/profile/api-keys`) — the platform root is just a redirect, so this avoids a hop. - **Locale-aware secondary CTA**: derived from `getRoutes(locale)` so future i18n/route changes flow through the existing helper. - **Stale fallback** (out of scope): `comfy-api/gateways/stripe/stripe.go:159` has an unrelated stale fallback pointing at `/payments/` (plural) that's overridden by the env config in production. Worth fixing in a follow-up. ## Screenshots EN success / failed and zh-CN success / failed at desktop widths. Mobile viewport stacks the CTA buttons vertically (verified locally). ## Screenshots     ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11855-feat-website-add-payment-success-and-failed-pages-3556d73d3650819f8f45d8ecf27cb264) by [Unito](https://www.unito.io) --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com>
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import { defineConfig } from 'astro/config'
|
|
import sitemap from '@astrojs/sitemap'
|
|
import vue from '@astrojs/vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
const LOCALES = ['en', 'zh-CN'] as const
|
|
const DEFAULT_LOCALE = 'en'
|
|
const PAYMENT_STATUSES = ['success', 'failed'] as const
|
|
const LOCALE_PREFIXES = LOCALES.map((locale) =>
|
|
locale === DEFAULT_LOCALE ? '' : `/${locale}`
|
|
)
|
|
const SITEMAP_EXCLUDED_PATHNAMES = new Set(
|
|
LOCALE_PREFIXES.flatMap((prefix) =>
|
|
PAYMENT_STATUSES.map((status) => `${prefix}/payment/${status}`)
|
|
)
|
|
)
|
|
|
|
function isExcludedFromSitemap(page: string): boolean {
|
|
const pathname = new URL(page).pathname.replace(/\/$/, '')
|
|
return SITEMAP_EXCLUDED_PATHNAMES.has(pathname)
|
|
}
|
|
|
|
export default defineConfig({
|
|
site: 'https://comfy.org',
|
|
output: 'static',
|
|
prefetch: { prefetchAll: true },
|
|
redirects: {
|
|
'/cloud/enterprise-case-studies/comfyui-at-architectural-scale-how-moment-factory-reimagined-3d-projection-mapping':
|
|
'/customers/moment-factory/',
|
|
'/cloud/enterprise-case-studies/how-series-entertainment-rebuilt-game-and-video-production-with-comfyui':
|
|
'/customers/series-entertainment/'
|
|
},
|
|
build: {
|
|
assets: '_website'
|
|
},
|
|
devToolbar: { enabled: !process.env.NO_TOOLBAR },
|
|
integrations: [
|
|
vue(),
|
|
sitemap({
|
|
filter: (page) => !isExcludedFromSitemap(page)
|
|
})
|
|
],
|
|
vite: {
|
|
plugins: [tailwindcss()],
|
|
server: {
|
|
watch: {
|
|
ignored: ['**/playwright-report/**']
|
|
}
|
|
}
|
|
},
|
|
i18n: {
|
|
locales: [...LOCALES],
|
|
defaultLocale: DEFAULT_LOCALE,
|
|
routing: {
|
|
prefixDefaultLocale: false
|
|
}
|
|
}
|
|
})
|