Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: account overview as root account page #43

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<ng-container *ngIf="!isMobileView; else mobileNavigation">
<ul id="AccountNav" class="account-navigation list-unstyled" data-testing-id="myaccount-navigation">
<ng-container *ngFor="let item of navigationItems">
<ng-container *ngFor="let item of navigationItems; let first = first">
<ng-container *ngIf="item.feature; else unrestricted">
<li *ishFeature="item.feature" routerLinkActive="active">
<a [routerLink]="item.link">{{ item.localizationKey | translate }}</a>
</li>
</ng-container>
<ng-template #unrestricted>
<li routerLinkActive="active">
<li routerLinkActive="active" [routerLinkActiveOptions]="{ exact: first }">
<a [routerLink]="item.link" [attr.data-testing-id]="item.dataTestingId">{{
item.localizationKey | translate
}}</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class AccountNavigationComponent implements OnInit, OnChanges {
* Manages the Account Navigation items.
*/
navigationItems: { link: string; localizationKey: string; dataTestingId?: string; feature?: string }[] = [
{ link: '/account/overview', localizationKey: 'account.my_account.link' },
{ link: '/account', localizationKey: 'account.my_account.link' },
{ link: '/account/orders', localizationKey: 'account.order_history.link' },
{ link: '/account/addresses', localizationKey: 'account.saved_addresses.link', dataTestingId: 'addresses-link' },
{ link: '/account/profile', localizationKey: 'account.profile.link' },
Expand Down
9 changes: 2 additions & 7 deletions src/app/pages/account/account-page.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ const accountPageRoutes: Routes = [
},
loadChildren: () => import('../account-order/account-order-page.module').then(m => m.AccountOrderPageModule),
},
{
path: 'overview',
data: { breadcrumbData: [{ key: 'account.overview.link' }] },
component: AccountOverviewPageModule.component,
},
{
path: 'profile',
data: { breadcrumbData: [{ key: 'account.profile.link' }] },
Expand Down Expand Up @@ -75,8 +70,8 @@ const accountPageRoutes: Routes = [
},
{
path: '',
pathMatch: 'full',
redirectTo: 'overview',
data: { breadcrumbData: [] },
component: AccountOverviewPageModule.component,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
>

<li *ngIf="account" class="breadcrumbs-list">
<a class="breadcrumbs-list-link" routerLink="/account">{{ 'account.my_account.link' | translate }}</a
><span class="breadcrumb-list-separator">{{ separator }}</span>
<ng-container *ngIf="trail.length; else AccountOverview">
<a class="breadcrumbs-list-link" routerLink="/account">{{ 'account.my_account.link' | translate }}</a
><span class="breadcrumb-list-separator">{{ separator }}</span>
</ng-container>
<ng-template #AccountOverview>
{{ 'account.my_account.link' | translate }}
</ng-template>
</li>

<li
Expand Down