From 037024f1093b9798dad4f89f18e1271347c14294 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 15 Oct 2024 09:40:29 -0500 Subject: [PATCH] can group by nook or type --- app/src/pages/sync.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/pages/sync.tsx b/app/src/pages/sync.tsx index 1fd79437..21d5c534 100644 --- a/app/src/pages/sync.tsx +++ b/app/src/pages/sync.tsx @@ -35,8 +35,11 @@ import { } from 'ag-grid-community2' import 'ag-grid-community2/styles/ag-grid.css' import 'ag-grid-community2/styles/ag-theme-alpine.css' +import { LicenseManager } from 'ag-grid-enterprise2' import { DiffModeToggleGroup } from '../components/diffModeContext' +LicenseManager.setLicenseKey(import.meta.env.VITE_AG_GRID_LICENSE) + async function postMedia( type: 'note' | 'template', mediaId: MediaId, @@ -156,7 +159,6 @@ class CellRenderer implements ICellRendererComp { init(params: ICellRendererParams) { if (params.data == null) { - this.eGui.textContent = 'N/A' return } const remoteTemplate = params.data.template.remotes[params.data.nook] @@ -235,8 +237,8 @@ function Content(): JSX.Element { onMount(() => { const gridOptions = { columnDefs: [ - { field: 'nook' }, - { field: 'type' }, + { field: 'nook', enableRowGroup: true }, + { field: 'type', enableRowGroup: true }, { headerName: 'Diff', headerComponent: HeaderRenderer, @@ -254,6 +256,7 @@ function Content(): JSX.Element { }, suppressRowHoverHighlight: true, enableCellTextSelection: true, + rowGroupPanelShow: 'onlyWhenGrouping', } satisfies GridOptions as GridOptions gridApi = createGrid(ref, gridOptions) })