Repository navigation
feat: Displays region modal if no addresses and location is mandatory - #2750
Merged
Merged
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
lariciamota
force-pushed
the
feat/delivery-promise
branch
from
March 28, 2025 15:27
3825b3c to
9742ded
Compare
hellofanny
marked this pull request as ready for review
March 28, 2025 17:35
hellofanny
requested review from
emersonlaurentino,
lariciamota,
lucasfp13,
renatamottam and
renatomaurovtex
and removed request for
a team,
emersonlaurentino and
renatomaurovtex
March 28, 2025 17:35
3 tasks
lariciamota
reviewed
Mar 31, 2025
lucasfp13
approved these changes
Apr 4, 2025
lariciamota
force-pushed
the
feat/delivery-promise
branch
from
April 8, 2025 12:46
a28d534 to
8fbe4f1
Compare
hellofanny
force-pushed
the
feat/mandatory-modal-location
branch
from
April 8, 2025 15:53
c9b9f45 to
5901652
Compare
Contributor
Author
lucasfp13
approved these changes
Apr 8, 2025
Comment on lines
+42
to
+46
| inputField: { | ||
| label: inputFieldLabel, | ||
| errorMessage: inputFieldErrorMessage, | ||
| buttonActionText: inputButtonActionText, | ||
| } = {}, |
Contributor
There was a problem hiding this comment.
question: Do we really need to define a default value here?
Suggested change
| inputField: { | |
| label: inputFieldLabel, | |
| errorMessage: inputFieldErrorMessage, | |
| buttonActionText: inputButtonActionText, | |
| } = {}, | |
| inputField: { | |
| label: inputFieldLabel, | |
| errorMessage: inputFieldErrorMessage, | |
| buttonActionText: inputButtonActionText, | |
| }, |
lariciamota
pushed a commit
that referenced
this pull request
Apr 11, 2025
…#2750) This PR implements the scenario where no address is available and the location is set as mandatory on `discovery.config` <img width="400" alt="image" src="https://github.com/user-attachments/assets/c37757e3-7d4f-4cbe-9ea6-9fabf781547e" /> **note**: The region modal and the flow implemented in this PR differ from the previous prototype. But I've already aligned with @renatamottam (design team) and she will update the figma file. (The main difference is that we won't be using the `Set Location` button, we agreed to use the `Apply` from the input field) <img width="263" alt="image" src="https://github.com/user-attachments/assets/827d0a3e-10c9-4628-99b3-3a86f0b6013e" /> We also made a fix in the current flow of the default `RegionModal`. - It won't automatically close if the added postalCode is invalid and not applied. Adds `buttonActionText` field in hCMS (the default is `Apply`) | hCMS | RegionModal| |-|-| |<img width="500" alt="image" src="https://github.com/user-attachments/assets/64b8aa01-a5e7-48a0-95fe-4d742d8b2f8d" />|<img width="589" alt="image" src="https://github.com/user-attachments/assets/cbe4c7e3-e6e9-4fad-bfbe-c4a8d10ed683" />| TODO: when merging the feature branch, remind to run cms-sync in the default account. 1. when accessing the website, If there is no address and location is set as mandatory, regardless of the page they are accessing, the region modal should appear "forcing" the user to add a valid postal code. 2. while the region modal is displayed the user won't see the modal's close button and won't be able to use the escape key to close it. 3. when a valid postal code is entered, the region modal will close automatically. <img width="500" alt="image" src="https://github.com/user-attachments/assets/662caa3b-3fad-4c45-9f2e-c492dc4776d3" /> <img width="500" alt="image" src="https://github.com/user-attachments/assets/eb6fcef6-f95c-4b92-aa72-0a5d56c42415" /> 1. Run locally or test via this [preview](https://starter-6czvt97g2-vtex.vercel.app) in the `discovery.config` file, sets `mandatory` as true: ``` deliveryPromise: { enabled: true, mandatory: true, }, ``` 2. **Logged in / postalCode available scenario** If there is a postalCode already set, you shouldn't see a region modal appearing when accessing the website. When clicking to edit the postalCode button (in this example `07008`), you should able to see the `RegionModal` with the close button and be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/65be27fe-a76a-40cd-81cf-6d13f014fca9" /> 3. **postalCode not defined** When accessing the website, `RegionModal` should appear "forcing" the user to add a valid postal code. There won't be a close button and you won't be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/99f4021a-9166-4c25-87bc-a27c27da5af3" /> https://github.com/vtex-sites/starter.store/pull/741
lariciamota
pushed a commit
that referenced
this pull request
Apr 22, 2025
…#2750) This PR implements the scenario where no address is available and the location is set as mandatory on `discovery.config` <img width="400" alt="image" src="https://github.com/user-attachments/assets/c37757e3-7d4f-4cbe-9ea6-9fabf781547e" /> **note**: The region modal and the flow implemented in this PR differ from the previous prototype. But I've already aligned with @renatamottam (design team) and she will update the figma file. (The main difference is that we won't be using the `Set Location` button, we agreed to use the `Apply` from the input field) <img width="263" alt="image" src="https://github.com/user-attachments/assets/827d0a3e-10c9-4628-99b3-3a86f0b6013e" /> We also made a fix in the current flow of the default `RegionModal`. - It won't automatically close if the added postalCode is invalid and not applied. Adds `buttonActionText` field in hCMS (the default is `Apply`) | hCMS | RegionModal| |-|-| |<img width="500" alt="image" src="https://github.com/user-attachments/assets/64b8aa01-a5e7-48a0-95fe-4d742d8b2f8d" />|<img width="589" alt="image" src="https://github.com/user-attachments/assets/cbe4c7e3-e6e9-4fad-bfbe-c4a8d10ed683" />| TODO: when merging the feature branch, remind to run cms-sync in the default account. 1. when accessing the website, If there is no address and location is set as mandatory, regardless of the page they are accessing, the region modal should appear "forcing" the user to add a valid postal code. 2. while the region modal is displayed the user won't see the modal's close button and won't be able to use the escape key to close it. 3. when a valid postal code is entered, the region modal will close automatically. <img width="500" alt="image" src="https://github.com/user-attachments/assets/662caa3b-3fad-4c45-9f2e-c492dc4776d3" /> <img width="500" alt="image" src="https://github.com/user-attachments/assets/eb6fcef6-f95c-4b92-aa72-0a5d56c42415" /> 1. Run locally or test via this [preview](https://starter-6czvt97g2-vtex.vercel.app) in the `discovery.config` file, sets `mandatory` as true: ``` deliveryPromise: { enabled: true, mandatory: true, }, ``` 2. **Logged in / postalCode available scenario** If there is a postalCode already set, you shouldn't see a region modal appearing when accessing the website. When clicking to edit the postalCode button (in this example `07008`), you should able to see the `RegionModal` with the close button and be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/65be27fe-a76a-40cd-81cf-6d13f014fca9" /> 3. **postalCode not defined** When accessing the website, `RegionModal` should appear "forcing" the user to add a valid postal code. There won't be a close button and you won't be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/99f4021a-9166-4c25-87bc-a27c27da5af3" /> https://github.com/vtex-sites/starter.store/pull/741
lariciamota
pushed a commit
that referenced
this pull request
May 8, 2025
…#2750) This PR implements the scenario where no address is available and the location is set as mandatory on `discovery.config` <img width="400" alt="image" src="https://github.com/user-attachments/assets/c37757e3-7d4f-4cbe-9ea6-9fabf781547e" /> **note**: The region modal and the flow implemented in this PR differ from the previous prototype. But I've already aligned with @renatamottam (design team) and she will update the figma file. (The main difference is that we won't be using the `Set Location` button, we agreed to use the `Apply` from the input field) <img width="263" alt="image" src="https://github.com/user-attachments/assets/827d0a3e-10c9-4628-99b3-3a86f0b6013e" /> We also made a fix in the current flow of the default `RegionModal`. - It won't automatically close if the added postalCode is invalid and not applied. Adds `buttonActionText` field in hCMS (the default is `Apply`) | hCMS | RegionModal| |-|-| |<img width="500" alt="image" src="https://github.com/user-attachments/assets/64b8aa01-a5e7-48a0-95fe-4d742d8b2f8d" />|<img width="589" alt="image" src="https://github.com/user-attachments/assets/cbe4c7e3-e6e9-4fad-bfbe-c4a8d10ed683" />| TODO: when merging the feature branch, remind to run cms-sync in the default account. 1. when accessing the website, If there is no address and location is set as mandatory, regardless of the page they are accessing, the region modal should appear "forcing" the user to add a valid postal code. 2. while the region modal is displayed the user won't see the modal's close button and won't be able to use the escape key to close it. 3. when a valid postal code is entered, the region modal will close automatically. <img width="500" alt="image" src="https://github.com/user-attachments/assets/662caa3b-3fad-4c45-9f2e-c492dc4776d3" /> <img width="500" alt="image" src="https://github.com/user-attachments/assets/eb6fcef6-f95c-4b92-aa72-0a5d56c42415" /> 1. Run locally or test via this [preview](https://starter-6czvt97g2-vtex.vercel.app) in the `discovery.config` file, sets `mandatory` as true: ``` deliveryPromise: { enabled: true, mandatory: true, }, ``` 2. **Logged in / postalCode available scenario** If there is a postalCode already set, you shouldn't see a region modal appearing when accessing the website. When clicking to edit the postalCode button (in this example `07008`), you should able to see the `RegionModal` with the close button and be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/65be27fe-a76a-40cd-81cf-6d13f014fca9" /> 3. **postalCode not defined** When accessing the website, `RegionModal` should appear "forcing" the user to add a valid postal code. There won't be a close button and you won't be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/99f4021a-9166-4c25-87bc-a27c27da5af3" /> https://github.com/vtex-sites/starter.store/pull/741
lariciamota
pushed a commit
that referenced
this pull request
May 12, 2025
…#2750) This PR implements the scenario where no address is available and the location is set as mandatory on `discovery.config` <img width="400" alt="image" src="https://github.com/user-attachments/assets/c37757e3-7d4f-4cbe-9ea6-9fabf781547e" /> **note**: The region modal and the flow implemented in this PR differ from the previous prototype. But I've already aligned with @renatamottam (design team) and she will update the figma file. (The main difference is that we won't be using the `Set Location` button, we agreed to use the `Apply` from the input field) <img width="263" alt="image" src="https://github.com/user-attachments/assets/827d0a3e-10c9-4628-99b3-3a86f0b6013e" /> We also made a fix in the current flow of the default `RegionModal`. - It won't automatically close if the added postalCode is invalid and not applied. Adds `buttonActionText` field in hCMS (the default is `Apply`) | hCMS | RegionModal| |-|-| |<img width="500" alt="image" src="https://github.com/user-attachments/assets/64b8aa01-a5e7-48a0-95fe-4d742d8b2f8d" />|<img width="589" alt="image" src="https://github.com/user-attachments/assets/cbe4c7e3-e6e9-4fad-bfbe-c4a8d10ed683" />| TODO: when merging the feature branch, remind to run cms-sync in the default account. 1. when accessing the website, If there is no address and location is set as mandatory, regardless of the page they are accessing, the region modal should appear "forcing" the user to add a valid postal code. 2. while the region modal is displayed the user won't see the modal's close button and won't be able to use the escape key to close it. 3. when a valid postal code is entered, the region modal will close automatically. <img width="500" alt="image" src="https://github.com/user-attachments/assets/662caa3b-3fad-4c45-9f2e-c492dc4776d3" /> <img width="500" alt="image" src="https://github.com/user-attachments/assets/eb6fcef6-f95c-4b92-aa72-0a5d56c42415" /> 1. Run locally or test via this [preview](https://starter-6czvt97g2-vtex.vercel.app) in the `discovery.config` file, sets `mandatory` as true: ``` deliveryPromise: { enabled: true, mandatory: true, }, ``` 2. **Logged in / postalCode available scenario** If there is a postalCode already set, you shouldn't see a region modal appearing when accessing the website. When clicking to edit the postalCode button (in this example `07008`), you should able to see the `RegionModal` with the close button and be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/65be27fe-a76a-40cd-81cf-6d13f014fca9" /> 3. **postalCode not defined** When accessing the website, `RegionModal` should appear "forcing" the user to add a valid postal code. There won't be a close button and you won't be able to close it using the esc key. <img width="500" alt="image" src="https://github.com/user-attachments/assets/99f4021a-9166-4c25-87bc-a27c27da5af3" /> https://github.com/vtex-sites/starter.store/pull/741
lariciamota
added a commit
that referenced
this pull request
May 13, 2025
## What's the purpose of this pull request? Feature branch for the Delivery Promise feature - phase 1 (navigation based on shopper location). - #2708 - #2728 - #2739 - #2745 - #2749 - #2750 - #2768 - #2772 - #2775 - #2809 - #2817 - #2824 - #2835 ## How it works? ## How to test it? ### Starters Deploy Preview ## References - [Jira epic](https://vtex-dev.atlassian.net/browse/SFS-1696) ## Checklist - [ ] For documentation changes, ping `@Mariana-Caetano` to review and update (Or submit a doc request) - [ ] TODO: Request Doc for PopOver - [ ] TODO: Remind to run cms sync in the default account when the feature branch is merged since new section was added. (And add the new section in the admin!) --------- Co-authored-by: Lucas Feijó <[email protected]> Co-authored-by: Fanny Chien <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What's the purpose of this pull request?
This PR implements the scenario where no address is available and the location is set as mandatory on
discovery.confignote: The region modal and the flow implemented in this PR differ from the previous prototype. But I've already aligned with @renatamottam (design team) and she will update the figma file. (The main difference is that we won't be using the
Set Locationbutton, we agreed to use theApplyfrom the input field)We also made a fix in the current flow of the default
RegionModal.Adds
buttonActionTextfield in hCMS (the default isApply)TODO: when merging the feature branch, remind to run cms-sync in the default account.
How it works?
How to test it?
in the
discovery.configfile, setsmandatoryas true:If there is a postalCode already set, you shouldn't see a region modal appearing when accessing the website.
When clicking to edit the postalCode button (in this example
07008), you should able to see theRegionModalwith the close button and be able to close it using the esc key.When accessing the website,
RegionModalshould appear "forcing" the user to add a valid postal code. There won't be a close button and you won't be able to close it using the esc key.Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/741