This commit is contained in:
2020-10-30 17:25:17 +00:00
parent ac749f91fc
commit 915a95cbe3
3 changed files with 95 additions and 5 deletions

View File

@@ -59,7 +59,8 @@ todo: if dashboard view is empty should be a string displayed saying nothing sel
todo: popup warning box error: Could not find one or more icon(s) iconName: "exclamation" prefix: "fas"
I think maybe this is a built in vuetify icon?

View File

@@ -13,6 +13,54 @@ export default {
dashSalesOnlyTest: {
roles: [role.SalesFull, role.SalesLimited],
title: "Sales only test item"
},
dashBizOnlyTest1: {
roles: [role.BizAdminFull, role.BizAdminLimited],
title: "1Biz only test item"
},
dashTechOnlyTest1: {
roles: [role.TechFull, role.TechLimited],
title: "1Tech only test item"
},
dashSalesOnlyTest1: {
roles: [role.SalesFull, role.SalesLimited],
title: "1Sales only test item"
},
dashBizOnlyTest2: {
roles: [role.BizAdminFull, role.BizAdminLimited],
title: "2Biz only test item"
},
dashTechOnlyTest2: {
roles: [role.TechFull, role.TechLimited],
title: "2Tech only test item"
},
dashSalesOnlyTest2: {
roles: [role.SalesFull, role.SalesLimited],
title: "2Sales only test item"
},
dashBizOnlyTest3: {
roles: [role.BizAdminFull, role.BizAdminLimited],
title: "3Biz only test item"
},
dashTechOnlyTest3: {
roles: [role.TechFull, role.TechLimited],
title: "3Tech only test item"
},
dashSalesOnlyTest3: {
roles: [role.SalesFull, role.SalesLimited],
title: "3Sales only test item"
},
dashBizOnlyTest4: {
roles: [role.BizAdminFull, role.BizAdminLimited],
title: "4Biz only test item"
},
dashTechOnlyTest4: {
roles: [role.TechFull, role.TechLimited],
title: "4Tech only test item"
},
dashSalesOnlyTest: {
roles: [role.SalesFull, role.SalesLimited],
title: "4Sales only test item"
}
},
availableItems() {

View File

@@ -1,6 +1,45 @@
<template>
<v-row v-if="formState.ready">
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
<v-col>
<v-dialog
scrollable
max-width="600px"
v-model="showSelector"
@keydown.esc="cancel"
data-cy="dashSelector"
>
<v-card elevation="24">
<v-card-title class="headline lighten-2" primary-title>
<span> {{ $ay.t("Add") }} </span>
</v-card-title>
<v-card-text style="height: 500px;">
<v-list>
<v-list-item
v-for="item in availableItems"
:key="item.id"
@click="addItem(item.id)"
>
<v-list-item-title>{{ item.name }}</v-list-item-title>
</v-list-item>
</v-list>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-btn
color="primary"
text
@click.native="showSelector = false"
data-cy="dashSelector:cancel"
>{{ $ay.t("Cancel") }}</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
</v-col>
<v-col
v-for="(item, i) in effectiveView"
:key="i"
@@ -97,6 +136,7 @@ export default {
item
);
},
availableItems: function() {},
async getDataFromApi() {
let vm = this;
window.$gz.form.setFormState({
@@ -147,6 +187,7 @@ export default {
data() {
return {
effectiveView: [],
showSelector: false,
formState: {
ready: false,
dirty: false,
@@ -171,8 +212,8 @@ async function clickHandler(menuItem) {
let m = window.$gz.menu.parseMenuItem(menuItem);
if (m.owner == FORM_KEY && !m.disabled) {
switch (m.key) {
case "new":
alert("STUB: Select new item to add to dashboard");
case "add-dash":
m.vm.showSelector = true;
break;
default:
@@ -197,9 +238,9 @@ function generateMenu(vm) {
};
menuOptions.menuItems.push({
title: "New",
title: "Add",
icon: "$ayiPlus",
key: FORM_KEY + ":new",
key: FORM_KEY + ":add-dash",
vm: vm
});