dashpress icon indicating copy to clipboard operation
dashpress copied to clipboard

bug: Functionality Bug

Open MuhammadAliashraf opened this issue 9 months ago • 3 comments

Bug Report

DashPress version:

v1.0.4(Latest Version)

Current behavior: Now Here is the URl:https://demo.dashpress.io/admin/film_actor In This Page There is a Tabel In this Tabel, when we select one Row or one Check Box Then Its Selecting the All CheckBoxs To be Checked.

Expected behavior: When i select the one checkBox Then its has to be select the one CheckBox Only that is Selected By User.

Steps to reproduce: we have to review the code for the table

Other information: image

MuhammadAliashraf avatar May 06 '24 14:05 MuhammadAliashraf

Thanks @MuhammadAliashraf

The issue is not with DashPress but with the film_actor table. The issue is that this table does not have a primary key so it doesn't know which ID to select. If you try selecting multiple items on tables with a primary key (e.g https://demo.dashpress.io/admin/customer), this will not happen There is no code change from my end to fix this issue other than to add a primary key to the database. Will look into adding a primary key for the table though

thrownullexception avatar May 06 '24 15:05 thrownullexception

@thrownullexception Thanks

MuhammadAliashraf avatar May 06 '24 15:05 MuhammadAliashraf

Taking a look now I see why my checks are not even working, because I wrote this https://github.com/dashpresshq/dashpress/blob/737c4861bbe292d0390251b8d975492bf8af7480/src/backend/entities/entities.service.ts#L63

And I check the schema and I see this

Screenshot 2024-05-06 at 16 28 56

The film_actor has a two primary keys which is problematic for Dashpress, so I will update the logic of the code above to also error out of the number of primary keys is not equal to one.

Thanks for reporting this issue

thrownullexception avatar May 06 '24 15:05 thrownullexception

Added checks to block actions when there are multiple primary IDs, Won't solve this issue in particular but users will get the error when they try to performs on the entity

thrownullexception avatar May 18 '24 02:05 thrownullexception