From e949fa62272d4b41e4e1e5d8c3956c247499e72d Mon Sep 17 00:00:00 2001 From: Emerson Laurentino Date: Fri, 17 Feb 2023 15:05:00 -0300 Subject: [PATCH 1/3] chore: uses `publicSettingsForApp` endpoint to retrieve app settings --- CHANGELOG.md | 4 ++++ manifest.json | 2 +- react/ProductComparisonContext.tsx | 2 +- react/queries/AppSettings.graphql | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e972c0e..289fc6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Uses `publicSettingsForApp` endpoint to retrieve app settings + ## [0.17.0] - 2022-06-15 ### Added diff --git a/manifest.json b/manifest.json index e476b57..9ce1a16 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,7 @@ "vtex.product-list-context": "0.x", "vtex.flex-layout": "0.x", "vtex.pixel-manager": "1.x", - "vtex.apps-graphql": "2.x", + "vtex.apps-graphql": "3.x", "vtex.product-context": "0.x" }, "settingsSchema": { diff --git a/react/ProductComparisonContext.tsx b/react/ProductComparisonContext.tsx index ac6d0a3..2750370 100644 --- a/react/ProductComparisonContext.tsx +++ b/react/ProductComparisonContext.tsx @@ -212,7 +212,7 @@ const ProductComparisonProvider = ({ children }: Props) => { useEffect(() => { const appSettings = JSON.parse( - pathOr(`{}`, ['appSettings', 'message'], appSettingsData) + pathOr(`{}`, ['publicSettingsForApp', 'message'], appSettingsData) ) dispatch({ diff --git a/react/queries/AppSettings.graphql b/react/queries/AppSettings.graphql index 5a006d0..aa0e59b 100644 --- a/react/queries/AppSettings.graphql +++ b/react/queries/AppSettings.graphql @@ -1,5 +1,5 @@ query AppSettings($version: String) { - appSettings(app: "vtex.product-comparison", version: $version) + publicSettingsForApp(app: "vtex.product-comparison", version: $version) @context(provider: "vtex.apps-graphql") { message } From e0fbc3719b07aca2ca49e2fcbb35d54093b202d1 Mon Sep 17 00:00:00 2001 From: Emerson Laurentino Date: Tue, 21 Feb 2023 11:56:07 -0300 Subject: [PATCH 2/3] Update manifest.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: LarĂ­cia Mota --- manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.json b/manifest.json index 9ce1a16..b3e5868 100644 --- a/manifest.json +++ b/manifest.json @@ -33,6 +33,7 @@ "vtex.product-context": "0.x" }, "settingsSchema": { + "access": "public", "title": "Product comparison", "type": "object", "properties": { From 2e5797ed9fc2b29e4a6585c13778c9ead37b9339 Mon Sep 17 00:00:00 2001 From: Emerson Laurentino Date: Fri, 24 Feb 2023 11:24:13 -0300 Subject: [PATCH 3/3] chore: lint --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index b3e5868..304b978 100644 --- a/manifest.json +++ b/manifest.json @@ -33,7 +33,7 @@ "vtex.product-context": "0.x" }, "settingsSchema": { - "access": "public", + "access": "public", "title": "Product comparison", "type": "object", "properties": {