ICode9

精准搜索请尝试: 精确搜索
  • SAP 电商云 Spartacus UI 里的 InjectionToken 应用场景2021-11-01 14:03:58

    看个具体的例子: InjectionToken 构造函数,需要传一个类型参数进去。 这个 ActionReducerMap 的定义很讲究: export declare type ActionReducerMap<T, V extends Action = Action> = { [p in keyof T]: ActionReducer<T[p], V>; }; 使用这个类型时,需要传入两个类型参数 T 和

  • @ngrx/router-store 在 SAP 电商云 Spartacus UI 开发中的作用2021-11-01 14:03:17

    标题:@ngrx/router-store 的作用 官网 用于将 Angular Router 与 Store 连接的绑定。 在每个路由器导航周期中,会分派多个动作,让您可以监听路由器状态的变化。 然后,您可以从路由器的状态中选择数据,为您的应用程序提供附加信息。 安装: npm install @ngrx/router-store --save 之后,

  • 2021-10-28 SAP Spartacus SSR 性能方面的一些学习笔记2021-10-29 14:35:26

    如果客户已经拥有 CDN 缓存,可以不启用 cache:true, cacheSize:xxx 。 这种内存缓存功能仅适用于没有生产就绪 CDN 的简单店面。也就是说,如果客户没有任何外部缓存服务(akamai / cloudflare / 其他),他们可以尝试,至少暂时,使用 SSR 服务内存缓存和 cache: true (最好也使用 cacheSi

  • SAP Spartacus 里的 .release-it.json 文件2021-10-29 14:07:13

    在 SAP Spartacus package.json 里有一个依赖叫做 release-it: 这个工具的链接:https://github.com/release-it/release-it 这是一个用于自动化版本控制和包发布相关任务的通用 CLI 工具。 使用 release-it 进行版本管理,并通过其多功能配置、强大的插件系统和挂钩来执行任何

  • SAP 电商云 Spartacus UI product 明细页面的路由配置2021-10-27 14:33:40

    如果直接访问如下 url: http://localhost:4200/powertools-spa/en/USD/jerryproduct/3881018/Angle Grinder RT-AG 115 页面打开后,没有看到和 product 相关的执行逻辑: 这个 cxRoute: 'product' 是哪里维护的? 看这个高亮区域是从哪里赋值的? 在 routing.module.js 里,一个初始化

  • 如何在 SAP 电商云 Spartacus 代码里获取 Routes 路由信息2021-10-22 18:32:46

    使用如下代码: export class AppModule { constructor(private router: Router,protected injector: Injector){ this.router.events.subscribe((data) => { console.log('Jerry route event: ', data); }); const routeConfig: Router = this.in

  • 关于 SAP 电商云 Spartacus UI SSR 的 state transfer 问题2021-10-17 13:01:06

    我使用基于版本 3.4.5(某客户正在使用)的 Schematics 创建了一个店面,并在 SSR 模式下运行它。 我在浏览器中访问 http://localhost:4000/。 通过 Chrome 开发工具我知道主页的源代码是由 SSR 服务器成功生成了。 然而,即使在 SSR 模式下,我发现 /cms/pages OCC API 仍然是从客户端触

  • SAP 电商云 Spartacus UI SSR 单元测试里的 callFake2021-10-06 10:01:36

    callFake 的接口定义可以在 jasmine.js 里找到: SpyStrategy.callFake, 返回 Spy 对象。 spy1 即 originalEngine,二者指向同一个对象实例: 只要 spy1 即 originalEngine 这个函数被调用,则返回 callFake 指定的 mock 版本的实现:return originalEngineInstance,后者也是个 mock 对象

  • SAP 电商云 Spartacus UI 页面布局的设计原理2021-10-03 09:33:40

    Spartacus 每个 UI 划分成不同的区域 section,每个区域由若干个 slots 组成。每个 slot 可以包含一个或多个 CMS Component. 我曾经写过一篇 文章 详细介绍过。 以 homepage为例,其实现的 HTML 位置:projects\storefrontlib\src\layout\main\storefront.component.html 看这个 header

  • 如何在 SAP Commerce Cloud Portal 构建和部署 SAP Spartacus Storefront2021-10-02 10:00:56

    Commerce Cloud portal: CCV2 部署包含构建和部署两个子步骤。 首先登录 cloud portal,创建一个新 build: 点击 create 按钮: 输入构建的名称和托管要构建的代码库的 git 分支。名称只是一个标签,但是,我们按照惯例使用名称是为了更容易了解构建包含的内容。约定如下: spartacus-[hyb

  • 关于 SAP Spartacus SSR 3.4.5 版本优化的 reuseCurrentRendering2021-09-30 20:31:07

    Please note that concurrency: 50 (in SsrOptimizationOptions) means that OptimizedSsrEngine will perform at most 50 parallel rendering tasks. With the option reuseCurrentRendering enabled, it means: At most 50 different URLs can be rendered at once (regar

  • 如何在 SAP Spartacus 产品明细页面添加自定义 UI2021-09-27 17:34:38

    产品明细页面 Product Detail Page,简称 PDP. 首先在页面上找到 Component selector:cx-tab-paragraph-container: 对应的 Angular Component 名称:TabParagraphContainerComponent 四个 button 之后,在 active div 里,是 cx-product-details-tab: 其 Component:ProductDetailsTa

  • SAP Commerce Cloud Spartacus UI 的购物车 Cart 功能2021-09-25 19:01:05

    此功能是在 TUA Spartacus 库的 1.0 版中引入的。 购物车在 TUA Spartacus 与核心 Commerce Spartacus 中的工作方式不同,需要支持产品供应以及复杂的定价结构,以支持多种类型的收费,包括一次性收费、经常性收费和基于使用的收费。 在各种费用中,对于购物车,客户需要了解结帐时的立即付

  • SAP Commerce Cloud Spartacus UI 的购物车 Cart 功能2021-09-16 19:31:33

    此功能是在 TUA Spartacus 库的 1.0 版中引入的。 购物车在 TUA Spartacus 与核心 Commerce Spartacus 中的工作方式不同,需要支持产品供应以及复杂的定价结构,以支持多种类型的收费,包括一次性收费、经常性收费和基于使用的收费。 在各种费用中,对于购物车,客户需要了解结帐时的

  • 如何获取 SAP Commerce Cloud Spartacus UI 购物车 Cart 的加载状态2021-09-15 22:06:19

    在 Storefront AppModule 构造函数里注入 ActiveCartService: private cartService: ActiveCartService, 调用其 API: const loading$ = this.cartService.getLoading(); loading$.subscribe((data) => console.log('Jerry cart loading? ', data)); 打印出的日志: a

  • 如何获取 SAP Commerce Cloud Spartacus UI 购物车 Cart 的加载状态2021-09-15 14:59:56

    在 Storefront AppModule 构造函数里注入 ActiveCartService: private cartService: ActiveCartService, 调用其 API: const loading$ = this.cartService.getLoading(); loading$.subscribe((data) => console.log('Jerry cart loading? ', data)); 打印出的日志:

  • 关于 SAP Spartacus CSR fallback 之后,是否仍然会继续进行 SSR 的处理2021-09-02 23:03:54

    来自 nguniversal 的 express engine 渲染完了后,渲染完毕的 HTML 源代码保存在 150 行代码 html 里,callback 就是 Spartacus 团队开发的 ssr optimization engine 的实现: 回调执行时,maxRenderTimeout 不为空,说明 maxRenderTime 驱动的 setTimeout 尚未执行,这说明 maxRenderTime

  • SAP Spartacus 服务器端渲染单步调试步骤之二:在服务器端执行应用程序 Angular 代码2021-08-23 14:01:48

    前文:SAP Spartacus 服务器端渲染单步调试步骤之一:应用程序准备工作 入口: 进入 platform-server.js: 入口: 最终在服务器端执行 bootstrap,输入 Component 为 AppComponent: 这些调用栈和在客户端执行是一样的: 一旦进入这个调用,说明服务器端应用程序的渲染已经结束了: html 变量

  • SAP Spartacus 如何重定义登录 Login Component2021-08-23 14:00:42

    首先在一个标准的 Storefront 上,找到该 Component 的 selector 找到其 Component 名称:LoginComponent 然后找到该 Component 的路径,位于 feature-libs 下面的 user 模块内: feature-libs\user\account\components\login\login.component.ts 在该模块内,找到了其与 CMS Component Lo

  • SAP Spartacus 因为 refresh token 刷新令牌过期后显示用户重新登录页面的逻辑2021-08-16 14:35:17

    在 auth.interceptor.ts 里判断,token 是否过期: isExpiredToken: 通过服务器端返回的错误类型判断。 如果确实过期了,首先调用 handleExpiredToken, 返回的 Observable 对象,使用该 token,重新发送之前因为 token 过期而失效的请求:createNewRequestWithNewToken: stream 是一个 Behav

  • 关于 SAP Spartacus defaultCmsContentProvider 和默认 layoutConfig 的一些测试2021-08-16 14:33:07

    以 Spartacus-b2c-configuration.module.ts 文件为例: 这些默认的配置文件,都是从另一个库,即 @Spartacus/Storefront 里导入的,后者的入口是 public_api 文件: 在这个文件里加上一行打印语句,可以看到所有默认的配置: 这些默认配置硬编码在 layout-config.ts 内: 如果注释掉一部

  • SAP Spartacus 里的 icon 设计2021-08-16 14:31:20

    同 SAP Fiori 一样,SAP Spartacus 里也有大量的自定义 icon 设计,比如下图的 iconTypes.RESET: 需要调用 iconLoader 获取 RESET icon 对应的 HTML 源代码: 动态创建新的 link 标签,并加载对应的 css: css 地址:https://use.fontawesome.com/releases/v5.8.1/css/all.css SAP Spar

  • 基于 SAP Spartacus 的 SAP 电商云 SEO 搜索引擎优化的一个例子2021-08-07 17:04:50

    这是一个客户采取 SAP Spartacus 实施的 Storefront - 电商店铺,已经上线了: https://lego.yellowblocks.me/en-ae/ 该网站开启了 SSR 即服务器端渲染模式,便于网站的内容被网络爬虫索引: 该页面源代码内的 title 标签内包含的内容,会出现在搜索引擎结果列表的网站标题区域内: descri

  • Debug a Server–Side Rendered SAP Spartacus Storefront Using Chrome Dev Tools2021-08-07 17:02:28

    In SAP Spartacus document there is a page for "How to Debug a Server–Side Rendered Storefront" using Visual Studio Code. https://sap.github.io/spartacus-docs/3.x/how-to-debug-server-side-rendered-storefront/ This document just introduces another

  • SAP Spartacus 会使用 Session timeout 吗?2021-08-07 16:34:09

    问题:Where to configure session timeout in Spartacus 答案 我假设您使用 Hybris OAuth 服务器的默认身份验证流程(密码流程)。 在这种情况下,会话长度是通过后台的 OAuth 客户端设置来控制的。 但是,要知道会话何时到期,您可以检查令牌有效负载 (AuthStorageService.getToken)。属性

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有