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

fix: improper currency formatting issue in kanban view #666

Merged
merged 7 commits into from
Mar 21, 2025

Conversation

rajabxahmd
Copy link
Contributor

@rajabxahmd rajabxahmd commented Mar 17, 2025

ISSUE:

Currency is not being formatted inside kanban view. In other views its fine.

CAUSE:

  • In the parseRows function inside pages like Deals.vue and Leads.vue, the fieldType variable was being populated using the array(columns) passed into the function, which contains key and type. This worked fine for other views.
  • However, the Kanban view was passing a different array (fields) into the getKanbanRows function, which contains fieldname and fieldtype instead. This caused fieldType to be undefined for the Kanban view, as the parseRows function expected key and type , but fieldname and fieldtype were provided instead. As a result, currency and other fields were not formatted correctly in the Kanban view.

FIX:

A conditional check was added in the parseRows function to handle different structures of the array passed into the function:

  • For the Kanban view, the fieldType is now populated using fieldname and fieldtype.
  • Else, the fieldType is populated using key and type.

This ensures that the fieldType is correctly set in both Kanban and other views, allowing proper formatting for fields like currency, date, and percent.

ADDITIONAL INFO:

  • This fix was tested to ensure that currency and other fields (like Date, Percent, and Float) are now correctly formatted in both the Kanban and other views.
  • The changes do not affect the functionality or formatting in other parts of the application, and only fix the issue related to the Kanban view’s fieldtype handling.
  • This anyhow is a fix limited to the pages the changes were made. Any future implications of new pages or views might not benefit from this. I shall be posting an alternative fix as well.

BEFORE FIX:

before kanban

AFTER FIX:

kanban after

rajabxahmd and others added 2 commits March 19, 2025 15:44
Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com>
@rajabxahmd rajabxahmd requested a review from shariquerik March 19, 2025 10:42
rajabxahmd and others added 2 commits March 19, 2025 16:19
Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com>
Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com>
@rajabxahmd rajabxahmd requested a review from shariquerik March 19, 2025 10:50
@shariquerik shariquerik merged commit 72e499e into frappe:develop Mar 21, 2025
1 check passed
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