Skip to content

Commit

Permalink
Merge pull request #16 from NCR-Corporation/develop
Browse files Browse the repository at this point in the history
Updating images to have full url, removing tooltip from admin header
  • Loading branch information
kg185155 committed Feb 17, 2021
2 parents 89b4551 + fae8df6 commit f3c205f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
9 changes: 0 additions & 9 deletions components/admin/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,9 @@ const Header = ({ navigation = true, activeTab }) => {
</Link>
</Col>
<Col className="col text-md-right">
<Tooltip
placement="right"
isOpen={tooltipOpen}
target="TooltipExample"
toggle={toggleTooltip}
>
Returns all ACTIVE data in Postman collection.
</Tooltip>
<Button
color="primary"
className="float-right"
id="TooltipExample"
onClick={() => buildSampleDatabase()}
>
{exporting ? (
Expand Down
4 changes: 3 additions & 1 deletion components/public/ItemCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const ItemCard = ({ catalogItem, showCartButton = true }) => {
});
};

console.log(item, itemAttributes);
return (
<Card className="border-0 shadow-sm item-card h-100">
<Link href={`/catalog/${item.itemId.itemCode}`}>
Expand All @@ -63,7 +64,8 @@ const ItemCard = ({ catalogItem, showCartButton = true }) => {
src={
itemAttributes &&
itemAttributes.imageUrls &&
itemAttributes.imageUrls.length > 0
itemAttributes.imageUrls.length > 0 &&
itemAttributes.imageUrls[0] !== ''
? itemAttributes.imageUrls[0]
: 'https://via.placeholder.com/150'
}
Expand Down
26 changes: 13 additions & 13 deletions data/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"price": "0.99",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/avocado.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/avocado.jpg",
"groups": "28ba8df5",
"nonMerchandise": false
},
Expand Down Expand Up @@ -83,7 +83,7 @@
"price": "2.99",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/glass-bowl.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/glass-bowl.jpg",
"groups": "626b2673",
"nonMerchandise": false
},
Expand Down Expand Up @@ -127,7 +127,7 @@
"price": "1.99",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/yellow-onions.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/yellow-onions.jpg",
"nonMerchandise": false
},
{
Expand Down Expand Up @@ -170,7 +170,7 @@
"price": "8.99",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/plastic-serving-bowl.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/plastic-serving-bowl.jpg",
"groups": "626b2673",
"nonMerchandise": false
},
Expand Down Expand Up @@ -214,7 +214,7 @@
"price": "3.49",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/tostitos-mild-salsa",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/tostitos-mild-salsa",
"groups": "28ba8df5",
"nonMerchandise": false
},
Expand Down Expand Up @@ -258,7 +258,7 @@
"price": "4.59",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/porcelain-dinner-plate.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/porcelain-dinner-plate.jpg",
"groups": "626b2673",
"nonMerchandise": false
},
Expand Down Expand Up @@ -302,7 +302,7 @@
"price": "4.59",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/glass-dinner-plate.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/glass-dinner-plate.jpg",
"groups": "626b2673",
"nonMerchandise": false
},
Expand Down Expand Up @@ -346,7 +346,7 @@
"price": "3.79",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/salsa-con-queso.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/salsa-con-queso.jpg",
"groups": "28ba8df5",
"nonMerchandise": false
},
Expand Down Expand Up @@ -390,7 +390,7 @@
"price": "2.49",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/russett-potato.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/russett-potato.jpg",
"nonMerchandise": false
},
{
Expand Down Expand Up @@ -433,7 +433,7 @@
"price": "3.49",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/strawberries.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/strawberries.jpg",
"nonMerchandise": false
},
{
Expand Down Expand Up @@ -476,7 +476,7 @@
"price": "1.35",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/blueberries.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/blueberries.jpg",
"nonMerchandise": false
},
{
Expand Down Expand Up @@ -519,7 +519,7 @@
"price": "1.99",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/bananas.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/bananas.jpg",
"nonMerchandise": false
},
{
Expand Down Expand Up @@ -562,7 +562,7 @@
"price": "3.99",
"currency": "USD",
"effectiveDate": "2020-12-17T05:00:00Z",
"imageUrl": "/images/catalog/scoops-chips.jpg",
"imageUrl": "https://retaildemo.ncrcloud.com/images/catalog/scoops-chips.jpg",
"groups": "28ba8df5",
"nonMerchandise": false
},
Expand Down
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
images: {
domains: ['https://via.placeholder.com', 'via.placeholder.com'],
domains: [
'retaildemo.ncrcloud.com',
'https://via.placeholder.com',
'via.placeholder.com',
],
},
};
9 changes: 8 additions & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ function Home() {
className="mb-4 shadow-sm"
>
<Image
src={`${element.group.data.tag}`}
src={
element &&
element.group &&
element.group.data &&
element.group.data.tag
? element.group.data.tag
: ''
}
alt={`${element.group.data.title.values[0].value}`}
objectFit="none"
layout="fill"
Expand Down

0 comments on commit f3c205f

Please sign in to comment.