Fix Create for Lists with no name and no initial fields
At the moment if you have no name path or mapping, and no initial fields, you get an empty "create" dialog.
In this scenario, we should do one of the following:
- Default the
autocreateoption totrue - Default the
nocreateoption totrue - Display a message in the "Create" dialog about the invalid List configuration
The third option is probably the safest, as there's no guarantee that items can safely be autocreated, and simply not having the create UI might be confusing for users.
Alternatively we could log a message when Keystone starts with the warning, as this is really an invalid config for a List.
Alternatively we could log a message when Keystone starts with the warning, as this is really an invalid config for a List.
This would be my preference
I vote for a 4th option of detecting this at build/run time. There's other invalid configurations that we need to detect as well.
I vote for option 3 and display the message: 'XY has no initial fields. An empty XY with default values will be created.' I don't see this as an misconfiguration. Sometimes you just want to generate some values in a save hook and let the user fill in the rest. We could still show a warning in the log as long it is not fatal. Would you merge a pull request if I implemented this like I described?
@geloescht if I came up with a use case for such configuration I wouldn't like to present users with your suggested message as it sounds a bit technically intimidating, IMO :-) I think the logging of the message at startup is the safest and non-restrictive option. Perhaps at some point we should have validation configuration for things like this.
And as far as behavior, if we truly consider this invalid configuration then keystone should not come up until the issue is addressed as it happens for other invalid list configuration.
And, actually personally I prefer #2201 :-)
Well, me too, but let's be realistic. The initial modal is workable and killing it now would probably delay 0.4 for another month or so.
If you really want to make this a misconfiguration we should still not throw a fatal error. It'd be very annoying if a server simply refused to start because of something like this. Instead, let's log a warning and set nocreate: true so everyone can see that this list is crippled.
The issue I still have with this in general is whether this can be a valid configuration for some use case. Not having initial fields and not having a name field seems to me like it can be valid configuration for someone. What if you still log a message in the initial form but make it a bit less technically intimidating just in case it is perfectly intended?
This should also play well if and when #2201 is addressed.