From 95b29d70599dc8a11d65140b1bdea10244afd7ec Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 22 Nov 2022 00:24:14 +0000 Subject: [PATCH] case 4310 plus misc cleanup of ay-report as it's actually visible to users if they go into the file system --- devdocs/todo.txt | 77 ------------------- docs/8.0/ayanova/docs/changelog.md | 3 +- .../AyaNova/Controllers/NotifyController.cs | 2 +- server/AyaNova/resource/rpt/ay-report.js | 25 +----- 4 files changed, 4 insertions(+), 103 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 9f2ad0b1..e4c91e9c 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -1,78 +1 @@ todo: clean up solutions.txt and research.txt and move into a consolidated coding focused how-to.md doc -todo: test regular notification after case 4310 isn't broken by changes to mail delivery system -{[ - { - "Id": 544, - "Concurrency": 41215321, - "Serial": 544, - "Notes": "top\nUpdated on render at Fri Nov 18 2022 15:34:53 GMT-0800 (Pacific Standard Time)", - "Wiki": null, - "CustomFields": { - "c1": "Here is some custom text", - "c2": "2022-11-18T08:00:00Z", - "c3": "true" - }, - "Tags": [], - "CustomerId": 17, - "CustomerViz": "Adams, Gleason and Runolfsson", - "CustomerTechNotesViz": null, - "CustomerPhone1Viz": "697.907.8664 x7787", - "CustomerPhone2Viz": "(406) 837-7972 x321", - "CustomerPhone3Viz": "416-306-6458", - "CustomerPhone4Viz": "", - "CustomerPhone5Viz": "", - "CustomerEmailAddressViz": "johncrdnl@gmail.com", - "ProjectId": null, - "ProjectViz": null, - "InternalReferenceNumber": null, - "CustomerReferenceNumber": null, - "CustomerContactName": null, - "FromQuoteId": null, - "FromPMId": null, - "CreatedDate": "2022-11-18T19:10:26.870114Z", - "ServiceDate": "2022-11-18T19:10:20.989Z", - "CompleteByDate": null, - "DurationToCompleted": "00:00:00", - "InvoiceNumber": null, - "CustomerSignature": null, - "CustomerSignatureName": null, - "CustomerSignatureCaptured": null, - "TechSignature": null, - "TechSignatureName": null, - "TechSignatureCaptured": null, - "Onsite": true, - "ContractId": null, - "ContractViz": "-", - "LastStatusId": null, - "PostAddress": "6901 Langosh Village", - "PostCity": "Emardhaven", - "PostRegion": "Georgia", - "PostCountry": "Saint Vincent and the Grenadines", - "PostCode": "12106-4039", - "Address": "174 Yost Corners", - "City": "Emardhaven", - "Region": "Georgia", - "Country": "Saint Vincent and the Grenadines", - "Latitude": -81.341400, - "Longitude": 74.885800, - "Items": [], - "States": [], - "IsLockedAtServer": false, - "AlertViz": "", - "FromQuoteViz": null, - "FromPMViz": null, - "LastStateUserViz": null, - "LastStateNameViz": null, - "LastStateColorViz": null, - "LastStateCompletedViz": false, - "LastStateLockedViz": false, - "IsCompleteRecord": true, - "UserIsRestrictedType": false, - "UserIsTechRestricted": false, - "UserIsSubContractorFull": false, - "UserIsSubContractorRestricted": false, - "UserCanViewPartCosts": true, - "UserCanViewLaborOrTravelRateCosts": true, - "UserCanViewLoanerCosts": true - } -]} \ No newline at end of file diff --git a/docs/8.0/ayanova/docs/changelog.md b/docs/8.0/ayanova/docs/changelog.md index 6f2f6cd3..ceaa0695 100644 --- a/docs/8.0/ayanova/docs/changelog.md +++ b/docs/8.0/ayanova/docs/changelog.md @@ -15,8 +15,9 @@ See the [upgrade instructions](ops-upgrade.md) section of this manual for detail #### Added - Server: Added new internal API route `/api/v8/notify/direct-smtp` to support on demand notification scenarios +- Server, App: log to AyaNova event log when User sends a direct smtp message using new notify API route, can be viewed in [Event history](adm-history.md) - Server: Report api utility methods ayPutToAPI, ayPostToAPI, ayGetFromAPI was incorrectly throwing exception on empty return body (202, 204 results) -- App: added `z_API send SMTP from work order report` example report to show how to use the new API notify via smpt method added to +- App: added `z_API send SMTP from work order report` example report to show how to use the new API notify via smpt method added to send an email when a report is rendered automatically. Note: this example report will only automatically install in new databases created after upgrading to this release. For existing databases [download z_API send SMTP from work order report](https://ayanova.com/download/xtra/z_API send SMTP from work order report.ayrt) diff --git a/server/AyaNova/Controllers/NotifyController.cs b/server/AyaNova/Controllers/NotifyController.cs index 78a04f33..90608ccf 100644 --- a/server/AyaNova/Controllers/NotifyController.cs +++ b/server/AyaNova/Controllers/NotifyController.cs @@ -235,7 +235,7 @@ namespace AyaNova.Api.Controllers /// Currently supported types are Customer, HeadOffice, Vendor, User /// WARNING: be careful using this method; high volume emailing or spam-like behavior /// could result in a ban or block of your mail account or mail server or domain - /// + /// Use of this method is logged to AyaNova event log on successful attempted delivery /// /// Accepted on success or error [HttpPost("direct-smtp")] diff --git a/server/AyaNova/resource/rpt/ay-report.js b/server/AyaNova/resource/rpt/ay-report.js index 58f31e13..5e591db3 100644 --- a/server/AyaNova/resource/rpt/ay-report.js +++ b/server/AyaNova/resource/rpt/ay-report.js @@ -147,8 +147,6 @@ Handlebars.registerHelper("ayConcat", function () { /////////////////////////////////////////// // Turn a utc date into a displayable // short date and time -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString -//(PRIVATE NOT DOCUMENTED, FOR HELPER USE) // function utcDateToShortDateAndTimeLocalized(ayValue) { if (!ayValue) { @@ -177,7 +175,6 @@ function utcDateToShortDateAndTimeLocalized(ayValue) { /////////////////////////////////////////// // Turn a utc date into a displayable // short date -//(PRIVATE NOT DOCUMENTED, FOR HELPER USE) function utcDateToShortDateLocalized(ayValue) { if (!ayValue) { return ""; @@ -203,7 +200,6 @@ function utcDateToShortDateLocalized(ayValue) { /////////////////////////////////////////// // Turn a utc date into a displayable // short time -//(PRIVATE NOT DOCUMENTED, FOR HELPER USE) function utcDateToShortTimeLocalized(ayValue) { if (!ayValue) { return ""; @@ -230,7 +226,6 @@ function utcDateToShortTimeLocalized(ayValue) { /////////////////////////////////////////// // CURRENCY LOCALIZATION -//(PRIVATE NOT DOCUMENTED, FOR HELPER USE) // function currencyLocalized(ayValue) { if (!ayValue) { @@ -247,7 +242,6 @@ function currencyLocalized(ayValue) { /////////////////////////////////////////// // DECIMAL LOCALIZATION -//(PRIVATE NOT DOCUMENTED, FOR HELPER USE) // function decimalLocalized(ayValue) { if (!ayValue) { @@ -278,9 +272,6 @@ async function ayGetTranslations(keys) { ayTranslationKeyCache[item.key] = item.value; }); } catch (error) { - //fundamental error, can't proceed with this call - // handleError("GET", error, route); - //todo: deal with this properly throw error; } } @@ -307,9 +298,6 @@ async function ayGetFromAPI(route, token) { }); return await extractBodyEx(r); } catch (error) { - //fundamental error, can't proceed with this call - // handleError("GET", error, route); - //todo: deal with this properly throw error; } } @@ -377,12 +365,8 @@ async function ayPutToAPI(route, data, token) { ///////////////////////////// // attachment download URL -// (PRIVATE NOT DOCUMENTED FOR HELPER USE) +// (INTERNAL USE NOT DOCUMENTED FOR HELPER USE) function attachmentDownloadUrl(fileId, ctype) { - //http://localhost:7575/api/v8/attachment/download/100?t=sssss - //Ctype is optional and is the MIME content type, used to detect image urls at client for drag and drop ops - //in wiki but ignored by server - let url = "attachment/download/" + fileId + @@ -459,10 +443,3 @@ function ayGroupByKey(reportDataArray, groupByKeyName) { } return ret; } - -// //Utils -// function ayPad(n, width, z) { -// z = z || "0"; -// n = n + ""; -// return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; -// }