Skip to content

DiRaltvein/directus-files-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This small reproduction was created to showcase a weird behaviour of files built in interface. Problem arrises, when fields data is changed using 'setFieldValue' emit. Problem is that if there is a need to upload files from another interface and then by emitting 'setFieldValue' event to change fiels shown by directus built in 'files' interface it does not show them. In current repository behaviour can be reproduced by following next steps:

1. go to .env and input your test database. I was using postgresql, so there is connector for postgresql uncommented (database is not part of this weird behjaviour so it can be anything you want).
2. npm install && npm run configure
3. npm run dev (or 'npm run build' and after 'npm run start' )
4. when running npm run configure note admin email and password that were automatically generated be using them login into application
5. after logged in there is only 1 collection named 'test collection' and this collection has only 1 field 'test files field'. Lets try to create a new item in this collection and observer the behaviour. Important to note that field is using custom interface that is stored in this repository.
6. First create a new item and upload some random file. When first creating a new item there is no problem, everything works just as it shoud. So click 'Upload file' and pick any file you like (1 or 2 or ... does not matter). Do not forget to save the changes.
7. Great, now that 1 item is added lets try to change our 1 item. On this step order is important. First change title of file you uploaded (if multiple files were uploaded cahnge title on any of them), after that (without saving in between anything) remove previously uploaded file (once again any file is fine) and after that (once again without saving the item) try to add another file by 'Upload File' functionality. Now you may notice, that file is not shown, althrough in console it is shown, as it has been added. Also as can be seen, when saving although not shown in UI files are still added.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published