awcodes / filament-curator

A media picker plugin for Filament Panels.
MIT License
343 stars 89 forks source link

ULID and UUID support #268

Closed kirkbushell closed 1 year ago

kirkbushell commented 1 year ago

The package makes a couple of assumptions on the consumers by assuming that all table IDs are auto-increment ids (integers).

This pull request solves that by updating the various pieces of code that expect only an integer, updating them to also allow strings for ulids and uuids.

awcodes commented 1 year ago

Looks like this is breaking the isSelected method in the panel. Items are not being highlighted when they are selected in the item grid.

kirkbushell commented 1 year ago

Looks like this is breaking the isSelected method in the panel. Items are not being highlighted when they are selected in the item grid.

Alright, I'll take a look.

kirkbushell commented 1 year ago

Looks like this is breaking the isSelected method in the panel. Items are not being highlighted when they are selected in the item grid.

I had a look, but all the methods are protected by the quotes. Could you point to where you're seeing that particular issue?

awcodes commented 1 year ago

In the curator-panel.blade file. When you click on an image in the grid the image should get highlighted with a primary color border and a check mark when selected. The string id isn't passing the conditional in the isSelected() method in the x-data.

kirkbushell commented 1 year ago

In the curator-panel.blade file. When you click on an image in the grid the image should get highlighted with a primary color border and a check mark when selected. The string id isn't passing the conditional in the isSelected() method in the x-data.

Ah, must be the equivalence check maybe?

kirkbushell commented 1 year ago

Alright, pushed an update.

awcodes commented 1 year ago

Sorry, but I'm still having issues with this. I can indeed select them now, but I can't deselect them.

kirkbushell commented 1 year ago

Sorry, but I'm still having issues with this. I can indeed select them now, but I can't deselect them.

It's all good, easier if we had a test suite :P

kirkbushell commented 1 year ago

Sorry, but I'm still having issues with this. I can indeed select them now, but I can't deselect them.

Okay, went through the curator.js file and removed those equivalence checks as well, I think it should be all good now.

awcodes commented 1 year ago

Thanks, I was able fix the deselection.