adminjs-prisma icon indicating copy to clipboard operation
adminjs-prisma copied to clipboard

extensibility: export Property class

Open GaussianWonder opened this issue 1 year ago • 1 comments

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.

GaussianWonder avatar Oct 03 '24 13:10 GaussianWonder

+1 on this

BobReid avatar Oct 29 '24 15:10 BobReid