-
-
Notifications
You must be signed in to change notification settings - Fork 424
Description
Checklist
- I am using an up-to-date version.
- I have read the documentation.
- I have searched existing issues.
Description
Rather than displaying file properties in labels above the fields box, using their own specific formatting, it could be nice to instead add them to the file's fields as read-only, 'derived' fields.
Solution
Firstly, add support for read-only fields. These should be visually distinct from normal fields to make it clear to the user that they're intentionally read-only and not confuse the user that they aren't able to be edited.
Then, when the file's properties are loaded, instead of formatting and writing to a label, add a read-only field to the entry's fields. These should be saved to the database on every load to ensure the derived field is kept up to date.
I'm not sure whether there should be new derived_<type>_fields tables, or whether the normal field type tables should be updated to keep track of what file property the field is derived from. I'm leaning more towards the latter, though, to avoid introducing a ton of new tables.
Alternatives
As of now, file properties are handled differently from fields, despite being very similar and resulting in duplicated functionality. Handling file properties as derived fields would make working with file properties and adding new properties later on simpler.