Skip to content
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

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

Open
wohali opened this issue May 28, 2020 · 4 comments

Comments

@wohali
Copy link
Member

wohali commented May 28, 2020

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.

@popojargo
Copy link
Member

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

@wohali
Copy link
Member Author

wohali commented Jun 9, 2020

@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 wohali changed the title Consider adding "language": "javascript" to new ddocs by default "Add new doc" on design documents menu item is misleading / should autocreate skeleton ddoc Jun 9, 2020
@popojargo
Copy link
Member

popojargo commented Jun 13, 2020

Something like this?

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

@wohali

@wohali
Copy link
Member Author

wohali commented Jun 17, 2020

@popojargo Yes, this is the idea.

VDUs should also be included.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants