Giter Site home page Giter Site logo

Comments (16)

AnthonyPhan avatar AnthonyPhan commented on July 18, 2024 2

O boy I feel dumb for not remembering to do that!
Cloning and running your repo works perfectly now, thank you :)

from community-content.

istian avatar istian commented on July 18, 2024 2

hi @pouyamiralayi , I indeed cloned your fork but did not pull to get the other files :) It is working now and I already tried importing records and it works! Again, thank you! This will speed up my personal project.

from community-content.

AnthonyPhan avatar AnthonyPhan commented on July 18, 2024 1

Hi Pouyamiralyi, yes i can confirm I use graphQL in my project.
I did add the create actions for importconfig and ImportedItem however after doing this my admin panel would not open. Let me know if you have more success :)

from community-content.

AnthonyPhan avatar AnthonyPhan commented on July 18, 2024

Hi I belive something must have changed in the Strapi plugin system since this tutorial was released. I downloaded the source code for the tutorial here and ran it and everything worked perfectly. Then i updated the version from 3.0.0-beta.18.3 to 3.0.0-beta.19.4 , rebuilt the project and now i receive the following error

image

I was able to manually resolve this error by adding the "create" action but then my admin panel will no long open and i receive a blank white screen when navigating to localhost:1337/admin
image

from community-content.

pouyamiralayi avatar pouyamiralayi commented on July 18, 2024

Hi @AnthonyPhan do you confirm using graphql plugin inside your project?

from community-content.

pouyamiralayi avatar pouyamiralayi commented on July 18, 2024

We had this issue with graphql and we provided some default endpoints for CRUD actions to remedy the situation!

from community-content.

pouyamiralayi avatar pouyamiralayi commented on July 18, 2024

Hi @AnthonyPhan until i apply the patch to the tut and it's official repo, you can use this repo which is compatible with Strapi 19.4 beside compatibility with graphql.
what are the changes?
1.basically we do not export the plugin configuration object anymore, instead we must export a function which registers the plugin inside the index.js file of the plugin's root directory!
2. the getmodels endpoint of CTB no longer exists and we use content-types endpoint for the sake of retrieving the details of content types.

Lastly is there any way for me to simply install you plugin into my project? I tried simply replicating your files into my plugins folder

you are doing it correctly. after the replacement, just remove your build directory and issue yarn build to build the admin with the new changes.

Cheers!

from community-content.

AnthonyPhan avatar AnthonyPhan commented on July 18, 2024

Hi Pouya,

I very much appreciate your help.
I tried cloning your fork and running the code but received the following error.
image

Note: import method: File Upload

I will continue to investigate on my end to see the reason for the issue.

from community-content.

pouyamiralayi avatar pouyamiralayi commented on July 18, 2024

Hi @AnthonyPhan 403 means you have not allowed access to plugin endpoints in the roles & permissions plugin. Please follow the instructions on the readme file of the plugin [setup section].
Cheers!

from community-content.

istian avatar istian commented on July 18, 2024

hello @pouyamiralayi ,

I did tried downloading your fork and just copied the import-content plugin in my plugins directory but after running build and develop my strapi won't start with the following:

[2020-04-16T03:07:41.349Z] error Error: [GraphQL] Cannot find action "plugins::import-content.importconfig.findOne". Check your graphql configurations.
    at getAction (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\services\resolvers-builder.js:159:11)
    at buildQuery (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\services\resolvers-builder.js:97:18)
    at buildCollectionType (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\services\type-definitions.js:379:27)
    at models.map.model (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\services\type-definitions.js:239:16)        
    at Array.map (<anonymous>)
    at buildModels (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\services\type-definitions.js:228:17)
    at buildModelsShadowCRUD (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\services\schema-generator.js:135:8)    
    at Object.generateSchema (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\services\schema-generator.js:29:7)     
    at Object.initialize (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi-plugin-graphql\hooks\graphql\index.js:87:9)
    at Promise.resolve.then (C:\Users\CRVicente\Development\NodeJs\Strapi\myApi\node_modules\strapi\lib\hooks\index.js:37:28)

Also, is graphQL plugin required for the import-content plugin to work?

If I uninstall graphql however and run develop, my admin page is blank with the following console error
image

Strapi: 3.0.0-beta.19.5
Node: 10.15.0
npm: 6.4.1

from community-content.

AnthonyPhan avatar AnthonyPhan commented on July 18, 2024

@istian Are you using the repo from this link:
https://github.com/pouyamiralayi/strapi-import-content-plugin-tutorial/tree/migrate_to_19.4

or this link:
https://github.com/strapi/community-content/tree/master/tutorials/code/import-content-plugin-tutorial

from community-content.

istian avatar istian commented on July 18, 2024

hi @AnthonyPhan , I used the first one as I read that one has the patch for beta 19.4 so I'm assuming it will work to 19.5 as well.

I am not able to get the latter in my admin page doesn't work.

from community-content.

pouyamiralayi avatar pouyamiralayi commented on July 18, 2024

Hi @istian can you confirm that you have the below files inside your plugin controllers directory?

ImportConfig.js
ImportContent.js
ImportedItem.js

and can you confirm the existence of the following inside your plugin admin/src/index.js?

export default strapi => {

  const plugin = {
    blockerComponent: null,
    blockerComponentProps: {},
    description: pluginDescription,
    icon: pluginPkg.strapi.icon,
    id: pluginId,
    initializer: Initializer,
    injectedComponents: [],
    isReady: true,
    layout: null,
    lifecycles,
    leftMenuLinks: [],
    leftMenuSections: [],
    mainComponent: Comp,
    name: pluginPkg.strapi.name,
    preventComponentRendering: false,
    trads,
  };
  return strapi.registerPlugin(plugin);
}

Cheers!

from community-content.

pouyamiralayi avatar pouyamiralayi commented on July 18, 2024

Also, is graphQL plugin required for the import-content plugin to work?

No! but if you are using the graphQL plugin, you must provide the default crud endpoints for all your content-types (for our scenario ImportConfig & ImportedItem)
Cheers!

from community-content.

istian avatar istian commented on July 18, 2024

hey @pouyamiralayi , I don't have the 3 files in my controllers directoryand theadmin/src/index.jscontent is also different on my copy. I fixed those andvoila`, it works! Thanks so much for you both for helping me!

Although, I have another annoying issue :) Everytime I click on the import content nav in the left panel, there's always a 404 mini popup error appear and the url is content-type-builder/models

image

from community-content.

pouyamiralayi avatar pouyamiralayi commented on July 18, 2024

Hi @istian i am glad it works! based on your clarification on the structure of the project, i am sure that your clone is not from migrate_to_19.4 branch. the 404 error is typically because of the recent changes in CTB controllers and we are using the new endpoints, please fork the mentioned branch, follow the setup section in the README and let us know if anything went wrong again.
Cheers!

from community-content.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.