Skip to content

Commit

Permalink
Merge pull request #8036 from marmelab/fix-dashboard-redirection
Browse files Browse the repository at this point in the history
Feat: Add filter redirection for pending reviews
  • Loading branch information
fzaninotto authored Aug 4, 2022
2 parents c28db11 + 83ff11a commit 54a483d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/demo/src/dashboard/CardWithIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as React from 'react';
import { FC, createElement } from 'react';
import { Card, Box, Typography, Divider } from '@mui/material';
import { Link } from 'react-router-dom';
import { Link, To } from 'react-router-dom';
import { ReactNode } from 'react';

import cartouche from './cartouche.png';
import cartoucheDark from './cartoucheDark.png';

interface Props {
icon: FC<any>;
to: string;
to: To;
title?: string;
subtitle?: string | number;
children?: ReactNode;
Expand Down
9 changes: 8 additions & 1 deletion examples/demo/src/dashboard/PendingReviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
useIsDataLoaded,
} from 'react-admin';

import { stringify } from 'query-string';

import CardWithIcon from './CardWithIcon';
import StarRatingField from '../reviews/StarRatingField';
import { Customer, Review } from '../types';
Expand All @@ -43,7 +45,12 @@ const PendingReviews = () => {

return (
<CardWithIcon
to="/reviews"
to={{
pathname: '/reviews',
search: stringify({
filter: JSON.stringify({ status: 'pending' }),
}),
}}
icon={CommentIcon}
title={translate('pos.dashboard.pending_reviews')}
subtitle={total}
Expand Down

0 comments on commit 54a483d

Please sign in to comment.