-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add support for file question #2040
Conversation
Nice for starting implementing this!
I am not sure why we need a new table? Would it be not sufficent to just store the filename in the answers? As everything else is already stored in Nextcloud's file database. But I am also not the fond of having a custom API for something Nextcloud provides out-of-the-box: Files. |
What I could imagine is creating shares for the forms folders with upload only permission (or upload+view when having form-results permissions). Then one could directly upload to that folder using webdav. |
I think that all of those make sense. That's also how Google Forms does it: Available file types: The settings could be stored into our |
Mates, I've see one problem with multiple files: there is no possibility to set multiple hyperlinks inside single cell. see https://answers.microsoft.com/en-us/msoffice/forum/all/multiple-hyperlinks-in-one-cell-excel/7af82648-b7a0-4c9c-b4d7-c485b256dc06 for the reference. Even if it possible with LibreOffice Calc, PhpSpreadsheet does not support this. Any ideas how to workaround that? |
@susnux the problem is that we need upload file and store it id somewhere before form submission. Of course, I can use only
|
What about creating a subfolder per submission and then just linking the folder instead of the single files? |
2410888
to
3bffb99
Compare
This comment was marked as outdated.
This comment was marked as outdated.
pinging @jancborchardt Do you have a preferred way to do this design wise? I think we should at least have it in submenus like for the file linking. Another possibility would be a NcModal... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would say go with a modal here since it's quite a bunch of different settings. The small dropdown is too cramped of a space for that.
And agree on that we should go with the actual file names, and also "Forms/Form name", without UUID. Since this will be visible in the file system there should be no IDs visible – if the name exists, we can append " (2)" and count up like we do in Files and elsewhere too.
@Koc and also, awesome feature! That will be very useful. :)
Why should the UUID be safe? It is just obfuscation.
This one would be preserved, there is no need to rename the file at all, see the suggestion of subdirs for submissions.
Would also be possible. Given The process could be:
|
One question is of course where to store it, there are two options (I see):
|
I'd prefer app data |
ffbcf78
to
d45d84c
Compare
As @Chartman123 can you suggest how can I get this app folder? For now I'm using |
@Koc I don't know much about that, but I found this in the dev docs: https://docs.nextcloud.com/server/stable/developer_manual/basics/storage/appdata.html |
BTW this could be exploited by create own forms and upload files there to create files even if the quota is exceeded. Not sure if this would be a problem. An other problem with app data would be that it does not allow any integration out of the box, e.g. someone submits a file -> you can only access it within the forms app with custom handling. |
But I also think app data is probably the best location as that data is not directly connected to an user (because in the future a form might be collaborative). |
Yes, that's what I meant, use app data folder and mountpoint Forms in root folder |
2650d5d
to
f862a87
Compare
f54bf2b
to
c0ce60e
Compare
conflicts fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me right now.
Yet I would like to give this a longer test (also security) before releasing in the stable channel :)
c0ce60e
to
3360cd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already tested some things like what happens, if the folder is already created manually by the user or shared by someone else. So far no problems (other than of course 'file not found' problems if you delete the folder (or subfolders).
So, you could just resolve the comment from my review and then also ready to go from my side :)
@susnux what do you mean with "longer testing"? Already merge it but don't release a new 4.3 version or still wait with merging?
I get the following warning in my Nextcloud log:
|
@Chartman123 do you mean that we need somehow reduce amount of queries for sumbission insertion? How many queries do we have for another questions type? |
Signed-off-by: Konstantin Myakshin <[email protected]>
3360cd9
to
6720298
Compare
Any idea why Cypress is failing after rebase?
At the same time node lint works fine |
@susnux @Chartman123 so, there are 2 approvals, green pipeline. What else left to be merged? |
🎉🎉🎉🎉🎉 |
@Koc I need this functionality - the user must download the file to be able to send the survey. |
@cloudkuba This PR is just about submitting files... Attaching files to the description of the form or a question can already be done with a markdown link: |
Hi, What I mean is more about verification that the file MUST be downloaded in order to proceed. |
@cloudkuba no, this is not in our scope |
This PR introduces possibility add new File Question type:
Preview
This is how it works under the hood:
forms/unsubmitted/{formId}. {formName}/{questionId}. {questionName}
and store insideoc_forms_v2_uploaded_files
table.forms/{formId}. {formName}/{submissionId}/{questionId}. {questionName}
, store original file name asoc_forms_v2_answers.text
and reference to uploaded file asoc_forms_v2_answers.file_id
. And remove row fromoc_forms_v2_uploaded_files
There are validations for: