fix(ui): fix make dev (#3795)

1. For some bizarre reason, importing inflection by itself is undefined. But you can import specific functions
2. Per https://github.com/vite-pwa/vite-plugin-pwa/issues/419, `type: 'module',` is only for non-chromium browsers
This commit is contained in:
Kendall Garner
2025-03-10 18:50:16 +00:00
committed by GitHub
parent 5c67297dce
commit a28462a7ab
8 changed files with 15 additions and 18 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import React from 'react'
import { Chip, makeStyles } from '@material-ui/core'
import { useTranslate } from 'react-admin'
import inflection from 'inflection'
import { humanize, underscore } from 'inflection'
const useQuickFilterStyles = makeStyles((theme) => ({
chip: {
@@ -16,11 +16,11 @@ export const QuickFilter = ({ source, resource, label, defaultValue }) => {
if (typeof lbl === 'string' || lbl instanceof String) {
if (label) {
lbl = translate(lbl, {
_: inflection.humanize(inflection.underscore(lbl)),
_: humanize(underscore(lbl)),
})
} else {
lbl = translate(`resources.${resource}.fields.${source}`, {
_: inflection.humanize(inflection.underscore(source)),
_: humanize(underscore(source)),
})
}
}
+2 -2
View File
@@ -13,7 +13,7 @@ import {
useTranslate,
useRecordContext,
} from 'react-admin'
import inflection from 'inflection'
import { humanize, underscore } from 'inflection'
import {
ArtistLinkField,
BitrateField,
@@ -140,7 +140,7 @@ export const SongInfo = (props) => {
<TableRow key={`${record.id}-${key}`}>
<TableCell scope="row" className={classes.tableCell}>
{translate(`resources.song.fields.${key}`, {
_: inflection.humanize(inflection.underscore(key)),
_: humanize(underscore(key)),
})}
:
</TableCell>