Default user export to filtered scope and note Anonymous in all-users label

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
vedanta.gawande 2026-06-27 01:06:41 +00:00
parent cf4f9b8918
commit c7b8651b7d
3 changed files with 5 additions and 2 deletions

View File

@ -426,7 +426,8 @@ function UserTableBody(props: {
fetchRows: fetchExportRows,
emptyExportTitle: "No users to export",
emptyExportDescription: "There are no users matching the current filters",
allScopeLabel: "Export all users in the project",
defaultScope: "filtered",
allScopeLabel: "Export all users in the project (includes Anonymous)",
filteredScopeLabel: (
<>
Export only filtered/searched users

View File

@ -55,7 +55,7 @@ export function DataGridExportDialog<TRow>({
[exportOptions?.fields, columns],
);
const [format, setFormat] = useState<DataGridExportFormat>("csv");
const [scope, setScope] = useState<DataGridExportScope>("all");
const [scope, setScope] = useState<DataGridExportScope>(exportOptions?.defaultScope ?? "all");
const [fields, setFields] = useState<readonly DataGridExportField<TRow>[]>(resolvedFields);
const [isExporting, setIsExporting] = useState(false);
const [progress, setProgress] = useState<ExportProgress>(idleExportProgress);

View File

@ -251,6 +251,8 @@ export type DataGridExportOptions<TRow> = {
allScopeLabel?: ReactNode;
filteredScopeLabel?: ReactNode;
progressSubjectLabel?: string;
/** Which export scope is selected by default when the dialog opens. Defaults to `"all"`. */
defaultScope?: DataGridExportScope;
};
// ─── Callbacks ───────────────────────────────────────────────────────