From a6a31c8e00a8d73b8ac2d1cfa892a77148d37ae3 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Sun, 26 May 2024 23:26:22 -0300 Subject: [PATCH 1/3] feat: adds the ability to set name and email as required fields --- react/AvailabilityNotifier.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/react/AvailabilityNotifier.tsx b/react/AvailabilityNotifier.tsx index 54f5bd9e..70a6cf51 100644 --- a/react/AvailabilityNotifier.tsx +++ b/react/AvailabilityNotifier.tsx @@ -25,6 +25,8 @@ interface Props { available?: boolean /* SKU id to notify to */ skuId?: string + nameRequired: boolean + emailRequired: boolean } export interface SellerObj { @@ -185,6 +187,7 @@ function AvailabilityNotifier(props: Props) { })} value={name} onChange={handleNameChange} + required={props.nameRequired} />
@@ -199,6 +202,7 @@ function AvailabilityNotifier(props: Props) { onBlur={() => setDidBlurEmail(true)} error={didBlurEmail && emailError} errorMessage={emailErrorMessage} + required={props.emailRequired} />
@@ -241,4 +245,9 @@ function AvailabilityNotifier(props: Props) { ) } +AvailabilityNotifier.defaultProps = { + nameRequired: false, + emailRequired: false, +} + export default AvailabilityNotifier From 8ac1ec1eed7bdd569caf423cc15bb69183923007 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Sun, 26 May 2024 23:32:19 -0300 Subject: [PATCH 2/3] changelog.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7159a27a..451a87c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. 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). +### Added +- adds the ability to set name and email as required fields + ## [Unreleased] ## [1.13.1] - 2024-04-30 From 6fe615fc6021c69a834a663fe29843e96e4697a0 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Sun, 26 May 2024 23:34:16 -0300 Subject: [PATCH 3/3] versio and changelog.md --- CHANGELOG.md | 2 ++ manifest.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 451a87c5..990eec85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. 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). +## [1.13.2] - 2024-05-26 + ### Added - adds the ability to set name and email as required fields diff --git a/manifest.json b/manifest.json index b578d762..6b15386b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "availability-notify", "vendor": "vtex", - "version": "1.13.1", + "version": "1.13.2", "title": "Availability Notify", "description": "Record and send notification when an item is back in stock", "scripts": {