SAP Spartacus B2B OrgUnit 和 OrgUser 的路由映射差别比较

SAP Spartacus B2B 页面相似 SAP Fiori Launchpad,共有 6 个 tile(磁贴),点击某个磁贴,能跳转到对应的列表页面。app

路由映射就是指点击某个 url 以后(例如上图所示的例子),应该激活哪个 Angular Component.url

例如上图 User tile,经过 a 标签实现,点击以后,会跳转到其 href 属性指向的 url:http://localhost:4200/powerto...spa

问题是,这个 url ,对应 SAP Spartacus 里哪一个 Angular Component 么?路由

咱们能够经过查询源代码的方式自行找到答案。rem

和 B2B User tile 相关的配置,都维护在文件 user.config.ts 里, orgUser 的路径为 organization/users:get

这里就能找到 User tile 对应的 Angular Component了。it

ManageUsersListComponent 对应 ListComponent:io

对于 Org Unit 来讲,路由配置的格式同 User 同样:class

这里同 User Mapping 实现有差别。在 User CMS mapping 里,ManageUsersListComponent 对应 ListComponent,而对于 Org Unit,Commerce 后台 ManageUnitsListComponent,映射到 SAP Spartacus Component 是 UnitListComponent,而不是更通用的 ListComponent.后台

更多Jerry的原创文章,尽在:"汪子熙":

相关文章
相关标签/搜索