Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: connect dashboard static widgets to data #6062

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

FredrikOseberg
Copy link
Contributor

This PR connects the static widgets to actual data

Copy link

vercel bot commented Jan 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2024 8:59am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Jan 30, 2024 8:59am

@@ -18,6 +18,19 @@ const StyledGrid = styled(Box)(({ theme }) => ({
export const ExecutiveDashboard: VFC = () => {
const { executiveDashboardData, loading, error } = useExecutiveDashboard();

const calculateFlagPerUsers = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was considering this calculation in the backend and decided it's ok to have it in frontend for now. What do you prefer?

@FredrikOseberg
Copy link
Contributor Author

FredrikOseberg commented Jan 30, 2024 via email

@@ -30,8 +43,11 @@ export const ExecutiveDashboard: VFC = () => {
/>
</Box>
<StyledGrid>
<UserStats />
<FlagStats />
<UserStats count={executiveDashboardData.users.total || 0} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Backend is deliberately not returning null/undefined values so that we don't need to be defensive in the UI

@@ -18,6 +18,19 @@ const StyledGrid = styled(Box)(({ theme }) => ({
export const ExecutiveDashboard: VFC = () => {
const { executiveDashboardData, loading, error } = useExecutiveDashboard();

const calculateFlagPerUsers = () => {
if (
!executiveDashboardData.users.total ||
Copy link
Contributor

Choose a reason for hiding this comment

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

should never occur

Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

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

minor comments inside

@FredrikOseberg
Copy link
Contributor Author

FredrikOseberg commented Jan 30, 2024 via email

@FredrikOseberg FredrikOseberg merged commit 7d6d406 into main Jan 30, 2024
13 checks passed
@FredrikOseberg FredrikOseberg deleted the feat/connect-widgets-to-data branch January 30, 2024 09:07
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