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

Getting stuck on the implementation #15

Open
ReisoAphi opened this issue Jan 3, 2023 · 10 comments
Open

Getting stuck on the implementation #15

ReisoAphi opened this issue Jan 3, 2023 · 10 comments

Comments

@ReisoAphi
Copy link

Im Getting this msg from the adminJs app: "You have to implement action component for your ActionSee:the documentation"
image

Any clue?

@joncottrell
Copy link

Same issue here. @ReisoAphi what did you end up doing?

@Brdnn
Copy link

Brdnn commented Apr 11, 2023

I am facing the same issue, any workaround there?

@ZeroCho
Copy link

ZeroCho commented May 23, 2023

    componentLoader,
    resources: [createUserResource(componentLoader)],

I think you guys didn't put componentLoader option above resources option

@vikas21222
Copy link

Im Getting this msg from the adminJs app: "You have to implement action component for your ActionSee:the documentation" image

also facing the same issue

@ahmetson
Copy link

It happens because the ComponentLoader passed to the ImportExport feature is not known by Adminjs.
You should pass the component loader that's used by Adminjs to the ImportExportFeature.

Correct format of the app.js is:

import { ComponentLoader } from 'adminjs'

const componentLoader = new ComponentLoader()

 const adminOptions: AdminJSOptions = {
    componentLoader,
    resources: [createCustomResource(componentLoader)]
    }
 }

const adminjs = new AdminJS(adminOptions);

Now, the script that defines the resource with the ImportExportFeature:

let createCustomResource = (componentLoader) => {
   return {
      resource: DatabaseModel,
      features: [
            importExportFeature({ componentLoader }),
       ],
   }
}

If you define the componentLoader in the script with the resource using new ComponentLoader() and it's not passed to the adminjs, then you will see the error.

In short, you should have only one instane of ComponentLoader within your app.

@lpbonomi
Copy link

@ahmetson looks like this works, maybe this should go in the docs?

@vikas21222
Copy link

It happens because the ComponentLoader passed to the ImportExport feature is not known by Adminjs. You should pass the component loader that's used by Adminjs to the ImportExportFeature.

Correct format of the app.js is:

import { ComponentLoader } from 'adminjs'

const componentLoader = new ComponentLoader()

 const adminOptions: AdminJSOptions = {
    componentLoader,
    resources: [createCustomResource(componentLoader)]
    }
 }

const adminjs = new AdminJS(adminOptions);

Now, the script that defines the resource with the ImportExportFeature:

let createCustomResource = (componentLoader) => {
   return {
      resource: DatabaseModel,
      features: [
            importExportFeature({ componentLoader }),
       ],
   }
}

If you define the componentLoader in the script with the resource using new ComponentLoader() and it's not passed to the adminjs, then you will see the error.

In short, you should have only one instane of ComponentLoader within your app.

not usefull for me still getting same error

@lpbonomi
Copy link

In my case, I wasn't bundling the components after using admin.watch() and admin.initialize() it worked

@juanjofrelopez
Copy link

@ReisoAphi Hi! Any solution to this? I'm facing the same problem with the export functionality. Thanks

@ReisoAphi
Copy link
Author

ReisoAphi commented May 2, 2024

Whenever you add a React implementation, you need to bunddle. Add to your admin app a watcher, admin.watch(), let the app run and it will bundle whenever the app sees a react change.

And dont forget to add the feature to your table features property.

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

8 participants