From b89d88ffcda383ed8666ba350f689d6c1eb97844 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Thu, 22 Jun 2023 17:00:36 -0400 Subject: [PATCH] Started Harri script. Pushed groups for Anthology. --- Scripts/API_Tests/create_groups.py | 70 +++++++++------ Scripts/GoogleScripts/GetProps.js | 3 + .../GoogleScripts/Harri_Get_Props/.clasp.json | 1 + .../GoogleScripts/Harri_Get_Props/GetProps.js | 87 +++++++++++++++++++ .../Harri_Get_Props/appsscript.json | 7 ++ .../GoogleScripts/_onboarding_old.html.liquid | 30 ------- 6 files changed, 142 insertions(+), 56 deletions(-) create mode 100644 Scripts/GoogleScripts/GetProps.js create mode 100644 Scripts/GoogleScripts/Harri_Get_Props/.clasp.json create mode 100644 Scripts/GoogleScripts/Harri_Get_Props/GetProps.js create mode 100644 Scripts/GoogleScripts/Harri_Get_Props/appsscript.json delete mode 100644 Scripts/GoogleScripts/_onboarding_old.html.liquid diff --git a/Scripts/API_Tests/create_groups.py b/Scripts/API_Tests/create_groups.py index 8587c129..8ec644ee 100644 --- a/Scripts/API_Tests/create_groups.py +++ b/Scripts/API_Tests/create_groups.py @@ -4,26 +4,39 @@ import Apikeys apikey = Apikeys.anthology groups_to_create = [ - "Engage", - "Encompass", - "Reach", - "Student", - "Learn", - "Baseline", - "Ally", - "Milestone", - "Raise", - "Accreditation", - "Program Review", - "Portfolio", - "Outcomes", - "Engage-Campus-wide Elections", - "Engage-Co-Curricular Paths", - "Engage-ECIA", - "Engage-Rooms and Reservations", - "Learn-Bb Reporting", - "Learn-A4L", -] + "Academic Economics", + "Academy Use/Navigation", + "Accreditation", + "Ally", + "Anthology 101", + "Baseline", + "Beacon", + "Course Evaluations", + "Evaluate", + "CVue", + "Data Strategy", + "Digital Assistant", + "Encompass", + "Engage", + "Faculty Development", + "Finance & HCM", + "Insight", + "Learn", + "Milestone", + "Occupation Insight", + "Outcomes", + "Payroll", + "Planning", + "Portfolio", + "Power BI", + "Professional Development", + "Program Review", + "Radius", + "Raise", + "Reach", + "Student", + "Talisma", + ] url = "https://api.northpass.com/v2/bulk/groups" headers = { @@ -33,10 +46,15 @@ headers = { } payload2 = [] for group in groups_to_create: - payload2.append({"name": group}) - payload = {"data": {"attributes": {"groups": payload2}}} + t1 = f"{group} - (T1)" + t2 = f"{group} - (T2)" + t3 = f"{group} - (T3)" -# print(payload) -response = requests.post(url, json=payload, headers=headers) -print(response.text) -# print(response) + payload = {"data": {"attributes": {"groups": + [{"name": t1}, + {"name": t2}, + {"name": t3}]}}} + # print(payload) + response = requests.post(url, json=payload, headers=headers) + print(response.status_code) + print(response) diff --git a/Scripts/GoogleScripts/GetProps.js b/Scripts/GoogleScripts/GetProps.js new file mode 100644 index 00000000..582fd177 --- /dev/null +++ b/Scripts/GoogleScripts/GetProps.js @@ -0,0 +1,3 @@ +function getProps() { + +} diff --git a/Scripts/GoogleScripts/Harri_Get_Props/.clasp.json b/Scripts/GoogleScripts/Harri_Get_Props/.clasp.json new file mode 100644 index 00000000..24f78e86 --- /dev/null +++ b/Scripts/GoogleScripts/Harri_Get_Props/.clasp.json @@ -0,0 +1 @@ +{"scriptId":"17cLm8wwin--btQr0A6G_QkxOeT2Q3QnL8mEup8ZThMTAPwrUw2qsyg6N","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GoogleScripts/Harri_Get_Props"} diff --git a/Scripts/GoogleScripts/Harri_Get_Props/GetProps.js b/Scripts/GoogleScripts/Harri_Get_Props/GetProps.js new file mode 100644 index 00000000..e6f8d456 --- /dev/null +++ b/Scripts/GoogleScripts/Harri_Get_Props/GetProps.js @@ -0,0 +1,87 @@ +const sheet = SpreadsheetApp.getActiveSheet(); +const apiKey = 'RfmxChNLLodO6M0Z88BwG9Xyu' + +function getUuids() { + var sheet = SpreadsheetApp.getActiveSheet(); + var numRows = sheet.getLastRow()-1; // Number of rows to process + var dataRange = sheet.getRange(2, 3, numRows, 1); + var values = dataRange.getValues(); + writeHeadings(); + + for (email in values){ + var row = values[email]; + var email = row[0] + var api_url = 'https://api.northpass.com/v2/people/?filter[email][eq]='+email; + const settings = { + async: true, + crossDomain: true, + method: 'GET', + headers: { + accept: 'application/json', + 'X-Api-Key': apiKey + } + }; + const sendMsg = UrlFetchApp.fetch(api_url, settings); + var uuidResponse = sendMsg.getContentText(); + var parsedata = JSON.parse(uuidResponse); + try { + var uuid = parsedata["data"][0]["id"]; + if (email != "") { + findRow(email, uuid); + } + } + catch(ex) { + Logger.log(ex) + continue + } + finally { + } + }; + }; + +function findRow(email, uuid){ + var sheetRow = SpreadsheetApp.getActiveSpreadsheet(); + var data = sheetRow.getDataRange().getValues(); + for(var i = 0; i -
-
- {% if features.learning_paths? %} -
- {% t shared.learning_paths %} -
- {% include "learning_paths_index", items: learning_paths.enrolled %} - {% endif %} -
- {% t shared.course_vocabulary.plural, key: current_school.course_vocabulary %} -
- {% include "courses_index", class: "col-xs-12 col-sm-6 np-stretch-content" %} -
- {% if features.training_events? %} -
-
- {% t .upcoming_events %} -
- {% include "training_events_dashboard" %} -
- {% endif %} -
- -{% include "footer" %} - -current_page: "/app/user-guides"