Skip to content

Commit

Permalink
Merge pull request #1167 from openmsupply/#1159-printing-refinements
Browse files Browse the repository at this point in the history
Tidy report usage
  • Loading branch information
mark-prins authored Apr 11, 2022
2 parents fd67768 + 56df1a1 commit 0e954b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/common/src/intl/locales/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@
"button.login": "Log in",
"error.login": "Invalid username or password",
"select-store": "Select store",
"select-report": "Select Report"
}
"select-report": "Select Template"
}
6 changes: 5 additions & 1 deletion packages/system/src/Report/components/ReportSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ export const ReportSelector: FC<ReportSelectorProps> = ({
));

const noReports = !isLoading && !data?.nodes.length;
const oneReport =
!isLoading && data?.nodes.length === 1 ? data.nodes[0] : null;

return (
return !!oneReport ? (
<div onClick={() => onClick(oneReport)}>{children}</div>
) : (
<PaperClickPopover
placement="bottom"
width={350}
Expand Down

0 comments on commit 0e954b8

Please sign in to comment.