jhipster / jhipster-lite

JHipster Lite ⚡ is a development platform to generate, develop & deploy modern web applications & microservices architecture, step by step - using Hexagonal Architecture :gem:
https://lite.jhipster.tech
Apache License 2.0
463 stars 212 forks source link

Add a new property type to manage a file. #4019

Closed antarus closed 1 year ago

antarus commented 2 years ago

Add a new property type to manage a file.

Let's imagine that my module requires a file to be configured.

pascalgrimaud commented 2 years ago

I don't understand well :-D Can you describe more your use case, with an example plz?

antarus commented 2 years ago

I want to upload a dsl file for a new module, I would like to be able to add it in the frontend and retrieve it in the backend to process it

DamnClin commented 2 years ago

I'm guessing this is related to https://github.com/jhipster/jhipster-lite/discussions/2754

If that's the case, for this peculiar case I don't think this should be in a module since it is very specific and will need some further improvements.

For this, you'll need something on module that will be called any time after application. Ex: I apply the liquibase module and then I upload a JDL. The liquibase module should be able to react to that by generating the dedicated changelog. I think this can be done with an optional visitor on modules so each module can decide how to react to this kind of things

antarus commented 2 years ago

yes but at first, I may not need to interact with the other modules.

I was thinking more about the upload part of feature Replay #2907

But ideally your proposal seems the way to go for manage a dsl file.

DamnClin commented 2 years ago

The replay feature is not a module I think, for me it's a dedicated feature

antarus commented 2 years ago

I think adding a file type property to JHipsterPropertyType and managing it on the frontend side would do the job for some modules.

DamnClin commented 2 years ago

Yep but can't do it without a use case :D So we need a module that needs a file to add that

pascalgrimaud commented 2 years ago

agree with @DamnClin : it should be implemented only when you need it, not before. So there should be a use case for that

antarus commented 2 years ago

my module need a file in entry for generate code from this file. Il want to create my domain entity from it and more later perhaps

DamnClin commented 2 years ago

I don't get it, by definition domain entity can't be generated since it's not related to any other kind of model (this is the main model, driving the other ones).

Also I don't think this is a module. Model generation (ex to generate a CRUD) is not a module, this is another feature, not a module

DamnClin commented 2 years ago

I can think of some modules that may need a file (modules related to a provider giving you a configuration file to add to your app) BUT adding file management is a lot of work (I think ~2h to handle the new type front + back and property type to get the file as a byte[]). I don't want to add it without any exact need

pascalgrimaud commented 1 year ago

Closing this for now, following the different discussion Don't hesitate to comment if someone disagree