Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/207#discussion_r22031987
--- Diff: app/addons/compaction/routes.js ---
@@ -11,49 +11,77 @@
// the License.
define([
- "app",
-
- "api",
-
- // Modules
- "addons/compaction/views",
- "addons/databases/resources"
+ 'app',
+ 'api',
+ 'addons/compaction/views',
+ 'addons/databases/resources',
+ 'addons/documents/shared-resources',
+ 'addons/documents/shared-views',
+ 'addons/fauxton/components'
],
-function(app, FauxtonAPI, Compaction, Databases) {
-
- var CompactionRouteObject = FauxtonAPI.RouteObject.extend({
- layout: "one_pane",
+function(app, FauxtonAPI, Compaction, Databases, Documents, SharedViews,
Components) {
- crumbs: function () {
- return [
- {"name": this.database.id, "link":
Databases.databaseUrl(this.database)},
- {"name": "Compact & Clean", "link": "compact"}
- ];
- },
+ function getCrumbs (database) {
+ return [
+ { "type": "back", "link": "/_all_dbs" },
+ { "name": database.id, "link": Databases.databaseUrl(database),
className: "lookahead-tray-link" }
+ ];
+ }
+ var CompactionRouteObject = FauxtonAPI.RouteObject.extend({
+ layout: "with_tabs_sidebar",
+ overrideBreadcrumbs: true,
routes: {
- "database/:database/compact": "compaction"
+ 'database/:database/compact': 'compaction'
},
- initialize: function(route, masterLayout, options) {
+ initialize: function (route, masterLayout, options) {
var databaseName = options[0];
-
- this.database = this.database || new Databases.Model({id:
databaseName});
+ this.database = this.database || new Databases.Model({ id:
databaseName });
--- End diff --
This function looks exactly like the initialize function for
`DocumentsRouteObject`. I think we should break all these sections into smaller
functions in the DocumentsRouteObject. Then this RouteObject can inherit or
Mixin those functions. So then the initialize function would look something
like this:
initialize: function () {
this.createDesignDocCollection();
this.setLeftheader();
this.setSidebar();
}
This would then make it that any changes or bug fixes we do should apply
across modules. For example the lookahead tray bug fix would automatically be
fixed in the compaction module as its using the same code to generate the
sidebar.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---