diff --git a/cartridges/int_bolt_custom/cartridge/templates/default/account/components/navTabs.isml b/cartridges/int_bolt_custom/cartridge/templates/default/account/components/navTabs.isml new file mode 100644 index 0000000..e1071d7 --- /dev/null +++ b/cartridges/int_bolt_custom/cartridge/templates/default/account/components/navTabs.isml @@ -0,0 +1,52 @@ + diff --git a/cartridges/int_bolt_custom/cartridge/templates/default/account/header.isml b/cartridges/int_bolt_custom/cartridge/templates/default/account/header.isml new file mode 100644 index 0000000..0680bff --- /dev/null +++ b/cartridges/int_bolt_custom/cartridge/templates/default/account/header.isml @@ -0,0 +1,33 @@ + + Bolt SSO change. Replace login button +
+ + + + + + + ${Resource.msg('link.header.login', 'account', null)} + +
+ + +
diff --git a/cartridges/int_bolt_custom/cartridge/templates/default/account/login.isml b/cartridges/int_bolt_custom/cartridge/templates/default/account/login.isml new file mode 100644 index 0000000..bb01122 --- /dev/null +++ b/cartridges/int_bolt_custom/cartridge/templates/default/account/login.isml @@ -0,0 +1,44 @@ + + + var assets = require('*/cartridge/scripts/assets.js'); + assets.addCss('/css/login.css'); + assets.addJs('/js/login.js'); + + +
+

${Resource.msg('header.hero.image.login', 'login', null)}

+
+
+ + +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
diff --git a/cartridges/int_bolt_custom/cartridge/templates/default/account/mobileHeader.isml b/cartridges/int_bolt_custom/cartridge/templates/default/account/mobileHeader.isml new file mode 100644 index 0000000..adebc57 --- /dev/null +++ b/cartridges/int_bolt_custom/cartridge/templates/default/account/mobileHeader.isml @@ -0,0 +1,36 @@ + + + + + diff --git a/cartridges/int_bolt_sfra/cartridge/client/default/js/main.js b/cartridges/int_bolt_sfra/cartridge/client/default/js/main.js index d77f399..a19020a 100644 --- a/cartridges/int_bolt_sfra/cartridge/client/default/js/main.js +++ b/cartridges/int_bolt_sfra/cartridge/client/default/js/main.js @@ -13,6 +13,7 @@ $(document).ready(function () { processInclude(require('base/components/clientSideValidation')); processInclude(require('base/components/countrySelector')); processInclude(require('base/components/toolTip')); + processInclude(require('./sso')); }); require('base/thirdParty/bootstrap'); diff --git a/cartridges/int_bolt_sfra/cartridge/client/default/js/sso.js b/cartridges/int_bolt_sfra/cartridge/client/default/js/sso.js new file mode 100644 index 0000000..6798488 --- /dev/null +++ b/cartridges/int_bolt_sfra/cartridge/client/default/js/sso.js @@ -0,0 +1,7 @@ +'use strict'; + +$(document).ready(function () { + $('.bolt-sso-custom').on('click', function (e) { + e.preventDefault(); // prevent URL redirection + }); +}); diff --git a/cartridges/int_bolt_sfra/cartridge/controllers/Account.js b/cartridges/int_bolt_sfra/cartridge/controllers/Account.js index 9215a12..e91ff6c 100644 --- a/cartridges/int_bolt_sfra/cartridge/controllers/Account.js +++ b/cartridges/int_bolt_sfra/cartridge/controllers/Account.js @@ -12,6 +12,9 @@ var BoltHttpUtils = require('int_bolt_core/cartridge/scripts/services/utils/http var LogUtils = require('int_bolt_core/cartridge/scripts/utils/boltLogUtils'); var log = LogUtils.getLogger('Login'); +var BoltPreferences = require('int_bolt_core/cartridge/scripts/services/utils/preferences'); +var configuration = BoltPreferences.getSitePreferences(); + // for SSO login during checkout, update dwsid in Bolt db. server.prepend('Show', function (req, res, next) { var boltOrderId = req.session.privacyCache.store.boltOrderId; @@ -46,4 +49,11 @@ function putSFCCObject(boltOrderId) { } } +server.append('Header', function (req, res, next) { + res.setViewData({ + config: configuration + }); + next(); +}); + module.exports = server.exports(); diff --git a/cartridges/int_bolt_sfra/cartridge/controllers/Login.js b/cartridges/int_bolt_sfra/cartridge/controllers/Login.js index 1347512..2a5c8e6 100644 --- a/cartridges/int_bolt_sfra/cartridge/controllers/Login.js +++ b/cartridges/int_bolt_sfra/cartridge/controllers/Login.js @@ -14,6 +14,9 @@ var LogUtils = require('int_bolt_core/cartridge/scripts/utils/boltLogUtils'); var OAuthUtils = require('int_bolt_core/cartridge/scripts/utils/oauthUtils'); var log = LogUtils.getLogger('Login'); +var BoltPreferences = require('int_bolt_core/cartridge/scripts/services/utils/preferences'); +var configuration = BoltPreferences.getSitePreferences(); + server.get('OAuthRedirectBolt', function (req, res, next) { if (!Site.getCurrent().getCustomPreferenceValue('boltEnableSSO')) { log.error('Bolt SSO feature is not enabled'); @@ -76,4 +79,11 @@ function renderError(res, next) { return next(); } +server.append('Show', function (req, res, next) { + res.setViewData({ + config: configuration + }); + next(); +}); + module.exports = server.exports(); diff --git a/cartridges/int_bolt_sfra/cartridge/templates/default/common/boltScripts.isml b/cartridges/int_bolt_sfra/cartridge/templates/default/common/boltScripts.isml index 51f63f5..c53f962 100644 --- a/cartridges/int_bolt_sfra/cartridge/templates/default/common/boltScripts.isml +++ b/cartridges/int_bolt_sfra/cartridge/templates/default/common/boltScripts.isml @@ -5,14 +5,5 @@ - - - SSO login and logout button - -
-