Skip to content

Commit

Permalink
fix: 1.hide “My orders” and “company orders” in for junior buyers in …
Browse files Browse the repository at this point in the history
…the buyer portal

2.email Field on Last Step of Registration allows the email address to break out of the box
1.https://bigc-b2b.atlassian.net/jira/software/c/projects/BUN/issues/BUN-1689
2.https://bigc-b2b.atlassian.net/browse/SUP-1345
  • Loading branch information
BrianJiang2021 authored and libruce committed Dec 27, 2023
1 parent 027616f commit 76d8c46
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/storefront/src/pages/registered/RegisterComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ export default function RegisterComplete(props: RegisterCompleteProps) {
color: '#000000',
marginBottom: '10px',
marginTop: '-12px',
wordWrap: 'break-word',
}}
>
{`Create password for ${enterEmail}`}
Expand Down
17 changes: 14 additions & 3 deletions apps/storefront/src/shared/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const routes: RouteItem[] = [
wsKey: 'router-orders',
isMenuItem: true,
component: OrderList,
permissions: [0, 1, 2, 3, 4, 99, 100],
permissions: [0, 1, 3, 4, 99, 100],
isTokenLogin: true,
idLang: 'global.navMenu.orders',
},
Expand All @@ -108,7 +108,7 @@ const routes: RouteItem[] = [
wsKey: 'router-orders',
isMenuItem: true,
component: CompanyOrderList,
permissions: [0, 1, 2, 3],
permissions: [0, 1, 3],
isTokenLogin: true,
idLang: 'global.navMenu.companyOrders',
},
Expand Down Expand Up @@ -409,7 +409,18 @@ const gotoAllowedAppPage = async (
(!url && role !== 100 && pathname.includes('account.php')) ||
isAccountEnter
)
url = role === 3 ? '/dashboard' : '/orders'
switch (role) {
case 2:
url = '/accountSettings'
break
case 3:
url = '/dashboard'
break
default:
url = '/orders'
break
}

const flag = routes.some(
(item: RouteItem) =>
(matchPath(item.path, url) || url.includes('invoice?')) &&
Expand Down
15 changes: 13 additions & 2 deletions apps/storefront/src/utils/b3AccountItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ const redirectBcMenus = (
isAgenting: boolean
): string => {
// Supermarket theme
if (key === '/account.php') {
return +role !== 3 ? '/orders' : '/dashboard'
if (key.includes('/account.php') && !key.includes('?')) {
switch (role) {
case 2:
return '/accountSettings'
case 3:
return '/dashboard'
default:
return '/orders'
}
}

// Vault theme
Expand All @@ -61,6 +68,10 @@ const redirectBcMenus = (
: '/dashboard'
}

if (+role === 2 && currentItem?.newTargetUrl.includes('order_status')) {
return '/accountSettings'
}

if (currentItem?.newTargetUrl) {
return currentItem.newTargetUrl
}
Expand Down

0 comments on commit 76d8c46

Please sign in to comment.