@lendi/navbar 7.14.7 → 7.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,3 +52,6 @@ export const MultiNavbar = () => {
52
52
 
53
53
  This component need to know environmentContext to describe apiBaseUrl so that it could make some API call specific to Lendi use case
54
54
  like getting broker information and get chat channel information.
55
+
56
+ This package passes the returnURL on clicking Sign-in button so that sign-in flow knows where to come back after authentication.
57
+ The usage of @lendi/navbar on homepage will set dashboard url as returnURL on clicking the sign-in button(SUB-2409)
@@ -615,9 +615,18 @@ var DesktopActionsWrapper = styled__default["default"].div.withConfig({
615
615
  componentId: "lui__sc-jh42qz-0"
616
616
  })(["display:flex;", ";"], breakpoint.between('mobile', 'desktop')(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n display: none;\n "]))));
617
617
 
618
+ var DEFAULT_DASHBOARD_URL = '/v2/dashboard/';
618
619
  var getSignInURL = (brand, env, returnURL) => {
619
620
  var urls = lalaUtils.getURLs(brand, lalaReact.Type.Customer, env);
620
- return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(returnURL !== null && returnURL !== void 0 ? returnURL : urls.origin));
621
+ var dashboardReturnURL = brand === lalaReact.Brand.Domain ? "/loanfinder".concat(DEFAULT_DASHBOARD_URL) : DEFAULT_DASHBOARD_URL;
622
+ /**
623
+ * The return URL should be based on origin
624
+ * If origin is homepage or not given, then return URL should be dashboard
625
+ * else, whatever is given.
626
+ */
627
+
628
+ var newReturnURL = returnURL === undefined || returnURL === '' || returnURL === urls.origin ? dashboardReturnURL : returnURL;
629
+ return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(newReturnURL));
621
630
  };
622
631
 
623
632
  var getEnvFromHostname = hostname => {
@@ -367,9 +367,9 @@ var _templateObject$a, _templateObject$9, RestrictionContext = React__default.de
367
367
  }, DesktopActionsWrapper = styled__default.default.div.withConfig({
368
368
  displayName: "style__DesktopActionsWrapper",
369
369
  componentId: "lui__sc-jh42qz-0"
370
- })([ "display:flex;", ";" ], breakpoint.between("mobile", "desktop")(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral([ "\n display: none;\n " ])))), getSignInURL = (brand, env, returnURL) => {
371
- var urls = lalaUtils.getURLs(brand, lalaReact.Type.Customer, env);
372
- return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(null != returnURL ? returnURL : urls.origin));
370
+ })([ "display:flex;", ";" ], breakpoint.between("mobile", "desktop")(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral([ "\n display: none;\n " ])))), DEFAULT_DASHBOARD_URL = "/v2/dashboard/", getSignInURL = (brand, env, returnURL) => {
371
+ var urls = lalaUtils.getURLs(brand, lalaReact.Type.Customer, env), dashboardReturnURL = brand === lalaReact.Brand.Domain ? "/loanfinder".concat(DEFAULT_DASHBOARD_URL) : DEFAULT_DASHBOARD_URL, newReturnURL = void 0 === returnURL || "" === returnURL || returnURL === urls.origin ? dashboardReturnURL : returnURL;
372
+ return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(newReturnURL));
373
373
  }, getEnvFromHostname = hostname => null != hostname && hostname.includes("dev.") ? lalaReact.Environment.Development : null != hostname && hostname.includes("stg.") || null != hostname && hostname.includes("stage.") ? lalaReact.Environment.Staging : null != hostname && hostname.includes("preprod.") ? lalaReact.Environment.Preproduction : null != hostname && hostname.includes("lendi.com.au") || null != hostname && hostname.includes("domain.com.au") || null != hostname && hostname.includes("aussie.com.au") ? lalaReact.Environment.Production : lalaReact.Environment.Development, RenderChatOrSideBar = _ref => {
374
374
  var {openCommPanel: openCommPanel = (() => {}), teamMember: teamMember, dashboardVariant: dashboardVariant, hasUnreadMessages: hasUnreadMessages} = _ref, primaryLabel = null != teamMember && teamMember.firstName ? "Talk to ".concat(teamMember.firstName) : LABEL_TALK_TO_EXPERT;
375
375
  return jsxRuntime.jsx(TalkExpertAction, {
@@ -588,9 +588,18 @@ var DesktopActionsWrapper = styled.div.withConfig({
588
588
  componentId: "lui__sc-jh42qz-0"
589
589
  })(["display:flex;", ";"], between('mobile', 'desktop')(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n display: none;\n "]))));
590
590
 
591
+ var DEFAULT_DASHBOARD_URL = '/v2/dashboard/';
591
592
  var getSignInURL = (brand, env, returnURL) => {
592
593
  var urls = getURLs(brand, Type.Customer, env);
593
- return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(returnURL !== null && returnURL !== void 0 ? returnURL : urls.origin));
594
+ var dashboardReturnURL = brand === Brand.Domain ? "/loanfinder".concat(DEFAULT_DASHBOARD_URL) : DEFAULT_DASHBOARD_URL;
595
+ /**
596
+ * The return URL should be based on origin
597
+ * If origin is homepage or not given, then return URL should be dashboard
598
+ * else, whatever is given.
599
+ */
600
+
601
+ var newReturnURL = returnURL === undefined || returnURL === '' || returnURL === urls.origin ? dashboardReturnURL : returnURL;
602
+ return "".concat(urls.authenticate, "?returnURL=").concat(encodeURIComponent(newReturnURL));
594
603
  };
595
604
 
596
605
  var getEnvFromHostname = hostname => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lendi/navbar",
3
3
  "access": "restricted",
4
- "version": "7.14.7",
4
+ "version": "7.14.8",
5
5
  "license": "ISC",
6
6
  "source": "src/index.tsx",
7
7
  "main": "dist/navbar.cjs.js",