pimcore / admin-ui-classic-bundle

Other
11 stars 99 forks source link

Fix: Filter for relation throws an error #741

Closed blankse closed 2 weeks ago

blankse commented 2 weeks ago

Fix: https://github.com/pimcore/admin-ui-classic-bundle/issues/720

kingjia90 commented 2 weeks ago

There is still something not right, maybe we should introduce also a minimum width? image

blankse commented 2 weeks ago

@kingjia90 What did you config as width?

kingjia90 commented 2 weeks ago

it's the default value in demo instance, ~i believe it's empty~ it's 96 but don't know from where it comes image

blankse commented 2 weeks ago

@kingjia90 I changed it again https://github.com/pimcore/admin-ui-classic-bundle/pull/741/commits/1bddd1241a6652cd2c896c030eed13f5919cec17 There are so many width keys in this fieldInfo object. I hope this is the right one. In my tests it works now.

kingjia90 commented 2 weeks ago

weird, to me it doesn't work, it's the default 700, the table within the dialog seems crammed and not utilizing/distributing the width for each grid column

image

blankse commented 2 weeks ago

@kingjia90 What did you set as the width? I entered 1000 in this field in the demo, and it is now wider. Yes, the columns are narrow, but I believe that’s because they are empty at the beginning.

blankse commented 2 weeks ago

@kingjia90 I cleared the browser cache/cookies. Now the column widths also correct. Extjs saves the widths of the columns in the local storage: image image

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

kingjia90 commented 2 weeks ago

@kingjia90 What did you set as the width? I entered 1000 in this field in the demo, and it is now wider. Yes, the columns are narrow, but I believe that’s because they are empty at the beginning.

i didn't set anything, that should be right, nevermind, it is just fine

@kingjia90 I cleared the browser cache/cookies. Now the column widths also correct. Extjs saves the widths of the columns in the local storage: image image

ahhh didn't know that... does it implicitly mean that we cannot use variable width and should be always fixed?

blankse commented 2 weeks ago

@kingjia90 It's not from ext js. It is here in the admin-ui-classic-bundle:

https://github.com/pimcore/admin-ui-classic-bundle/blob/e3b66fb164a72430cee9bac9ccf1ff21b6de9d3d/public/js/pimcore/object/tags/manyToManyObjectRelation.js#L405-L426 https://github.com/pimcore/admin-ui-classic-bundle/blob/e3b66fb164a72430cee9bac9ccf1ff21b6de9d3d/public/js/pimcore/object/tags/abstractRelations.js#L210-L225

You have first open the filter with the very small window. So the columns was saved small. You can drag and drop the widths wider and it should be saved for the next window, right? When you have a empty local storage the columns have a correct width.

kingjia90 commented 2 weeks ago

It seems it's because the grid is likely empty on first time opening as "Filter by relation" and therefore it doesn't have an estimation on how long each column would be. Ideally we should trigger this resize with localStorage.setItem on selecting/adding the first element

The current PR changes LGTM