couchdb-fauxton icon indicating copy to clipboard operation
couchdb-fauxton copied to clipboard

"Add new doc" on design documents menu item is misleading / should autocreate skeleton ddoc

Open wohali opened this issue 4 years ago • 4 comments

Current Behaviour

Right now, creating a ddoc in Fauxton is just like creating any other document. You get a new _id value, but nothing else.

Since ddocs are largely written in JavaScript, and anyone using another language will know to put a different language in there, consider adding the "language": "javascript" key to a new ddoc by default.

Expected Behaviour

All ddocs in CouchDB have the "language" key/value pair filled in.

wohali avatar May 28 '20 16:05 wohali

We do currently add the language property to DDoc. When did you encounter that it was not filled?

popojargo avatar Jun 09 '20 04:06 popojargo

@popojargo Looks like this is just a confusing option in the menu. See this screenshot:

Snap 2020-06-09, 10_49_20

Picking the ➕ icon on the Design Documents row, then picking "Add New Doc" I would have expected to create a design document template for me. Instead, it's the same as clicking the ➕ next to All Documents.

Personally, I would either drop the "Add new doc" option from the ddocs menu, or have it auto-create a dummy template ddoc with all the empty sections in it. (This is a common complaint we get - "What is the full structure of a raw ddoc?" - we should maybe give a UI for this, but this is an enhancement request.)

I'll update the title of this bug.

wohali avatar Jun 09 '20 14:06 wohali

Something like this?

{
  "_id": "_design/new-ddoc",
  "language": "javascript",
  "views": {},
  "updates": {},
  "filters": {}
}

@wohali

popojargo avatar Jun 13 '20 20:06 popojargo

@popojargo Yes, this is the idea.

VDUs should also be included.

Don't add shows/lists as they are going away.

wohali avatar Jun 17 '20 19:06 wohali