Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: optimize warning message (#20529)

ecmadao2a54124f07b9
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 817d3f3e30..f38116d3b8 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -842,8 +842,14 @@
"export-center": {
"data-export": "Data Export",
"deprecated": {
- "description": "Export Center will be deprecated in a future release. For new data exports, consider using the SQL Editor's export action.",
+ "approval-flow-link-text": "request access approval flow",
+ "configure-approval-flow": "Make sure the <lnk>{{linkText}}</lnk> is configured.",
+ "enable-jit-first": "Enable <lnk>{{linkText}}</lnk> on the project so users can submit a Just-in-Time export request from the SQL Editor.",
+ "go-to-sql-editor-for-export": "Go to SQL Editor for data export.",
+ "intro": "Export Center will be deprecated in a future release.",
"open-sql-editor": "Go to SQL Editor",
+ "project-jit-link-text": "Just-in-Time access",
+ "request-via-jit": "Users can submit a Just-in-Time export request from the SQL Editor.",
"title": "Export Center will be deprecated"
}
},
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 9edab391ad..b0f56ee738 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -842,8 +842,14 @@
"export-center": {
"data-export": "Exportación de datos",
"deprecated": {
- "description": "El Centro de Exportación será deprecado en una versión futura. Para nuevas exportaciones de datos, considere usar la acción de exportación del Editor SQL.",
+ "approval-flow-link-text": "flujo de aprobación de solicitudes de acceso",
+ "configure-approval-flow": "Asegúrate de que el <lnk>{{linkText}}</lnk> esté configurado.",
+ "enable-jit-first": "Habilita el <lnk>{{linkText}}</lnk> en el proyecto para que los usuarios puedan enviar una solicitud de exportación Just-in-Time desde el Editor SQL.",
+ "go-to-sql-editor-for-export": "Ve al Editor SQL para exportar datos.",
+ "intro": "El Centro de Exportación se desactivará en una próxima versión.",
"open-sql-editor": "Ir al Editor SQL",
+ "project-jit-link-text": "acceso Just-in-Time",
+ "request-via-jit": "Los usuarios pueden enviar una solicitud de exportación Just-in-Time desde el Editor SQL.",
"title": "El Centro de Exportación será deprecado"
}
},
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index fca0783276..5158d98523 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -842,8 +842,14 @@
"export-center": {
"data-export": "データエクスポート",
"deprecated": {
- "description": "エクスポートセンターは将来のリリースで非推奨になります。新しいデータエクスポートには、SQL エディターのエクスポート機能の使用をご検討ください。",
+ "approval-flow-link-text": "リクエストアクセスの承認フロー",
+ "configure-approval-flow": "<lnk>{{linkText}}</lnk>が設定されていることをご確認ください。",
+ "enable-jit-first": "プロジェクトの<lnk>{{linkText}}</lnk>を有効にすると、ユーザーは SQL エディターから Just-in-Time のエクスポートリクエストを送信できます。",
+ "go-to-sql-editor-for-export": "データのエクスポートには SQL エディターをご利用ください。",
+ "intro": "エクスポートセンターは今後のリリースで非推奨になります。",
"open-sql-editor": "SQL エディターを開く",
+ "project-jit-link-text": "Just-in-Time アクセス",
+ "request-via-jit": "ユーザーは SQL エディターから Just-in-Time のエクスポートリクエストを送信できます。",
"title": "エクスポートセンターは非推奨になります"
}
},
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 174d18ee37..53f09a39d6 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -842,8 +842,14 @@
"export-center": {
"data-export": "Xuất dữ liệu",
"deprecated": {
- "description": "Trung tâm Xuất dữ liệu sẽ bị ngừng hỗ trợ trong bản phát hành tương lai. Đối với các yêu cầu xuất dữ liệu mới, vui lòng sử dụng chức năng xuất của SQL Editor.",
+ "approval-flow-link-text": "luồng phê duyệt yêu cầu truy cập",
+ "configure-approval-flow": "Hãy đảm bảo <lnk>{{linkText}}</lnk> đã được cấu hình.",
+ "enable-jit-first": "Bật <lnk>{{linkText}}</lnk> cho dự án để người dùng có thể gửi yêu cầu xuất dữ liệu Just-in-Time từ SQL Editor.",
+ "go-to-sql-editor-for-export": "Hãy vào SQL Editor để xuất dữ liệu.",
+ "intro": "Trung tâm Xuất dữ liệu sẽ bị ngừng hỗ trợ trong một bản phát hành tương lai.",
"open-sql-editor": "Đi tới SQL Editor",
+ "project-jit-link-text": "Truy cập Just-in-Time",
+ "request-via-jit": "Người dùng có thể gửi yêu cầu xuất dữ liệu Just-in-Time từ SQL Editor.",
"title": "Trung tâm Xuất dữ liệu sẽ bị ngừng hỗ trợ"
}
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 3a7403c4fe..23a5bc3aaa 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -842,8 +842,14 @@
"export-center": {
"data-export": "数据导出",
"deprecated": {
- "description": "导出中心将在未来版本中弃用。对于新的数据导出,建议使用 SQL 编辑器的导出功能。",
+ "approval-flow-link-text": "请求访问审批流程",
+ "configure-approval-flow": "请确保已配置<lnk>{{linkText}}</lnk>。",
+ "enable-jit-first": "在该项目上启用<lnk>{{linkText}}</lnk>后,用户即可在 SQL 编辑器中提交即时导出请求。",
+ "go-to-sql-editor-for-export": "请前往 SQL 编辑器进行数据导出。",
+ "intro": "导出中心将在未来版本中弃用。",
"open-sql-editor": "前往 SQL 编辑器",
+ "project-jit-link-text": "即时访问",
+ "request-via-jit": "用户可以在 SQL 编辑器中提交即时导出请求。",
"title": "导出中心即将弃用"
}
},
diff --git a/frontend/src/react/pages/project/ProjectDataExportPage.tsx b/frontend/src/react/pages/project/ProjectDataExportPage.tsx
index f5e20a0f20..3aadd283a9 100644
--- a/frontend/src/react/pages/project/ProjectDataExportPage.tsx
+++ b/frontend/src/react/pages/project/ProjectDataExportPage.tsx
@@ -1,6 +1,6 @@
import { Download, Loader2, SquareTerminal } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
-import { useTranslation } from "react-i18next";
+import { Trans, useTranslation } from "react-i18next";
import {
AdvancedSearch,
type ScopeOption,
@@ -14,10 +14,13 @@ import { Button } from "@/react/components/ui/button";
import { Tooltip } from "@/react/components/ui/tooltip";
import { PagedTableFooter, usePagedData } from "@/react/hooks/usePagedData";
import { useProjectByName } from "@/react/hooks/useProjectByName";
+import { useSQLEditorQueryDataPolicy } from "@/react/hooks/useSQLEditorBridge";
import { displayRoleTitleFromList } from "@/react/lib/role";
import { router } from "@/react/router";
import {
+ PROJECT_V1_ROUTE_SETTINGS,
SQL_EDITOR_HOME_MODULE,
+ WORKSPACE_ROUTE_CUSTOM_APPROVAL,
WORKSPACE_ROUTE_USER_PROFILE,
} from "@/react/router/handles";
import { useAppStore } from "@/react/stores/app";
@@ -55,6 +58,34 @@ export function ProjectDataExportPage({ projectId }: { projectId: string }) {
const projectName = `${projectNamePrefix}${projectId}`;
const project = useProjectByName(projectName);
+ // Drives the deprecation banner's conditional sentence. Mirrors the
+ // SQL editor's policy reader so the wording matches what users
+ // actually see in the editor (a banner that says "go to SQL Editor
+ // for export" would be misleading if export is in fact gated there).
+ const queryDataPolicy = useSQLEditorQueryDataPolicy(projectName);
+
+ // Resolved hrefs for the inline links in the deprecation banner.
+ // Memoized so render-time JSX stays cheap, and so SPA navigation
+ // works via the click handler while right-click / cmd-click still
+ // opens the real path in a new tab.
+ const projectSettingsHref = useMemo(
+ () =>
+ router.resolve({
+ name: PROJECT_V1_ROUTE_SETTINGS,
+ params: { projectId },
+ }).fullPath,
+ [projectId]
+ );
+ const customApprovalHref = useMemo(
+ () => router.resolve({ name: WORKSPACE_ROUTE_CUSTOM_APPROVAL }).fullPath,
+ []
+ );
+ // Workspace-level setting permission: gates the "configure your
+ // approval flow" sentence so non-admins don't see advice they can't
+ // act on. `bb.settings.set` is the same check the workspace settings
+ // page uses.
+ const canSetWorkspaceSettings = hasWorkspacePermissionV2("bb.settings.set");
+
const [showDrawer, setShowDrawer] = useState(false);
// Read-only scopes (always present, not removable)
@@ -220,7 +251,91 @@ export function ProjectDataExportPage({ projectId }: { projectId: string }) {
<Alert
variant="warning"
title={t("export-center.deprecated.title")}
- description={t("export-center.deprecated.description")}
+ description={
+ // Single paragraph: intro + one branch of line 2 (always
+ // present) + the optional approval-flow advice. Sentences
+ // flow inline separated by spaces, links are inline
+ // anchors styled with `text-accent-text underline` so they
+ // stand out on the warning-toned Alert background.
+ //
+ // Trans `values + components` shape matches the codebase
+ // convention (see `subscription.overuse-warning` in
+ // `BannersWrapper.tsx`): the locale embeds
+ // `<link>{{linkText}}</link>`, `values.linkText` provides
+ // the translated label, and `components.link` is the
+ // wrapping `<a>`. The text-inside-tag shorthand
+ // (`<link>label</link>` with no `values`) is harder to get
+ // right across `<Trans>` versions, so stick with what's
+ // proven.
+ <p>
+ {t("export-center.deprecated.intro")}{" "}
+ {!queryDataPolicy.disableExport
+ ? t("export-center.deprecated.go-to-sql-editor-for-export")
+ : project?.allowJustInTimeAccess
+ ? t("export-center.deprecated.request-via-jit")
+ : null}
+ {queryDataPolicy.disableExport &&
+ !project?.allowJustInTimeAccess && (
+ <Trans
+ t={t}
+ i18nKey="export-center.deprecated.enable-jit-first"
+ values={{
+ linkText: t(
+ "export-center.deprecated.project-jit-link-text"
+ ),
+ }}
+ components={{
+ // Tag name `lnk` (not `link`) — `<link>` is an
+ // HTML void element, which the Trans HTML parser
+ // self-closes, orphaning the inner text and the
+ // closing tag so the wrapping `<a>` never gets
+ // generated and the link silently vanishes.
+ lnk: (
+ <a
+ className="text-accent underline hover:text-accent-hover"
+ href={projectSettingsHref}
+ onClick={(e) => {
+ e.preventDefault();
+ router.push(projectSettingsHref);
+ }}
+ />
+ ),
+ }}
+ />
+ )}
+ {/* Approval-flow advice only when the JIT path is in
+ play (i.e. the policy disables direct export). When
+ export is policy-allowed, no JIT request is needed,
+ so the approval flow isn't part of the user's path
+ and the line would be noise. */}
+ {canSetWorkspaceSettings && queryDataPolicy.disableExport && (
+ <>
+ {" "}
+ <Trans
+ t={t}
+ i18nKey="export-center.deprecated.configure-approval-flow"
+ values={{
+ linkText: t(
+ "export-center.deprecated.approval-flow-link-text"
+ ),
+ }}
+ components={{
+ lnk: (
+ <a
+ className="text-accent underline hover:text-accent-hover"
+ href={customApprovalHref}
+ onClick={(e) => {
+ e.preventDefault();
+ router.push(customApprovalHref);
+ }}
+ />
+ ),
+ }}
+ />
+ </>
+ )}
+ </p>
+ }
>
<div className="mt-3 flex justify-end">
<Button
@@ -250,7 +365,11 @@ export function ProjectDataExportPage({ projectId }: { projectId: string }) {
: undefined
}
>
- <Button disabled={!canCreate} onClick={() => setShowDrawer(true)}>
+ <Button
+ variant="outline"
+ disabled={!canCreate}
+ onClick={() => setShowDrawer(true)}
+ >
<Download className="size-4 mr-1" />
{t("quick-action.request-export-data")}
</Button>