From 7c1b45c15f37df25ba7f006b9a10d1ebe3b23975 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Wed, 14 Sep 2022 16:22:13 -0400 Subject: [PATCH] Swift + Apps Scripts --- AppScriptsProjects/.clasp.json | 1 + CustomerNotes.md | 16 +- Google_Scripts/.DS_Store | Bin 0 -> 6148 bytes Google_Scripts/AE_Reminders/.clasp.json | 1 + .../AE_Reminders/AEMissedMeetingData.js | 217 ++++++++++++++++++ Google_Scripts/AE_Reminders/appsscript.json | 7 + Google_Scripts/Dept_Calendar/.clasp.json | 1 + Google_Scripts/Dept_Calendar/Code.js | 27 +++ Google_Scripts/Dept_Calendar/appsscript.json | 7 + Google_Scripts/SDR_Meetings/.clasp.json | 1 + Google_Scripts/SDR_Meetings/NewMeetings.js | 110 +++++++++ Google_Scripts/SDR_Meetings/appsscript.json | 7 + Google_Scripts/Sheets_to_Jira/.clasp.json | 1 + Google_Scripts/Sheets_to_Jira/IntoJira.js | 119 ++++++++++ Google_Scripts/Sheets_to_Jira/appsscript.json | 7 + Google_Scripts/WCA_Webhook/.clasp.json | 1 + Google_Scripts/WCA_Webhook/Code.js | 47 ++++ Google_Scripts/WCA_Webhook/appsscript.json | 10 + .../{ => _originals}/AE_Reminders_Daily.gs | 0 .../{ => _originals}/DeptCalendar.gs | 0 .../{ => _originals}/Gmail_Alerts.gs | 0 .../{ => _originals}/New_SDR_Meetings_msg.gs | 0 .../{ => _originals}/Sheets>Jira.gs | 0 .../{ => _originals}/WCAWebhooks.gs | 0 .../Swift Medical/_cards_course.html.liquid | 34 --- .../_courses_catalog.html.liquid | 29 ++- Timetagger/_timetagger/users/norm~bm9ybQ==.db | Bin 49152 -> 49152 bytes 27 files changed, 604 insertions(+), 39 deletions(-) create mode 100644 AppScriptsProjects/.clasp.json create mode 100644 Google_Scripts/.DS_Store create mode 100644 Google_Scripts/AE_Reminders/.clasp.json create mode 100644 Google_Scripts/AE_Reminders/AEMissedMeetingData.js create mode 100644 Google_Scripts/AE_Reminders/appsscript.json create mode 100644 Google_Scripts/Dept_Calendar/.clasp.json create mode 100644 Google_Scripts/Dept_Calendar/Code.js create mode 100644 Google_Scripts/Dept_Calendar/appsscript.json create mode 100644 Google_Scripts/SDR_Meetings/.clasp.json create mode 100644 Google_Scripts/SDR_Meetings/NewMeetings.js create mode 100644 Google_Scripts/SDR_Meetings/appsscript.json create mode 100644 Google_Scripts/Sheets_to_Jira/.clasp.json create mode 100644 Google_Scripts/Sheets_to_Jira/IntoJira.js create mode 100644 Google_Scripts/Sheets_to_Jira/appsscript.json create mode 100644 Google_Scripts/WCA_Webhook/.clasp.json create mode 100644 Google_Scripts/WCA_Webhook/Code.js create mode 100644 Google_Scripts/WCA_Webhook/appsscript.json rename Google_Scripts/{ => _originals}/AE_Reminders_Daily.gs (100%) rename Google_Scripts/{ => _originals}/DeptCalendar.gs (100%) rename Google_Scripts/{ => _originals}/Gmail_Alerts.gs (100%) rename Google_Scripts/{ => _originals}/New_SDR_Meetings_msg.gs (100%) rename Google_Scripts/{ => _originals}/Sheets>Jira.gs (100%) rename Google_Scripts/{ => _originals}/WCAWebhooks.gs (100%) delete mode 100644 NP_Custom_Templates/customer_templates/Swift Medical/_cards_course.html.liquid diff --git a/AppScriptsProjects/.clasp.json b/AppScriptsProjects/.clasp.json new file mode 100644 index 00000000..b7ce22ac --- /dev/null +++ b/AppScriptsProjects/.clasp.json @@ -0,0 +1 @@ +{"scriptId":"1NKCzBIDEvcD4HUFEXadwtoGbElLem0g0asxQO4lWjCxyp5B-yMvSZnMD","rootDir":"/Users/normrasmussen/Documents/Northpass/AppScriptsProjects"} diff --git a/CustomerNotes.md b/CustomerNotes.md index 14208777..c4f8f226 100644 --- a/CustomerNotes.md +++ b/CustomerNotes.md @@ -1408,7 +1408,21 @@ Andres/Paula - 8/22/22 * Users within an organization account * MAIN: Users should not be seeing any default Northpass pages (login, enrollment emails, etc) -## Proof of Concept from HelloInsights +## Proof of Concept from HelloInsight + +## Design Handoff 9/13/2022 +## Hours Estimates +* They want estimates of how long eerything will take to build it all for the MVP + * Then we will decide how everything should be split up + * They don't want to burn through all 48 hours. + * API work will also take some hours + * Font Awesome icons via property to update on their own + + * HOURS NEEDED: + * Templates Design: 6 hours + * Properties & Logic (ie. static completions): 3 hours + * LX Design: 8 with quiz styling + * LX Quiz:HARD NO SAYS KAITLYN TBD # NP Proof of Concept As a software engineer, I want to implement a proof of concept integration of Northpass, so that I can better understand the effort level required to build the basic functionality necessary for Q1 2022/23 as well as test some functionality that will be implemented in Q2 and beyond. diff --git a/Google_Scripts/.DS_Store b/Google_Scripts/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0= formatWeek) && (missedEntries[1] <= formatNow)) { + meetingCount += 1; + missedEntries.pop(); + missedEntries.toString(); + slackingAEListOne.push(missedEntries); + //Logger.log(slackingAEListOne); + }; + }; + /* Now outside of the if statement: + the array is built, and we want each group to be on a new line, remove the commas and add a hyphen. + The counter counts if there is 1 or more meetings, or not. If 0, it sends a certain message, not tagging anyone. + If it is one or more, it splices by the first array (index 0), adds a new line, and replaces commans with hyphens. + */ + if (meetingCount >= 1) { + var slackingAEListTwo = slackingAEListOne.splice(0).join('\n'); + var finalAEList = slackingAEListTwo.replace(/,/g, ' - '); + // This if statement is going to only tag those who appear in the previous list. + // No need to tag people who have done their work and contribute to clean data. + if (finalAEList.includes('Norm')) { + tagList.push('<@U020KRBDSDQ>'); + } + if (finalAEList.includes('Dan')) { + tagList.push('<@U01P7DTFSQZ>'); + } + if (finalAEList.includes('Charles')) { + tagList.push('<@U01286MQUS2>'); + } + if (finalAEList.includes('Travis')) { + tagList.push('<@UFE3T14UX>'); + } + if (finalAEList.includes('Nick')) { + tagList.push('<@U0276LMA70F>'); + } + if (finalAEList.includes('Mike')) { + tagList.push('<@U027MAQUPM0>'); + } + if (finalAEList.includes('Doug')) { + tagList.push('<@U02CK55FHFX>'); + } + if (finalAEList.includes('Isabel')) { + tagList.push('<@U03019S7R6F>'); + } + if (finalAEList.includes('Ryan')) { + tagList.push('<@U0325CWA3N3>'); + } + var tagUsers = tagList.toString(); + /* + Now, we're building the payload for the Slack Message. + This is very specific and prone to errors, so check that it works using Slack's tool: + https://app.slack.com/block-kit-builder/ + + Copy from Rich: + ":rotating_light::rotating_light::rotating_light: New Meeting Tracker Alert! :rotating_light::rotating_light::rotating_light: + It's your daily reminder to update the new meeting tracker. + If you've been tagged, please address this by EOD." + */ + let payloadText = +{ + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":rotating_light::rotating_light::rotating_light: New Meeting Tracker Alert! :rotating_light::rotating_light::rotating_light:" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "It's your daily reminder to update the new meeting tracker." + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "If you've been tagged, please address this by EOD." + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": finalAEList // Sends list with AE, meeting date, and company + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "In case you need it, here's a link to the sheet. :point_right:" + }, + "accessory": { + "type": "button", + "text": { + "type": "plain_text", + "text": "Sales New Meeting Tracker", + "emoji": true + }, + "value": "sales_tracker_link_123", + "url": "https://docs.google.com/spreadsheets/d/150nSuHQLJHpJaYdQ6KHeN7nQ6iexwtnQEpicM77PK8A/edit#gid=0 | First Meeting Tracker", + "action_id": "button-action" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": tagUsers // Tags with slack user numbers if they appear in finalSend + } + } + ] +}; + // This is standard operating procedure to creating the payload and destination + const webhook = "https://hooks.slack.com/services/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"; + const options = { + method: "post", + contentType: "application/json", + muteHttpExceptions: true, + payload: JSON.stringify(payloadText), + }; + const sendMsg = UrlFetchApp.fetch(webhook, options); + var respCode = sendMsg.getResponseCode(); + //Logger.log(sendMsg); // Debug to confirm send + //Logger.log(respCode); // Debug to show errors, if any + /* + This is the else statement that sends a certain message not tagging anyone and saying that data is clean. + */ + } else { + let noMeetingMsg = + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":star::star::star: New Meeting Tracker Alert! :star::star::star:" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Good job, everyone! All meetings from the last 5 days are up to date. Keep doing what you're doing!" + } + } + ] +}; +// This is standard operating procedure to creating the payload and destination + const webhook = "https://hooks.slack.com/services/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"; + const options = { + method: "post", + contentType: "application/json", + muteHttpExceptions: true, + payload: JSON.stringify(noMeetingMsg), + }; + const sendMsg = UrlFetchApp.fetch(webhook, options); + var respCode = sendMsg.getResponseCode(); + //Logger.log(sendMsg); // Debug to confirm send + //Logger.log(respCode); // Debug to show errors, if any +} +}; \ No newline at end of file diff --git a/Google_Scripts/AE_Reminders/appsscript.json b/Google_Scripts/AE_Reminders/appsscript.json new file mode 100644 index 00000000..3cf1d247 --- /dev/null +++ b/Google_Scripts/AE_Reminders/appsscript.json @@ -0,0 +1,7 @@ +{ + "timeZone": "America/New_York", + "dependencies": { + }, + "exceptionLogging": "STACKDRIVER", + "runtimeVersion": "V8" +} \ No newline at end of file diff --git a/Google_Scripts/Dept_Calendar/.clasp.json b/Google_Scripts/Dept_Calendar/.clasp.json new file mode 100644 index 00000000..bde649e3 --- /dev/null +++ b/Google_Scripts/Dept_Calendar/.clasp.json @@ -0,0 +1 @@ +{"scriptId":"1bG7euzp-k-XWRrCkTEwdOLYxuLgIMgzKcfvWjdOKU226uYPC7aTU_JfJ","rootDir":"/Users/normrasmussen/Documents/Northpass/Google_Scripts/Dept_Calendar"} diff --git a/Google_Scripts/Dept_Calendar/Code.js b/Google_Scripts/Dept_Calendar/Code.js new file mode 100644 index 00000000..57233e6d --- /dev/null +++ b/Google_Scripts/Dept_Calendar/Code.js @@ -0,0 +1,27 @@ +function createEvent() { + let calendarID = ''; + let eventName = ''; + let startTime = ''; + let endTime = ''; + let zoomLink = ''; + var event = CalendarApp.getCalendarById(calendarID).create( + eventName, startTime, endTime, zoomLink); + eventID = event.getID(); + } + +function addLearner(eventID, calendarID) { + let attendeeEmail = '{{ current_person.email }}'; + let calendar = calendarID; + let event = eventID; + + let basCalendar = CalendarApp.getCalendarById(calendar); + if (basCalendar == null) { + return; + } + let currentEvent = calendar.getEventById(event); + if (currentEvent == null) { + return; + } + event.addGuest(attendeeEmail); + + } diff --git a/Google_Scripts/Dept_Calendar/appsscript.json b/Google_Scripts/Dept_Calendar/appsscript.json new file mode 100644 index 00000000..3cf1d247 --- /dev/null +++ b/Google_Scripts/Dept_Calendar/appsscript.json @@ -0,0 +1,7 @@ +{ + "timeZone": "America/New_York", + "dependencies": { + }, + "exceptionLogging": "STACKDRIVER", + "runtimeVersion": "V8" +} \ No newline at end of file diff --git a/Google_Scripts/SDR_Meetings/.clasp.json b/Google_Scripts/SDR_Meetings/.clasp.json new file mode 100644 index 00000000..649ab79a --- /dev/null +++ b/Google_Scripts/SDR_Meetings/.clasp.json @@ -0,0 +1 @@ +{"scriptId":"11ghDxFT1kf_3PLsjOUcd3isFIXoJtyNzu2mEbhdci53nJXYTpSRHYJxl","rootDir":"/Users/normrasmussen/Documents/Northpass/Google_Scripts/SDR_Meetings"} diff --git a/Google_Scripts/SDR_Meetings/NewMeetings.js b/Google_Scripts/SDR_Meetings/NewMeetings.js new file mode 100644 index 00000000..c77d73a2 --- /dev/null +++ b/Google_Scripts/SDR_Meetings/NewMeetings.js @@ -0,0 +1,110 @@ +const sheetTwo = SpreadsheetApp.getActiveSheet(); +var now = new Date(); +var formatToday = Utilities.formatDate(now, 'America/New_York', 'MM/dd/yyyy'); + +function newMeetings() { + var startRow = 2; // First row of data to process + var numRows = sheetTwo.getLastRow()-1; // Number of rows to process + var dataRange = sheetTwo.getRange(startRow, 1, numRows, sheet.getLastColumn()); + var data = dataRange.getValues(); + var sdrMeeting = []; + + for (i in data) { + var row = data[i]; + var sdr = row[0]; // Column A + var date = Utilities.formatDate(row[3],'America/New_York','MM/dd/yyyy'); // Column D + var company = row[4]; // Column E + var outbound = row[5]; // Column F + let sdrMeetingListOne = [sdr, date, company, outbound]; + if ((sdrMeetingListOne[1] == formatToday) && (sdrMeetingListOne[0] != '') && (sdrMeetingListOne[3] == "Outbound")) { + sdrMeetingListOne.toString(); + sdrMeeting.push(sdrMeetingListOne); + Logger.log(sdrMeetingListOne) + } else if ((sdrMeetingListOne[1] == formatToday) && (sdrMeetingListOne[0] != '')) { + let noMeetingText = + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":star: *C'mon team!* :star:" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "No new meetings today? We can do better than that! Hustle!" + } + }, + ] + } + const webhook = "https://hooks.slack.com/services/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"; + const options = { + method: "post", + contentType: "application/json", + muteHttpExceptions: true, + payload: JSON.stringify(noMeetingText), + } + const sendMsg = UrlFetchApp.fetch(webhook, options); + var respCode = sendMsg.getResponseCode(); + Logger.log(sendMsg); + Logger.log(respCode); + } + }; + Logger.log(sdrMeeting); + var toSend = sdrMeeting.splice(1).join('\n'); + var getEm = toSend.replace(/,/g, ' - ') + Logger.log(getEm) +/* + let payloadMeetingText = +{ + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":star: *Pitter Patter!* :star:" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Here's who has meetings today. Get after it boys and girls!" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": getEm + } + }, + { + "type": "image", + "image_url": "https://media.giphy.com/media/3ohjURBuAtWDV8d3SE/giphy.gif", + "alt_text": "inspiration" + } + ] +} + //(array[0] + ", you still need to fill out the cells for" + array[2] + " from " + array[1] + "!\n"); + const webhook = "https://hooks.slack.com/services/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"; + const options = { + method: "post", + contentType: "application/json", + muteHttpExceptions: true, + payload: JSON.stringify(payloadText), + }; + const sendMsg = UrlFetchApp.fetch(webhook, options); + var respCode = sendMsg.getResponseCode(); + Logger.log(sendMsg); + Logger.log(respCode);*/ +}; \ No newline at end of file diff --git a/Google_Scripts/SDR_Meetings/appsscript.json b/Google_Scripts/SDR_Meetings/appsscript.json new file mode 100644 index 00000000..3cf1d247 --- /dev/null +++ b/Google_Scripts/SDR_Meetings/appsscript.json @@ -0,0 +1,7 @@ +{ + "timeZone": "America/New_York", + "dependencies": { + }, + "exceptionLogging": "STACKDRIVER", + "runtimeVersion": "V8" +} \ No newline at end of file diff --git a/Google_Scripts/Sheets_to_Jira/.clasp.json b/Google_Scripts/Sheets_to_Jira/.clasp.json new file mode 100644 index 00000000..abb89fb3 --- /dev/null +++ b/Google_Scripts/Sheets_to_Jira/.clasp.json @@ -0,0 +1 @@ +{"scriptId":"1VUbCbC6whkodvYSfTSmaFCNVxowtahxUHaKcr7Dg_Ly0vevBLqlDWmdS","rootDir":"/Users/normrasmussen/Documents/Northpass/Google_Scripts/Sheets_to_Jira"} diff --git a/Google_Scripts/Sheets_to_Jira/IntoJira.js b/Google_Scripts/Sheets_to_Jira/IntoJira.js new file mode 100644 index 00000000..280c6d75 --- /dev/null +++ b/Google_Scripts/Sheets_to_Jira/IntoJira.js @@ -0,0 +1,119 @@ +/* Pertinent Information and Codes: +Custom Fields: +Channel = customfield_10121 +Campaign = customfield_10120 +SDR = customfield_10122 +Start Date = customfield_10015 + +Users: +Travis Nardin = 5d9cb42c0265ca0db955b965 +Dan Peski = 603318815ddf020069969cad +Norm Rasmussen = 6092af20d353800068863d15 +Michael Valido = 61fbf60cd8d7cf006a90941c +Jon Newfield = 6092af212c2f6c0068ec92c4 +Isabel Katz = 620145241fec260068c107e5 +Charles McGovern = 5eaaf1c4021ae30ba8fcb184 +Nick Zuppe = 60eddda64257a90070aeebef +Doug Goldsmith = 61294a4845f753006951a590 +Nick Appleby = 6183eab7892c420072f9c437 +Quba Williams-Wilfong = 62101fe4e41f76006a6f6510 + +Without accounts: Adan, Drew + +*/ +function myFunction() { + var URL = "https://northpass.atlassian.net/rest/api/3/issue/"; + var token = "2NrKYv22TLWnxTo7EhU3633E"; + var user = "nrasmussen@northpass.com"; + var UserCredentials = Utilities.base64Encode(user + ":" + token); + + // Setting up data range and empty arrays + const sheet = SpreadsheetApp.getActiveSheet(); + var startRow = 2; // First col of data to process + var numRows = 1132; // Number of rows to process + var dataRange = sheet.getRange(startRow, 1, numRows, sheet.getLastColumn()).getValues(); + + for (col in dataRange) { // For a data col within the entire data range + var col = dataRange[col]; + let sdr = col[0]; // Column - A + let name = col[1]; // Column - B + let bookingDate = Utilities.formatDate(col[2], "America/New_York", "MM/dd/yyyy"); // Column - C + let meetingDate = Utilities.formatDate(col[3], "America/New_York", "MM/dd/yyyy"); // Column - D + let rawDate = Utilities.formatDate(col[3], "America/New_York", "yyyy-MM-dd"); + let company = col[4]; // Column - E + let channel = col[5]; // Column - F + let result = col[7]; // Column - H + let campaign = col[8]; // Column - I + let info = col[9]; // Column - J + let list = [sdr, name, rawDate, bookingDate, meetingDate, company, channel, result, campaign, info]; + let sdrDict = { + "Mike" : + "61fbf60cd8d7cf006a90941c", + "Nick" : + "60eddda64257a90070aeebef", + "Appleby" : + "6183eab7892c420072f9c437", + "Doug" : + "61294a4845f753006951a590", + "Quba" : + "62101fe4e41f76006a6f6510", + }; + if (list.includes("Norm")) { + var data = { + "fields": { + "project": { + "key": "NPIPE", + }, + "issuetype": { + "id": "10275", + }, + "summary": list[5], + "description": { + "type": "doc", + "version": 1, + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "Booked Date - " + list[3] + '\n' + + "Meeting Date - " + list[4] + '\n' + + "Description from Tracker: " + list[9] + '\n' + + "Last Status - " + list[7] + } + ] + } + ], + }, + "customfield_10015": list[2], // Start (Meeting) Date - rawDate + "customfield_10127": [ // Campaign + list[8], + ], + "customfield_10128": [ // Channel + list[6], + ], + "customfield_10129": [{"id" : sdrDict[list[0]]}], // SDR + } + }, + payload = JSON.stringify(data); + Logger.log(payload); + var headers = { + "Accept": "application/json", + "Content-Type": "application/json", + "Authorization": "Basic " + UserCredentials, + "muteHttpExceptions": true, + } + var options = { + "method": "POST", + "headers": headers, + "payload": payload + } + //Logger.log(options); + var response = UrlFetchApp.fetch(URL, options); + //Logger.log(response); + var respCode = response.getResponseCode(); + //Logger.log(respCode); + } + } +}; \ No newline at end of file diff --git a/Google_Scripts/Sheets_to_Jira/appsscript.json b/Google_Scripts/Sheets_to_Jira/appsscript.json new file mode 100644 index 00000000..3cf1d247 --- /dev/null +++ b/Google_Scripts/Sheets_to_Jira/appsscript.json @@ -0,0 +1,7 @@ +{ + "timeZone": "America/New_York", + "dependencies": { + }, + "exceptionLogging": "STACKDRIVER", + "runtimeVersion": "V8" +} \ No newline at end of file diff --git a/Google_Scripts/WCA_Webhook/.clasp.json b/Google_Scripts/WCA_Webhook/.clasp.json new file mode 100644 index 00000000..e4ed4b66 --- /dev/null +++ b/Google_Scripts/WCA_Webhook/.clasp.json @@ -0,0 +1 @@ +{"scriptId":"1NKCzBIDEvcD4HUFEXadwtoGbElLem0g0asxQO4lWjCxyp5B-yMvSZnMD","rootDir":"/Users/normrasmussen/Documents/Northpass/Google_Scripts/WCA_Webhook"} diff --git a/Google_Scripts/WCA_Webhook/Code.js b/Google_Scripts/WCA_Webhook/Code.js new file mode 100644 index 00000000..e4b628ea --- /dev/null +++ b/Google_Scripts/WCA_Webhook/Code.js @@ -0,0 +1,47 @@ +function doGet(e) { + return HtmlService.createHtmlOutput("get request received"); +} + +//this is a function that fires when the webapp receives a POST request +function doPost(e) { + var params = JSON.stringify(e.postData.contents); + params = JSON.parse(params); + var now = new Date(); + var timeAdded = Utilities.formatDate(now,'America/New_York','MM/dd/yyyy'); + + var learnerName = params.substring(params.indexOf('{"name":"') + 7, params.lastIndexOf('"email"')); + learnerName = learnerName.slice(learnerName.indexOf('"') + 1, learnerName.lastIndexOf('"'),); + //Logger.log("Name = " + learnerName); + + var learnerEmail = params.substring(params.indexOf('"sso_uid":"') + 9, params.lastIndexOf('"full_name"')); + learnerEmail = learnerEmail.slice(learnerName.indexOf('"') + 3, learnerEmail.lastIndexOf('"'),); + //Logger.log("Email = " + learnerEmail); + + var courseName = params.substring(params.indexOf('"course_name":"') + 4, params.lastIndexOf('"attributes"')); + courseName = courseName.slice(courseName.indexOf('"') + 3, courseName.lastIndexOf('"'),); + //Logger.log("Course = " + courseName); + + var activityName = params.substring(params.indexOf('"title":"') + 4, params.lastIndexOf('"course_name"')); + activityName = activityName.slice(activityName.indexOf('"') + 3, activityName.lastIndexOf('"'),); + //Logger.log("Activity = " + activityName); + + var dateCompleted = params.substring(params.indexOf('"updated_at":"') + 4, params.lastIndexOf('"activated_at"')); + dateCompleted = dateCompleted.slice(dateCompleted.indexOf('"') + 3, dateCompleted.lastIndexOf('"'),); + //Logger.log("Completed on = " + dateCompleted); + + var sheet = SpreadsheetApp.getActiveSheet(); + var lastRow = Math.max(sheet.getLastRow(),1); + + sheet.insertRowAfter(lastRow); + sheet.getRange(lastRow + 1, 1).setValue(timeAdded); + sheet.getRange(lastRow + 1, 2).setValue(learnerName); + sheet.getRange(lastRow + 1, 3).setValue(learnerEmail); + sheet.getRange(lastRow + 1, 4).setValue(courseName); + sheet.getRange(lastRow + 1, 5).setValue(activityName); + sheet.getRange(lastRow + 1, 6).setValue(dateCompleted); + sheet.getRange(lastRow + 1, 7).setValue(params); + + + SpreadsheetApp.flush(); + return HtmlService.createHtmlOutput("post request received"); +} \ No newline at end of file diff --git a/Google_Scripts/WCA_Webhook/appsscript.json b/Google_Scripts/WCA_Webhook/appsscript.json new file mode 100644 index 00000000..7058a561 --- /dev/null +++ b/Google_Scripts/WCA_Webhook/appsscript.json @@ -0,0 +1,10 @@ +{ + "timeZone": "America/New_York", + "dependencies": {}, + "exceptionLogging": "STACKDRIVER", + "runtimeVersion": "V8", + "webapp": { + "executeAs": "USER_DEPLOYING", + "access": "ANYONE_ANONYMOUS" + } +} \ No newline at end of file diff --git a/Google_Scripts/AE_Reminders_Daily.gs b/Google_Scripts/_originals/AE_Reminders_Daily.gs similarity index 100% rename from Google_Scripts/AE_Reminders_Daily.gs rename to Google_Scripts/_originals/AE_Reminders_Daily.gs diff --git a/Google_Scripts/DeptCalendar.gs b/Google_Scripts/_originals/DeptCalendar.gs similarity index 100% rename from Google_Scripts/DeptCalendar.gs rename to Google_Scripts/_originals/DeptCalendar.gs diff --git a/Google_Scripts/Gmail_Alerts.gs b/Google_Scripts/_originals/Gmail_Alerts.gs similarity index 100% rename from Google_Scripts/Gmail_Alerts.gs rename to Google_Scripts/_originals/Gmail_Alerts.gs diff --git a/Google_Scripts/New_SDR_Meetings_msg.gs b/Google_Scripts/_originals/New_SDR_Meetings_msg.gs similarity index 100% rename from Google_Scripts/New_SDR_Meetings_msg.gs rename to Google_Scripts/_originals/New_SDR_Meetings_msg.gs diff --git a/Google_Scripts/Sheets>Jira.gs b/Google_Scripts/_originals/Sheets>Jira.gs similarity index 100% rename from Google_Scripts/Sheets>Jira.gs rename to Google_Scripts/_originals/Sheets>Jira.gs diff --git a/Google_Scripts/WCAWebhooks.gs b/Google_Scripts/_originals/WCAWebhooks.gs similarity index 100% rename from Google_Scripts/WCAWebhooks.gs rename to Google_Scripts/_originals/WCAWebhooks.gs diff --git a/NP_Custom_Templates/customer_templates/Swift Medical/_cards_course.html.liquid b/NP_Custom_Templates/customer_templates/Swift Medical/_cards_course.html.liquid deleted file mode 100644 index 5402ed64..00000000 --- a/NP_Custom_Templates/customer_templates/Swift Medical/_cards_course.html.liquid +++ /dev/null @@ -1,34 +0,0 @@ -
-
- {% if course.ribbon %} -
- {{ course.ribbon }} -
- {% endif %} - {{ course.name }} -
-

- {{ course.name }} -

-
- {{ course.instructor_names }} -
- -
-
-
diff --git a/NP_Custom_Templates/customer_templates/Swift Medical/_courses_catalog.html.liquid b/NP_Custom_Templates/customer_templates/Swift Medical/_courses_catalog.html.liquid index fc6f8664..a550d371 100644 --- a/NP_Custom_Templates/customer_templates/Swift Medical/_courses_catalog.html.liquid +++ b/NP_Custom_Templates/customer_templates/Swift Medical/_courses_catalog.html.liquid @@ -1,8 +1,7 @@ {% if courses.in_catalog.any? %} -
- {% assign sorted_courses = courses.in_catalog | map: "properties" | sort: "course_order" %} - {% for course in sorted_courses %} -
+
+ {% for course in courses.in_catalog %} +
{% include "cards_course" with course %}
{% endfor %} @@ -15,3 +14,25 @@ {% endcapture %} {% include "courses_zero_state", message: message %} {% endif %} + + diff --git a/Timetagger/_timetagger/users/norm~bm9ybQ==.db b/Timetagger/_timetagger/users/norm~bm9ybQ==.db index db705d29b70d9cefb549a70fc0b33035929b2631..c1815c9daada2fbbe77724d5ae4637e1346328c1 100644 GIT binary patch literal 49152 zcmeI5Yiu0V6~}jNCr)fLepBK7qTM}*(9TiDYLzZVt?vy0X*danNAh6N3GRr)H~ zi2xBG0z`la5CI}U1c<=ZK_I`dwyC)}I;Y#|!Ca=0vF+^mZ~@=z*7c-X`%+?G>#ZFr z5v}6NofCs%Uus*QxVaNv{T&^v#nH@cP!qd)+BdcK42T<31FOY?y-M8L-nXH%zfbJx z+}hsOTQ|R{r8zp99UscfWQS&U;(>RS{h>89rBaCw&n8+&Z1++)G!JA_l3uBmNWx->eMa>3;@)BkL8VS*|7Z&< zcPjIp%Bwo(!DuWk84c721L+s%S3I0E(MnIk8GQCoYWmaEH70zYwDInb~! zu5_pYs83ol)uAPWU*1`;u~<{NM~@pebivg@hgGa5!fM!D`5=*n2oM1xKm>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