Fix: Currency Formatting Issue in Kanban View #651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
In the Kanban view, currency values were not being formatted correctly. However, formatting worked fine in List view and Group By view.
Cause:
The
parseRows()
function relies on columns to retrieve the type of each field using:let fieldType = columns?.find( (col) => (col.key || col.value) == row, )?.type
In List view and Group By view, the function was passed columns, where each object contains:
{ key: "fieldname", type: "fieldtype" }
However, in Kanban view, the
getKanbanRows()
function was incorrectly passing fields instead of columns. The fields objects contain:{ fieldname: "fieldname", fieldtype: "fieldtype" }
This mismatch caused fieldType to remain undefined, breaking the formatting logic.
Fix:
Updated the transform function in ViewControls.vue to modify fields before use:
transform(data) { data.fields.forEach((field) => { field.type = field.fieldtype; field.key = field.fieldname; }); return data; }
Now, fields are transformed to match the expected structure of columns, ensuring the
parseRows
function can correctly apply formatting.