This commit is contained in:
@@ -20,7 +20,9 @@ export default {
|
||||
role.SalesRestricted
|
||||
],
|
||||
title: "ReminderList",
|
||||
type: "GzDashTodayReminders"
|
||||
type: "GzDashTodayReminders",
|
||||
singleOnly: true,
|
||||
settings: {}
|
||||
},
|
||||
{
|
||||
id: "dash-today-reviews",
|
||||
@@ -40,14 +42,18 @@ export default {
|
||||
role.SalesRestricted
|
||||
],
|
||||
title: "ReviewList",
|
||||
type: "GzDashTodayReviews"
|
||||
type: "GzDashTodayReviews",
|
||||
singleOnly: true,
|
||||
settings: {}
|
||||
},
|
||||
{
|
||||
id: "dash-today-scheduled-wo",
|
||||
roles: [role.Tech, role.TechRestricted],
|
||||
title: "DashboardScheduled",
|
||||
type: "GzDashTodayScheduledWo",
|
||||
scheduleableUserOnly: true
|
||||
scheduleableUserOnly: true,
|
||||
singleOnly: true,
|
||||
settings: {}
|
||||
},
|
||||
|
||||
{
|
||||
@@ -60,7 +66,9 @@ export default {
|
||||
],
|
||||
title: "TEST Bar chart widget",
|
||||
type: "GzDashTestBarWidgetCountByUserType",
|
||||
scheduleableUserOnly: false
|
||||
scheduleableUserOnly: false,
|
||||
singleOnly: false,
|
||||
settings: {}
|
||||
},
|
||||
{
|
||||
id: "TestLineWidgetMonthlyTotalPrice",
|
||||
@@ -72,7 +80,9 @@ export default {
|
||||
],
|
||||
title: "TEST Line chart widget",
|
||||
type: "GzDashTestLineWidgetMonthlyTotalPrice",
|
||||
scheduleableUserOnly: false
|
||||
scheduleableUserOnly: false,
|
||||
singleOnly: true,
|
||||
settings: {}
|
||||
}
|
||||
],
|
||||
availableItems() {
|
||||
@@ -88,7 +98,13 @@ export default {
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
ret.push({ id: item.id, title: item.title, type: item.type });
|
||||
ret.push({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
type: item.type,
|
||||
singleOnly: item.singleOnly,
|
||||
settings: item.settings
|
||||
});
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<v-row v-if="formState.ready">
|
||||
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
|
||||
|
||||
{{ effectiveView }}
|
||||
<v-col v-if="showSelector" cols="12">
|
||||
<v-dialog
|
||||
v-model="showSelector"
|
||||
@@ -217,7 +217,7 @@ export default {
|
||||
availableItems: function() {
|
||||
const allItems = DashRegistry.availableItems();
|
||||
const newItems = allItems.filter(
|
||||
z => !this.effectiveView.find(m => m.id == z.id)
|
||||
z => !this.effectiveView.find(m => m.id == z.id && z.singleOnly)
|
||||
);
|
||||
return newItems;
|
||||
},
|
||||
@@ -240,6 +240,7 @@ export default {
|
||||
} else {
|
||||
const savedView = JSON.parse(res.data.view);
|
||||
const availableItems = DashRegistry.availableItems();
|
||||
//filter out any that are deprecated or no longer accessible due to role change
|
||||
const allowedView = savedView.filter(z =>
|
||||
availableItems.find(m => m.id == z.id)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user