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

Clone doesn't work #9

Open
smadaan8 opened this issue Mar 24, 2021 · 11 comments
Open

Clone doesn't work #9

smadaan8 opened this issue Mar 24, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@smadaan8
Copy link

smadaan8 commented Mar 24, 2021

Hi and first of all thanks for such an amazing plugin. It helped reduce my task a lot for previewing content.
I want to enquire if the cloning of content entry also works with this plugin?
In the image I see the clone button and after installing the plugin also I was able to display the clone button but it doesn't seem to be functioning.
Is there something I am missing or is cloning not supported in this plugin?

@danestves
Copy link
Owner

Hey @smadaan8 let me test it to see what is happening with the clone and i'll post an answer

@smadaan8
Copy link
Author

Hey @danestves
Thanks for the quick response.
Awaiting for your reply regarding clone.

@danestves
Copy link
Owner

Hi @smadaan8 i test it with a newer version even the latest version and it works as expected, you copy the files and rebuild the interface with npm run build?

@smadaan8
Copy link
Author

smadaan8 commented Apr 1, 2021

Hi @danestves
Thanks for checking. I copied the files and rebuild the interface and the clone button seems to be working.
I have a quick question about clone function.
Does the clone function let you make a clone record or is it something close to versioning?
As in if I create a clone and publish it does it unpublish the original content?

@danestves
Copy link
Owner

  1. Is a clone record
  2. No, doesn't unpublish the original content 🙌

@smadaan8
Copy link
Author

smadaan8 commented Apr 2, 2021

@danestves
Thanks, I understood.
I have one quick question.
We are trying to put in logic to have a different URL for each collection type and we were able to do it by making some changes to the following file.
strapi-plugin-preview-content/src/admin/main/preview-context/index.js /

I was able to verify the results in my local development environment but when I try to release the changes to my production environment(running on Heroku) it says that I cannot change the files in admin folder.
Do you know if there is some workaround?

@danestves
Copy link
Owner

Can you show me the error with more details? To see what is happening and also see if your workaround is good to put it in the plugin 🙌

@smadaan8
Copy link
Author

smadaan8 commented Apr 4, 2021

Hey @danestves
Sorry for the delay in response.
What we did is specify the URL for each collection type in the index.js file below.
if ( ${apiID}== "article" ) { data.url =https://XXX.com/article?id=${row.id}`;
} else if (${apiID} == "product") {
data.url = https://XXX.com/product?id=${row.id};
} `
Since we specified URLs directly I don't think it is possible to put it in the plugin.

However the problem I am facing is as below.
We put the above changes in below index.js and reflected them in the extension folder in Strapi and were able to check the preview working from the list view.
strapi-plugin-preview-content/strapi-files/v3.4.x/extensions/content-manager/admin/src/components/CustomTable/Row/index.js /

However, for preview button on the detail page we figured out that the URL needs to be specified in the below file.
strapi-plugin-preview-content/src/admin/main/preview-context/index.js /
The issue we are facing is that we can't exactly figure out in which folder in Strapi do we need to put the above file after updating it. Do we need to update the admin folder?

@danestves
Copy link
Owner

Hi, this is a problem with Strapi because there is a lot of files to be injected, i'm going to put this as a bug because we need to wait a way to do it

@danestves danestves added the bug Something isn't working label Apr 22, 2021
@Ruixian1006
Copy link

Hi @danestves, thanks for the effort to create the plugin. It's really great. I also have some custom logic would like to add to the preview button on the detail page. I have tried to customize the logic under extensions/preview-content/admin/main/preview-context/index.js but this does not work. May I know is there any solution for this now ?

@Ruixian1006
Copy link

Hi, @smadaan8 may I know is there any alternative solution to resolve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants