appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.64k stars 3.74k forks source link

[Bug]: Table widget throws error on Sorting save/discard column #27430

Open chandannkumar opened 1 year ago

chandannkumar commented 1 year ago

Is there an existing issue for this?

Description

A table with inline editing enabled, when we try to Sort the Save/Discard column , it throws error. This is happening on Production as well

Steps To Reproduce

  1. Drag & Drop a Table widget
  2. Connect Table with data and enable a Edit option for columns
  3. Make sure Save/Discard column appears on Table widget
  4. Click on Save/Discard column header to sort the column.
  5. Observe the error and records are also not visible on Table

Public Sample App

No response

Environment

Production

Issue video log

https://www.loom.com/share/013dd9215d09428e89a5818310f6c3f6

Version

Cloud/Production

carinanfonseca commented 2 months ago

Expected: it shouldn't be possible to click on Save/Discard column to change table sorting (it shouldn't take any action).

saicharan-zemoso commented 2 months ago

Hello @carinanfonseca , trying to reproduce the issue. It is not showing any error.

carinanfonseca commented 2 months ago

@saicharan-zemoso I am uploading a screen recording so you can see my steps to reproduce this issue.

Uploading Screen Recording 2024-09-04 at 01.19.54.mov…

saicharan-zemoso commented 2 months ago

Hello @carinanfonseca , The video is not uploaded completely can you upload it again.

this is video when I tried to reproduce the issue in app.appsmith , release and in the local dev setup. I was not getting any error on trying to sort the save/discard column.

https://github.com/user-attachments/assets/908c04be-f15f-49e2-b173-f55404d66c49

carinanfonseca commented 2 months ago

For some reason, I can't upload the video. Here is a link for the video: https://drive.google.com/file/d/1oP40JCUi7ql48-v771RTI7dfkH4F4_jz/view?usp=sharing

saicharan-zemoso commented 2 months ago

@carinanfonseca , thanks for the video that was helpful in finding the issue.

The issue was it was passing a column name which does not exist in the actual table when the save/discard is chosen as a column to sort.: Screenshot from 2024-09-04 16-29-00

In the above picture it was taking "EditAction1" as sort column which does not exist in the actual table. we can resolve this by passing an empty string when the save/discard column is clicked.

carinanfonseca commented 2 months ago

Good to know you understand the reason behind it. I see your approach, but I think it would be a cleaner solution to make the Save/Discard column unclickable and unsortable, as they are not relevant for that column. This would solve the problem entirely.

saicharan-zemoso commented 2 months ago

Ok sure. And I will make sure that the user should still be able freeze the column left or right. only sort functionality should be removed for that column.

saicharan-zemoso commented 2 months ago

Hello @carinanfonseca , I have raised a PR for this issue. No reviewers are assigned to this Pr. can you assign someone to review it: https://github.com/appsmithorg/appsmith/pull/36151