Skip to content

add basic stats for us to keep tabs on whats up#9

Open
lyoshenka wants to merge 2 commits into
mainfrom
stats
Open

add basic stats for us to keep tabs on whats up#9
lyoshenka wants to merge 2 commits into
mainfrom
stats

Conversation

@lyoshenka
Copy link
Copy Markdown
Member

No description provided.

Comment thread front-end/src/components/Stats.tsx Outdated
Comment thread back-end/types/route-types.ts Outdated
Comment thread back-end/utils/db.ts Outdated
Comment thread front-end/src/components/Stats.tsx Outdated
Comment thread back-end/utils/db.ts Outdated
Comment thread back-end/utils/db.ts Outdated
Comment thread back-end/utils/db.ts Outdated
Comment thread back-end/utils/db.ts
}

return {
accounts: accountRes.length ? Number(accountRes[0].accounts) : 0,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to avoid using numbers in boolean contexts (where 0 is falsy and >0 is truthy), because it can be a foot-gun

In this case I'd just do accounts: Number(accountRes[0].accounts ?? 0)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree with you on not doing truey integers, but i don't think im doing that here. if !accountRes.length, then there are 0 accounts

also im not sure i understand the difference in your two examples

Comment thread front-end/src/components/Stats.tsx Outdated
Comment thread front-end/src/components/Stats.tsx Outdated
Comment thread front-end/src/components/Stats.tsx Outdated
Comment thread front-end/src/views.ts
component: Account
}
},
Stats: {
Copy link
Copy Markdown
Collaborator

@brundonsmith brundonsmith Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to give some thought to how to prevent this from showing up for regular users. I'm thinking for now maybe VIEWS becomes dynamic, and factors in our hardcoded list of admin account IDs?

But there is a bigger discussion to be had around, if budibase won't serve all of our admin needs, should we a) look for an alternate service or b) modify our core systems and schemas to properly handle different access levels for admin users?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea this is my core question. there's a also a third option to use something that's meant for dashboards/reports such as https://github.com/metabase/metabase

(why is everything called ____base???)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partially i did this to get into the codebase a bit. ty for the comments, will fix what you pointed out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants