ICode9

精准搜索请尝试: 精确搜索
  • SAP Spartacus B2B 页面 Disable 按钮的显示原理2021-05-09 21:34:41

    SAP Spartacus B2B 页面 disable 按钮如下图所示。 这个高亮的 disable 按钮,和左边相邻的 Edit 按钮,实现位于不同的 Component. disable 按钮有单独的实现 Component:toggle-status.component.ts, selector: cx-org-toggle-status 在 B2B Launchpad 6 个 tile 里都消费了该 Compo

  • SAP Spartacus 升级时关于 schematics 的更新2021-05-09 21:33:32

    When upgrading Spartacus to a new major version (for example, from 3.x to 4.0), the Spartacus migration mechanism automatically implements fixes for code that is modified or removed in the new version. 当升级 Spartacus 到新的 major 版本时,Spartacus migration

  • SAP Spartacus B2B 页面 Popover Component 的条件显示逻辑2021-05-09 21:32:23

    如下图所示,这个 B2B 页面 的 Popover Component: 触发其的按钮位于 cx-org-card 内: 而下面这个 assigned users 明细页面,为什么就没有显示 Popover Component 的(i) 按钮了呢? 究其原因,selector cx-org-card 对应 CardComponent,在其模板实现里,有一个标志位,控制是否显示 Popover C

  • SAP Spartacus SplitViewComponent Migration 的一个具体例子2021-05-05 18:00:33

    参考 Pull Request:https://github.com/SAP/spartacus/pull/9946/files 首先在 docs/migration/3.0_md 里添加文字描述: projects/schematics/src/migrations/3_0/constructor-deprecations/constructor-deprecations.ts 在 CONSTRUCTOR_DEPRECATION_DATA 数组里,添加一个新元

  • SAP Spartacus B2B 页面 Disable Confirmation 对话框的显示原理2021-05-04 17:01:03

    该按钮的实现位于 toggle-status.component.html 里,点击后,可以对当前显示的 B2B item 进行 activation 和 deactivation 操作。 toggle(item) 方法的实现: 如果当前 item 处于 active 状态,则当前 toggle 应该执行 deactivation 操作,调用通过构造函数注入的 messageService,

  • SAP Spartacus B2B 列表页面的 (i) icon popover Component 的声明位置2021-05-03 13:35:18

    SAP Spartacus B2B 页面的列表页面,一共有 6 个类似 SAP Fiori Language 里的 tile(磁贴): 点击去之后,能看到列表页面有一个绿色 icon 图标,点击之后,弹出一个 Popover Component: 第一个疑问就是:我们需要在 6 个 不同的 tile 对应的列表页面里,重复定义 6 次 这个 Popover Component

  • SAP Spartacus B2B OrgUnit 和 OrgUser 的路由映射差异比较2021-05-03 13:34:29

    SAP Spartacus B2B 页面类似 SAP Fiori Launchpad,共有 6 个 tile(磁贴),点击某个磁贴,能跳转到对应的列表页面。 路由映射就是指点击某个 url 之后(例如上图所示的例子),应该激活哪一个 Angular Component. 例如上图 User tile,通过 a 标签实现,点击之后,会跳转到其 href 属性指向的 url

  • SAP Spartacus Popover Directive 构造函数的用途分析2021-05-03 13:34:15

    该构造函数位于文件 popover.directive.ts 里: 第 11 行 cxPopOver Directive 施加到 button 元素上之后,运行时,cxPopOver Directive 的构造函数触发。其参数,既有应用程序定义的类型,比如 PositioningService, 也有框架使用的类型,比如 ElementRef,ViewContainerRef 等等。 element

  • SAP Spartacus unit detail 页面显示后自动 focus 设置的原理2021-04-17 17:34:38

    这个自动 focus 设置的效果是:我们从 Spartacus Unit list 页面,随便选择一行,进入明细页面之后: 键盘 focus 会自动停留在 detail 页面(下图右边红色矩形框内)第一个 focusable 的元素上: 敲回车试试: 发现 (i) icon 是 unit 明细页面第一个 focusable 的元素。 这个功能的实现原理:

  • SAP Spartacus 如何借助env-cmd 实现 B2B 和 B2C 功能启动的无缝切换2021-04-12 13:58:25

    在之前的 SAP Spartacus 标准开发中,每次我从 Github 上 clone 了最新的代码后,必须手动修改 environment.ts 里的配置值,将 CX_BASE_URL 和 b2b 修改成实际值: 后来我研究了一下 package.json 里定义的脚本:发现使用了 env-cmd 这个工具: env-cmd --no-override -e dev,b2c,$S

  • 如何在SAP Spartacus category 页面里拿到当前的category信息2021-04-06 22:33:18

    需求 https://stackoverflow.com/questions/59950572/how-to-access-the-current-categorydata-in-a-category-page 实现原理 AFAIK, currently we do not have anything similar to CurrentProductService for current category. 当前 SAP Spartacus 标准实现里,缺乏类似 Curren

  • SAP Spartacus CMS 页面加载逻辑和性能的优化2021-04-03 09:30:04

    https://github.com/SAP/spartacus/issues/3649 SAP Commerce Cloud CMS 页面加载的一些优化点: Payload of the CMS page structure - 待加载CMS 页面结构的负载Splitting the CMS page structure in both page and page template CMSimprove cache-ability of the CMS page

  • 如何让SAP Spartacus ng build生成的JavaScript资源附带上store ID2021-02-19 11:33:26

    问题 As we are migrating our storefront to Spartacus, we can see the following JS resources generated do not contain the store id and this is causing issues with out cdn as we have multiple origin servers where to route the requests for this JS files. /r

  • SAP Spartacus翻译i18n - internationalization的工作原理2021-02-07 21:33:07

    需求:弄清楚UI上这个标题,是怎么渲染出来的: 在工程里找到了这个文件: feature-libs\organization\administration\assets\translations\en\units.i18n.ts 结构orgUnit的字段header:orgUnit.header, 对应了应用Component html里的key: 通过Spartacus 团队开发的cxTranslate pipe

  • SAP Spartacus central Travis build的lint环节2021-02-01 13:29:58

    起始命令: Running styleslint 260yarn run v1.22.5 261$ stylelint “{projects,feature-libs}/**/*.scss” 262Done in 1.02s. 263Validating code linting 264Linting “storefrontapp”… Lint warnings found in the listed files. 680Linting “storefrontlib”… 68

  • SAP UI的加载动画效果和幽灵设计(Ghost Design)2021-01-31 17:02:17

    这是Jerry 2021年的第 14 篇文章,也是汪子熙公众号总共第 285 篇原创文章。 在本篇文章之前,Jerry 印象最深的幽灵,应该要算《星际争霸I》里人族能够隐形的空中单位 Wraith( 幽灵战机 ),以及能施放核弹的 Ghost( 幽灵特工). 上周 Jerry 做 SAP Spartacus 开发时,接触到一个新的和

  • SAP Spartacus一个客户项目无法启用SSR服务器端渲染的实际例子和分析方法2021-01-28 11:01:35

    Customer support - SSR not working Main problem In the codebase I found multiple instances of access to properties inside this.windowRef.nativeWindow. This works correctly on client side, but on server side (SSR) nativeWindow is undefined. Recommendation

  • 如何使用schematics快速创建全新的SAP Spartacus Storefront并启用SSR2021-01-22 13:57:24

    ng add @spartacus/schematics --baseUrl https://spartacus-dev4.eastus.cloudapp.azure.com:9002/ --baseSite=electronics-spa --ssr 不能在空文件夹里使用上述命令行: 而是需要先用ng new standalone创建空的Angular项目: 创建完毕: 然后再执行命令行: ng add @spartacus/

  • SAP Spartacus 3.0部署在development environment上2021-01-21 09:57:55

    https://github.com/SAP-samples/cloud-commerce-sample-setup/tree/2011-spartacus 启动Spartacus,遇到错误消息: NullInjectorError: R3InjectorError(AppServerModule)[ApplicationModule -> ApplicationRef -> ApplicationInitStatus -> InjectionToken Application In

  • SAP Spartacus cost center list的数据源分析2021-01-14 18:57:03

    需求:下图列表里的数据是从哪里来的? cx-view里看到listData$这个Observable对象,来自list service的成员: cx-table控件在这里消费数据: subscribe后,看到的数据结构: page size:10 总共10页,总共97个。 请求url: https://spartacus-dev0.eastus.cloudapp.azure.com:9002/occ/v2

  • SAP Spartacus B2B页面Banner Component的路由url是在哪里定义的2020-12-17 12:32:32

    在Component wrapper里加上一行打印语句: 输出效果: 以CostCentersHomeLink为例:Spartacus里搜索不到,因为这是一个CMS Component: 从spartacussampledata addon的cms-responsive-content.impex文件里,找到了CostCentersHomeLink对应的url: ## BannerComponent in Organization

  • SAP Spartacus list.component.ts的listData$数据的触发逻辑2020-12-13 13:02:28

    template指Component页面,而factory指Component实例的构造函数。 下图第三行listData$ | async这个pipe触发了Observable的subscribe操作: 然而是谁调用的getTree函数? 是UnitListService的load函数: ListService的getData内调用了ListService的load方法: 最终在list.compone

  • SAP Spartacus Focusdirective继承自Lockdirective,静态代码分析2020-12-11 13:04:07

    Focusdirective并没有特殊的实现,同其父类Lockdirective相比只是把selector暴露出来而已: 三个依赖: elementRef: 施加Directive的DOM元素service: keyboardFocusServicerenderer: Renderer2 再看其父类LockDirective的实现。 有一个默认的配置defaultConfig: 当host元素有事件

  • SAP Spartacus 3.0的一些变化2020-12-07 14:02:08

    Technical Changes in Spartacus 3.0 Breaking Changes Translations (i18n) changed fixed the typo in the key user.register.managementInMyAccount (previously …managmentInMyAccount)key checkout.checkoutReview.editShippingMethod has been removedkey checkout.c

  • 在SAP Spartacus产品明细页面用outlet显示自定义数据2020-11-23 20:01:27

    首先创建一个新的Angular module和Component: 这个新的module,因为要使用Outlet功能,所以需要从@Spartacus/storefront里导入OutletRefModule,以及导出我们自己实现的MyOutletsComponent以便让外界消费。 MyOutletsComponent的实现: 在构造函数里注入currentProductService, 调用getP

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

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

ICode9版权所有