diff --git a/src/frontend/src/components/tableComponent/index.tsx b/src/frontend/src/components/tableComponent/index.tsx index 6113316be..b6d4fa109 100644 --- a/src/frontend/src/components/tableComponent/index.tsx +++ b/src/frontend/src/components/tableComponent/index.tsx @@ -46,6 +46,18 @@ const TableComponent = forwardRef< ); } + const colDef = props.columnDefs.map((col, index) => { + if (props.onSelectionChanged && index === 0) { + return { + ...col, + checkboxSelection: true, + headerCheckboxSelection: true, + headerCheckboxSelectionFilteredOnly: true, + }; + } else { + return col; + } + }); return (
diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index cfc687493..1cbc1da63 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -1024,6 +1024,7 @@ export async function getTransactionTable( export async function getMessagesTable( mode: "intersection" | "union", id?: string, + excludedFields?: string[], params = {}, ): Promise<{ rows: Array; columns: Array }> { const config = {}; @@ -1034,6 +1035,6 @@ export async function getMessagesTable( config["params"] = { ...config["params"], ...params }; } const rows = await api.get(`${BASE_URL_API}monitor/messages`, config); - const columns = extractColumnsFromRows(rows.data, mode); + const columns = extractColumnsFromRows(rows.data, mode, excludedFields); return { rows: rows.data, columns }; } diff --git a/src/frontend/src/modals/flowLogsModal/index.tsx b/src/frontend/src/modals/flowLogsModal/index.tsx index bc11a2906..f726e46df 100644 --- a/src/frontend/src/modals/flowLogsModal/index.tsx +++ b/src/frontend/src/modals/flowLogsModal/index.tsx @@ -53,11 +53,13 @@ export default function FlowLogsModal({ setRows(rows); }); } else if (activeTab === "Messages") { - getMessagesTable("union", currentFlowId).then((data) => { - const { columns, rows } = data; - setColumns(columns.map((col) => ({ ...col, editable: true }))); - setRows(rows); - }); + getMessagesTable("union", currentFlowId, ["index", "flow_id"]).then( + (data) => { + const { columns, rows } = data; + setColumns(columns.map((col) => ({ ...col, editable: true }))); + setRows(rows); + }, + ); } if (open && activeTab === "Messages" && !noticed.current) { diff --git a/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx index 65f7ecd41..e39fd743a 100644 --- a/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx @@ -78,9 +78,6 @@ export default function GlobalVariablesPage() { // Column Definitions: Defines the columns to be displayed. const [colDefs, setColDefs] = useState<(ColDef | ColGroupDef)[]>([ { - headerCheckboxSelection: true, - checkboxSelection: true, - showDisabledCheckboxes: true, headerName: "Variable Name", field: "name", flex: 2, diff --git a/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx index 7a40ebed5..8b606fb3c 100644 --- a/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx @@ -49,7 +49,7 @@ export default function MessagesPage() { useEffect(() => { console.log("MessagesPage useEffect"); - getMessagesTable("union").then((data) => { + getMessagesTable("union", undefined, ["index"]).then((data) => { const { columns, rows } = data; console.log(data); setColumns(columns.map((col) => ({ ...col, editable: true }))); diff --git a/src/frontend/src/utils/utils.ts b/src/frontend/src/utils/utils.ts index 223586986..00cf7861b 100644 --- a/src/frontend/src/utils/utils.ts +++ b/src/frontend/src/utils/utils.ts @@ -354,8 +354,9 @@ export function isTimeStampString(str: string): boolean { export function extractColumnsFromRows( rows: object[], mode: "intersection" | "union", + excludeColumns?: Array, ): (ColDef | ColGroupDef)[] { - const columnsKeys: { [key: string]: ColDef | ColGroupDef } = {}; + let columnsKeys: { [key: string]: ColDef | ColGroupDef } = {}; if (rows.length === 0) { return []; } @@ -395,5 +396,11 @@ export function extractColumnsFromRows( union(); } + if (excludeColumns) { + for (const key of excludeColumns) { + delete columnsKeys[key]; + } + } + return Object.values(columnsKeys); }