From c5bc8f861339367f7b0351ebdf99f74b2c1315df Mon Sep 17 00:00:00 2001 From: edyespinal Date: Wed, 28 Jul 2021 15:55:14 +0200 Subject: [PATCH 1/9] feat: add Twitter meta tags to product page --- manifest.json | 40 +++++++++++++++++++++++----------------- react/ProductWrapper.js | 4 ++++ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/manifest.json b/manifest.json index 19945ecb..1be1d9cd 100644 --- a/manifest.json +++ b/manifest.json @@ -34,7 +34,8 @@ "vtex.product-review-interfaces": "1.x", "vtex.rich-text": "0.x", "vtex.native-types": "0.x", - "vtex.telemarketing": "2.x" + "vtex.telemarketing": "2.x", + "vtex.twitter-meta-tags": "0.x" }, "settingsSchema": { "title": "admin/store.title", @@ -88,10 +89,7 @@ "type": "string" } }, - "required": [ - "rel", - "href" - ] + "required": ["rel", "href"] }, "description": "admin/store.faviconLinks.description" }, @@ -100,6 +98,23 @@ "type": "string", "description": "admin/store.searchTermPath.description" }, + "includeTwitterMetaTags": { + "title": "Include Twitter meta tags", + "type": "boolean" + }, + "twitterUsername": { + "title": "Twitter username", + "description": "The username your business uses on Twitter, for example: VTEXcommerce. (Do not include the @ sign)", + "type": "string" + }, + "twitterCard": { + "title": "Twitter Card", + "description": "Please choose the type for the Twitter Card", + "type": "string", + "default": "summary", + "enum": ["photo", "summary", "summary_large_image"], + "enumNames": ["Photo", "Summary", "Summmary Large Image"] + }, "advancedSettings": { "title": "admin/store.advancedSettings.title", "type": "object", @@ -215,18 +230,14 @@ { "properties": { "requiresAuthorization": { - "enum": [ - false - ] + "enum": [false] } } }, { "properties": { "requiresAuthorization": { - "enum": [ - true - ] + "enum": [true] }, "b2bEnabled": { "title": "admin/store.b2benabled.title", @@ -247,12 +258,7 @@ "b2bEnabled": { "ui:disabled": "true" }, - "ui:order": [ - "storeName", - "requiresAuthorization", - "b2bEnabled", - "*" - ] + "ui:order": ["storeName", "requiresAuthorization", "b2bEnabled", "*"] }, "$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema" } diff --git a/react/ProductWrapper.js b/react/ProductWrapper.js index defa3a4d..0afdaeea 100644 --- a/react/ProductWrapper.js +++ b/react/ProductWrapper.js @@ -6,6 +6,7 @@ import { useRuntime, } from 'vtex.render-runtime' import { ProductOpenGraph } from 'vtex.open-graph' +import { TwitterMetaTags } from 'vtex.twitter-meta-tags' import useProduct from 'vtex.product-context/useProduct' import ProductContextProvider from 'vtex.product-context/ProductContextProvider' import { Product as ProductStructuredData } from 'vtex.structured-data' @@ -24,6 +25,9 @@ const Content = ({ listName, loading, children, childrenProps }) => { loading={loading} /> {product && } + + {product && } + {product && selectedItem && ( )} From f07e271ea9d4d37ba8eec8cff450a967123f7005 Mon Sep 17 00:00:00 2001 From: edyespinal Date: Mon, 2 Aug 2021 11:32:20 +0200 Subject: [PATCH 2/9] chore: add store settings properties as dependencies to only be displayed when enabled --- manifest.json | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/manifest.json b/manifest.json index 1be1d9cd..430d3a7b 100644 --- a/manifest.json +++ b/manifest.json @@ -102,19 +102,6 @@ "title": "Include Twitter meta tags", "type": "boolean" }, - "twitterUsername": { - "title": "Twitter username", - "description": "The username your business uses on Twitter, for example: VTEXcommerce. (Do not include the @ sign)", - "type": "string" - }, - "twitterCard": { - "title": "Twitter Card", - "description": "Please choose the type for the Twitter Card", - "type": "string", - "default": "summary", - "enum": ["photo", "summary", "summary_large_image"], - "enumNames": ["Photo", "Summary", "Summmary Large Image"] - }, "advancedSettings": { "title": "admin/store.advancedSettings.title", "type": "object", @@ -248,6 +235,37 @@ } } ] + }, + "includeTwitterMetaTags": { + "oneOf": [ + { + "properties": { + "includeTwitterMetaTags": { + "enum": [false] + } + } + }, + { + "properties": { + "includeTwitterMetaTags": { + "enum": [true] + }, + "twitterUsername": { + "title": "Twitter username", + "description": "The username your business uses on Twitter, for example: VTEXcommerce. (Do not include the @ sign)", + "type": "string" + }, + "twitterCard": { + "title": "Twitter Card", + "description": "Please choose the type for the Twitter Card", + "type": "string", + "default": "summary", + "enum": ["photo", "summary", "summary_large_image"], + "enumNames": ["Photo", "Summary", "Summmary Large Image"] + } + } + } + ] } } }, From fada455b77850c1555077f0d2ce7ab886b5da32f Mon Sep 17 00:00:00 2001 From: edyespinal Date: Wed, 4 Aug 2021 17:52:06 +0200 Subject: [PATCH 3/9] chore: update CHANGELOG, fix: add mock definition for vtex.twitter-meta-tags --- CHANGELOG.md | 5 +++++ react/__mocks__/vtex.twitter-meta-tag.js | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 react/__mocks__/vtex.twitter-meta-tag.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d6b167e..0536150b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [2.121.0] - 2021-08-02 +### Added +- `Twitter meta tags` to all product pages. + + ## [2.120.0] - 2021-06-28 ### Changed - Now gets `listName` from params, not from query string diff --git a/react/__mocks__/vtex.twitter-meta-tag.js b/react/__mocks__/vtex.twitter-meta-tag.js new file mode 100644 index 00000000..77b5b214 --- /dev/null +++ b/react/__mocks__/vtex.twitter-meta-tag.js @@ -0,0 +1,3 @@ +import React from 'react' + +export const TwitterMetaTags = () =>
TwitterMetaTags
From f6854c3ed690af511945d393a872df34934df798 Mon Sep 17 00:00:00 2001 From: edyespinal Date: Thu, 5 Aug 2021 11:36:57 +0200 Subject: [PATCH 4/9] fix: mock definition filename typo --- .../{vtex.twitter-meta-tag.js => vtex.twitter-meta-tags.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename react/__mocks__/{vtex.twitter-meta-tag.js => vtex.twitter-meta-tags.js} (100%) diff --git a/react/__mocks__/vtex.twitter-meta-tag.js b/react/__mocks__/vtex.twitter-meta-tags.js similarity index 100% rename from react/__mocks__/vtex.twitter-meta-tag.js rename to react/__mocks__/vtex.twitter-meta-tags.js From 3d5916d4504989aef41d201d62cad8bc86619017 Mon Sep 17 00:00:00 2001 From: edyespinal Date: Tue, 31 Aug 2021 12:50:52 +0200 Subject: [PATCH 5/9] fix: remove version number and date from CHANGELOG --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0536150b..0979763f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -## [2.121.0] - 2021-08-02 ### Added - `Twitter meta tags` to all product pages. From 2b1eb85f5abe3e30756a4a28c32e6ee3cea4093d Mon Sep 17 00:00:00 2001 From: edyespinal Date: Thu, 2 Sep 2021 12:15:40 +0200 Subject: [PATCH 6/9] chore: add message ids to settings messages for translations. --- manifest.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 430d3a7b..8ae00779 100644 --- a/manifest.json +++ b/manifest.json @@ -99,7 +99,7 @@ "description": "admin/store.searchTermPath.description" }, "includeTwitterMetaTags": { - "title": "Include Twitter meta tags", + "title": "admin/store.includeTwitterMetaTags.title", "type": "boolean" }, "advancedSettings": { @@ -251,13 +251,13 @@ "enum": [true] }, "twitterUsername": { - "title": "Twitter username", - "description": "The username your business uses on Twitter, for example: VTEXcommerce. (Do not include the @ sign)", + "title": "admin/store.twitterUsername.title", + "description": "admin/store.twitterUsername.description", "type": "string" }, "twitterCard": { - "title": "Twitter Card", - "description": "Please choose the type for the Twitter Card", + "title": "admin/store.twitterCard.title", + "description": "admin/store.twitterCard.description", "type": "string", "default": "summary", "enum": ["photo", "summary", "summary_large_image"], From 1cf1b90acf458bd3586354732c79ef6d24318484 Mon Sep 17 00:00:00 2001 From: Edy Espinal <17585823+edyespinal@users.noreply.github.com> Date: Fri, 3 Sep 2021 10:49:03 +0200 Subject: [PATCH 7/9] Update CHANGELOG.md Remove unnecessary blank line. Co-authored-by: Igor Brasileiro --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0979763f..4ed9c725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - `Twitter meta tags` to all product pages. - ## [2.120.0] - 2021-06-28 ### Changed - Now gets `listName` from params, not from query string From ab49b0403e3e39665691b28e038d4e399aa3d14c Mon Sep 17 00:00:00 2001 From: Edy Espinal <17585823+edyespinal@users.noreply.github.com> Date: Wed, 22 Sep 2021 16:17:14 +0200 Subject: [PATCH 8/9] Update CHANGELOG.md Co-authored-by: Victor Hugo Miranda Pinto --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ed9c725..b8022fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] - ### Added - `Twitter meta tags` to all product pages. From 49cdd8f65670dd1f6a19ff5ad64b22948cc7b186 Mon Sep 17 00:00:00 2001 From: edyespinal Date: Wed, 6 Oct 2021 17:19:59 +0200 Subject: [PATCH 9/9] chore: remove unavailable option for Twitter Card --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 8ae00779..811085b3 100644 --- a/manifest.json +++ b/manifest.json @@ -260,8 +260,8 @@ "description": "admin/store.twitterCard.description", "type": "string", "default": "summary", - "enum": ["photo", "summary", "summary_large_image"], - "enumNames": ["Photo", "Summary", "Summmary Large Image"] + "enum": ["summary", "summary_large_image"], + "enumNames": ["Summary", "Summary with Large Image"] } } }