-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unification of "Product List (Manual)" with the other CMS Produ…
…ct Lists (#673) - renamed CMS component "Product List" to "Product List (Manual)"
- Loading branch information
Showing
8 changed files
with
71 additions
and
96 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
11 changes: 11 additions & 0 deletions
11
src/app/shared/cms/components/cms-product-list-manual/cms-product-list-manual.component.html
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div *ngIf="productSKUs?.length" class="product-list-container" [ngClass]="pagelet.stringParam('CSSClass')"> | ||
<h2 *ngIf="pagelet.stringParam('Title')">{{ pagelet.stringParam('Title') }}</h2> | ||
<ish-products-list | ||
[productSKUs]="productSKUs" | ||
[listStyle]="pagelet.stringParam('ListStyle')" | ||
[slideItems]="pagelet.numberParam('SlideItems')" | ||
[listItemStyle]="pagelet.stringParam('ListItemStyle')" | ||
[listItemCSSClass]="pagelet.stringParam('ListItemCSSClass')" | ||
> | ||
</ish-products-list> | ||
</div> |
51 changes: 51 additions & 0 deletions
51
...p/shared/cms/components/cms-product-list-manual/cms-product-list-manual.component.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MockComponent } from 'ng-mocks'; | ||
|
||
import { createContentPageletView } from 'ish-core/models/content-view/content-view.model'; | ||
import { ProductsListComponent } from 'ish-shared/components/product/products-list/products-list.component'; | ||
|
||
import { CMSProductListManualComponent } from './cms-product-list-manual.component'; | ||
|
||
describe('Cms Product List Manual Component', () => { | ||
let component: CMSProductListManualComponent; | ||
let fixture: ComponentFixture<CMSProductListManualComponent>; | ||
let element: HTMLElement; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [CMSProductListManualComponent, MockComponent(ProductsListComponent)], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CMSProductListManualComponent); | ||
component = fixture.componentInstance; | ||
element = fixture.nativeElement; | ||
const pagelet = { | ||
definitionQualifiedName: 'fq', | ||
id: 'id', | ||
displayName: 'name', | ||
domain: 'domain', | ||
configurationParameters: { | ||
Products: ['1@Domain', '2@Domain'], | ||
Title: 'PageletTitle', | ||
CSSClass: 'css-class', | ||
ListItemCSSClass: 'li-css-class', | ||
}, | ||
}; | ||
component.pagelet = createContentPageletView(pagelet); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(component).toBeTruthy(); | ||
expect(element).toBeTruthy(); | ||
expect(() => component.ngOnChanges()).not.toThrow(); | ||
expect(() => fixture.detectChanges()).not.toThrow(); | ||
expect(component.productSKUs).toMatchInlineSnapshot(` | ||
Array [ | ||
"1", | ||
"2", | ||
] | ||
`); | ||
}); | ||
}); |
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
14 changes: 0 additions & 14 deletions
14
src/app/shared/cms/components/cms-product-list/cms-product-list.component.html
This file was deleted.
Oops, something went wrong.
73 changes: 0 additions & 73 deletions
73
src/app/shared/cms/components/cms-product-list/cms-product-list.component.spec.ts
This file was deleted.
Oops, something went wrong.
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