-
-
Notifications
You must be signed in to change notification settings - Fork 742
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@@ -18,6 +18,19 @@ const StyledGrid = styled(Box)(({ theme }) => ({ | |||
export const ExecutiveDashboard: VFC = () => { | |||
const { executiveDashboardData, loading, error } = useExecutiveDashboard(); | |||
|
|||
const calculateFlagPerUsers = () => { |
There was a problem hiding this comment.
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?
Agree. It is a very simple derivation of data.
tir. 30. jan. 2024 kl. 08:43 skrev Mateusz Kwasniewski <
***@***.***>:
… ***@***.**** commented on this pull request.
------------------------------
In frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx
<#6062 (comment)>:
> @@ -18,6 +18,19 @@ const StyledGrid = styled(Box)(({ theme }) => ({
export const ExecutiveDashboard: VFC = () => {
const { executiveDashboardData, loading, error } = useExecutiveDashboard();
+ const calculateFlagPerUsers = () => {
I was considering this calculation in the backend and decided it's ok to
have it in frontend for now. What do you prefer?
—
Reply to this email directly, view it on GitHub
<#6062 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD2WIPWIWMCK6JMUGFKK2M3YRCQCDAVCNFSM6AAAAABCPVCGHSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNJQGQYTOMRYGQ>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
@@ -30,8 +43,11 @@ export const ExecutiveDashboard: VFC = () => { | |||
/> | |||
</Box> | |||
<StyledGrid> | |||
<UserStats /> | |||
<FlagStats /> | |||
<UserStats count={executiveDashboardData.users.total || 0} /> |
There was a problem hiding this comment.
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 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should never occur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments inside
I was following what the types were telling me here. Lets look into it.
tir. 30. jan. 2024 kl. 08:45 skrev Mateusz Kwasniewski <
***@***.***>:
… ***@***.**** commented on this pull request.
------------------------------
In frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx
<#6062 (comment)>:
> @@ -18,6 +18,19 @@ const StyledGrid = styled(Box)(({ theme }) => ({
export const ExecutiveDashboard: VFC = () => {
const { executiveDashboardData, loading, error } = useExecutiveDashboard();
+ const calculateFlagPerUsers = () => {
+ if (
+ !executiveDashboardData.users.total ||
should never occur
—
Reply to this email directly, view it on GitHub
<#6062 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD2WIPRQLG34OLG2RR66OGTYRCQJNAVCNFSM6AAAAABCPVCGHSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNJQGQZDAMRZGY>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
7041573
to
e4b3619
Compare
This PR connects the static widgets to actual data