Skip to content

Commit acdfbe7

Browse files
committed
feat(unit-user-usage): add activity totals to table
1 parent 196f1c6 commit acdfbe7

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

components/usage/UserUsageTable.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,18 @@ export const UserUsageTable = ({ users, toolbarContent, onChange }: UserUsageTab
6767
columns: [
6868
columnHelper.accessor("first_seen", {
6969
header: "First Seen",
70-
cell: ({ getValue }) => dayjs.utc(getValue()).format(`${DATE_FORMAT} ${TIME_FORMAT}`),
70+
cell: ({ getValue, row }) =>
71+
dayjs.utc(getValue()).format(`${DATE_FORMAT} ${TIME_FORMAT}`) +
72+
`(${row.original.activity.total_days_since_first_seen} days ago)`,
7173
sortingFn: (a, b) =>
7274
dayjs.utc(a.original.first_seen).diff(dayjs.utc(b.original.first_seen)),
7375
}),
76+
77+
columnHelper.accessor("activity.total_days_active", {
78+
header: "Total",
79+
cell: ({ getValue, row }) =>
80+
`${getValue()} days (${row.original.activity.total_activity})`,
81+
}),
7482
columnHelper.accessor((user) => user.activity.period_b?.active_days, {
7583
id: "activity_b",
7684
header: "API Used",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"@rjsf/utils": "5.18.1",
5353
"@rjsf/validator-ajv8": "5.18.1",
5454
"@sentry/nextjs": "7.109.0",
55-
"@squonk/account-server-client": "2.1.1-rc.1",
56-
"@squonk/data-manager-client": "2.0.7-rc.5",
55+
"@squonk/account-server-client": "2.1.1-rc.2",
56+
"@squonk/data-manager-client": "2.0.7-rc.8",
5757
"@squonk/mui-theme": "3.0.2",
5858
"@squonk/sdf-parser": "1.3.0",
5959
"@tanstack/match-sorter-utils": "8.15.1",

pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)