fix: (regression beta) admin/plugins: "theme" field shouldn't be displayed in dialog

Massimo Melina committed Jun 5, 2024 at 12:48 UTC 3bd3304e67e7dba7beec2165c776fa3089fc6fef
2 files changed +4 -2
admin/src/DataTable.ts
+2 -1
@@ -12,6 +12,7 @@ const ACTIONS = 'Actions'
12 export type DataTableColumn<R extends GridValidRowModel=any> = GridColDef<R> & {
13 hidden?: boolean
14 hideUnder?: Breakpoint | number
15 + dialogHidden?: boolean
16 mergeRender?: { other: string, override?: Partial<GridColDef<R>> } & BoxProps
17 }
18 interface DataTableProps<R extends GridValidRowModel=any> extends Omit<DataGridProps<R>, 'columns'> {
@@ -136,7 +137,7 @@ export function DataTable({ columns, initialState={}, actions, actionsProps, ini
137 if (window.getSelection()?.type === 'Range') return // not a click but a drag
138 const n = apiRef.current.getVisibleColumns().length
139 const showCols = manipulatedColumns.filter(x =>
139 - x.renderCell || x.field === ACTIONS || row[x.field] !== undefined)
140 + !x.dialogHidden && (x.renderCell || x.field === ACTIONS || row[x.field] !== undefined))
141 if (showCols.length <= n) return
142 newDialog({
143 title: "Details",
admin/src/InstalledPlugins.ts
+2 -1
@@ -208,8 +208,9 @@ export const descriptionField: DataTableColumn = {
208
209 export const themeField: DataTableColumn = {
210 field: 'isTheme',
211 - headerName: "theme",
211 + headerName: "is theme",
212 hidden: true,
213 + dialogHidden: true,
214 type: 'boolean',
215 renderCell({ value }) {
216 return value && iconTooltip(ThemeIcon, _.isString(value) ? `${value} theme` : "theme", { fontSize: '1.2rem', mr: '.3em' })