-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
"Disable editing value" prevents also creation of value #23114
Comments
Ah that's a misleading label then yeah. Readonly is intended to make the field readonly in the app in all cases. It's not intended to be a 'only allow value to be set on creation' |
Any thoughts on a better label? MDN's description for |
I see. That raises multiple questions for me:
Regarding the naming for the label, I think mentioning "immutable" in the description might be a step in the right direction. Additionally, mentioning the behavior in the documentation, e.g. when discussing fields (https://docs.directus.io/app/data-model/fields.html) might help users to know what this option does. |
Interesting.
|
Maybe the term "editing" in the label "Disable editing value" lead me astray and my mind was fixed on "editing" as in "modifying after creation". In my opinion this "edit" term is slightly ambiguous. Either way, I would be happy with the API bugfix and clarification in the documentation. |
This would be a practical option. |
If I am not mistaken is the only way through a custom extension (filter hook for |
If you ask me, I don't see why the field shouldn't be editable via the API. It has to be editable somehow otherwise the field would be useless and making it only editable during creation is limiting I think. As said above, access control should be sufficient for defining who can create or update the field and under what conditions. IMO, simply updating the label to specify that readonly here means "in app" should suffice - that way it serves more as a visual UI cue which is what it's most useful for. |
+1 for "Disabled for UI editing" will be great option. I want to have some fields open for API but not for GUI - like "slug" which i want to alter via API, or via creation, or via custom extension, but not from UI itself. Note: Read-only values can be set on creation by its own default value? |
Describe the Bug
If a field in a collection is set to "Readonly"/"Disable editing value", you can't input a value on item creation because the respective input field is inactive. Marking the field additionally as required for creation makes it impossible to create the item.
"disable editing value" sounds to me like it should prevent me from modifying existing entries. Disabling also the input of new values does not seem correct.
N.B. It is possible to create a new item via the API.
To Reproduce
Directus Version
v10.13.1
Hosting Strategy
Self-Hosted (Docker Image)
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: