diff --git a/packages/frontend/src/pages/Analytics/AnalyticsPage.tsx b/packages/frontend/src/pages/Analytics/AnalyticsPage.tsx index a076abfe2..e2a081f77 100644 --- a/packages/frontend/src/pages/Analytics/AnalyticsPage.tsx +++ b/packages/frontend/src/pages/Analytics/AnalyticsPage.tsx @@ -37,7 +37,7 @@ const Graphs = (): JSX.Element | null => { return ( -
+
diff --git a/packages/frontend/src/pages/Analytics/components/TopPraise.tsx b/packages/frontend/src/pages/Analytics/components/TopPraise.tsx index b46e4769b..a2e9550ca 100644 --- a/packages/frontend/src/pages/Analytics/components/TopPraise.tsx +++ b/packages/frontend/src/pages/Analytics/components/TopPraise.tsx @@ -125,7 +125,7 @@ const TopPraise = ({ Highest scored praise
-
    +
      {data.map((praise) => ( @@ -136,7 +136,7 @@ const TopPraise = ({
      See{' '} full report diff --git a/packages/frontend/src/pages/Analytics/components/TopPraiseGivers.tsx b/packages/frontend/src/pages/Analytics/components/TopPraiseGivers.tsx index 0c6ede3f6..88b65c30d 100644 --- a/packages/frontend/src/pages/Analytics/components/TopPraiseGivers.tsx +++ b/packages/frontend/src/pages/Analytics/components/TopPraiseGivers.tsx @@ -70,11 +70,17 @@ const TopPraiseGivers = ({ { Header: 'Username', accessor: 'username', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Cell: (data: any) => ( +
      + {data.value ? data.value : data.row.original.useraccountname} +
      + ), }, { Header: 'Score', accessor: 'score', - className: 'text-right', + className: 'text-right w-12', Cell: ({ value }: { value: number }) => ( {new Intl.NumberFormat().format(Math.round(value))} @@ -94,7 +100,7 @@ const TopPraiseGivers = ({ return ( Top praise givers - +
      {rows.map((row) => { prepareRow(row); diff --git a/packages/frontend/src/pages/Analytics/components/TopPraiseReceivers.tsx b/packages/frontend/src/pages/Analytics/components/TopPraiseReceivers.tsx index 997f0c34b..f88edbbe4 100644 --- a/packages/frontend/src/pages/Analytics/components/TopPraiseReceivers.tsx +++ b/packages/frontend/src/pages/Analytics/components/TopPraiseReceivers.tsx @@ -73,13 +73,16 @@ const TopPraiseReceivers = ({ Header: 'Username', accessor: 'username', // eslint-disable-next-line @typescript-eslint/no-explicit-any - Cell: (data: any) => - data.value ? data.value : data.row.original.useraccountname, + Cell: (data: any) => ( +
      + {data.value ? data.value : data.row.original.useraccountname} +
      + ), }, { Header: 'Score', accessor: 'score', - className: 'text-right', + className: 'text-right w-12', Cell: ({ value }: { value: number }) => ( {new Intl.NumberFormat().format(Math.round(value))} @@ -99,7 +102,7 @@ const TopPraiseReceivers = ({ return ( Top praise receivers -
      +
      {rows.map((row) => { prepareRow(row); diff --git a/packages/frontend/src/pages/Reports/ReportsRunPage.tsx b/packages/frontend/src/pages/Reports/ReportsRunPage.tsx index f73a97c80..930e683fa 100644 --- a/packages/frontend/src/pages/Reports/ReportsRunPage.tsx +++ b/packages/frontend/src/pages/Reports/ReportsRunPage.tsx @@ -48,9 +48,13 @@ const ReportsRunPage = (): JSX.Element | null => { if (!response?.rows) return ; - const json = JSON.stringify(response.rows); - const parser = new Parser(); - const csv = parser.parse(response.rows); + let json = ''; + let csv = ''; + if (response.rows.length > 0) { + json = JSON.stringify(response.rows); + const parser = new Parser(); + csv = parser.parse(response.rows); + } return ( diff --git a/packages/frontend/src/pages/Reports/components/CopyToClipboard.tsx b/packages/frontend/src/pages/Reports/components/CopyToClipboard.tsx index f7fc05858..6e0ef6349 100644 --- a/packages/frontend/src/pages/Reports/components/CopyToClipboard.tsx +++ b/packages/frontend/src/pages/Reports/components/CopyToClipboard.tsx @@ -12,7 +12,7 @@ const CopyToClipboard: React.FC = ({ text }) => { const handleCopy = (): void => { const copy = async (): Promise => { try { - await navigator.clipboard.writeText(JSON.stringify(text)); + await navigator.clipboard.writeText(text); toast.success('Copied to clipboard'); } catch (err) { console.error('Failed to copy text: ', err); diff --git a/packages/frontend/src/pages/Reports/components/RevealMore.tsx b/packages/frontend/src/pages/Reports/components/RevealMore.tsx index d7de2303a..1b3a48c8a 100644 --- a/packages/frontend/src/pages/Reports/components/RevealMore.tsx +++ b/packages/frontend/src/pages/Reports/components/RevealMore.tsx @@ -20,14 +20,7 @@ const RevealMore: React.FC = ({ content }) => {
      - - {rows.map((row) => ( - <> - {row} -
      - - ))} -
      +
      {rows.map((row) => `${row}\n`)}
      {rows.length > 10 && (
      + {headerGroup.headers.map((column) => { const { key, ...restColumn } = column.getHeaderProps(); // eslint-disable-next-line @typescript-eslint/no-explicit-any