Polypheny-DB icon indicating copy to clipboard operation
Polypheny-DB copied to clipboard

Move and Store the Data Source and Data Store Logos on Polypheny-DB

Open malikrafsan opened this issue 2 years ago • 4 comments

Summary

In this pull request, we move the logos from stored at the Frontend (Polypheny-UI) to the Backend (Polypheny-DB). We also add the logo path/icon identifier on the response regarding Data Store and Data Source (/getSnapshot). By doing this, we can simplify the process of adding new Data Stores / Data Sources by storing the logos in Polypheny-DB sources together with the adapter implementation.

Fixes: #222

Changes

  • Add adapterLogo attribute on AdapterProperties annotation interface
  • Send adapterLogo attribute with existing adapter information
  • Change Polypheny-UI logic regarding adapterLogo

Related PRs


Screenshots

  • Asset files can be served by Polypheny-DB, under /public hosted path Screenshot from 2024-04-05 00-59-49

  • Polypheny-UI can access the Polypheny-DB static files and the Data Source and Data Store logos are shown successfully Screenshot from 2024-04-05 01-02-00

malikrafsan avatar Apr 02 '24 15:04 malikrafsan

@malikrafsan thank you very much for this PR, this looks really promising! While I'm satisfied with most of it I have one bigger change request before the review:

At the moment you attach the logo to the AdapterTemplateModel, which is a part of the SnapshotModel. The SnapshotModel is broadcast to the client on every update of the schema and therefore it includes as little data as possible. With your approach the size is increased drastically, which is not ideal. I would suggest that you expose the images via static routes from the backend and only attach the paths in the AdapterTemplateModel to circumvent that.

datomo avatar Apr 08 '24 07:04 datomo

Hi @datomo, thank you so much for the feedback and for taking the time to review the PR. I really appreciate your insights and suggestions!

I'd like to clarify that I have indeed followed the suggested approach. The images are served through static routes from the backend (<origin>/public/assets/dbms-logos/<filename>), and only the paths to these images (/assets/dbms-logos/<filename>) are linked in the AdapterTemplateModel. There's no direct embedding of the logo images (base64 image string) within the AdapterTemplateModel

However, I am afraid that my understanding is incorrect or that there are any aspects of the implementation that need further clarification. Please kindly let me know if so. Your guidance is greatly appreciated!

Thank you once again for your time and consideration

Screenshot from 2024-04-09 22-36-08

Screenshot from 2024-04-09 22-36-46

malikrafsan avatar Apr 09 '24 15:04 malikrafsan

Hey @malikrafsan My bad, I totally missed this. You are right, then you already used the optimal way.

datomo avatar Apr 09 '24 15:04 datomo

Thanks for confirming @datomo ! It's great to know this is the optimal approach. I'll mark this PR as ready for review then, looking forward to your review! Once again, thank you so much

malikrafsan avatar Apr 09 '24 17:04 malikrafsan