SoftwareBrothers / adminjs

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

[Bug]: [@admins/relations] custom action icon not shown #1658

Open captHarlock69 opened 2 months ago

captHarlock69 commented 2 months ago

Contact Details

No response

What happened?

added a new custom action to a resource A with "icon" property. In the list page of the resource the icon is correctly show. In a second resource B I added a oneToMany relation to resource B but when I enter in frontend of resource B in the relations-list I see there is a button with the custom action but with an empy box . Action handler is called properly. Only icon not visible.

Bug prevalence

whenever I open che relation "show" in frontend

AdminJS dependencies version

adminjs version 7.81 admin/relations version 1.1.2

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

// preson.resource.ts
import { targetRelationSettingsFeature } from '@adminjs/relations';
import { Person } from './models/index.js';

export const createPersonResource = () => ({
  resource: Person,
  options: {
    actions: {
       addChild: {
         actionType: 'record',
         isVisible: true,
         isAccessible: true,
         icon: 'PlusCircle' // <--- just added this
         component: AddChildComponent,
         handler: () => {} // my handler
       }
    }
  },
  features: [targetRelationSettingsFeature()],
});

// team.resource.ts --> as in examples