This commit is contained in:
@@ -16,17 +16,17 @@ todo: DASHBOARD
|
||||
See notes there
|
||||
ELEMENTS
|
||||
dash ui items that can self update and display properly in any form factor
|
||||
central dash registry - collection of dash ui items, the roles they are available for, their unique ID's
|
||||
Xcentral dash registry - collection of dash ui items, the roles they are available for, their unique ID's
|
||||
stored at *client* statically, (server prevents out of role access to data anyway)
|
||||
[{id:(unique id, probably human readable 'tag-dash-format'),roles:[role array available to]}]
|
||||
User dash registry - user's selected dash widgets to display and the order to display them in plus any unique settings to each one
|
||||
XUser dash registry - user's selected dash widgets to display and the order to display them in plus any unique settings to each one
|
||||
Index in array is their display order
|
||||
[{id:(unique dashitem id),settings:{refreshfrequencymaybe:22,other:'setting'}},{id:(second item id)}]
|
||||
dashboard host page
|
||||
iterates user registry, instantiates the dash items in order desired if user is in allowed role (user may have changed roles)
|
||||
handles removal, re-ordering events
|
||||
dashboard selection UI
|
||||
UI accessed from dashboard menu allowing user to add widgets
|
||||
Xdashboard selection UI
|
||||
XUI accessed from dashboard menu allowing user to add widgets
|
||||
|
||||
todo: wireframe / mockup dashboard item objects
|
||||
mockup dash items with all commonality built in, better to start mocking up now than try to design perfectly in advance and then implement
|
||||
|
||||
@@ -2,72 +2,97 @@ import authorizationroles from "./authorizationroles";
|
||||
let role = authorizationroles.AUTHORIZATION_ROLES;
|
||||
export default {
|
||||
registry: {
|
||||
TestWidgetsPriciest: {
|
||||
roles: [
|
||||
role.BizAdminFull,
|
||||
role.BizAdminLimited,
|
||||
role.SalesFull,
|
||||
role.SalesLimited
|
||||
],
|
||||
title: "Priciest widgets",
|
||||
type: "GzDashTestWidgetsPriciest"
|
||||
},
|
||||
dashBizOnlyTest: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "Biz only test item"
|
||||
title: "Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "Tech only test item"
|
||||
title: "Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "Sales only test item"
|
||||
title: "Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest1: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "1Biz only test item"
|
||||
title: "1Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest1: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "1Tech only test item"
|
||||
title: "1Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest1: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "1Sales only test item"
|
||||
title: "1Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest2: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "2Biz only test item"
|
||||
title: "2Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest2: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "2Tech only test item"
|
||||
title: "2Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest2: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "2Sales only test item"
|
||||
title: "2Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest3: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "3Biz only test item"
|
||||
title: "3Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest3: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "3Tech only test item"
|
||||
title: "3Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest3: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "3Sales only test item"
|
||||
title: "3Sales only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashBizOnlyTest4: {
|
||||
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||
title: "4Biz only test item"
|
||||
title: "4Biz only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashTechOnlyTest4: {
|
||||
roles: [role.TechFull, role.TechLimited],
|
||||
title: "4Tech only test item"
|
||||
title: "4Tech only test item",
|
||||
type: "GzDashBase"
|
||||
},
|
||||
dashSalesOnlyTest: {
|
||||
roles: [role.SalesFull, role.SalesLimited],
|
||||
title: "4Sales only test item"
|
||||
title: "4Sales only test item",
|
||||
type: "GzDashBase"
|
||||
}
|
||||
},
|
||||
availableItems() {
|
||||
let ret = [];
|
||||
for (const [key, value] of Object.entries(this.registry)) {
|
||||
if (authorizationroles.hasRole(value.roles)) {
|
||||
ret.push({ id: key, title: value.title });
|
||||
ret.push({ id: key, title: value.title, type: value.type });
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
27
ayanova/src/components/dash-test-widgets-priciest.vue
Normal file
27
ayanova/src/components/dash-test-widgets-priciest.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<gz-dash
|
||||
:showCount="true"
|
||||
:count="0"
|
||||
moreUrl="/home-dashboard"
|
||||
icon="$ayiSplotch"
|
||||
:updateFrequency="60000"
|
||||
>
|
||||
MY CONTENT HERE
|
||||
</gz-dash>
|
||||
</template>
|
||||
<script>
|
||||
import GzDash from "../components/dash-base.vue";
|
||||
export default {
|
||||
components: {
|
||||
GzDash
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {},
|
||||
created() {},
|
||||
|
||||
computed: {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
@@ -49,6 +49,7 @@
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
{{ item.type }}
|
||||
<gz-dash
|
||||
:title="item.title"
|
||||
:id="item.id"
|
||||
@@ -71,6 +72,8 @@
|
||||
const FORM_KEY = "home-dashboard";
|
||||
import DashRegistry from "../api/dash-registry";
|
||||
import GzDash from "../components/dash-base.vue";
|
||||
//---------- DASH ITEMS ----------
|
||||
import GzDashTestWidgetsPriciest from "../components/dash-test-widgets-priciest.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
Reference in New Issue
Block a user