RAWeb icon indicating copy to clipboard operation
RAWeb copied to clipboard

feat(manage): add achievement relation manager for games

Open wescopeland opened this issue 1 year ago • 8 comments

This PR ports most (all?) of the functionality from the achievement inspector to the management app.

Developers are able to:

  • Drag and drop to reorder achievements.
  • Toggle code columns.
  • Bulk promote and demote.
  • Bulk assign/remove types.

Additionally, actions are guarded using the AchievementPolicy, ensuring that Jr Devs can't update things they're not supposed to be able to.

The achievements are now listed on the game view page, eg: /manage/games/1.

I wish there was a way to pop some kind of "Success!" confirm on reordering. Unfortunately, it doesn't look like Filament supports this.

https://github.com/RetroAchievements/RAWeb/assets/3984985/1855cebb-ee1c-40ab-9ecf-a49ebde0d975

wescopeland avatar Jun 21 '24 20:06 wescopeland

Drag and drop reorder doesn't seem to work for me. The cursor turns into a red NOT symbol (cursor doesn't appear in screenshot, so I can't really share).

Jamiras avatar Jul 17 '24 14:07 Jamiras

I'm having trouble reproducing this issue on your account. Do you have the developer role assigned?

Screenshot 2024-07-17 at 5 30 36 PM

I recently took a fresh snapshot of prod and noticed your account didn't have the role. Upon assigning the role, I'm able to drag and drop to reorder achievements with your account.

wescopeland avatar Jul 17 '24 21:07 wescopeland

I've had to add that role for other features. This is what I currently look like locally: image

Jamiras avatar Jul 17 '24 21:07 Jamiras

Those are the same roles my account has.

Are you able to reproduce this issue in other browsers? I'm able to successfully drag+drop with Chrome and Firefox. I've also tested with multiple user accounts and multiple roles.

Can you also try ensuring Vite is running? Can you try sail artisan cache:clear and sail artisan view:clear? I've noticed Filament seems to very aggressively lean into caching and even while doing active development I have to frequently clear Laravel's various caches.

wescopeland avatar Jul 17 '24 21:07 wescopeland

I get the same behavior in Chrome and Edge. Firefox doesn't give me the NO sign, but it doesn't seem to actually rearrange anything either.

Output from provided commands:

jamiras@ubuntu24 pr/2516:~/source/RAWeb$ sail artisan cache:clear

   INFO  Application cache cleared successfully.  

jamiras@ubuntu24 pr/2516:~/source/RAWeb$ sail artisan view:clear

   INFO  Compiled views cleared successfully.

I also see the same behavior logged in as your user (same set of roles)

Jamiras avatar Jul 17 '24 22:07 Jamiras

Understood, thank you for trying those things.

There must be a difference between our two setups somewhere; I'm having a hard time right now thinking of what it might be. After #2502 is done using preview, maybe what would be best is to deploy this branch onto preview and see if the issue still surfaces in that environment.

wescopeland avatar Jul 17 '24 22:07 wescopeland

User error. You have to click the image before reordering is allowed.

It acts like things can be dragged before clicking it.

Jamiras avatar Jul 17 '24 22:07 Jamiras

Latest includes a slight change to the reorder button to hopefully improve its usability.

Screenshot 2024-07-17 at 8 16 57 PM

wescopeland avatar Jul 18 '24 00:07 wescopeland