Skip to content

Commit

Permalink
fix: (regression beta) admin/plugins: misplaced theme icon
Browse files Browse the repository at this point in the history
  • Loading branch information
rejetto committed Jul 19, 2024
1 parent 7a34629 commit 5d792a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions admin/src/DataTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type DataTableColumn<R extends GridValidRowModel=any> = GridColDef<R> & {
dialogHidden?: boolean
sx?: SxProps
mergeRender?: { [other: string]: false | { override?: Partial<GridColDef<R>> } & BoxProps }
mergeRenderSx?: SxProps
}
interface DataTableProps<R extends GridValidRowModel=any> extends Omit<DataGridProps<R>, 'columns'> {
columns: Array<DataTableColumn<R>>
Expand Down Expand Up @@ -63,12 +64,11 @@ export function DataTable({ columns, initialState={}, actions, actionsProps, ini
const { columns } = params.api.store.getSnapshot()
return h(Box, { maxHeight: '100%', sx: { textWrap: 'wrap', ...sx } }, // wrap if necessary, but stay within the row
col.renderCell ? col.renderCell(params) : params.formattedValue,
h(Flex, { fontSize: 'smaller', flexWrap: 'wrap', mt: '2px' }, // wrap, normally causing overflow/hiding, if it doesn't fit
h(Flex, { fontSize: 'smaller', flexWrap: 'wrap', mt: '2px', ...col.mergeRenderSx }, // wrap, normally causing overflow/hiding, if it doesn't fit
...onlyTruthy(_.map(col.mergeRender, (props, other) => {
if (!props || columns.columnVisibilityModel[other] !== false) return null
const { override, ...rest } = props
const rendered = renderCell({ ...columns.lookup[other], ...override }, params.row)
return rendered && h(Box, { ...rest, ...compact && { lineHeight: '1em' } }, rendered)
const rendered = renderCell({ ...columns.lookup[other], ...props.override }, params.row)
return rendered && h(Box, { ...props, ...{ override: undefined }, ...compact && { lineHeight: '1em' } }, rendered)
}))
)
)
Expand Down
3 changes: 2 additions & 1 deletion admin/src/InstalledPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ function UsernameField({ value, onChange, multiple, ...rest }: FieldProps<string

export const descriptionField: DataTableColumn = {
field: 'description',
mergeRender: { isTheme: { sx: { float: 'left' } }} ,
mergeRender: { isTheme: {} } ,
mergeRenderSx: { float: 'left' },
}

export const themeField: DataTableColumn = {
Expand Down

0 comments on commit 5d792a5

Please sign in to comment.