merge fix

This commit is contained in:
cristhianzl 2024-06-14 16:39:20 -03:00
commit d8b72fd158
3 changed files with 18 additions and 16 deletions

View file

@ -8,7 +8,7 @@ import {
} from "../../constants/constants"; } from "../../constants/constants";
import { useDarkStore } from "../../stores/darkStore"; import { useDarkStore } from "../../stores/darkStore";
import "../../style/ag-theme-shadcn.css"; // Custom CSS applied to the grid import "../../style/ag-theme-shadcn.css"; // Custom CSS applied to the grid
import { cn, toTitleCase } from "../../utils/utils"; import { cn } from "../../utils/utils";
import ForwardedIconComponent from "../genericIconComponent"; import ForwardedIconComponent from "../genericIconComponent";
import { Alert, AlertDescription, AlertTitle } from "../ui/alert"; import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
import TableOptions from "./components/TableOptions"; import TableOptions from "./components/TableOptions";
@ -40,6 +40,7 @@ const TableComponent = forwardRef<
let colDef = props.columnDefs.map((col, index) => { let colDef = props.columnDefs.map((col, index) => {
let newCol = { let newCol = {
...col, ...col,
headerName: col.headerName,
}; };
if (index === props.columnDefs.length - 1) { if (index === props.columnDefs.length - 1) {
newCol = { newCol = {
@ -141,7 +142,6 @@ const TableComponent = forwardRef<
{...props} {...props}
defaultColDef={{ defaultColDef={{
minWidth: 100, minWidth: 100,
autoHeight: true,
}} }}
animateRows={false} animateRows={false}
columnDefs={colDef} columnDefs={colDef}

View file

@ -40,7 +40,7 @@ export default function ShortcutsPage() {
const combinationToEdit = shortcuts.filter((s) => s.name === selectedRows[0]); const combinationToEdit = shortcuts.filter((s) => s.name === selectedRows[0]);
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const updateUniqueShortcut = useShortcutsStore( const updateUniqueShortcut = useShortcutsStore(
(state) => state.updateUniqueShortcut (state) => state.updateUniqueShortcut,
); );
function handleRestore() { function handleRestore() {
@ -97,6 +97,7 @@ export default function ShortcutsPage() {
</div> </div>
<div className="grid gap-6 pb-8"> <div className="grid gap-6 pb-8">
<div> <div>
{colDefs && nodesRowData.length > 0 && (
<TableComponent <TableComponent
suppressRowClickSelection={true} suppressRowClickSelection={true}
domLayout="autoHeight" domLayout="autoHeight"
@ -108,6 +109,7 @@ export default function ShortcutsPage() {
setOpen(true); setOpen(true);
}} }}
/> />
)}
</div> </div>
</div> </div>
</div> </div>

View file

@ -364,7 +364,7 @@ export function extractColumnsFromRows(
function intersection() { function intersection() {
for (const key in rows[0]) { for (const key in rows[0]) {
columnsKeys[key] = { columnsKeys[key] = {
headerName: toTitleCase(key), headerName: key,
field: key, field: key,
cellRenderer: TableAutoCellRender, cellRenderer: TableAutoCellRender,
filter: true, filter: true,
@ -382,7 +382,7 @@ export function extractColumnsFromRows(
for (const row of rows) { for (const row of rows) {
for (const key in row) { for (const key in row) {
columnsKeys[key] = { columnsKeys[key] = {
headerName: toTitleCase(key), headerName: key,
field: key, field: key,
filter: true, filter: true,
cellRenderer: TableAutoCellRender, cellRenderer: TableAutoCellRender,