"CCCompany",
"CCTest",
"CCRequireCCV",
- "DashboardsLite",
+ "DashboardLite",
"DefaultPriority",
"RequireProjectAssignment",
"UseProjects"
]
};
- if (XT.session.settings.get("DashboardsLite")) {
- module.panels.unshift({name: "crmDashboard", kind: "XV.CrmDashboard"});
+ if (XT.session.settings.get("DashboardLite")) {
+ var dashboardModule = {
+ name: "dashboardLite",
+ label: "_dashboard".loc(),
+ panels: [
+ {
+ name: "dashboardLite",
+ kind: "XV.DashboardLite",
+ newActions: [
+ {name: "assignedIncidents", label: "_assignedIncidents".loc(), item: "XV.AssignedIncidentBarChart"},
+ {name: "opportunities", label: "_opportunities".loc(), item: "XV.OpportunityBarChart"}
+ ]
+ }
+ ]
+ };
+
+ XT.app.$.postbooks.insertModule(dashboardModule, 0);
}
isBiAvailable = XT.session.config.biAvailable && XT.session.privileges.get("ViewSalesHistory");
+++ /dev/null
-/*jshint bitwise:true, indent:2, curly:true, eqeqeq:true, immed:true,
-latedef:true, newcap:true, noarg:true, regexp:true, undef:true,
-trailing:true, white:true*/
-/*global XT:true, XM:true, XV:true, _:true, window: true, enyo:true, nv:true, d3:true, console:true */
-
-(function () {
-
- enyo.kind({
- name: "XV.CrmDashboard",
- kind: "XV.Dashboard",
- collection: "XM.UserChartCollection",
- // this tells the default query what extension to pull charts for
- extension: "crm",
- // title is what show in the "add chart" picker on the
- // dashboard and the chart is the widget to be added
- newActions: [
- {name: "assignedIncidents", label: "_assignedIncidents".loc(), item: "XV.AssignedIncidentBarChart"},
- {name: "opportunities", label: "_opportunities".loc(), item: "XV.OpportunityBarChart"}
- ]
- });
-}());
enyo.depends(
"list_relations.js",
"list_relations_box.js",
- "dashboard.js",
"workspace.js"
);
/*jshint bitwise:true, indent:2, curly:true, eqeqeq:true, immed:true,
latedef:true, newcap:true, noarg:true, regexp:true, undef:true,
trailing:true, white:true*/
-/*global XT:true, XV:true, XM:true, enyo:true, console:true */
+/*global XT:true, XV:true, XM:true, enyo:true, console:true, _:true */
(function () {
]
};
+ if (XT.session.settings.get("DashboardLite")) {
+ // TODO if we commit to this approach it would make sense to move this code into
+ // XT.app.$.postbooks.insertDashboardCharts() or something like it
+ var newActions = [
+ {name: "salesHistory", label: "_salesHistory".loc(), item: "XV.SalesHistoryTimeSeriesChart"},
+ {name: "bookings", label: "_bookings".loc(), item: "XV.SalesOrderTimeSeriesChart"}
+ ];
+ var preExistingDashboard = _.find(XT.app.$.postbooks.modules, function (module) {
+ return module.name === "dashboardLite";
+ });
+
+ if (preExistingDashboard) {
+ preExistingDashboard.panels[0].newActions = _.union(preExistingDashboard.panels[0].newActions, newActions);
+
+ } else {
+ var dashboardModule = {
+ name: "dashboardLite",
+ label: "_dashboard".loc(),
+ panels: [
+ {
+ name: "dashboardLite",
+ kind: "XV.DashboardLite",
+ newActions: newActions
+ }
+ ]
+ };
+
+ XT.app.$.postbooks.insertModule(dashboardModule, 0);
+ }
+ }
+
isBiAvailable = XT.session.config.biAvailable && XT.session.privileges.get("ViewSalesHistory");
if (isBiAvailable) {
module.panels.push({name: "salesAnalysisPage", kind: "analysisFrame"});
+++ /dev/null
-/*jshint bitwise:true, indent:2, curly:true, eqeqeq:true, immed:true,
-latedef:true, newcap:true, noarg:true, regexp:true, undef:true,
-trailing:true, white:true*/
-/*global XT:true, XM:true, XV:true, _:true, window: true, enyo:true, nv:true, d3:true, console:true */
-
-(function () {
-
- enyo.kind({
- name: "XV.SalesDashboard",
- kind: "XV.Dashboard",
- collection: "XM.UserChartCollection",
- // title is what show in the "add chart" picker on the
- // dashboard and the chart is the widget to be added
- // this tells the default query what extension to pull charts for
- extension: "sales",
- newActions: [
- {name: "salesHistory", label: "_salesHistory".loc(), item: "XV.SalesHistoryTimeSeriesChart"},
- {name: "bookings", label: "_bookings".loc(), item: "XV.SalesOrderTimeSeriesChart"}
- ]
- });
-
-}());
"list.js",
"list_relations.js",
"list_relations_box.js",
- "dashboard.js",
"workspace.js"
);
}
});
+ enyo.kind({
+ name: "XV.DashboardLite",
+ kind: "XV.Dashboard",
+ collection: "XM.UserChartCollection",
+ // this tells the default query what extension to pull charts for
+ extension: "crm",
+ // title is what show in the "add chart" picker on the
+ // dashboard and the chart is the widget to be added
+ newActions: [] // to be added by extensions
+ });
}());