SAP Spartacus在某些屏幕尺寸下无法正常工作的原因分析
有个使用SAP Spartacus的客户遇到一个问题:
We are getting one issue in our Spartacus application (currently we are on 2.1 version).
When we are trying to load checkout-login page with 100% zoom in the browser, it is loading not-found page instead of checkout-login page and when the same page is refreshed with 90% zoom in the browser, we can see the correct checkout-login page with proper data.
这个问题乍一看有点奇怪,当浏览器缩放比率为90%时,checkout-login 页面可以正常工作,但是当缩放率调至100%时,反而不能正常工作了,会显示not-found页面。
We checked the cms-page.guard.ts file in that it is going to canActivateNotFoundPage method instead of canActivatePage from canActivate Method.
原因分析
we found an error in “CustomOccCmsPageNormalizer” at:
问题是下面这段客户自开发代码引起的:
accountNavigationChildren = accountNavigationChildren.concat(
supportComponentData.navigationNode
);
It seems like “supportComponentData” is undefined in some case. This variable contains the “MySupportComponent” component from the response. Since “supportComponentData” is undefined an error is thrown which causes the “checkout-login” page rendering to fail. Spartacus then falls back to getting the “not found” page.
To explain further, in the “CmsPageGuard”, Spartacus calls “CmsService.getPage” which will try to load the checkout page.
Since there is an error in the page normalizer, the “CmsService” will return “false” to the “CmsPageGuard” meaning the page wasn’t rendered. The “CmsPageGuard” then goes ahead and requests the “not found” page.
Because of an “if statement” wrapping the failing logic, the problem is only visible for screen sizes between 768 and 1399 (inclusively).
这个问题只有在屏幕尺寸位于区间768~1399区域内才能重现。
Additionally, we were not able to witness this same problem on the d1 server which might mean that the p1 server is missing the “MySupportComponent”.
相关文章
- SAP Fiori Elements List Report 列表宽度决定逻辑的单步调试
- SAP UI5应用在SAP WebIDE里clone之后出现404 not found error for sap-ui-core.js错误的原因分析
- SAP UI5 js file will be executed immediately after downloaded successfully
- SAP ABAP OData 服务如何支持删除(Delete)操作试读版
- SAP ABAP Platform 1909最新版的 docker 镜像
- SAP CRM HANA report里 默认filter 的工作机制分析
- SAP CRM Fiori 应用 My Opportunity应用点击Edit后出现time out的错误分析
- SAP WebClient UI界面元素ID生成的逻辑分析
- 如何分析SAP ABAP的SYSTEM_NO_ROLL运行时错误
- SAP ABAP和C4C,Hybris Commerce里一些性能分析工具
- SAP ABAP Netweaver里的SE80事务码是如何响应用户请求的
- SAP CRM One Order关于索引表CRMD_ORDER_INDEX的一些性能问题的分析
- 如何在SAP ABAP development studio里进行代码coverage分析
- how SAP OData supported option in odata eq ne lt gt?
- SAP 电商云 Spartacus UI 的 checkout 场景中的串行请求设计分析
- 如何修改 SAP Spartacus CMS API 默认的 endpoint
- SAP Cloud for Customer的跳转链接制作navigation link
- SAP table HRP1000的妙用
- 如何分析SAP CRM UI label显示成technical name的问题
- 在SAP HANA Express Edition里进行文本分析
- SAP HANA里的情感分析实现的SQLScript代码
- 如何在 Web 应用里消费 SAP Leonardo 的机器学习 API
- 如何在SAP云平台上使用MongoDB服务
- SAP UI5 日期类型 sap.ui.model.type.Date 的显示格式问题分析
- SAP UI5 batch 请求的响应解析流程分析
- 深入掌握 SAP Fiori Elements 工作原理的前提条件:理解 Smart Field
- SAP移动解决方案之Cordova技术架构综述
- 31. SAP UI5 Fiori 应用在启动时向 ABAP 后台发起的 OData 请求序列的顺序和作用分析