Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ConnectionManagementTab = ({
controllerProps,
receiverData,
...props
}) => {
const notify = useNotify();
const refreshWholeView = useRefresh();
// we need to force update the sender data without refreshing
// the whole view
const [refresh, setRefresh] = useState(true);
const [filter, setFilter] = useState({
transport: get(receiverData, 'transport'),
});
const [paginationURL, setPaginationURL] = useState(null);
const { data, loaded, pagination } = useGetList({
...props,
filter,
paginationURL,
resource: 'senders',
refresh,
});
// receiverData initialises undefined, update when no longer null
const SendersList = props => {
const refresh = useRefresh();
const [filter, setFilter] = useState({});
const [paginationURL, setPaginationURL] = useState(null);
const { data, loaded, pagination, url } = useGetList({
...props,
filter,
paginationURL,
});
if (!loaded) return ;
if (!data) return null;
const nextPage = label => {
setPaginationURL(pagination[label]);
};
const changeFilter = (filterValue, name) => {
let currentFilter = filter;
const ResetViewsButton = ({ resource, selectedIds }) => {
const notify = useNotify();
const unselectAll = useUnselectAll();
const refresh = useRefresh();
const [updateMany, { loading }] = useUpdateMany(
resource,
selectedIds,
{ views: 0 },
{
onSuccess: () => {
notify(
'ra.notification.updated',
'info',
{ smart_count: selectedIds.length },
true
);
unselectAll(resource);
refresh();
},
onFailure: error =>
const SourcesList = props => {
const refresh = useRefresh();
const [filter, setFilter] = useState({});
const [paginationURL, setPaginationURL] = useState(null);
const { data, loaded, pagination, url } = useGetList({
...props,
filter,
paginationURL,
});
if (!loaded) return ;
const nextPage = label => {
setPaginationURL(pagination[label]);
};
const changeFilter = (filterValue, name) => {
let currentFilter = filter;
if (filterValue) {
const UserEdit = (props) => {
const { permissions } = props
const translate = useTranslate()
const [mutate] = useMutation()
const notify = useNotify()
const redirect = useRedirect()
const refresh = useRefresh()
const isMyself = props.id === localStorage.getItem('userId')
const getNameHelperText = () =>
isMyself && {
helperText: translate('resources.user.helperTexts.name'),
}
const canDelete = permissions === 'admin' && !isMyself
const save = useCallback(
async (values) => {
try {
await mutate(
{
type: 'update',
resource: 'user',
payload: { id: values.id, data: values },
const ReceiversList = props => {
const refresh = useRefresh();
const [filter, setFilter] = useState({});
const [paginationURL, setPaginationURL] = useState(null);
const { data, loaded, pagination, url } = useGetList({
...props,
filter,
paginationURL,
});
if (!loaded) return ;
const nextPage = label => {
setPaginationURL(pagination[label]);
};
const changeFilter = (filterValue, name) => {
let currentFilter = filter;
if (filterValue) {
const NavLinkMenuItem = ({
to,
icon,
label = titleCase(to.substr(1)),
...props
}) => {
const history = useHistory();
const refresh = useRefresh();
const refreshHandler = () => {
if (window.location.hash.substr(1) === to) {
refresh();
} else {
history.push(to);
}
};
return (
{icon}
);
const NodesList = props => {
const refresh = useRefresh();
const [filter, setFilter] = useState({});
const [paginationURL, setPaginationURL] = useState(null);
const { data, loaded, pagination, url } = useGetList({
...props,
filter,
paginationURL,
});
if (!loaded) return ;
const nextPage = label => {
setPaginationURL(pagination[label]);
};
const changeFilter = (filterValue, name) => {
let currentFilter = filter;
if (filterValue) {
const PlaylistSongs = ({ playlistId, readOnly, actions, ...props }) => {
const listContext = useListContext()
const { data, ids, onUnselectItems } = listContext
const isXsmall = useMediaQuery((theme) => theme.breakpoints.down('xs'))
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
const classes = useStyles({ isDesktop })
const dispatch = useDispatch()
const dataProvider = useDataProvider()
const refresh = useRefresh()
const notify = useNotify()
const version = useVersion()
const onAddToPlaylist = useCallback(
(pls) => {
if (pls.id === playlistId) {
refresh()
}
},
[playlistId, refresh]
)
const reorder = useCallback(
(playlistId, id, newPos) => {
dataProvider
.update('playlistTrack', {
const SubscriptionsList = props => {
const refresh = useRefresh();
const [filter, setFilter] = useState({});
const [paginationURL, setPaginationURL] = useState(null);
const { data, loaded, pagination, url } = useGetList({
...props,
filter,
paginationURL,
});
if (!loaded) return ;
const nextPage = label => {
setPaginationURL(pagination[label]);
};
const changeFilter = (filterValue, name) => {
let currentFilter = filter;
if (filterValue) {