noi-techpark / it.bz.opendatahub.databrowser

Explore and navigate through Open Data you need to build your next service.
https://databrowser.opendatahub.com
GNU Affero General Public License v3.0
8 stars 7 forks source link

As a Data Editor I want the possibility to upload a PDF file in more languages, to avoid to make the upload procedure for each language. #414

Closed sseppi closed 8 months ago

sseppi commented 11 months ago

Actually the Data Browser does not allow to choose the languages where an uploaded file (eg. PDF) is visible.

The actual workflow foresees that the link to the uploaded document is stored only in the language where is uploaded. So, as can be seen in the screenshot below, each file has only one language associated:

Image

Since we will have both cases:

it would be very helpful if, during the upload procedure, the user will have the possibility to choose the languages where the file should be visible. The data Browser should the store the link to the file only in the selected languages.

In that way the user will have to change only the document name in all languages and not upload every time the same file.

As example I share in the screenshot below how does it work in the old databrowser.

Image

pkritzinger commented 11 months ago

@sseppi shall we also consider images in a first step or only files? In any case: I think that the two have to be reviewed separately since images can be structured in arrays, while files are only single fields.

sseppi commented 11 months ago

@pkritzinger for the moment the request is only related to the Documents. At the moment I don't see useful such an use case also for images.

Moreover the JSON schema actually differs, since the url field is translated only in the Documents and not in the ImageGallery propery.

What do you exaclty mean with the sentence below?

In any case: I think that the two have to be reviewed separately since images can be structured in arrays, while files are only single fields.

For now in the EventShort endpoint we have also the possibility to upoaod more files like for example all Slides of an event.

pkritzinger commented 11 months ago

@sseppi oh sorry, I did not have that in mind. so basically, the logic between images/ files is the same :) but as you mentioned, let's start with files

sseppi commented 10 months ago

Hi @MatteoBiasi ,

Paul and Matthias defined a first version of the design for the upload of a file in more than one language as you can see in the Figma file below:

https://www.figma.com/file/AZ5PKjEQ6DSQ50lgtTp6Wo/Integration-Maps-%26-File-upload?type=whiteboard&node-id=4-1446

Can you please make and effort estimation for the implementation of it? Do we have enough budget in the actual contract?

pkritzinger commented 10 months ago

@sseppi @MatteoBiasi
Finalized Design, let's discuss it tomorrow. https://www.figma.com/file/DmuP6Dbv5LzkCNOXrDnWIL/2023?type=design&node-id=1219%3A1707&mode=design&t=w7f2pj460jDlkLGO-1

a-crea commented 9 months ago

Hi all (@gappc) I spent some time analyzing possible solutions to what we discussed last time. I still need support on this: 1) As far as the mockup shows, we need the files names. We currently do not have the possibility neither to get them through the upload, neither in the data fetch. 2) Following the first point, I tried to expand the upload function and therefore the EditListUpload, but it's a big change, should we consider edit/add on the useUpload utils, or should be handled separately? 3) The data structure for the new dialog requires a bit of heavy data manipulation, which is quite different from the present structure, I'm facing some problems in this regard, I ask: is EventDocumentCell the right place to do it? Or this manipulation should be placed elsewhere? 4) The aim is to send back in the PUT request the same document, with a different document name, for each language selected, which is how are now handled single language files. Is it enough or could it cause problems with the current backend structure?

gappc commented 9 months ago

Hi @a-crea,

I think it would be best if we schedule a meeting to discuss your questions. In the mean time, I'll try to provide some information.

General image / file upload for tourism API: you select files to upload using either a file chooser or a dropzone and then you upload documents to either https://api.tourism.testingmachine.eu/v1/FileUpload/Image or https://api.tourism.testingmachine.eu/v1/FileUpload (see definitions in .env file). From the upload response you'll get a list of remote URLs. Then you set / update the URLs in your current document, which is eventually saved.

Here some more

  1. The filenames are available before the upload, because you select the files on your machine. After you select the files, you have to provide the list of selected files to the useUpload function. That means, you should know the filenames. Please let me know if I misunderstood or if the problem is another one
  2. At the moment I don't know what you changed. Could you please push a PR so I can take a look at it (would be also helpful for the meeting)? In general, the useUpload function just takes a list of files and uploads them to one of two endpoints, defined in .env. On success, useUpload returns a list of remote URLs where the files can be downloaded.
  3. see 2. - without code it's hard to give an answer
  4. I think you refer to the update of the current document? In that case, you just update the document properties with the remote URLs and the names (for each language) that the user defined in your dialog. Again, maybe I'm missing something, please let me know