feat: hide desk dashboard if onboarding is present

This commit is contained in:
Shivam Mishra 2020-05-14 12:45:56 +05:30
parent 07893b295b
commit 2c5fe271ff
2 changed files with 4 additions and 2 deletions

View file

@ -294,7 +294,7 @@ class DesktopPage {
make_charts() {
return frappe.dashboard_utils.get_dashboard_settings().then(settings => {
let chart_config = settings.chart_config? JSON.parse(settings.chart_config): {};
let chart_config = settings.chart_config ? JSON.parse(settings.chart_config): {};
if (this.data.charts.items) {
this.data.charts.items.map(chart => {
chart.chart_settings = chart_config[chart.chart_name] || {};
@ -306,6 +306,7 @@ class DesktopPage {
container: this.page,
type: "chart",
columns: 1,
hidden: Boolean(this.onboarding_widget),
options: {
allow_sorting: this.allow_customization,
allow_create: this.allow_customization,

View file

@ -52,6 +52,7 @@ export default class WidgetGroup {
</div>
</div>`);
this.widget_area = widget_area;
if (this.hidden) this.widget_area.hide()
this.title_area = widget_area.find(".widget-group-title");
this.control_area = widget_area.find(".widget-group-control");
this.body = widget_area.find(".widget-group-body");
@ -96,7 +97,7 @@ export default class WidgetGroup {
}
customize() {
this.widget_area.show();
if (!this.hidden) this.widget_area.show();
this.widgets_list.forEach((wid) => {
wid.customize(this.options);
});