Skip to content

Actions showIn list does not work? #553

@TrilipuT

Description

@TrilipuT

Hey!

After recent updates (seems like after threeDotsMenu is introduced) action icon does not show in list even if showIn list is set to true.
It looks like Tooltip component does not render icon correctly... Can you help here?
Image

here's my actions array

actions: [
            {
                name: 'Approve',  // Display name of the action
                icon: 'flowbite:check-plus-circle-solid',  // Icon to display (using Flowbite icons)
                allowed: ({ adminUser, standardAllowedActions }) => {
                    return true;  // Allow everyone
                },
                // Handler function when action is triggered
                action: async ({adminforth, resource, recordId, adminUser}) => {
                    try {
                        const oldRecord = await admin.resource('vehicle').get([Filters.EQ('id', recordId)]);
                        // let result = await adminforth.updateResourceRecord({resource: resource,recordId: recordId,oldRecord: oldRecord,record: {status: 1},adminUser: adminUser})
                        let result = await adminforth.resource('vehicle').update(recordId, {status: 'ACTIVE'});
                        if (result.ok) {
                            await scheduleForUpdate(recordId, adminforth)
                            await adminforth.getPluginByClassName<AuditLogPlugin>('AuditLogPlugin').createLogRecord(
                                resource,
                                'approve',
                                {status: 'ACTIVE'},
                                adminUser,
                                oldRecord
                            )
                            return {
                                ok: true,
                                successMessage: "Approved successfully",
                            };
                        } else {
                            throw new Error(result.error);
                        }
                    } catch (error) {
                        return {
                            ok: false,
                            successMessage: `Error ${error.message}`,
                        };
                    }
                },
                // Configure where the action appears
                showIn: {
                    list: true,
                    listThreeDotsMenu: true,
                    showButton: true,        // Show as a button
                    showThreeDotsMenu: true, // Show in three-dots menu
                }
            },
        ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions