Draft: `UFile` (UAutoField for `Document` attributes) and `UFileRenderer`: removed...
UFile
(UAutoField for Document
attributes) and UFileRenderer
: removed the new property preview-editable
.
Motivation:
- The new property logic is very confusing, it is hard to guess why it is called "editable", ability to edit is already controlled by the
disabled
property - What is the logic behind selection of MIME types, which are controlled by that property? It seem to be a bit random, and hard guessed by developers
What I see from code is that this property impact in not an obvious way on the type of rendered used for file, and have NO relation to if it editable or not.
That is why I strongly suggest removing this property, and change the code as it is always "editable" (It's really not! Again the disabled
defined if it is editable or not).
IF a control over "Content Type" <==> "Rendered Type" is necessary, there are better ways:
- Application wide: introduce a function
registerFileContentTypeRenderer
to register renderer and specify content types it shall be used for - Scoped to control (if required): ability to pass a call-back as a prop to control and delegate to it in
renderType
PS: we already have a bit of confusion about the property: https://git-pub.intecracy.com/unitybase/ldoc/-/merge_requests/2562
Edited by Andrii Bezuglyi