= {
};
const getTrialUrgency = (props: TrialSidebarBannerProps): TrialUrgency => {
- if (props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.EXPIRED) {
+ if (
+ props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.EXPIRED ||
+ props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.CANCELLED
+ ) {
return TRIAL_URGENCY.CRITICAL;
}
if (
@@ -181,7 +197,11 @@ const TILT_RANGE_Y = 2;
const TILT_LIFT = -2;
export const TrialSidebarBanner = (props: TrialSidebarBannerProps) => {
- const isExpired = props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.EXPIRED;
+ // Expired trial and cancelled subscription share the terminal treatment:
+ // error badge, error icon, "Subscription required" heading.
+ const isTerminal =
+ props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.EXPIRED ||
+ props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.CANCELLED;
const isScanBased =
props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.ACTIVE_SCANS;
// The backend keeps a scan-capped trial `active` once its quota is spent.
@@ -189,7 +209,7 @@ export const TrialSidebarBanner = (props: TrialSidebarBannerProps) => {
const urgency = getTrialUrgency(props);
const urgencyStyles = TRIAL_URGENCY_STYLES[urgency];
const copy = TRIAL_SIDEBAR_BANNER_COPY[props.variant];
- const heading = isExpired
+ const heading = isTerminal
? "Subscription required"
: props.variant === TRIAL_SIDEBAR_BANNER_VARIANT.ACTIVE_UNLIMITED
? "Trial active"
@@ -282,14 +302,16 @@ export const TrialSidebarBanner = (props: TrialSidebarBannerProps) => {
diff --git a/ui/next.config.js b/ui/next.config.js
index 5298187572..67ef650ebb 100644
--- a/ui/next.config.js
+++ b/ui/next.config.js
@@ -8,6 +8,14 @@ const { withSentryConfig } = require("@sentry/nextjs");
// HTTP Security Headers
const nextConfig = {
poweredByHeader: false,
+ // Dev-only. Lets the dev server accept HMR/asset requests from a tunnel
+ // hostname (ngrok/cloudflared), needed when testing the local UI through a
+ // public tunnel or from an external device.
+ // Comma-separated, e.g. NEXT_ALLOWED_DEV_ORIGINS=foo.ngrok-free.dev
+ allowedDevOrigins: (process.env.NEXT_ALLOWED_DEV_ORIGINS || "")
+ .split(",")
+ .map((origin) => origin.trim())
+ .filter(Boolean),
// Use standalone only in production deployments, not for CI/testing
...(process.env.NODE_ENV === "production" &&
!process.env.CI && {