Skip to content

refactor: change private properties to protected for extensibility #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

aniruddha-adhikary
Copy link
Contributor

Thanks for building AdminJS!

I ran into a little snag when trying to extend some of the Prisma resource functionalities, specifically with the buildSortBy, model... properties being private:

class PermissionCheckedResource extends Prisma.Resource {
  findOne(...) {
    this.buildSortBy
     ^ this method is private thus cannot update behavior easily
  }
}

Having this method as private means a lot of repeating code if we try to customize behavior. It would be awesome if it could be switched to protected to make subclassing a breeze and keep our codebase clean.

Thought this might make AdminJS more flexible for others too who might be looking to extend functionality in similar ways.

Thanks for considering this tweak!

@dziraf dziraf merged commit 90ab9a2 into SoftwareBrothers:main Sep 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants