This commit is contained in:
@@ -16,7 +16,8 @@ todo: DASHBOARD
|
|||||||
See notes there
|
See notes there
|
||||||
ELEMENTS
|
ELEMENTS
|
||||||
dash ui items that can self update and display properly in any form factor
|
dash ui items that can self update and display properly in any form factor
|
||||||
dash registry - collection of dash ui items, the roles they are available for, their unique ID's
|
central 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]}]
|
[{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
|
User 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
|
Index in array is their display order
|
||||||
@@ -26,7 +27,7 @@ todo: DASHBOARD
|
|||||||
handles removal, re-ordering events
|
handles removal, re-ordering events
|
||||||
dashboard selection UI
|
dashboard selection UI
|
||||||
UI accessed from dashboard menu allowing user to add widgets
|
UI accessed from dashboard menu allowing user to add widgets
|
||||||
|
|
||||||
todo: wireframe / mockup dashboard item objects
|
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
|
mockup dash items with all commonality built in, better to start mocking up now than try to design perfectly in advance and then implement
|
||||||
COMMON PROPERTIES
|
COMMON PROPERTIES
|
||||||
|
|||||||
51
ayanova/src/api/dash-registry.js
Normal file
51
ayanova/src/api/dash-registry.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/**
|
||||||
|
if (
|
||||||
|
window.$gz.role.hasRole([
|
||||||
|
role.BizAdminFull,
|
||||||
|
role.BizAdminLimited,
|
||||||
|
role.DispatchFull,
|
||||||
|
role.DispatchLimited,
|
||||||
|
role.InventoryLimited,
|
||||||
|
role.InventoryFull,
|
||||||
|
role.AccountingFull,
|
||||||
|
role.TechLimited,
|
||||||
|
role.TechFull,
|
||||||
|
role.SalesFull,
|
||||||
|
role.SalesLimited
|
||||||
|
])
|
||||||
|
) {
|
||||||
|
sub.push({
|
||||||
|
title: "Search",
|
||||||
|
icon: "$ayiSearch",
|
||||||
|
route: "/home-search",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
import authorizationroles from "./authorizationroles";
|
||||||
|
let role = authorizationroles.AUTHORIZATION_ROLES;
|
||||||
|
export default {
|
||||||
|
registry: {
|
||||||
|
dashBizOnlyTest: {
|
||||||
|
roles: [role.BizAdminFull, role.BizAdminLimited],
|
||||||
|
title: "Biz only dash item"
|
||||||
|
},
|
||||||
|
dashTechOnlyTest: {
|
||||||
|
roles: [role.TechFull, role.TechLimited],
|
||||||
|
title: "Tech only dash item"
|
||||||
|
},
|
||||||
|
dashSalesOnlyTest: {
|
||||||
|
roles: [role.SalesFull, role.TechLSalesLimitedimited],
|
||||||
|
title: "Sales only dash item"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
availableItems() {
|
||||||
|
let ret=[];
|
||||||
|
for (const [key, value] of Object.entries(this.registry)) {
|
||||||
|
// console.log(`key: ${key}, value: ${JSON.stringify(value)}`);
|
||||||
|
if(authorizationroles.hasRole(value.roles)){
|
||||||
|
ret.push()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
xl="3"
|
xl="3"
|
||||||
>
|
>
|
||||||
<gz-dash
|
<gz-dash
|
||||||
:title="'Dash-' + i"
|
:title="'Dash-' + item.id"
|
||||||
:id="'dash-item-' + i"
|
:id="'dash-item-' + item.id"
|
||||||
v-on:dash-remove="dashRemove"
|
v-on:dash-remove="dashRemove"
|
||||||
v-on:dash-move-start="dashMoveStart"
|
v-on:dash-move-start="dashMoveStart"
|
||||||
v-on:dash-move-back="dashMoveBack"
|
v-on:dash-move-back="dashMoveBack"
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DashRegistry from "../api/dash-registry";
|
||||||
import GzDash from "../components/dash-base.vue";
|
import GzDash from "../components/dash-base.vue";
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -47,12 +48,13 @@ export default {
|
|||||||
title: "Dashboard",
|
title: "Dashboard",
|
||||||
helpUrl: "form-home-dashboard"
|
helpUrl: "form-home-dashboard"
|
||||||
});
|
});
|
||||||
|
DashRegistry.availableItems();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dashItems: function() {
|
dashItems: function() {
|
||||||
let ret = [];
|
let ret = [];
|
||||||
for (var i = 0; i < 12; i++) {
|
for (var i = 0; i < 12; i++) {
|
||||||
ret.push({ index: i, title: `Dash ${i}` });
|
ret.push({ id: i.toString(), title: `Dash ${i}` });
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user