- FormError ignored its children when an error was set, rendering the raw
zod message instead of the translated text passed in. Prefer explicit
children, fall back to the field error message.
- Use .at(-1) in getTranslatedFeedbackDirectoryError per SonarQube S7755.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per Johannes on ENG-893: zero-workspace creation is acceptable — admins
move workspaces between directories and forcing at least one is an
arbitrary limitation. The unformatted-error fix
(getTranslatedFeedbackDirectoryError prefix stripping) is retained.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ENG-893
Why: A feedback directory with zero workspaces is useless — it groups
nothing. The create path allowed it, and any validation error that did
fire surfaced as a raw "field: CODE" string in the toast.
How:
- createFeedbackDirectory now rejects empty/missing workspaceIds with
DIRECTORY_WORKSPACES_REQUIRED before touching the database.
- getTranslatedFeedbackDirectoryError strips the "<field>: " prefix that
next-safe-action prepends to validation errors, so machine codes always
map to a translated message.
- Add the new translation key across all 15 locales.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tests now expect validation failures when CUBEJS_API_URL, CUBEJS_API_SECRET,
or HUB_API_KEY are missing, and all test env helpers provide HUB_API_KEY.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Makes Cube env vars mandatory in env.ts (per PR #7913) and adds them
as Docker build secrets with fallback values, following the same pattern
as DATABASE_URL, REDIS_URL, and HUB_API_URL.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HUB_API_URL is required by the Zod env validation at build time but was
not provided as a Docker secret, causing the release build to fail.
Adds HUB_API_URL with a dummy fallback (http://localhost:4000) to the
build pipeline, following the same pattern as DATABASE_URL/REDIS_URL.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hub 0.3.0 renames the `user_identifier` API field to `user_id` (breaking
change). This commit bumps the Hub Docker image, upgrades the
@formbricks/hub TypeScript SDK from 0.4.3 to 0.5.0, and renames every
`user_identifier` reference in Zod schemas, server actions, transform
pipeline, form components, CubeJS schema, connector types, and seed data
to match the new API contract.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move duplicated function to @/lib/ai/service and export TAIUnavailableReason
type. Remove local copies from charts-list-page and dashboard-detail-page.
- Server-side: Replace hardcoded OpenAI with provider-agnostic `getAiModel(env)` and enforce
`assertOrganizationAIConfigured(organizationId, "dataAnalysis")` which validates license
entitlement, org-level toggle, and instance configuration
- Client-side: Instead of hiding AI section when unavailable, show it disabled with a tooltip
explaining the reason (not in plan / not enabled / instance not configured), following the
same pattern as AI translate
- Thread `isAIAvailable` and `aiUnavailableReason` through the component chain from server
pages down to `AIQuerySection`
- Update test mocks to match new provider-agnostic AI imports