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

PR for landing page #17978

Merged
merged 56 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
73a4fb6
new changes
anjana-bl Oct 13, 2023
8b0ddee
removing guard - as per review
anjana-bl Oct 13, 2023
3abd427
naming change
anjana-bl Oct 13, 2023
f89fd98
Update .env-cmdrc
anjana-bl Oct 13, 2023
316b7d0
Update public_api.ts
anjana-bl Oct 13, 2023
2544f0e
order history + customer ticket
anjana-bl Oct 13, 2023
bdfa4d0
review comments
anjana-bl Oct 13, 2023
b88cc9e
landing page: user & navigation
Oct 14, 2023
a96a2db
linting update
Oct 14, 2023
893d114
unit test case
anjana-bl Oct 15, 2023
19ca801
unti test
anjana-bl Oct 15, 2023
6f140b5
unit test - order + customer ticketing
anjana-bl Oct 16, 2023
3e32355
Merge branch 'MyAccount-PR-1' into MyAccount-PR-2
anjana-bl Oct 16, 2023
44f49fd
added myaccount-v2-user.component.spec.ts
Oct 16, 2023
b94f330
Update _myaccount-v2-navigation.scss
Oct 16, 2023
d326e00
Create myaccount-v2-navigation.component.spec.ts
Oct 16, 2023
621cef1
linting + code coverage
anjana-bl Oct 16, 2023
d687733
Update _myaccount-v2-navigation.scss
Oct 16, 2023
7a027b2
review comment for user
Oct 16, 2023
221bf3c
unit test case+formatting
anjana-bl Oct 16, 2023
7bb99d9
renamed myaccount to my-account
Oct 16, 2023
0e7d361
naming change + review comments
anjana-bl Oct 16, 2023
d9fa9e8
Merge branch 'MyAccount-PR-1' into MyAccount-PR-2
anjana-bl Oct 16, 2023
3f80067
unit test case
anjana-bl Oct 16, 2023
15e988f
Merge branch 'develop-6.6.x' into MyAccount-PR-1
anjana-bl Oct 16, 2023
014d06b
Merge branch 'MyAccount-PR-1' into MyAccount-PR-2
anjana-bl Oct 16, 2023
2b946b3
review comments
anjana-bl Oct 16, 2023
370082b
Add license header
github-actions[bot] Oct 16, 2023
881d634
Update _my-account-v2-order.scss
anjana-bl Oct 16, 2023
5a1ccfa
Merge branch 'MyAccount-PR-2' of https://github.com/SAP/spartacus int…
anjana-bl Oct 16, 2023
9bba423
Update my-account-v2-order-history.service.spec.ts
anjana-bl Oct 16, 2023
1216305
Update my-account-v2-navigation.component.spec.ts
anjana-bl Oct 17, 2023
4e18ae1
Update index_spec.ts.snap
anjana-bl Oct 17, 2023
4923fe8
adding a11y label
anjana-bl Oct 17, 2023
a39e034
CXINT-2317: cypress test for the Order Details flow enhanced UI (#17981)
sisodiyam Oct 17, 2023
ad7fa62
Update launch.json
anjana-bl Oct 17, 2023
186698b
CXINT-2317: Cypress test for My Account Landing Page (#17984)
sisodiyam Oct 17, 2023
e84606d
Merge branch 'MyAccount-PR-1' into MyAccount-PR-2
anjana-bl Oct 17, 2023
1c25538
removing title
anjana-bl Oct 17, 2023
ca2eae4
Update user.model.ts
Oct 17, 2023
fa787ce
Merge branch 'MyAccount-PR-2' of https://github.com/SAP/spartacus int…
Oct 17, 2023
a24130a
Update my-account-v2-user.component.html
Oct 17, 2023
5a1b822
Update my-account-v2-navigation.component.spec.ts
Oct 17, 2023
d55b139
Update _my-account-v2-navigation.scss
Oct 17, 2023
8db2689
Update spartacus-features.module.ts
Oct 17, 2023
2b2a0a4
Update constants.ts
Oct 17, 2023
187a998
linting update
Oct 17, 2023
74e45a4
code review changes
anjana-bl Oct 17, 2023
0607f6c
Update _my-account-v2-navigation.scss
Oct 17, 2023
18a4604
Merge branch 'MyAccount-PR-2' of https://github.com/SAP/spartacus int…
anjana-bl Oct 17, 2023
78f005e
CXINT-2317: Fixed review comments (#17985)
sisodiyam Oct 17, 2023
8235882
review comment
anjana-bl Oct 17, 2023
9b0e5db
Add license header
github-actions[bot] Oct 17, 2023
ad3d497
Merge branch 'MyAccount-PR-1' into MyAccount-PR-2
anjana-bl Oct 17, 2023
5a0116a
Merge branch 'develop-6.6.x' into MyAccount-PR-2
anjana-bl Oct 17, 2023
bd6447e
review change
anjana-bl Oct 17, 2023
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
5 changes: 5 additions & 0 deletions .env-cmdrc
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,10 @@
"pdf-invoices": {
"CX_BASE_URL": "https://api.cg79x9wuu9-eccommerc1-s5-public.model-t.myhybris.cloud",
"CX_PDF_INVOICES": "true"
},
"myaccount-v2":{
"CX_BASE_URL": "https://api.cg79x9wuu9-eccommerc1-s5-public.model-t.myhybris.cloud",
"CX_PDF_INVOICES": "true",
"CX_MYACCOUNT_V2": "true"
}
}
69 changes: 14 additions & 55 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,19 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickProcess}"
},
{
"type": "firefox",
"request": "launch",
"reAttach": true,
"name": "Launch Firefox against localhost",
"url": "http://localhost:4200",
"pathMappings": [
{
"url": "webpack:///",
"path": "${workspaceFolder}/projects"
}
]
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}/projects",
"sourceMapPathOverrides": {
"": "${webRoot}/"
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
},
{
"type": "msedge",
"request": "launch",
"name": "Launch Edge against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug schematics",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/node_modules/@angular/cli/bin/ng",
"args": ["add", "--skip-confirmation", "@spartacus/schematics@latest"],
"console": "integratedTerminal",
"outFiles": ["${workspaceFolder}/node_modules/@spartacus/**/*.js"]
},

// to debug a schematics Jest test, make sure that a spec.ts file is currently opened.
{
"type": "node",
"request": "launch",
"name": "Debug project/schematics Jest test",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--config",
"projects/schematics/jest.schematics.config.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
}
]
}
}
8 changes: 7 additions & 1 deletion core-libs/setup/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@
"@spartacus/user/profile": ["dist/user/profile"],
"@spartacus/user/profile/occ": ["dist/user/profile/occ"],
"@spartacus/user/profile/root": ["dist/user/profile/root"],
"@spartacus/storefront": ["dist/storefrontlib"]
"@spartacus/storefront": ["dist/storefrontlib"],
"@spartacus/pdf-invoices/assets": ["dist/pdf-invoices/assets"],
"@spartacus/pdf-invoices/components": ["dist/pdf-invoices/components"],
"@spartacus/pdf-invoices/core": ["dist/pdf-invoices/core"],
"@spartacus/pdf-invoices": ["dist/pdf-invoices"],
"@spartacus/pdf-invoices/occ": ["dist/pdf-invoices/occ"],
"@spartacus/pdf-invoices/root": ["dist/pdf-invoices/root"]
}
},
"angularCompilerOptions": {
Expand Down
8 changes: 7 additions & 1 deletion feature-libs/checkout/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@
"@spartacus/user/profile/core": ["dist/user/profile/core"],
"@spartacus/user/profile": ["dist/user/profile"],
"@spartacus/user/profile/occ": ["dist/user/profile/occ"],
"@spartacus/user/profile/root": ["dist/user/profile/root"]
"@spartacus/user/profile/root": ["dist/user/profile/root"],
"@spartacus/pdf-invoices/assets": ["dist/pdf-invoices/assets"],
"@spartacus/pdf-invoices/components": ["dist/pdf-invoices/components"],
"@spartacus/pdf-invoices/core": ["dist/pdf-invoices/core"],
"@spartacus/pdf-invoices": ["dist/pdf-invoices"],
"@spartacus/pdf-invoices/occ": ["dist/pdf-invoices/occ"],
"@spartacus/pdf-invoices/root": ["dist/pdf-invoices/root"]
}
},
"angularCompilerOptions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ export const customerTicketing = {
closeRequest: 'Close Request',
ticketNotFound: 'Ticket not found.',
},
myAccountV2CustomerTicketing: {
heading: 'Customer Service',
showMore: 'Show More',
changedOn: 'Changed On: {{value}}',
ticketId: 'ID: {{value}}',
},
Platonn marked this conversation as resolved.
Show resolved Hide resolved
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export const customerTicketingTranslationChunksConfig: TranslationChunksConfig =
'customerTicketingList',
'createCustomerTicket',
'customerTicketingDetails',
'myAccountV2CustomerTicketing',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { CustomerTicketingListModule } from './list/customer-ticketing-list';
import { CustomerTicketingDetailsModule } from './details/customer-ticketing-details';
import { CustomerTicketingReopenModule } from './details/customer-ticketing-reopen';
import { CustomerTicketingMessagesModule } from './details/customer-ticketing-messages';
import { MyAccountV2CustomerTicketingModule } from './myaccount-v2';

@NgModule({
imports: [
Expand All @@ -26,6 +27,7 @@ import { CustomerTicketingMessagesModule } from './details/customer-ticketing-me
CustomerTicketingListModule,
CustomerTicketingMessagesModule,
CustomerTicketingCreateModule,
MyAccountV2CustomerTicketingModule,
],
providers: [provideDefaultConfig(defaultCustomerTicketingFormLayoutConfig)],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

export * from './myaccount-v2-customer-ticketing.component';
export * from './myaccount-v2-customer-ticketing.module';
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<ng-container>
<div class="cx-myaccount-customer-ticket-header">
<!-- HEADER -->
<div class="cx-myaccount-customer-ticket-heading">
{{ 'myAccountV2CustomerTicketing.heading' | cxTranslate }}
</div>

<!-- SHOW MORE -->
<div class="cx-myaccount-customer-ticket-show-more">
<a
id="show-more-requests"
class="btn-link cx-action-link"
[routerLink]="
{
cxRoute: 'supportTickets'
} | cxUrl
"
>
{{ 'myAccountV2CustomerTicketing.showMore' | cxTranslate }}
</a>
</div>
</div>
<ng-container *ngIf="tickets$ | async as ticketList; else spinner">
<ng-container *ngIf="ticketList.tickets.length > 0; else noCustomerTickets">
<div class="cx-myaccount-customer-ticket-body">
<ng-container *ngFor="let ticket of ticketList.tickets">
<div class="cx-myaccount-customer-ticket-details">
<span class="cx-myaccount-customer-ticket-subject">
{{ ticket.subject }}
</span>
<span class="cx-myaccount-customer-ticket-details-light">
| {{ ticket.ticketCategory?.name }}
</span>
<span class="cx-myaccount-customer-ticket-details-light">
|
{{
'myAccountV2CustomerTicketing.ticketId'
| cxTranslate: { value: ticket.id }
}}
</span>
</div>
<div class="cx-myaccount-customer-ticket-details-light">
{{
'myAccountV2CustomerTicketing.changedOn'
| cxTranslate
: { value: ticket.modifiedAt | cxDate: 'd, MMMM, yyyy' }
}}
</div>
</ng-container>
</div>
</ng-container>
</ng-container>
</ng-container>

<ng-template #noCustomerTickets>
<div class="cx-myaccount-no-ticket">
{{ 'customerTicketingList.noTickets' | cxTranslate }}
</div>
</ng-template>

<ng-template #spinner>
<cx-spinner></cx-spinner>
</ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import { Pipe, PipeTransform } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing';
import {
I18nTestingModule,
RoutingService,
TranslationService,
} from '@spartacus/core';
import { TicketList } from '@spartacus/customer-ticketing/root';
import { BehaviorSubject, EMPTY, Observable, of } from 'rxjs';
import { MyAccountV2CustomerTicketingComponent } from './myaccount-v2-customer-ticketing.component';

const mockTicketList: TicketList = {
pagination: {},
sorts: [],
tickets: [
{
id: '0000001',
modifiedAt: '2021-01-13T10:06:57+0000',
subject: 'My drill is broken.',
ticketCategory: {
id: 'ENQUIRY',
name: 'Enquiry',
},
},
],
};

@Pipe({
name: 'cxUrl',
})
class MockUrlPipe implements PipeTransform {
transform() {}
}
@Pipe({
name: 'cxTranslate',
})
class MockTranslatePipe implements PipeTransform {
transform(): any {}
}
class MockRoutingService {
go() {}
}

class MockTranslationService {
translate(): Observable<string> {
return EMPTY;
}
}

class MockcustomerTicketingFacade {
getTickets(
_pageSize: number,
_currentPage?: number,
_sort?: string
): Observable<TicketList> {
return mockTicketList$.asObservable();
}

clearTicketList() {}
}

const mockTicketList$ = new BehaviorSubject<TicketList>(mockTicketList);

describe('MyAccountV2CustomerTicketingComponent', () => {
let component: MyAccountV2CustomerTicketingComponent;
let fixture: ComponentFixture<MyAccountV2CustomerTicketingComponent>;

beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule, I18nTestingModule],
declarations: [
MyAccountV2CustomerTicketingComponent,
MockTranslatePipe,
MockUrlPipe,
],
providers: [
{
provide: 'CustomerTicketingFacade',
useClass: MockcustomerTicketingFacade,
},
{ provide: RoutingService, useClass: MockRoutingService },
{ provide: TranslationService, useClass: MockTranslationService },
],
}).compileComponents();

fixture = TestBed.createComponent(MyAccountV2CustomerTicketingComponent);
component = fixture.componentInstance;
component.tickets$ = of(mockTicketList);
fixture.detectChanges();
})
);

it('should be created', () => {
expect(component).toBeTruthy();
});

it('should display heading', () => {
const heading = fixture.debugElement.query(
By.css('.cx-myaccount-customer-ticket-heading')
);
expect(heading.nativeElement).not.toBeNull();
const link = fixture.debugElement.query(By.css('#show-more-requests'));
expect(link).not.toBeNull();
});

it('should show 1 return request', () => {
const details = fixture.debugElement.query(
By.css('.cx-myaccount-customer-ticket-details')
);
expect(details.nativeElement).not.toBeNull();
const noTicket = fixture.debugElement.query(
By.css('.cx-myaccount-no-ticket')
);
expect(noTicket).toBeNull();
});
it('should show no return request', () => {
component.tickets$ = of({ tickets: [] });
fixture.detectChanges();
const details = fixture.debugElement.query(
By.css('.cx-myaccount-customer-ticket-details')
);
expect(details).toBeNull();
const noTicket = fixture.debugElement.query(
By.css('.cx-myaccount-no-ticket')
);
expect(noTicket).not.toBeNull();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* SPDX-FileCopyrightText: 2023 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import { Component, inject } from '@angular/core';
import {
CustomerTicketingFacade,
TicketList,
} from '@spartacus/customer-ticketing/root';
import { Observable } from 'rxjs';

@Component({
selector: 'cx-myaccount-v2-customer-ticketing',
templateUrl: './myaccount-v2-customer-ticketing.component.html',
})
export class MyAccountV2CustomerTicketingComponent {
protected PAGE_SIZE = 1;
protected customerTicketingFacade = inject(CustomerTicketingFacade);
tickets$: Observable<TicketList | undefined> =
this.customerTicketingFacade.getTickets(this.PAGE_SIZE);
}
Loading