Skip to content

[Feature] Implementing Draggable Cards | Dashboard#3069

Open
Civolilah wants to merge 14 commits intoinvoiceninja:developfrom
Civolilah:feature/1605-dashboard-chart-cards
Open

[Feature] Implementing Draggable Cards | Dashboard#3069
Civolilah wants to merge 14 commits intoinvoiceninja:developfrom
Civolilah:feature/1605-dashboard-chart-cards

Conversation

@Civolilah
Copy link
Copy Markdown
Collaborator

@Civolilah Civolilah commented Mar 26, 2026

@beganovich @turbo124 The PR includes the implementation of total cards on the dashboard. Screenshot:

Screenshot 2026-03-31 at 19 11 12

Let me know your thoughts.

@Civolilah Civolilah marked this pull request as ready for review March 31, 2026 17:11
@turbo124
Copy link
Copy Markdown
Member

turbo124 commented Apr 2, 2026

@Civolilah looks good, for now, could we please remove the refresh button, otherwise good to merge.

@turbo124
Copy link
Copy Markdown
Member

turbo124 commented Apr 2, 2026

image

@Civolilah i think there is an issue with the labelling here.

image

We need to include sum,average,count labels as well.

@Civolilah
Copy link
Copy Markdown
Collaborator Author

@turbo124 The logic for refreshing data in cards has been commented out for now, and the labeling has also been improved. Screenshot:

Screenshot 2026-04-03 at 08 33 23

Let me know your thoughts.

return;
}

const updated = cloneDeep(user) as User;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unnecessary as. Type should be inferred.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@beganovich Sure, it has been removed.

Comment on lines +76 to +83
).then((response: GenericSingleResourceResponse<CompanyUser>) => {
set(updated, 'company_user', response.data.data);

$refetch(['company_users']);

dispatch(updateUser(updated));
dispatch(resetChanges());
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we not need handling for errors here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@beganovich Hmm, I don't think so. We get the response from the API with the saved data and simply update the Redux state with it. I mean, we do the same thing in any other place where we need to update Redux, so I don't think we need it.

Comment on lines +54 to +56
useEffect(() => {
setOrder(currentDashboardFields);
}, [currentDashboardFields.length]);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can potentially get rid of this effect by top-down re-render key.

// In parent (Totals.tsx)

<PreferenceCardsGrid
  key={currentDashboardFields.join(',')} // Remount
  currentDashboardFields={currentDashboardFields}
  // ...
/>

Please test this and see if it works.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@beganovich Yes, we can achieve it on this way also. It works fine.

}, [manageOpen, currentUser]);

const handleSave = () => {
const updated = cloneDeep(currentUser) as User;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unnecessary type assertion again, should be inferred.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@beganovich Yeh, we can avoid it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants