Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshakb committed Aug 10, 2023
1 parent ca5ca25 commit 19f7991
Show file tree
Hide file tree
Showing 21 changed files with 17,709 additions and 152 deletions.
6 changes: 3 additions & 3 deletions cartridges/bm_pinterest/cartridge/controllers/PinterestBM.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function verifyAllDomains() {
}

return result;
};
}

/**
* Handle Pinterest App Linking Callback
Expand Down Expand Up @@ -221,7 +221,7 @@ function handleConnectionCallback(httpParameterMap) {
viewData.pinterestBaseUrl = siteCurrent.getCustomPreferenceValue('pinterestIntegrationBaseURL');

return viewData;
};
}

/**
* Handle Pinterest App Disconnect
Expand Down Expand Up @@ -288,7 +288,7 @@ function handleDisconnection() {
}

return viewData;
};
}

server.get('Start', server.middleware.https, function (req, res, next) {
var httpParameterMap = request.getHttpParameterMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function getCatalogIDs() {
var resultCatalogFeeds = pinterestCatalogFeedsService.call();

if (resultCatalogFeeds.ok) {
JSON.parse(resultCatalogFeeds.object).items.forEach(catalog => {
JSON.parse(resultCatalogFeeds.object).items.forEach(function(catalog){
//only grab active catalogs matching this site
if (
catalog.status === 'ACTIVE'
Expand All @@ -24,7 +24,7 @@ function getCatalogIDs() {
}

return allCatalogIDs;
};
}

function getCatalogs() {
var pinterestCatalogFeedsService = require('*/cartridge/scripts/services/pinterestCatalogFeeds');
Expand All @@ -33,7 +33,7 @@ function getCatalogs() {
var resultCatalogFeeds = pinterestCatalogFeedsService.call();

if (resultCatalogFeeds.ok) {
JSON.parse(resultCatalogFeeds.object).items.forEach(catalog => {
JSON.parse(resultCatalogFeeds.object).items.forEach(function(catalog){
//only grab active catalogs matching this site
if (
catalog.status === 'ACTIVE'
Expand All @@ -48,7 +48,7 @@ function getCatalogs() {
}

return allCatalogLocales;
};
}

module.exports = {
getCatalogIDs: getCatalogIDs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function getAllSites() {
var resultWebsites = pinterestUserWebsitesService.call();
if (resultWebsites.ok) {
apiSitesObject = JSON.parse(resultWebsites.object);
apiSitesObject.items.forEach(item => {
apiSitesObject.items.forEach(function(item){
if (item.status === 'verified') {
apiSitesVerified.push(item.website);
} else {
Expand All @@ -24,7 +24,7 @@ function getAllSites() {
var allSitesData = [];
var locales = site.allowedLocales.toArray();

locales.forEach(locale => {
locales.forEach(function(locale){
if (locale != 'default' && locales.length > 1) {
request.setLocale(locale);

Expand Down Expand Up @@ -61,7 +61,7 @@ function getAllSites() {
apiSitesVerified: apiSitesVerified,
apiSitesNotVerified: apiSitesNotVerified
};
};
}

module.exports = {
getAllSites: getAllSites
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function isConnected(businessAccountConfig) {
}

return isConnected;
};
}

/**
* Get Pinterest Account Config
Expand Down Expand Up @@ -67,7 +67,7 @@ function getBusinessAccountConfig() {
} else {
return data;
}
};
}

/**
* Save Pinterest Account Config
Expand Down Expand Up @@ -112,7 +112,7 @@ function setBusinessAccountConfig(pinterestAppID, pinterestConfigurationData) {

return false;
}
};
}

/**
* Get site/env unique id
Expand All @@ -126,7 +126,7 @@ function getExternalBusinessID(advertiserID, siteCurrent) {
} else {
return null;
}
};
}

module.exports = {
isConnected: isConnected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ exports.beforeStep = function () {
if (siteLocales.length === 1 || (siteLocales[i] && siteLocales[i] !== 'default')) {

try {
var configCountry = configCountries.filter(locale => locale.id === siteLocales[i]);
var configCountry = configCountries.filter(function(locale){return locale.id === siteLocales[i]});
localeCurrencyCode = configCountry && configCountry.length? configCountry.pop().currencyCode : siteCurrent.defaultCurrency;
} catch (e) {
localeCurrencyCode = siteCurrent.defaultCurrency;
Expand Down Expand Up @@ -204,7 +204,7 @@ exports.write = function (lines) {

//overwrite old .xml file with newly created .tmp.xml since there were no errors
file.renameTo(new File(lines[i].folderFile.fullPath + File.SEPARATOR + pinterestHelpers.getCatalogFileName(lines[i].locale, false)));
};
}
} catch (e) {
processedAll = false;
pinterestLogger.warn('Pinterest Warning: catalog processing error, ' + ((e && e.message)? e.message : 'unknown error'));
Expand Down Expand Up @@ -246,7 +246,7 @@ exports.afterStep = function () {
request.setLocale(siteLocales[i]);

try {
var configCountry = configCountries.filter(locale => locale.id === siteLocales[i]);
var configCountry = configCountries.filter(function(locale){return locale.id === siteLocales[i]});
localeCurrency = configCountry && configCountry.length? configCountry.pop().currencyCode : siteCurrent.defaultCurrency;
} catch (e) {
localeCurrency = siteCurrent.defaultCurrency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports.beforeStep = function () {
var pinterestLocale = siteLocales[i];

try {
var configCountry = configCountries.filter(locale => locale.id === siteLocales[i]);
var configCountry = configCountries.filter(function(locale){return locale.id === siteLocales[i]});
currency = dw.util.Currency.getCurrency(configCountry && configCountry.length? configCountry.pop().currencyCode : siteCurrent.defaultCurrency);
} catch (e) {
currency = dw.util.Currency.getCurrency(siteCurrent.defaultCurrency);
Expand Down
2 changes: 1 addition & 1 deletion cartridges/bm_pinterest/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "bm_pinterest",
"version": "0.1.1"
"version": "0.1.2"
}
Loading

0 comments on commit 19f7991

Please sign in to comment.