mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-23 17:21:18 -05:00
Compare commits
4 Commits
fix/1492-d
...
fix/1206-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cd2c1c9b7 | ||
|
|
0d72aaea80 | ||
|
|
42168a4141 | ||
|
|
5faf88d2a5 |
@@ -300,7 +300,6 @@ export const ResponseTable = ({
|
||||
<DataTableSettingsModal
|
||||
open={isTableSettingsModalOpen}
|
||||
setOpen={setIsTableSettingsModalOpen}
|
||||
survey={survey}
|
||||
table={table}
|
||||
columnOrder={columnOrder}
|
||||
handleDragEnd={handleDragEnd}
|
||||
|
||||
@@ -1328,7 +1328,7 @@ export const reconcileCloudStripeSubscriptionsForOrganization = async (
|
||||
const freshSubscriptions = await client.subscriptions.list({
|
||||
customer: customerId,
|
||||
status: "active",
|
||||
limit: 5,
|
||||
limit: 1,
|
||||
});
|
||||
|
||||
if (freshSubscriptions.data.length === 0) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useSortable } from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import { Column, Table, flexRender } from "@tanstack/react-table";
|
||||
import { Column, HeaderContext, Table, flexRender } from "@tanstack/react-table";
|
||||
import { GripVertical } from "lucide-react";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import { Switch } from "@/modules/ui/components/switch";
|
||||
@@ -24,11 +24,10 @@ export const DataTableSettingsModalItem = <T,>({ column, table }: DataTableSetti
|
||||
zIndex: isDragging ? 10 : 1,
|
||||
};
|
||||
|
||||
// Find the header for this column from the table's header groups
|
||||
const header = table
|
||||
.getHeaderGroups()
|
||||
.flatMap((headerGroup) => headerGroup.headers)
|
||||
.find((h) => h.column.id === column.id);
|
||||
// Build a minimal header context so we can render the column's header definition regardless of
|
||||
// whether the column is currently visible. getHeaderGroups() only includes visible columns, so
|
||||
// hidden columns would fall back to rendering the raw column ID without this approach.
|
||||
const headerContext = { column, header: null, table } as unknown as HeaderContext<any, unknown>;
|
||||
|
||||
return (
|
||||
<div ref={setNodeRef} style={style} id={column.id}>
|
||||
@@ -40,7 +39,7 @@ export const DataTableSettingsModalItem = <T,>({ column, table }: DataTableSetti
|
||||
<button type="button" aria-label="Reorder column" onClick={(e) => e.preventDefault()}>
|
||||
<GripVertical className="h-4 w-4" />
|
||||
</button>
|
||||
{header ? flexRender(column.columnDef.header, header.getContext()) : column.id}
|
||||
{flexRender(column.columnDef.header, headerContext)}
|
||||
</div>
|
||||
<Switch
|
||||
id={column.id}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { Table } from "@tanstack/react-table";
|
||||
import { SettingsIcon } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { TSurvey } from "@formbricks/types/surveys/types";
|
||||
import {
|
||||
Dialog,
|
||||
DialogBody,
|
||||
@@ -30,7 +29,6 @@ interface DataTableSettingsModalProps<T> {
|
||||
table: Table<T>;
|
||||
columnOrder: string[];
|
||||
handleDragEnd: (event: DragEndEvent) => void;
|
||||
survey?: TSurvey;
|
||||
}
|
||||
|
||||
export const DataTableSettingsModal = <T,>({
|
||||
@@ -39,7 +37,6 @@ export const DataTableSettingsModal = <T,>({
|
||||
table,
|
||||
columnOrder,
|
||||
handleDragEnd,
|
||||
survey,
|
||||
}: DataTableSettingsModalProps<T>) => {
|
||||
const { t } = useTranslation();
|
||||
const sensors = useSensors(
|
||||
@@ -72,9 +69,7 @@ export const DataTableSettingsModal = <T,>({
|
||||
if (columnId === "select" || columnId === "createdAt") return;
|
||||
const column = tableColumns.find((column) => column.id === columnId);
|
||||
if (!column) return null;
|
||||
return (
|
||||
<DataTableSettingsModalItem column={column} table={table} key={column.id} survey={survey} />
|
||||
);
|
||||
return <DataTableSettingsModalItem column={column} table={table} key={column.id} />;
|
||||
})}
|
||||
</SortableContext>
|
||||
</DndContext>
|
||||
|
||||
Reference in New Issue
Block a user