How to use the react-admin.sanitizeListRestProps function in react-admin

To help you get started, we’ve selected a few react-admin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github navidrome / navidrome / ui / src / playlist / PlaylistActions.js View on Github external
headers: new Headers({ Accept: M3U_MIME_TYPE }),
      }).then((res) => {
        const blob = new Blob([res.body], { type: M3U_MIME_TYPE })
        const url = window.URL.createObjectURL(blob)
        const link = document.createElement('a')
        link.href = url
        link.download = `${record.name}.m3u`
        document.body.appendChild(link)
        link.click()
        link.parentNode.removeChild(link)
      }),
    [record]
  )

  return (
    
      <div>
        <div>
          <button label="{translate('resources.album.actions.playAll')}">
            
          </button>
          <button label="{translate('resources.album.actions.shuffle')}">
            
          </button>
          </div></div>
github navidrome / navidrome / ui / src / song / SongListActions.js View on Github external
displayedFilters,
  filterValues,
  permanentFilter,
  exporter,
  basePath,
  selectedIds,
  onUnselectItems,
  showFilter,
  maxResults,
  total,
  ids,
  ...rest
}) =&gt; {
  const isNotSmall = useMediaQuery((theme) =&gt; theme.breakpoints.up('sm'))
  return (
    
      {filters &amp;&amp;
        cloneElement(filters, {
          resource,
          showFilter,
          displayedFilters,
          filterValues,
          context: 'button',
        })}
      
      {isNotSmall &amp;&amp; }
    
  )
}
github navidrome / navidrome / ui / src / playlist / PlaylistListActions.js View on Github external
const PlaylistListActions = ({ className, ...rest }) =&gt; {
  const isNotSmall = useMediaQuery((theme) =&gt; theme.breakpoints.up('sm'))
  const translate = useTranslate()

  return (
    
      
        {translate('ra.action.create')}
      
      {isNotSmall &amp;&amp; }
    
  )
}
github navidrome / navidrome / ui / src / album / AlbumActions.js View on Github external
}, [dispatch, data, ids])

  const handlePlayLater = React.useCallback(() =&gt; {
    dispatch(addTracks(data, ids))
  }, [dispatch, data, ids])

  const handleShuffle = React.useCallback(() =&gt; {
    dispatch(shuffleTracks(data, ids))
  }, [dispatch, data, ids])

  const handleDownload = React.useCallback(() =&gt; {
    subsonic.download(record.id)
  }, [record])

  return (
    
      <div>
        <div>
          <button label="{translate('resources.album.actions.playAll')}">
            
          </button>
          <button label="{translate('resources.album.actions.shuffle')}">
            
          </button>
          </div></div>
github navidrome / navidrome / ui / src / album / AlbumListActions.js View on Github external
displayedFilters,
  filterValues,
  permanentFilter,
  exporter,
  basePath,
  selectedIds,
  onUnselectItems,
  showFilter,
  maxResults,
  total,
  fullWidth,
  ...rest
}) =&gt; {
  const isNotSmall = useMediaQuery((theme) =&gt; theme.breakpoints.up('sm'))
  return (
    
      {filters &amp;&amp;
        cloneElement(filters, {
          resource,
          showFilter,
          displayedFilters,
          filterValues,
          context: 'button',
        })}
      {isNotSmall ? (
        
      ) : (
        
      )}
    
  )
}
github navidrome / navidrome / ui / src / artist / ArtistListActions.js View on Github external
const ArtistListActions = ({ className, ...rest }) =&gt; {
  const isNotSmall = useMediaQuery((theme) =&gt; theme.breakpoints.up('sm'))

  return (
    
      {isNotSmall &amp;&amp; }
    
  )
}
github navidrome / navidrome / ui / src / common / ArtistSimpleList.js View on Github external
export const ArtistSimpleList = ({
  linkType,
  className,
  classes: classesOverride,
  data,
  hasBulkActions,
  ids,
  loading,
  selectedIds,
  total,
  ...rest
}) =&gt; {
  const classes = useStyles({ classes: classesOverride })
  return (
    (loading || total &gt; 0) &amp;&amp; (
      
        {ids.map(
          (id) =&gt;
            data[id] &amp;&amp; (
              <span> linkType(id)}&gt;
                
                  
                        <div>{data[id].name}</div>
                        {config.enableStarRating &amp;&amp; (
                          </span>
github navidrome / navidrome / ui / src / common / SimpleList.js View on Github external
leftIcon,
  linkType,
  onToggleItem,
  primaryText,
  rightAvatar,
  rightIcon,
  secondaryText,
  selectedIds,
  tertiaryText,
  total,
  ...rest
}) =&gt; {
  const classes = useStyles({ classes: classesOverride })
  return (
    (loading || total &gt; 0) &amp;&amp; (
      
        {ids.map((id) =&gt; (
          
            
              {leftIcon &amp;&amp; (
                {leftIcon(data[id], id)}
              )}
              {leftAvatar &amp;&amp; (
                
                  {leftAvatar(data[id], id)}
github navidrome / navidrome / ui / src / common / SongSimpleList.js View on Github external
className,
  classes: classesOverride,
  data,
  hasBulkActions,
  ids,
  loading,
  onToggleItem,
  selectedIds,
  total,
  ...rest
}) =&gt; {
  const dispatch = useDispatch()
  const classes = useStyles({ classes: classesOverride })
  return (
    (loading || total &gt; 0) &amp;&amp; (
      
        {ids.map(
          (id) =&gt;
            data[id] &amp;&amp; (
              <span> dispatch(setTrack(data[id]))}&gt;
                
                  {data[id].title}
                    }
                    secondary={
                      &lt;&gt;
                        <span>
                          <span>
                            {data[id].artist}
                          </span>
                          <span></span></span></span>