Skip to content

Commit

Permalink
Merge pull request #722 from factly/fix/720-715/formats-dashboard-issues
Browse files Browse the repository at this point in the history
Fix/720-715/formats-dashboard-issues
  • Loading branch information
shreeharsha-factly committed May 12, 2023
2 parents ecb5702 + 201388d commit cac9a82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion studio/src/pages/dashboard/components/Features.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ function Features() {
const superOrg = useSelector(({ admin }) => {
return admin.organisation;
});
const selectedSpace = useSelector((state) =>({space_id:state.spaces.selected}));
React.useEffect(() => {
fetchEntities();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

React.useEffect(() => {
if (superOrg.is_admin) {
fetchEvents();
}
}, [superOrg.is_admin]);

const {
ratings,
Expand Down Expand Up @@ -101,7 +112,7 @@ function Features() {
actions={[
<Button
onClick={() => {
dispatch(addDefaultFormats()).then(() => history.push('/advanced/formats'));
dispatch(addDefaultFormats(selectedSpace)).then(() => history.push('/advanced/formats'));
}}
>
<PlusOutlined /> CREATE FORMATS
Expand Down
4 changes: 2 additions & 2 deletions studio/src/pages/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Dashboard() {
<Col md={{ span: 5 }}>
<Card size="small" hoverable={true} title="Total">
<Link to="/posts">
<Statistic value={article.publish + article.draft + article.ready} />
<Statistic value={~~article.publish + ~~article.draft + ~~article.ready} />
</Link>
</Card>
</Col>
Expand Down Expand Up @@ -88,7 +88,7 @@ function Dashboard() {
<Col md={{ span: 5 }}>
<Card size="small" hoverable={true} title="Total">
<Link to="/fact-checks">
<Statistic value={factCheck.publish + factCheck.draft + factCheck.ready} />
<Statistic value={(~~factCheck.publish + ~~factCheck.draft + ~~factCheck.ready)} />
</Link>
</Card>
</Col>
Expand Down

0 comments on commit cac9a82

Please sign in to comment.