From f5a1a2c925f25e45cc125fd2e64952e78790dcb4 Mon Sep 17 00:00:00 2001 From: Stefan Hauke Date: Tue, 9 Mar 2021 10:06:39 +0100 Subject: [PATCH] feat: check for multiple punchout roles (cXML or OCI) for punchout UI adaptions - check for new 'APP_B2B_CXML_USER' or 'APP_B2B_OCI_USER' role - check for new permission 'APP_B2B_SEND_PUNCHOUT_BASKET' BREAKING CHANGES: required Intershop Commerce Management version: 7.10.29.0 --- ...duct-context-display-properties.service.ts | 2 +- .../basket-add-to-quote.component.html | 2 +- .../account-overview.component.html | 6 +++-- .../account-navigation.component.ts | 24 ++++++++++++------- .../shopping-basket.component.html | 4 ++-- .../shell/footer/footer/footer.component.html | 2 +- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/app/extensions/punchout/exports/punchout-product-context-display-properties/punchout-product-context-display-properties.service.ts b/src/app/extensions/punchout/exports/punchout-product-context-display-properties/punchout-product-context-display-properties.service.ts index d3d8c31f62..c0e0aa49e2 100644 --- a/src/app/extensions/punchout/exports/punchout-product-context-display-properties/punchout-product-context-display-properties.service.ts +++ b/src/app/extensions/punchout/exports/punchout-product-context-display-properties/punchout-product-context-display-properties.service.ts @@ -15,7 +15,7 @@ export class PunchoutProductContextDisplayPropertiesService implements ExternalD setup(product$: Observable): Observable>> { return product$.pipe( - switchMapTo(this.roleToggleService.hasRole('APP_B2B_OCI_USER')), + switchMapTo(this.roleToggleService.hasRole(['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'])), map(isPunchoutUser => isPunchoutUser ? { diff --git a/src/app/extensions/quoting/shared/basket-add-to-quote/basket-add-to-quote.component.html b/src/app/extensions/quoting/shared/basket-add-to-quote/basket-add-to-quote.component.html index cb59ca6043..386f601f40 100644 --- a/src/app/extensions/quoting/shared/basket-add-to-quote/basket-add-to-quote.component.html +++ b/src/app/extensions/quoting/shared/basket-add-to-quote/basket-add-to-quote.component.html @@ -1,6 +1,6 @@ -

{{ 'account.overview.message_b2b.text' | translate }}

+

+ {{ 'account.overview.message_b2b.text' | translate }} +

@@ -47,7 +49,7 @@ - +
diff --git a/src/app/pages/account/account-navigation/account-navigation.component.ts b/src/app/pages/account/account-navigation/account-navigation.component.ts index 8511c04114..d924b3b48f 100644 --- a/src/app/pages/account/account-navigation/account-navigation.component.ts +++ b/src/app/pages/account/account-navigation/account-navigation.component.ts @@ -10,7 +10,7 @@ interface NavigationItems { feature?: string; serverSetting?: string; permission?: string; - notRole?: string; + notRole?: string | string[]; children?: NavigationItems; }; } @@ -34,7 +34,7 @@ export class AccountNavigationComponent implements OnInit, OnChanges { localizationKey: 'account.requisitions.requisitions', serverSetting: 'services.OrderApprovalServiceDefinition.runnable', permission: 'APP_B2B_PURCHASE', - notRole: 'APP_B2B_OCI_USER', + notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'], }, '/account/requisitions/approver': { localizationKey: 'account.requisitions.approvals', @@ -44,31 +44,34 @@ export class AccountNavigationComponent implements OnInit, OnChanges { '/account/quotes': { localizationKey: 'account.navigation.quotes.link', feature: 'quoting', - notRole: 'APP_B2B_OCI_USER', + notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'], }, '/account/order-templates': { localizationKey: 'account.ordertemplates.link', feature: 'orderTemplates', dataTestingId: 'order-templates-link', }, - '/account/orders': { localizationKey: 'account.order_history.link', notRole: 'APP_B2B_OCI_USER' }, + '/account/orders': { + localizationKey: 'account.order_history.link', + notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'], + }, '/account/wishlists': { localizationKey: 'account.wishlists.link', feature: 'wishlists', dataTestingId: 'wishlists-link', - notRole: 'APP_B2B_OCI_USER', + notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'], }, '/account/addresses': { localizationKey: 'account.saved_addresses.link', dataTestingId: 'addresses-link', - notRole: 'APP_B2B_OCI_USER', + notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'], }, '/account/payment': { localizationKey: 'account.payment.link', dataTestingId: 'payments-link', - notRole: 'APP_B2B_OCI_USER', + notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'], }, - '/account/profile': { localizationKey: 'account.profile.link', notRole: 'APP_B2B_OCI_USER' }, + '/account/profile': { localizationKey: 'account.profile.link', notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'] }, '/account/organization': { localizationKey: 'account.organization.user_management', permission: 'APP_B2B_MANAGE_USERS', @@ -79,7 +82,10 @@ export class AccountNavigationComponent implements OnInit, OnChanges { feature: 'punchout', permission: 'APP_B2B_MANAGE_PUNCHOUT', }, - '/logout': { localizationKey: 'account.navigation.logout.link', notRole: 'APP_B2B_OCI_USER' }, + '/logout': { + localizationKey: 'account.navigation.logout.link', + notRole: ['APP_B2B_CXML_USER', 'APP_B2B_OCI_USER'], + }, }; constructor(private router: Router) {} diff --git a/src/app/pages/basket/shopping-basket/shopping-basket.component.html b/src/app/pages/basket/shopping-basket/shopping-basket.component.html index dfb4b42fb4..527d5ce286 100644 --- a/src/app/pages/basket/shopping-basket/shopping-basket.component.html +++ b/src/app/pages/basket/shopping-basket/shopping-basket.component.html @@ -55,7 +55,7 @@

{{ 'checkout.order_details.heading' | translate }}

diff --git a/src/app/shell/footer/footer/footer.component.html b/src/app/shell/footer/footer/footer.component.html index 8ff9f04910..6f95aec785 100644 --- a/src/app/shell/footer/footer/footer.component.html +++ b/src/app/shell/footer/footer/footer.component.html @@ -1,3 +1,3 @@ - +