From e4936b3868759437a677be57c12edbc6e368dba5 Mon Sep 17 00:00:00 2001 From: sektordv Date: Fri, 11 Jun 2021 15:10:23 +0200 Subject: [PATCH 1/4] replaced skeleton with a dash --- src/warehouses/components/WarehouseList/WarehouseList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/warehouses/components/WarehouseList/WarehouseList.tsx b/src/warehouses/components/WarehouseList/WarehouseList.tsx index 720802af3..2b2eeb8f1 100644 --- a/src/warehouses/components/WarehouseList/WarehouseList.tsx +++ b/src/warehouses/components/WarehouseList/WarehouseList.tsx @@ -132,7 +132,7 @@ const WarehouseList: React.FC = props => { className={classes.tableRow} hover={!!warehouse} onClick={warehouse ? onRowClick(warehouse.id) : undefined} - key={warehouse ? warehouse.id : "skeleton"} + key={warehouse ? warehouse.id : "n/a"} data-test="warehouseEntry" data-testid={warehouse?.name.toLowerCase().replace(" ", "")} > @@ -142,7 +142,7 @@ const WarehouseList: React.FC = props => { {mapEdgesToItems(warehouse?.shippingZones) .map(({ name }) => name) - .join(", ") || } + .join(", ") || "-"}
From 7cc2c2158d7a1fd932b194074afe21eba0c98ba6 Mon Sep 17 00:00:00 2001 From: sektordv Date: Mon, 14 Jun 2021 12:10:42 +0200 Subject: [PATCH 2/4] fix for skeleton loader behavior --- .../__snapshots__/Stories.test.ts.snap | 570 +++++++++++++++++- .../WarehouseList/WarehouseList.tsx | 12 +- 2 files changed, 552 insertions(+), 30 deletions(-) diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 86cd9bc57..ed195b535 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -38951,10 +38951,85 @@ exports[`Storyshots Views / Attributes / Attribute details loading 1`] = ` class="MuiTableRow-root-id" > - No values found + + + + + ‌ + + + + + ‌ + + + + @@ -40886,10 +40961,84 @@ exports[`Storyshots Views / Attributes / Attribute details no values 1`] = ` class="MuiTableRow-root-id" > - No values found + + + + + ‌ + + + + + ‌ + + + + @@ -60837,6 +60986,42 @@ exports[`Storyshots Views / Collections / Collection detailsCollection details l + + + + + + + + - - No products found + + + + + + + + +
+
+ +
+
+ + ‌ + +
+
+ + + + ‌ + + + + + ‌ + + + + @@ -75491,9 +75779,43 @@ exports[`Storyshots Views / Customers / Customer details loading 1`] = ` > - No orders found + + ‌ + + + + + ‌ + + + + + ‌ + + + + + ‌ + @@ -89037,6 +89359,42 @@ exports[`Storyshots Views / Discounts / Sale details loading 1`] = ` + + + + + + + + - No categories found + + + + + + + + + + ‌ + + + + + ‌ + + + + @@ -230098,10 +230530,95 @@ exports[`Storyshots Views / Shipping / Shipping rate loading 1`] = ` class="MuiTableRow-root-id" > - No Products + + + + + + + + +
+
+ +
+
+ + ‌ + +
+
+ + + @@ -248267,11 +248784,12 @@ exports[`Storyshots Views / Warehouses / Warehouse details loading 1`] = `
-
- This warehouse has no shipping zones assigned. -
+ ‌ +
diff --git a/src/warehouses/components/WarehouseList/WarehouseList.tsx b/src/warehouses/components/WarehouseList/WarehouseList.tsx index 2b2eeb8f1..d96da07d6 100644 --- a/src/warehouses/components/WarehouseList/WarehouseList.tsx +++ b/src/warehouses/components/WarehouseList/WarehouseList.tsx @@ -132,7 +132,7 @@ const WarehouseList: React.FC = props => { className={classes.tableRow} hover={!!warehouse} onClick={warehouse ? onRowClick(warehouse.id) : undefined} - key={warehouse ? warehouse.id : "n/a"} + key={warehouse ? warehouse.id : "skeleton"} data-test="warehouseEntry" data-testid={warehouse?.name.toLowerCase().replace(" ", "")} > @@ -140,9 +140,13 @@ const WarehouseList: React.FC = props => { {maybe(() => warehouse.name, )}
- {mapEdgesToItems(warehouse?.shippingZones) - .map(({ name }) => name) - .join(", ") || "-"} + {disabled ? ( + + ) : ( + mapEdgesToItems(warehouse?.shippingZones) + ?.map(({ name }) => name) + .join(", ") || "-" + )}
From a7e5e28ca2673de85816ca2af5aad8e3987801d0 Mon Sep 17 00:00:00 2001 From: sektordv Date: Mon, 14 Jun 2021 12:28:57 +0200 Subject: [PATCH 3/4] updated test snapshots --- .../__snapshots__/Stories.test.ts.snap | 566 +----------------- 1 file changed, 24 insertions(+), 542 deletions(-) diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index ed195b535..86cd9bc57 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -38951,85 +38951,10 @@ exports[`Storyshots Views / Attributes / Attribute details loading 1`] = ` class="MuiTableRow-root-id" > - - - - - ‌ - - - - - ‌ - - - - + No values found @@ -40961,84 +40886,10 @@ exports[`Storyshots Views / Attributes / Attribute details no values 1`] = ` class="MuiTableRow-root-id" > - - - - - ‌ - - - - - ‌ - - - - + No values found @@ -60986,42 +60837,6 @@ exports[`Storyshots Views / Collections / Collection detailsCollection details l - - - - - - - - - - - - - - - + class="MuiTableCell-root-id MuiTableCell-body-id" + /> -
-
- -
-
- - ‌ - -
-
- - - - ‌ - - - - - ‌ - - - - + No products found @@ -75779,43 +75491,9 @@ exports[`Storyshots Views / Customers / Customer details loading 1`] = ` > - - ‌ - - - - - ‌ - - - - - ‌ - - - - - ‌ - + No orders found @@ -89359,42 +89037,6 @@ exports[`Storyshots Views / Discounts / Sale details loading 1`] = ` - - - - - - - - - - - - - - - - - - ‌ - - - - - ‌ - - - - + No categories found @@ -230530,95 +230098,10 @@ exports[`Storyshots Views / Shipping / Shipping rate loading 1`] = ` class="MuiTableRow-root-id" > - - - - - - - - -
-
- -
-
- - ‌ - -
-
- - - + No Products @@ -248784,12 +248267,11 @@ exports[`Storyshots Views / Warehouses / Warehouse details loading 1`] = `
- - ‌ - + This warehouse has no shipping zones assigned. +
From 8a1be512bf68f7b79a868291f003a4d3f86d6b14 Mon Sep 17 00:00:00 2001 From: sektordv Date: Tue, 15 Jun 2021 12:51:41 +0200 Subject: [PATCH 4/4] changed skeleton render condition --- src/warehouses/components/WarehouseList/WarehouseList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/warehouses/components/WarehouseList/WarehouseList.tsx b/src/warehouses/components/WarehouseList/WarehouseList.tsx index d96da07d6..ea82fe75c 100644 --- a/src/warehouses/components/WarehouseList/WarehouseList.tsx +++ b/src/warehouses/components/WarehouseList/WarehouseList.tsx @@ -140,7 +140,7 @@ const WarehouseList: React.FC = props => { {maybe(() => warehouse.name, )}
- {disabled ? ( + {warehouse?.shippingZones === undefined ? ( ) : ( mapEdgesToItems(warehouse?.shippingZones)