GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add user trash restore by sparkybug · Pull Request #4 · DataLinx/eclipsephp-core

Conversation

@sparkybug

@sparkybug sparkybug commented Mar 15, 2025

Copy link
Copy Markdown
Contributor

/claim #1

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
sparkybug added 2 commits March 15, 2025 10:29
@sparkybug
feat: added login tracking and login count features to User model
c0a81a0
@sparkybug
feat: added user trash & restore feature
abe1425
@algora-pbc algora-pbc Bot mentioned this pull request Mar 15, 2025
Implement User trashing and restoring #1
Closed
5 tasks
@algora-pbc algora-pbc Bot added the 🙋 Bounty claim label Mar 15, 2025
SlimDeluxe
SlimDeluxe requested changes Mar 15, 2025
View reviewed changes

@SlimDeluxe SlimDeluxe left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you are not checking permissions, but only the logged in state.
Please see here how to update permissions.
Also note that you can set up a super admin by calling this method in your test:
$this->set_up_super_admin_and_tenant();
This "logs in" a super admin with all permissions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/Feature/UserTrashRestoreTest.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/Feature/UserTrashRestoreTest.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/Feature/UserTrashRestoreTest.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

sparkybug added 2 commits March 15, 2025 15:48
@sparkybug
fix: made code fixes to the corrections provided for login tracking
1bb7d26
@sparkybug
refactor: modified testcases to explicitly check for permission & add…
2014141
…ed new testcases as well
@SlimDeluxe

SlimDeluxe commented Mar 17, 2025

Copy link
Copy Markdown
Member

@sparkybug , I see you added permissions checks, but they are custom and not using Filament Shield.

As I've mentioned before, you need to follow this procedure to create new permissions and update the policy.
So:

  1. Add the prefixes in UserResource: restore. restore_any, force_delete, force_delete_any
  2. Run php artisan shield:generate --panel=admin --resource=UserResource in the main app to update the permissions in the database and create a new policy class
  3. Copy the new generated methods to UserPolicy
  4. Update tests to use the correct permissions
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sparkybug
fix: rewrote the user trash restore tests to use filament policies
3241d64
@sparkybug

sparkybug commented Mar 17, 2025

Copy link
Copy Markdown
Contributor Author

@sparkybug , I see you added permissions checks, but they are custom and not using Filament Shield.

As I've mentioned before, you need to follow this procedure to create new permissions and update the policy. So:

  1. Add the prefixes in UserResource: restore. restore_any, force_delete, force_delete_any
  2. Run php artisan shield:generate --panel=admin --resource=UserResource in the main app to update the permissions in the database and create a new policy class
  3. Copy the new generated methods to UserPolicy
  4. Update tests to use the correct permissions

Hello @SlimDeluxe , I have done as requested. Sorry I was misunderstanding you all these while.
I have also added some more tests to ensure an all round check.
If you think they're not needed though, I could remove them.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sparkybug
Merge branch 'main' into add-user-trash-restore
0572818
@SlimDeluxe

SlimDeluxe commented Mar 18, 2025

Copy link
Copy Markdown
Member

Thank you, I've taken a quick look and unfortunately it appears it's not quite ready. I'll do the review tomorrow.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SlimDeluxe
SlimDeluxe requested changes Mar 19, 2025
View reviewed changes

@SlimDeluxe SlimDeluxe left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, some more fixes are required.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/Filament/Resources/UserResource.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/Filament/Resources/UserResource.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/Models/User.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/Feature/Filament/Resources/UserResourceTest.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/Feature/Filament/Resources/UserResourceTest.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/Feature/Filament/Resources/UserResourceTest.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/Feature/UserTrashRestoreTest.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sparkybug
fix: refactored and fixed all issues regarding
b4adfe9
@codecov-commenter

codecov-commenter commented Mar 20, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.26%. Comparing base (712beac) to head (66c6de6).

Additional details and impacted files
@@            Coverage Diff            @@
##               main       #4   +/-   ##
=========================================
  Coverage     59.26%   59.26%           
  Complexity      111      111           
=========================================
  Files            28       28           
  Lines           734      734           
=========================================
  Hits            435      435           
  Misses          299      299           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sparkybug added 3 commits March 20, 2025 01:30
@sparkybug
fix: rewrote the user trash restore tests to use filament policies
2d5d575
@sparkybug
Merge branch 'add-user-trash-restore' of https://github.com/sparkybug…
23fb178
…/eclipsephp-core into add-user-trash-restore
@sparkybug
fix: made all fixes to user trash restore
66c6de6
@sparkybug

sparkybug commented Mar 20, 2025

Copy link
Copy Markdown
Contributor Author

Hello @SlimDeluxe , I have made all fixes as you pointed out.
kindly review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SlimDeluxe
SlimDeluxe approved these changes Mar 21, 2025
View reviewed changes
@SlimDeluxe
SlimDeluxe merged commit dc021e4 into DataLinx:main Mar 21, 2025
@SlimDeluxe

SlimDeluxe commented Mar 21, 2025

Copy link
Copy Markdown
Member

Hi @sparkybug, thank you, this is now merged :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Apr 24, 2025
feat: world countries and world regions #6
Closed
feat: add world regions #7
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@SlimDeluxe SlimDeluxe SlimDeluxe approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

🙋 Bounty claim

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@sparkybug @SlimDeluxe @codecov-commenter
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.