-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cannot recognize current semantic route for my company pages (#1…
…2805) Previously, the routing config chunks for my company pages were provided in the components modules, which were lazy loaded. This caused 2 issues: - We could not recognize the semantic route for any my-accunt page (because `SemanticRoutesService.getRouteName()` depends on the routing config provided in the root injector on the app start, but not on configs provided lazily). - it was impossible to create a link to any my-company page (using `cxUrl` pipe) from another pages outside the my-company feature. (Currently we don't need such a links in OOTB Spartacus, but it's a potential future limitation.) Now above 2 issues are fixed, as we moved all the default routing config chunks to the `OrganizationAdministrationRootModule`, which provides the config chunks in the root injector. Therefore they are available in the `SemanticRoutesService` on app start. ### QA steps 1. Add in the constructor of the `StorefrontComponent` this snippet (log the semantic route on page change): ```ts this.routingService .getRouterState() .pipe( map((state) => state.state.semanticRoute), distinctUntilChanged(), tap((semanticRoute) => console.log({ semanticRoute })) ) .subscribe(); ``` 2. Turn on 'b2b' in `environment.ts` 3. Login as `[email protected]` 4. Navigate through my-company pages and verify the correct semantic route name is logged in the console for each feature's pages: budgets, cost centers, user groups, users, permissions, units Note: Some content pages like FAQ, find a store or help don't have route config provided - therefore it's a valid result that they `undefined` semantic route is logged in the console for those pages. ---- fixes #12717
- Loading branch information
Showing
41 changed files
with
453 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 5 additions & 39 deletions
44
feature-libs/organization/administration/components/budget/budget.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ibs/organization/administration/components/budget/services/current-budget.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
feature-libs/organization/administration/components/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
// This is not for the public API | ||
export const ROUTE_PARAMS = { | ||
budgetCode: 'budgetCode', | ||
unitCode: 'unitCode', | ||
costCenterCode: 'costCenterCode', | ||
userCode: 'userCode', | ||
userGroupCode: 'userGroupCode', | ||
permissionCode: 'permissionCode', | ||
addressCode: 'addressId', | ||
}; | ||
|
||
// TODO:#my-account-architecture - Number.MAX_VALUE? | ||
export const MAX_OCC_INTEGER_VALUE = 2147483647; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 5 additions & 43 deletions
48
feature-libs/organization/administration/components/cost-center/cost-center.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rganization/administration/components/cost-center/services/current-cost-center.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 3 additions & 34 deletions
37
feature-libs/organization/administration/components/permission/permission.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
feature-libs/organization/administration/components/shared/current-item.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...zation/administration/components/unit/links/addresses/list/unit-address-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/administration/components/unit/links/addresses/services/current-unit-address.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/administration/components/unit/links/children/create/current-child-unit.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../organization/administration/components/unit/links/users/list/unit-user-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.