From 8ae1943760d3f38b9176d56a9710a0a3da4aa593 Mon Sep 17 00:00:00 2001 From: Abrar Pathan Date: Thu, 18 Apr 2019 02:51:37 +0530 Subject: [PATCH 1/5] Update index.md (#1139) --- pwa-devdocs/src/technologies/theme-vs-storefront/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pwa-devdocs/src/technologies/theme-vs-storefront/index.md b/pwa-devdocs/src/technologies/theme-vs-storefront/index.md index a74fe39dc6..0b75c83578 100644 --- a/pwa-devdocs/src/technologies/theme-vs-storefront/index.md +++ b/pwa-devdocs/src/technologies/theme-vs-storefront/index.md @@ -87,7 +87,7 @@ The following table is a summary of general skills needed for Magento theme deve | [KnockoutJS][] | JS framework used for binding data models to the UI | | Cascading Style Sheets ([CSS][]) | Defines the style for a websites | | Leaner Style Sheets ([Less][]) | Language extension for CSS | -| XML | Format used by Magento for configuration and layout | +| Extensible Markup Language ([XML][]) | Format used by Magento for configuration and layout | | [Magento layouts][] | Layouts represent the structure for a page | | [Magento templates][] | Templates define how layout blocks are presented on a page | | [Magento UI library][] | Frontend library for Magento theme developers | @@ -130,6 +130,7 @@ The following table is a summary of general skills needed for PWA storefront dev [jQuery]: https://jquery.com/ [Less]: http://lesscss.org/ [CSS]: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css-overview.html +[XML]: https://magento.github.io/glossary/?#8c0645c5-aa6b-4a52-8266-5659a8b9d079 [Magento UI library]: https://magento-devdocs.github.io/magento2-ui-library/ [Magento layouts]: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html [Magento templates]: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-overview.html From b1dba9e290d40ae80fdf08a5ecce476a82a9bf17 Mon Sep 17 00:00:00 2001 From: Jimmy Sanford Date: Wed, 17 Apr 2019 14:29:22 -0700 Subject: [PATCH 2/5] Revert "Update index.md (#1139)" This reverts commit 8ae1943760d3f38b9176d56a9710a0a3da4aa593. --- pwa-devdocs/src/technologies/theme-vs-storefront/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pwa-devdocs/src/technologies/theme-vs-storefront/index.md b/pwa-devdocs/src/technologies/theme-vs-storefront/index.md index 0b75c83578..a74fe39dc6 100644 --- a/pwa-devdocs/src/technologies/theme-vs-storefront/index.md +++ b/pwa-devdocs/src/technologies/theme-vs-storefront/index.md @@ -87,7 +87,7 @@ The following table is a summary of general skills needed for Magento theme deve | [KnockoutJS][] | JS framework used for binding data models to the UI | | Cascading Style Sheets ([CSS][]) | Defines the style for a websites | | Leaner Style Sheets ([Less][]) | Language extension for CSS | -| Extensible Markup Language ([XML][]) | Format used by Magento for configuration and layout | +| XML | Format used by Magento for configuration and layout | | [Magento layouts][] | Layouts represent the structure for a page | | [Magento templates][] | Templates define how layout blocks are presented on a page | | [Magento UI library][] | Frontend library for Magento theme developers | @@ -130,7 +130,6 @@ The following table is a summary of general skills needed for PWA storefront dev [jQuery]: https://jquery.com/ [Less]: http://lesscss.org/ [CSS]: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css-overview.html -[XML]: https://magento.github.io/glossary/?#8c0645c5-aa6b-4a52-8266-5659a8b9d079 [Magento UI library]: https://magento-devdocs.github.io/magento2-ui-library/ [Magento layouts]: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html [Magento templates]: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-overview.html From 755a6e15397e70851e02e271cf6227eda45dbbdd Mon Sep 17 00:00:00 2001 From: Khoa Date: Fri, 17 May 2019 15:33:47 +0700 Subject: [PATCH 3/5] Disable render suggestion component when search query have not results. --- packages/venia-concept/src/components/SearchBar/suggestions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/venia-concept/src/components/SearchBar/suggestions.js b/packages/venia-concept/src/components/SearchBar/suggestions.js index d93713e8ea..ee646877cc 100644 --- a/packages/venia-concept/src/components/SearchBar/suggestions.js +++ b/packages/venia-concept/src/components/SearchBar/suggestions.js @@ -15,7 +15,7 @@ const Suggestions = props => { setVisible(false); }, [setVisible]); - if (!visible || !filters || !items) { + if (!visible || !filters || !items.length) { return null; } From 9a85242588b2da0b91c83390da04f6fb60353837 Mon Sep 17 00:00:00 2001 From: Khoa Date: Fri, 17 May 2019 16:13:56 +0700 Subject: [PATCH 4/5] Cover both items is null or empty array --- packages/venia-concept/src/components/SearchBar/suggestions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/venia-concept/src/components/SearchBar/suggestions.js b/packages/venia-concept/src/components/SearchBar/suggestions.js index ee646877cc..97792d361a 100644 --- a/packages/venia-concept/src/components/SearchBar/suggestions.js +++ b/packages/venia-concept/src/components/SearchBar/suggestions.js @@ -15,7 +15,7 @@ const Suggestions = props => { setVisible(false); }, [setVisible]); - if (!visible || !filters || !items.length) { + if (!visible || !filters || !items || !items.length) { return null; } From 094165e6b2e0a6a4c41053eb8e77e67d3fe723e2 Mon Sep 17 00:00:00 2001 From: Tommy Wiebell Date: Wed, 26 Jun 2019 13:06:44 -0500 Subject: [PATCH 5/5] Cover changes with tests --- .../SearchBar/__tests__/suggestions.spec.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/venia-concept/src/components/SearchBar/__tests__/suggestions.spec.js b/packages/venia-concept/src/components/SearchBar/__tests__/suggestions.spec.js index 9eba832411..272ed196bd 100644 --- a/packages/venia-concept/src/components/SearchBar/__tests__/suggestions.spec.js +++ b/packages/venia-concept/src/components/SearchBar/__tests__/suggestions.spec.js @@ -14,7 +14,7 @@ const filters = [ test('renders correctly', () => { const products = { filters: [], - items: [] + items: [{}] }; const instance = createTestInstance( @@ -63,10 +63,23 @@ test('renders null if visible is false', () => { expect(root.children).toEqual([]); }); +test('renders null if items array is empty', () => { + const products = { + filters: [], + items: [] + }; + + const { root } = createTestInstance( + + ); + + expect(root.children).toEqual([]); +}); + test('renders a category list', () => { const products = { filters, - items: [] + items: [{}] }; const { root } = createTestInstance(