ermouth / couch-photon

An alternative CouchDB admin panel
MIT License
87 stars 12 forks source link

Non-admin UI #4

Closed johs closed 6 years ago

johs commented 6 years ago

Do you plan to hide the top-right config and user tabs for non-admin users? Right now this looks like a very effective tool for admins, members with no business of changing config or managing ACL, updating the app etc, would be an interesting user group, as this is: 1) probably the best introduction they will find to the world of CouchDB 2) the perfect travel-with-the-data app

Any plans for a stripped-down version?

ermouth commented 6 years ago

I have better idea.

Stripping things down is barely configurable: you might want to hide that subset of buttons, and other wants to hide another subset. However, most of buttons have unique DOM ids, so hiding them is easily achieved using CSS rules. Not academically clean, by reasonably practical way.

But there should be a place where to insert that CSS rules, and, what is much more important, they should not be lost on update.

So, in general, the task is to provide metastructure, allowing to discover what branches were customized (and keep them untouched on update), and what branches could be updated safely.

I gonna add Merkle tree for it and make update mechanics respect end user customizations of the Photon ddoc. However, it‘s complex and not the priority.

johs commented 6 years ago

UI tweeks by CSS is totally fine:) Keeps the development of functionality on one straight path. How about the need for a single-document editor (Basically the json editor only). What would be the simplest way to offer that to users?

ermouth commented 6 years ago

If it went that far... Well, with Photon I‘m trying in many ways new type of app architecture. Actually, Photon was only created to check feasibility of some ideas )

As you might notice, Photon app itself lives in ddoc json, not in attaches. It means the app is transformable using ie views+lists depending on end-user role.

So for example adding explicit members to .apps.cw-Photon.Tabs, in format {id:'anyUniqueString', name:'InitialName', active:true|false, path:['dbName','docId']}, should open Photon with those tabs. And replacing .apps.cw-Photon.Switch function could help restrict opening other tabs.

And so on.

I never built apps in this way before, because precompiled optimized attaches always start bit faster. However, in Photon I bought delivery-time flexibility for about 100-150 ms additional delay on start. Cheap price for Photon remaining json tree, which you can flex literally on the fly.

johs commented 6 years ago

Mindblowing. One thing is for sure, there is nothing wrong with the performance of this app. It's fast & smooth:))