This commit is contained in:
@@ -18,9 +18,9 @@ todo: BAckend inapp notification form
|
|||||||
3 LINE style
|
3 LINE style
|
||||||
Listed in order from newest at top to oldest at bottom
|
Listed in order from newest at top to oldest at bottom
|
||||||
AVATAR to left side which is icon of ayatype
|
AVATAR to left side which is icon of ayatype
|
||||||
TITLE which is the event type translation AND object name
|
TITLE which is the event type translation AND object name and date
|
||||||
SUBTITLE which is the message if applicable
|
SUBTITLE which is the message if applicable
|
||||||
ACTION buttons open object, delete notification
|
ACTION buttons open object, delete notification, open subscription
|
||||||
|
|
||||||
POSSIBLE: Items approaching 90 days old should show differently to indicate they are about to be deleted, like faded or something?
|
POSSIBLE: Items approaching 90 days old should show differently to indicate they are about to be deleted, like faded or something?
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
{{ obj }}
|
{{ obj }}
|
||||||
|
|
||||||
<v-list three-line>
|
<v-list three-line>
|
||||||
<v-list-item> </v-list-item>
|
<v-list-item> </v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
@@ -30,6 +31,10 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selectLists: {
|
||||||
|
eventTypes: {},
|
||||||
|
ayaTypes: {}
|
||||||
|
},
|
||||||
obj: [],
|
obj: [],
|
||||||
formState: {
|
formState: {
|
||||||
ready: false,
|
ready: false,
|
||||||
@@ -66,7 +71,41 @@ export default {
|
|||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} else {
|
} else {
|
||||||
vm.obj = res.data;
|
//pre-make the display list object
|
||||||
|
//source object:
|
||||||
|
//[ { "id": 1, "concurrency": 18835104, "userId": 1, "created": "2020-07-20T19:35:49.665888Z", "ayaType": 2,
|
||||||
|
// "objectId": 101, "eventType": 2, "notifySubscriptionId": 1, "message": null, "fetched": true } ]
|
||||||
|
//display object:
|
||||||
|
//{event:"",objectname:"",objecttype:null,icon:null,eventdate:null,openurl:null,suburl:null,eventid}
|
||||||
|
|
||||||
|
let temp = res.data;
|
||||||
|
|
||||||
|
let timeZoneName = window.$gz.locale.getBrowserTimeZoneName();
|
||||||
|
let languageName = window.$gz.locale.getBrowserLanguages();
|
||||||
|
let hour12 = window.$gz.store.state.locale.hour12;
|
||||||
|
for (let i = 0; i < temp.length; i++) {
|
||||||
|
temp[
|
||||||
|
i
|
||||||
|
].uicreated = window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
temp[i].created,
|
||||||
|
timeZoneName,
|
||||||
|
languageName,
|
||||||
|
hour12
|
||||||
|
);
|
||||||
|
|
||||||
|
temp[i]["uievent"] = vm.selectLists.eventTypes.find(
|
||||||
|
z => z.id == temp[i].eventType
|
||||||
|
).name;
|
||||||
|
|
||||||
|
temp[i]["uiayatype"] = vm.selectLists.ayaTypes.find(
|
||||||
|
z => z.id == temp[i].ayaType
|
||||||
|
).name;
|
||||||
|
|
||||||
|
temp[i].icon = window.$gz.util.iconForType(temp[i].ayaType);
|
||||||
|
}
|
||||||
|
|
||||||
|
vm.obj = [...temp];
|
||||||
|
|
||||||
//modify the menu as necessary
|
//modify the menu as necessary
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
//Update the form status
|
//Update the form status
|
||||||
@@ -168,51 +207,74 @@ function generateMenu(vm) {
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
async function initForm(vm) {
|
async function initForm(vm) {
|
||||||
//await fetchTranslatedText(vm);
|
await fetchTranslatedText(vm);
|
||||||
//await populateSelectionLists(vm);
|
// await populateAyaTypeList(vm);
|
||||||
|
await populateSelectionLists(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
// //
|
//
|
||||||
// // Ensures UI translated text is available
|
// Ensures UI translated text is available
|
||||||
// //
|
//
|
||||||
// async function fetchTranslatedText(vm) {
|
async function fetchTranslatedText(vm) {
|
||||||
// await window.$gz.translation.cacheTranslations([
|
await window.$gz.translation.cacheTranslations([
|
||||||
// "Widget",
|
// "NotifyDeliveryMethod",
|
||||||
// "WidgetName",
|
// "NotifyEventType",
|
||||||
// "WidgetSerial",
|
// "NotifyDeliveryAddress",
|
||||||
// "WidgetDollarAmount",
|
// "InTags",
|
||||||
// "WidgetCount",
|
// "NotifyEventObjectDeleted",
|
||||||
// "User",
|
// "NotifyEventObjectCreated",
|
||||||
// "UserType",
|
// "NotifyEventObjectModified",
|
||||||
// "WidgetStartDate",
|
// "NotifyEventWorkorderStatusChange",
|
||||||
// "WidgetEndDate",
|
// "NotifyEventContractExpiring",
|
||||||
// "WidgetNotes",
|
// "NotifyEventCSRAccepted",
|
||||||
// "WidgetCustom1",
|
// "NotifyEventCSRRejected",
|
||||||
// "WidgetCustom2",
|
// "NotifyEventWorkorderClosed",
|
||||||
// "WidgetCustom3",
|
// "NotifyEventQuoteStatusChange",
|
||||||
// "WidgetCustom4",
|
// "NotifyEventQuoteStatusAge",
|
||||||
// "WidgetCustom5",
|
// "NotifyEventServiceBankDepleted",
|
||||||
// "WidgetCustom6",
|
// "NotifyEventReminderImminent",
|
||||||
// "WidgetCustom7",
|
// "NotifyEventScheduledOnWorkorder",
|
||||||
// "WidgetCustom8",
|
// "NotifyEventScheduledOnWorkorderImminent",
|
||||||
// "WidgetCustom9",
|
// "NotifyEventWorkorderCloseByPassed",
|
||||||
// "WidgetCustom10",
|
// "NotifyEventOutsideServiceOverdue",
|
||||||
// "WidgetCustom11",
|
// "NotifyEventOutsideServiceReceived",
|
||||||
// "WidgetCustom12",
|
// "NotifyEventPartRequestReceived",
|
||||||
// "WidgetCustom13",
|
// "NotifyEventNotifyHealthCheck",
|
||||||
// "WidgetCustom14",
|
// "NotifyEventBackupStatus",
|
||||||
// "WidgetCustom15",
|
// "NotifyEventCustomerServiceImminent",
|
||||||
// "WidgetCustom16"
|
// "NotifyEventPartRequested",
|
||||||
// ]);
|
// "NotifyEventWorkorderTotalExceedsThreshold",
|
||||||
// }
|
// "NotifyEventWorkorderStatusAge",
|
||||||
|
// "NotifyEventUnitWarrantyExpiry",
|
||||||
|
// "NotifyEventUnitMeterReadingMultipleExceeded",
|
||||||
|
// "NotifyEventDefaultNotification",
|
||||||
|
// "NotifyDeliveryMethodApp",
|
||||||
|
// "NotifyDeliveryMethodSMTP",
|
||||||
|
// "NotifyEventObjectAge",
|
||||||
|
// "NotifyEventServerOperationsProblem",
|
||||||
|
// "Duration"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
// //////////////////////
|
//////////////////////
|
||||||
// //
|
//
|
||||||
// //
|
//
|
||||||
// async function populateSelectionLists(vm) {
|
async function populateSelectionLists(vm) {
|
||||||
// //ensure the pick lists required are pre-fetched
|
//ensure the pick lists required are pre-fetched
|
||||||
// await window.$gz.enums.fetchEnumList("usertype");
|
await window.$gz.enums.fetchEnumList("NotifyEventType");
|
||||||
// vm.selectLists.usertypes = window.$gz.enums.getSelectionList("usertype");
|
var v = window.$gz.enums.getSelectionList("NotifyEventType");
|
||||||
// }
|
console.log(v);
|
||||||
|
vm.selectLists.eventTypes = window.$gz.enums.getSelectionList(
|
||||||
|
"NotifyEventType"
|
||||||
|
);
|
||||||
|
|
||||||
|
// await window.$gz.enums.fetchEnumList("NotifyDeliveryMethod");
|
||||||
|
// vm.selectLists.deliveryMethods = window.$gz.enums.getSelectionList(
|
||||||
|
// "NotifyDeliveryMethod"
|
||||||
|
// );
|
||||||
|
|
||||||
|
await window.$gz.enums.fetchEnumList("ayatype");
|
||||||
|
vm.selectLists.ayaTypes = window.$gz.enums.getSelectionList("ayatype");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user