Skip to content
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

extensibility: export Property class #58

Open
GaussianWonder opened this issue Oct 3, 2024 · 1 comment
Open

extensibility: export Property class #58

GaussianWonder opened this issue Oct 3, 2024 · 1 comment

Comments

@GaussianWonder
Copy link

I notice this commit targets extensibility.

Since prepareProperties is now overridable, I'd say it's just as useful to export the Property class in index.ts. It would allow me to use this:

export class PrismaProperty extends Property {
  /**
   * In [adminjs-prisma package](https://github.com/SoftwareBrothers/adminjs-prisma/blob/main/src/Property.ts) the isArray method is not implemented.
   *
   * This results in `isArray` always returning false. You can trace it back to [this Property base class](https://github.com/SoftwareBrothers/adminjs/blob/262fa77163747f6dd340fbeffcbf46386801edf1/src/backend/adapters/property/base-property.ts#L167).
   */
  isArray(): boolean {
    return this.column.isList;
  }
}

on a PrismaResource adapter which overloads the prepareProperties method.

@BobReid
Copy link

BobReid commented Oct 29, 2024

+1 on this

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

No branches or pull requests

2 participants