Skip to content

Commit

Permalink
Merge branch 'develop' into PWA-1101-alt
Browse files Browse the repository at this point in the history
  • Loading branch information
dpatil-magento authored and eug123 committed Jan 21, 2021
2 parents 2fa663a + 006c26b commit 4fd88b9
Show file tree
Hide file tree
Showing 22 changed files with 703 additions and 213 deletions.
3 changes: 1 addition & 2 deletions packages/peregrine/lib/talons/Breadcrumbs/useBreadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export const useBreadcrumbs = props => {
nextFetchPolicy: 'cache-first'
});

// Default to .html for when the query has not yet returned.
const categoryUrlSuffix = (data && data.category.url_suffix) || '.html';
const categoryUrlSuffix = (data && data.category.url_suffix) || '';

// When we have breadcrumb data sort and normalize it for easy rendering.
const normalizedData = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const useCategoryTile = props => {
const itemObject = useMemo(
() => ({
name: item.name,
url: `/${item.url_key}${item.url_suffix}`
url: `/${item.url_key}${item.url_suffix || ''}`
}),
[item]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,53 @@ exports[`should return correct shape 1`] = `
Object {
"availableStores": Map {
"store1" => Object {
"category_url_suffix": null,
"currency": "USD",
"isCurrent": false,
"locale": "locale1",
"product_url_suffix": null,
"storeName": "Store 1",
},
"store2" => Object {
"category_url_suffix": ".html",
"currency": "EUR",
"isCurrent": true,
"locale": "locale2",
"product_url_suffix": ".html",
"storeName": "Store 2",
},
"store3" => Object {
"category_url_suffix": null,
"currency": "EUR",
"isCurrent": false,
"locale": "locale3",
"product_url_suffix": ".htm",
"storeName": "Store 3",
},
"store4" => Object {
"category_url_suffix": ".htm",
"currency": "EUR",
"isCurrent": false,
"locale": "locale4",
"product_url_suffix": null,
"storeName": "Store 4",
},
"store5" => Object {
"category_url_suffix": "-abc1",
"currency": "EUR",
"isCurrent": false,
"locale": "locale5",
"product_url_suffix": ".htm.htm",
"storeName": "Store 5",
},
"store6" => Object {
"category_url_suffix": ".some.some",
"currency": "EUR",
"isCurrent": false,
"locale": "locale6",
"product_url_suffix": "-123abc",
"storeName": "Store 6",
},
},
"currentStoreName": "Store 2",
"handleSwitchStore": [Function],
Expand Down
Loading

0 comments on commit 4fd88b9

Please sign in to comment.