This commit is contained in:
@@ -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?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,54 @@ export default {
|
|||||||
dashSalesOnlyTest: {
|
dashSalesOnlyTest: {
|
||||||
roles: [role.SalesFull, role.SalesLimited],
|
roles: [role.SalesFull, role.SalesLimited],
|
||||||
title: "Sales only test item"
|
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() {
|
availableItems() {
|
||||||
|
|||||||
@@ -1,6 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row v-if="formState.ready">
|
<v-row v-if="formState.ready">
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<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-col
|
||||||
v-for="(item, i) in effectiveView"
|
v-for="(item, i) in effectiveView"
|
||||||
:key="i"
|
:key="i"
|
||||||
@@ -97,6 +136,7 @@ export default {
|
|||||||
item
|
item
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
availableItems: function() {},
|
||||||
async getDataFromApi() {
|
async getDataFromApi() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
@@ -147,6 +187,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
effectiveView: [],
|
effectiveView: [],
|
||||||
|
showSelector: false,
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -171,8 +212,8 @@ async function clickHandler(menuItem) {
|
|||||||
let m = window.$gz.menu.parseMenuItem(menuItem);
|
let m = window.$gz.menu.parseMenuItem(menuItem);
|
||||||
if (m.owner == FORM_KEY && !m.disabled) {
|
if (m.owner == FORM_KEY && !m.disabled) {
|
||||||
switch (m.key) {
|
switch (m.key) {
|
||||||
case "new":
|
case "add-dash":
|
||||||
alert("STUB: Select new item to add to dashboard");
|
m.vm.showSelector = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -197,9 +238,9 @@ function generateMenu(vm) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
title: "New",
|
title: "Add",
|
||||||
icon: "$ayiPlus",
|
icon: "$ayiPlus",
|
||||||
key: FORM_KEY + ":new",
|
key: FORM_KEY + ":add-dash",
|
||||||
vm: vm
|
vm: vm
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user