Anthology CSV parse update. Backed up Supplier Prod's templates.
This commit is contained in:
@ -71,6 +71,15 @@ $(document).ready(function() {
|
||||
filterWrapper.classList.toggle("filter-active");
|
||||
});
|
||||
|
||||
document.addEventListener("click", function(event) {
|
||||
const filterWrapper = document.querySelector('#carousel-filter-wrapper-analysis');
|
||||
const isClickInside = filterWrapper.contains(event.target) || event.target.id === "filterToggleAnalysis";
|
||||
|
||||
if (!isClickInside) {
|
||||
filterWrapper.classList.remove("filter-active");
|
||||
}
|
||||
});
|
||||
|
||||
function filterCardsAnalysis() {
|
||||
const selectedFilters = Array.from(document.querySelectorAll('#filterContentAnalysis .filter-checkbox:checked')).map(checkbox => checkbox.id.replace('a-', ''));
|
||||
const cards = document.querySelectorAll('.analysis-courses');
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="carousel-wrapper">
|
||||
<div class="carousel-heading">Getting Started</div>
|
||||
<div class="carousel-filter-wrapper">
|
||||
<div class="carousel-filter-wrapper" id="carousel-filter-wrapper-started">
|
||||
<div class="filter-container">
|
||||
<div class="filter" id="filterToggle">Filter</div>
|
||||
</div>
|
||||
@ -69,7 +69,14 @@ $(document).ready(function() {
|
||||
const filterWrapper = document.querySelector('.carousel-filter-wrapper');
|
||||
filterWrapper.classList.toggle("filter-active");
|
||||
});
|
||||
document.addEventListener("click", function(event) {
|
||||
const filterWrapper = document.querySelector('#carousel-filter-wrapper-started');
|
||||
const isClickInside = filterWrapper.contains(event.target) || event.target.id === "filterToggle";
|
||||
|
||||
if (!isClickInside) {
|
||||
filterWrapper.classList.remove("filter-active");
|
||||
}
|
||||
});
|
||||
function filterCards() {
|
||||
const selectedFilters = Array.from(document.querySelectorAll('.filter-checkbox:checked')).map(checkbox => checkbox.id.replace('gs-', ''));
|
||||
const cards = document.querySelectorAll('.gettin-started-courses');
|
||||
|
||||
@ -71,6 +71,15 @@ $(document).ready(function() {
|
||||
filterWrapper.classList.toggle("filter-active");
|
||||
});
|
||||
|
||||
document.addEventListener("click", function(event) {
|
||||
const filterWrapper = document.querySelector('#carousel-filter-wrapper-merchandising');
|
||||
const isClickInside = filterWrapper.contains(event.target) || event.target.id === "filterToggleMerchandising";
|
||||
|
||||
if (!isClickInside) {
|
||||
filterWrapper.classList.remove("filter-active");
|
||||
}
|
||||
});
|
||||
|
||||
function filterCards1() {
|
||||
const selectedFilters = Array.from(document.querySelectorAll('#filterContentMerchandising .filter-checkbox:checked')).map(checkbox => checkbox.id.replace('m-', ''));
|
||||
const cards = document.querySelectorAll('.merchandising-courses');
|
||||
|
||||
@ -220,6 +220,7 @@ section {
|
||||
}
|
||||
.slick-track {
|
||||
display: flex !important;
|
||||
margin: 0 !important
|
||||
}
|
||||
.slick-slide {
|
||||
height: auto !important;
|
||||
|
||||
@ -6,9 +6,9 @@ function main() {
|
||||
while (files.hasNext()) {
|
||||
var file = files.next();
|
||||
var getDate = new Date();
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh');
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
|
||||
var fileDate = file.getDateCreated();
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh');
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
|
||||
if (date == fileDateFormatted) {
|
||||
Logger.log("Updated: "+file)
|
||||
var updated_file = file.getBlob()
|
||||
@ -34,10 +34,10 @@ function moveOldFiles() {
|
||||
while (files.hasNext()) {
|
||||
var file = files.next();
|
||||
var getDate = new Date();
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh' );
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh:mm' );
|
||||
var fileDate = file.getDateCreated();
|
||||
Logger.log("FILE: "+file+", DATE UPLOADED: "+fileDate)
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh');
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
|
||||
if (date != fileDateFormatted) {
|
||||
const destination = DriveApp.getFolderById('1cIPZCgoj8XdjMIfL75QfomJAxsy2smGT');
|
||||
file.moveTo(destination);
|
||||
@ -144,12 +144,9 @@ function updatedDomainsOnly(domains_to_update) {
|
||||
const dom = array.shift();
|
||||
const groups = array;
|
||||
Logger.log("{domain_to_update : {domain :"+dom+", group_ids : "+groups+" }}")
|
||||
sendWebhook({domain_to_update : { domain: dom, group_ids: groups }})
|
||||
//sendWebhook({domain_to_update : { domain: dom, group_ids: groups }})
|
||||
replaceOnSheet(dom, groups);
|
||||
}
|
||||
// MailApp.sendEmail("nrasmussen@gainsight.com",
|
||||
// "Anthology has submitted a CSV",
|
||||
// "Here are the domains that will be updated: "+JSON.stringify(noErrorObj)+"\n\n"+"Group Errors (they likely don't exist): "+JSON.stringify(errorList));
|
||||
MailApp.sendEmail("amitd@anthology.com",
|
||||
"Anthology has submitted a CSV",
|
||||
"Here are the domains that will be updated: "+JSON.stringify(noErrorObj)+"\n\n"+"Group Errors (they likely don't exist): "+JSON.stringify(errorList));
|
||||
@ -165,13 +162,14 @@ function replaceOnSheet(dom, groups) {
|
||||
|
||||
let boo = sheet.createTextFinder(dom).findNext()
|
||||
if (boo != null ) {
|
||||
//Logger.log("Replace on Sheet Domain: "+dom)
|
||||
//Logger.log("New groups: "+groups)
|
||||
Logger.log("Replace on Sheet Domain: "+dom)
|
||||
Logger.log("New groups: "+groups)
|
||||
group2 = []
|
||||
currCell = boo.getRowIndex();
|
||||
groups.forEach(item => { if (item.length > 0) { group2.push(item) }});
|
||||
group2 = [group2];
|
||||
//Logger.log(group2);
|
||||
Logger.log(group2);
|
||||
sheet.getRange(currCell, 1, 1, 100).clear();
|
||||
sheet.getRange(currCell, 1).setValue(dom);
|
||||
sheet.getRange(currCell, 2, 1, group2[0].length).setValues(group2)
|
||||
} else {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const apiKey = '8ALsk8jDOlynEwn8ScMBSnG87';
|
||||
const apiKey = 'ANTHOAPIKEY';
|
||||
|
||||
function main() {
|
||||
prepareSheet();
|
||||
@ -14,14 +14,15 @@ function main() {
|
||||
var updated_file = file.getBlob();
|
||||
var updated_blob = updated_file.getDataAsString();
|
||||
var updated_data = Utilities.parseCsv(updated_blob, ',');
|
||||
var full_data = Utilities.parseCsv(updated_blob, ',');
|
||||
} else if (date != fileDateFormatted) {
|
||||
var outdated_file = file.getBlob();
|
||||
var outdated_blob = outdated_file.getDataAsString();
|
||||
var outdated_data = Utilities.parseCsv(outdated_blob, ',');
|
||||
}
|
||||
}
|
||||
fullParse(updated_data);
|
||||
austinComparseData(outdated_data, updated_data)
|
||||
austinComparseData(outdated_data, updated_data);
|
||||
fullParse(full_data);
|
||||
moveOldFiles();
|
||||
}
|
||||
|
||||
@ -93,6 +94,7 @@ function austinComparseData(outdated_data, updated_data) {
|
||||
}
|
||||
|
||||
function quickParse(domains_to_update) {
|
||||
Logger.log("Quick Parse Item: "+domains_to_update)
|
||||
for (var x = 1; x < domains_to_update.length; x++) {
|
||||
var array = domains_to_update[x];
|
||||
for (var i = 1; i < array.length; i++) {
|
||||
@ -111,7 +113,7 @@ function quickParse(domains_to_update) {
|
||||
const sendMsg = UrlFetchApp.fetch(api_url, settings);
|
||||
var uuidResponse = sendMsg.getContentText();
|
||||
var parseData = JSON.parse(uuidResponse)
|
||||
Logger.log("Austin:"+parseData)
|
||||
Logger.log("Austin Check:"+item)
|
||||
var groupID = parseData['data'][0]['id']
|
||||
var groupName = array.indexOf(item);
|
||||
if (groupName != -1) {
|
||||
@ -146,7 +148,7 @@ function fullParse(updated_data) {
|
||||
const sendMsg = UrlFetchApp.fetch(api_url, settings);
|
||||
var uuidResponse = sendMsg.getContentText();
|
||||
var parseData = JSON.parse(uuidResponse)
|
||||
Logger.log("FullParse:"+parseData)
|
||||
Logger.log("Current Check:"+item)
|
||||
var groupID = parseData['data'][0]['id']
|
||||
var groupName = array.indexOf(item);
|
||||
if (groupName != -1) {
|
||||
|
||||
Reference in New Issue
Block a user