Open Bollznet opened 3 months ago
Hi, it is possible. But you need an extension type that is ran on the backend. Like Endpoint and Hooks.
On Wed, Jun 26, 2024 at 10:18 PM Bollznet @.***> wrote:
Hi, Is possibile edit extension to save file inside directus? thanks
— Reply to this email directly, view it on GitHub https://github.com/karamokoisrael/directus-extension-flow2pdf/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARHNR45LVCXO3NBD4SW4LZLZJLEU7AVCNFSM6AAAAABJ6AEI2WVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3TKNBZHA2TIOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
We can collaborate to add this feature if you think it'll be useful.
We can collaborate to add this feature if you think it'll be useful.
Hi think it’ll be very useful. I can help you, but I'm not that great with development
No problem, you can just describe how want it to work and I'll handle the implementation.
Wow fantastic. I was thinking of making an extension that could be integrated into flows and that would save the file inside directus. So you could modify the payload and manipulate the data as you wanted. furthermore, it can be attached to an email or to another record etc... I hope it was clear and sorry for my English. I wrote to you on IG
Ok. The flow2pdf extension allows you to get data from flow and print to populate a pdf that you can download. Do you think saving the pdf locally in directus will solve the use case you are talking about ?
Yes! Is perfect! but it would be even better to be able to integrate the creation of the PDF into a flow.
Oh now I get it, like an operation available in flows to save a pdf from the data collected by the flow. But how will the user be notified ?
then I add to the flow to send an email to notify the user and inside I put the link to the file. what do you think about it?
Sounds good to me. We can also add in app notifications. Directus has a way to notify connected users.
On Thu, Jun 27, 2024 at 9:32 PM Bollznet @.***> wrote:
then I add to the flow to send an email to notify the user and inside I put the link to the file. what do you think about it?
— Reply to this email directly, view it on GitHub https://github.com/karamokoisrael/directus-extension-flow2pdf/issues/5#issuecomment-2194703745, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARHNR43GIHTPKTYJJXHX3I3ZJQH7RAVCNFSM6AAAAABJ6AEI2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJUG4YDGNZUGU . You are receiving this because you commented.Message ID: @.*** com>
I'll try to implement and basic version during my free time and let you know.
On Thu, Jun 27, 2024 at 9:52 PM Israël karamoko @.***> wrote:
Sounds good to me. We can also add in app notifications. Directus has a way to notify connected users.
On Thu, Jun 27, 2024 at 9:32 PM Bollznet @.***> wrote:
then I add to the flow to send an email to notify the user and inside I put the link to the file. what do you think about it?
— Reply to this email directly, view it on GitHub https://github.com/karamokoisrael/directus-extension-flow2pdf/issues/5#issuecomment-2194703745, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARHNR43GIHTPKTYJJXHX3I3ZJQH7RAVCNFSM6AAAAABJ6AEI2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJUG4YDGNZUGU . You are receiving this because you commented.Message ID: @.*** com>
Yes, in the flow you can make everything, so email or directus notification or update record or start a new flow.
Thanks.
Unfortunately I don't know how to develop in this advanced way and I can't help you.
I'll try to implement and basic version during my free time and let you know. On Thu, Jun 27, 2024 at 9:52 PM Israël karamoko @.> wrote: … Sounds good to me. We can also add in app notifications. Directus has a way to notify connected users. On Thu, Jun 27, 2024 at 9:32 PM Bollznet @.> wrote: > then I add to the flow to send an email to notify the user and inside I > put the link to the file. what do you think about it? > > — > Reply to this email directly, view it on GitHub > <#5 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/ARHNR43GIHTPKTYJJXHX3I3ZJQH7RAVCNFSM6AAAAABJ6AEI2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJUG4YDGNZUGU > . > You are receiving this because you commented.Message ID: > @.*** > com> >
You're already doing a lot suggesting new features. You can also help by testing the extension and giving feedbacks.
Hi Israel, did you have some time to work on it? Can I help you in any way?
Hi @Bollznet, not yet. But I'm going to start next week.
Hi Israel! Thanks! When you need information, I'm here.
Hi @karamokoisrael do you have any news? Were you able to watch us if possible?
Hi @Bollznet , I've implemented most of the features we've talked about. But I was wondering, should we let the user select his own operation ( sending email or notification ) after the pdf is generated or or operation should handle it all ?
Wow fantastic @karamokoisrael! I think best thing is that user select his own operation. so it can be adapted to multiple solutions What do you think?
I also think it's a good idea to give the user the freedom to chose his own operation. Our operation will return the saved file data then the user can decide how he wants to use it.
Hi @Bollznet . I'm done, you can install it locally and give it a try.
Hi @karamokoisrael ! Today I’m out of office! As soon as I get back I'll try it straight away and give you some feedback! thanks
hi @karamokoisrael i'm try the extension but there is an error:
[09:39:17.519] WARN: Cannot find module 'html-pdf-node'
directus-1 | Require stack:
directus-1 | - /directus/extensions/directus-extension-flow2pdf-master/dist/api.cjs
directus-1 | err: {
directus-1 | "type": "Error",
directus-1 | "message": "Cannot find module 'html-pdf-node'\nRequire stack:\n- /directus/extensions/directus-extension-flow2pdf-master/dist/api.cjs",
directus-1 | "stack":
directus-1 | Error: Cannot find module 'html-pdf-node'
directus-1 | Require stack:
directus-1 | - /directus/extensions/directus-extension-flow2pdf-master/dist/api.cjs
directus-1 | at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
directus-1 | at Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:81:25)
directus-1 | at require (node:internal/modules/helpers:177:18)
directus-1 | at Object.
Can you help? thanks
Have you installed it with a package manager like npm, yarn... or from the marketplace ?
If you install it with the package manager everything will work fine. But if you try with the marketplace the following package will be missing html-pdf-node
. I'll try to ask for help in the community.
@karamokoisrael i try with package manager but doesn't go. I launch this command "npm i directus-extension-flow2pdf" in root directory.
@karamokoisrael i had install it. But in the flow i had this error { "name": "DirectusError", "extensions": { "collection": "directus_files" }, "code": "UNEXPECTED_ERROR", "status": 500 }
How did you set up your flow to save the file? Thanks Stefano
this in log
Error: Failed to launch the browser process! spawn /directus/node_modules/.pnpm/puppeteer@10.4.0/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome ENOENT
directus-1 | TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
directus-1 | at onClose (/directus/node_modules/.pnpm/puppeteer@10.4.0/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
directus-1 | at ChildProcess.
You can try to reinstall the package and see if it works
nothing change @karamokoisrael the problem is install chrome inside docker. I'm are in localhost and this is my dockerfile
`FROM directus/directus:latest
USER root RUN corepack enable RUN apk update RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm RUN apk add google-chrome-stable_current_x86_64.rpm USER node
RUN pnpm install directus-extension-flow2pdf`
Do you use extension in localhost or in web server? thanks
It works in both environments
May I ask you how to install the extension. Because I installed chromium, but then I have to install all the rest of the dependencies. I can't get it to work, something is missing every time.
It should be easier with npm. However, if you install from the marketplace, the dependency used for printing the PDF will cause some issues. I've asked for help in the community, but the suggestions I've received haven't worked.
@karamokoisrael Thanks for your effort, I haven't been able to install it yet. I think there is some problem on where to read the nodo_modules. I've been trying to fix it for two days but without success. I'm also asking for help fixing the source.
Hi, Is possibile edit extension to save file inside directus? thanks