Move Playlists to the sidebar menu (#1339)
* Show playlists in sidebar menu * Fix menu * Refresh playlist submenu when adding new playlist * Group shared playlists below user's playlists * Fix text overflow in menu options * Add button in playlist menu to go to Playlists list * Add config option `DevSidebarPlaylists` to enable this feature (default false)
This commit is contained in:
@@ -6,17 +6,31 @@ import {
|
||||
BooleanInput,
|
||||
required,
|
||||
useTranslate,
|
||||
useRefresh,
|
||||
useNotify,
|
||||
useRedirect,
|
||||
} from 'react-admin'
|
||||
import { Title } from '../common'
|
||||
|
||||
const PlaylistCreate = (props) => {
|
||||
const { basePath } = props
|
||||
const refresh = useRefresh()
|
||||
const notify = useNotify()
|
||||
const redirect = useRedirect()
|
||||
const translate = useTranslate()
|
||||
const resourceName = translate('resources.playlist.name', { smart_count: 1 })
|
||||
const title = translate('ra.page.create', {
|
||||
name: `${resourceName}`,
|
||||
})
|
||||
|
||||
const onSuccess = () => {
|
||||
notify('ra.notification.created', 'info', { smart_count: 1 })
|
||||
redirect('list', basePath)
|
||||
refresh()
|
||||
}
|
||||
|
||||
return (
|
||||
<Create title={<Title subTitle={title} />} {...props}>
|
||||
<Create title={<Title subTitle={title} />} {...props} onSuccess={onSuccess}>
|
||||
<SimpleForm redirect="list" variant={'outlined'}>
|
||||
<TextInput source="name" validate={required()} />
|
||||
<TextInput multiline source="comment" />
|
||||
|
||||
Reference in New Issue
Block a user