This commit is contained in:
2022-03-05 01:12:40 +00:00
parent 19cf0086cd
commit f00cb7c413
6 changed files with 87 additions and 39 deletions

View File

@@ -837,3 +837,4 @@ Current v8 docs home: https://www.ayanova.com/docs/
BUILD 8.0.0-beta.1-rc4 CHANGES OF NOTE
- subscriptions lists fixed bug where no type selected would display "[undefined]" in data list, now displays nothing

View File

@@ -7,7 +7,13 @@ export default {
"ERROR enums::get -> enumKey " + enumKey + " is missing from store"
);
}
return window.$gz.store.state.enums[enumKey][enumValue];
const ret = window.$gz.store.state.enums[enumKey][enumValue];
if (ret == undefined) {
return "";
} else {
return ret;
}
} else {
const ret = [];
if (enumValue == null || enumValue == 0) {

View File

@@ -485,6 +485,12 @@ export default {
params: { recordid: tid.id }
});
break;
case ayatype.CustomerNotifySubscription:
vm.$router.push({
name: "cust-notify-subscription",
params: { recordid: tid.id }
});
break;
default:
window.$gz.eventBus.$emit(

View File

@@ -5,6 +5,17 @@
<v-form ref="form">
<v-row>
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-tag-picker
ref="customerTags"
v-model="obj.customerTags"
:label="$ay.t('CustomerTags')"
:readonly="formState.readOnly"
data-cy="customerTags"
:error-messages="form().serverErrors(this, 'customerTags')"
@input="fieldValueChanged('customerTags')"
></gz-tag-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
ref="eventType"
@@ -171,9 +182,24 @@
></gz-duration-picker>
</v-col>
<v-col v-if="showLinkReportId" cols="12" sm="6" lg="4" xl="3">
ATTACH REPORT todo: dynamic list of reports to select from for
type chosen
<v-col
v-if="showWorkOrderReportSelector"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
ref="linkReportId"
v-model="obj.linkReportId"
:aya-type="ayaTypes().Report"
:variant="ayaTypes().WorkOrder.toString()"
:readonly="formState.readOnly"
:label="$ay.t('AttachReport')"
data-cy="linkReportId"
:error-messages="form().serverErrors(this, 'linkReportId')"
@input="fieldValueChanged('linkReportId')"
></gz-pick-list>
</v-col>
<v-col v-if="showTags" cols="12">
@@ -197,8 +223,8 @@
</div>
</template>
<script>
const FORM_KEY = "notify-subscription";
const API_BASE_URL = "notify-subscription/";
const FORM_KEY = "customer-notify-subscription";
const API_BASE_URL = "customer-notify-subscription/";
export default {
data() {
return {
@@ -212,16 +238,14 @@ export default {
obj: {
id: 0,
concurrency: 0,
userId: this.$store.state.userId,
ayaType: 0,
eventType: 0,
advanceNotice: "00:00:00",
idValue: 0,
decValue: 0,
deliveryMethod: 1,
deliveryAddress: null,
linkReportId: 0,
tags: []
linkReportId: null,
tags: [],
customerTags: []
},
formState: {
ready: false,
@@ -307,15 +331,9 @@ export default {
return false;
}
},
showLinkReportId() {
//New NOTE NOTE: This is probably not required at the mo as customers are expected to login and view the reports as configured in global settings,
//so, if post release nothing relies on this it might be removed
//
//NOTE: Currently projected: Only Quotes and Workorders are involved in sending as attached reports
//And only to customers and only single items, not lists so it's doable to indicate a report id
//and send a link from notification to open the report
showWorkOrderReportSelector() {
switch (this.obj.eventType) {
case 999: //to be filled in later
case 30: //workorder completed
return true;
default:
return false;
@@ -505,7 +523,7 @@ export default {
//POST
vm.obj = res.data;
this.$router.replace({
name: "customer-notify-subscription",
name: "cust-notify-subscription",
params: {
recordid: res.data.id,
obj: res.data
@@ -558,7 +576,7 @@ export default {
},
duplicate() {
this.$router.push({
name: "customer-notify-subscription",
name: "cust-notify-subscription",
params: {
recordid: 0,
obj: this.obj
@@ -586,7 +604,7 @@ async function clickHandler(menuItem) {
break;
case "new":
m.vm.$router.push({
name: "customer-notify-subscription",
name: "cust-notify-subscription",
params: { recordid: 0 }
});
break;
@@ -611,7 +629,7 @@ function generateMenu(vm) {
readOnly: vm.formState.readOnly,
icon: "$ayiBullhorn",
title: "CustomerNotifySubscription",
helpUrl: "home-notify-subscriptions",
helpUrl: "customer-notify-subscriptions",
formData: {
ayaType: window.$gz.type.CustomerNotifySubscription,
recordId: vm.$route.params.recordid
@@ -685,7 +703,8 @@ async function fetchTranslatedText() {
"WorkOrderStatus",
"Total",
"UiFieldDataTypesInteger",
"QuoteQuoteStatusType"
"QuoteQuoteStatusType",
"AttachReport"
]);
}
@@ -700,16 +719,16 @@ async function populateSelectionLists(vm) {
vm.selectLists.eventTypes = tempEventTypes.filter(z => {
//return true if it's a type allowed for customer
switch (z.id) {
case 6:
return window.$gz.store.state.customerRights.notifyCSRAccepted;
case 7:
return window.$gz.store.state.customerRights.notifyCSRRejected;
case 21:
return window.$gz.store.state.customerRights.notifyServiceImminent;
case 30: //cust or inside user both
return window.$gz.store.state.customerRights.notifyWOCompleted;
case 31:
return window.$gz.store.state.customerRights.notifyWOCreated;
case 6: //notifyCSRAccepted;
return true;
case 7: //notifyCSRRejected;
return true;
case 21: //notifyServiceImminent;
return true;
case 30: //notifyWOCompleted;
return true;
case 31: //notifyWOCreated;
return true;
default:
return false;
}

View File

@@ -17,7 +17,7 @@
</div>
</template>
<script>
const FORM_KEY = "notify-subscriptions";
const FORM_KEY = "customer-notify-subscriptions";
export default {
data() {
return {
@@ -54,7 +54,7 @@ export default {
rowClick(item) {
//nav to item.id
window.$gz.eventBus.$emit("openobject", {
type: window.$gz.type.NotifySubscription,
type: window.$gz.type.CustomerNotifySubscription,
id: item.id
});
},
@@ -108,10 +108,17 @@ export default {
if (info && info != "") {
eventDisplay += ` - ${info}`;
}
let typeDisplay = `[${window.$gz.enums.get(
"coreview",
o.ayaType
)}]`;
if (typeDisplay == "[]") {
typeDisplay = "";
}
ret.push({
id: o.id,
eventType: eventDisplay,
ayaType: `[${window.$gz.enums.get("coreview", o.ayaType)}]`,
ayaType: typeDisplay,
customerTags: window.$gz.util.formatTags(o.customerTags),
tags: window.$gz.util.formatTags(o.tags)
});
@@ -151,7 +158,7 @@ async function clickHandler(menuItem) {
switch (m.key) {
case "new":
m.vm.$router.push({
name: "customer-notify-subscription",
name: "cust-notify-subscription",
params: { recordid: 0 }
});
break;

View File

@@ -106,10 +106,19 @@ export default {
if (info && info != "") {
eventDisplay += ` - ${info}`;
}
let typeDisplay = `[${window.$gz.enums.get(
"coreview",
o.ayaType
)}]`;
if (typeDisplay == "[]") {
typeDisplay = "";
}
ret.push({
id: o.id,
eventType: eventDisplay,
ayaType: `[${window.$gz.enums.get("coreview", o.ayaType)}]`,
ayaType: typeDisplay,
deliveryMethod: window.$gz.enums.get(
"NotifyDeliveryMethod",
o.deliveryMethod