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:
@@ -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)),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user