-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Changing User name field #968
Comments
I did a little digging and found where it seems the error is happening, but I am not sure if it is expected for some reason. https://github.com/keystonejs/keystone/blob/master/lib/list.js#L83-L85 Object.defineProperty(this, 'nameIsEditable', { get: function() {
return (this.fields[this.mappings.name] && this.fields[this.mappings.name].type === 'text') ? !this.fields[this.mappings.name].noedit : false;
}}); This checks if the field is type I can make the PR if y'all confirm that is the actual culprit. |
I tried some other things and found the actual blocker that stops the UI from functioning like 0.2.x. if (el.field === this.nameField || el.field.hidden) {
return;
} Removing Object.defineProperty(this, 'nameIsEditable', { get: function() {
return (this.fields[this.mappings.name] && this.fields[this.mappings.name].type === 'text') ? !this.fields[this.mappings.name].noedit : false;
}}); Although I am wondering if @JedWatson when you get settled back in can you give some insight. |
ah so then it sounds like it was intended to be configurable. I think changing it so Whether the behaviour changes or not we should add docs here http://keystonejs.com/docs/database/#fieldtypes-name |
I figured everything out I think... Keystone makes special use of a Field defined Object.defineProperty(this, 'nameIsEditable', { get: function() {
return (this.fields[this.mappings.name] && this.fields[this.mappings.name].type === 'text') ? !this.fields[this.mappings.name].noedit : false;
}});
So the new code preventing editing a name field that is not defined as if (el.field === this.nameField || el.field.hidden) {
return;
} Since If we want to keep the same look as in 0.2.x then If we want to make the Object.defineProperty(this, 'nameIsEditable', { get: function() {
return (this.fields[this.mappings.name]) ? !this.fields[this.mappings.name].noedit : false;
}}); |
@sebmck , I am still getting text for |
@snowkeeper Whoops, forgot to remove a condition. Fixed, let me know if that did the trick. |
Thanks @sebmck, looks good! |
Is there a setting I must enable to change a user's
name
attribute?The text was updated successfully, but these errors were encountered: