SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js
https://adminjs.co
MIT License
8.19k stars 661 forks source link

feat: support subproperties as a title #1643

Closed smacker closed 6 months ago

smacker commented 6 months ago

This change allows setting a sub property as a title of resource.

For example:

      resource: {
        model: getModelByName('Sport'),
        client: prisma,
      },
      options: {
        titleProperty: 'translation.en',
        listProperties: ['translation.ja', 'translation.en'],
        properties: {
          translation: { type: 'mixed' },
          'translation.ja': { type: 'string' },
          'translation.en': { type: 'string' },
          // some other props
        },
      },

In master branch such titleProperty is just ignored which is an unexpected behavior.

dziraf commented 6 months ago

@smacker Thanks, I'll merge this. Using the helper method actually makes more sense here.

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 7.8.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: