Skip to content

chore: No products available label from Headless CMS and code refactor - #2824

Merged
lucasfp13 merged 10 commits into
feat/delivery-promisefrom
chore/no-products-available-label
May 8, 2025
Merged

lucasfp13 merged 10 commits into
feat/delivery-promisefrom
chore/no-products-available-label

Conversation

@lucasfp13

@lucasfp13 lucasfp13 commented May 1, 2025 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the no products available error scenario.

How to test it?

Remember to apply cms-sync to a dev workspace to validate the new error message from hCMS.

Starters Deploy Preview

vtex-sites/faststoreqa.store#791

@lucasfp13 lucasfp13 self-assigned this May 1, 2025
@lucasfp13
lucasfp13 requested a review from a team as a code owner May 1, 2025 19:06
@lucasfp13
lucasfp13 requested review from emersonlaurentino and gabpaladino and removed request for a team May 1, 2025 19:06
@codesandbox-ci

codesandbox-ci Bot commented May 1, 2025 •

Copy link
Copy Markdown

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.

@lucasfp13 lucasfp13 changed the title chore: No products available label com Headless CMS and code refactor chore: No products available label from Headless CMS and code refactor May 2, 2025
@lucasfp13
lucasfp13 requested review from hellofanny and lariciamota and removed request for emersonlaurentino and gabpaladino May 2, 2025 11:59

@lariciamota lariciamota left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing using this preview 🚀

Screenshot 2025-05-08 at 11 27 55 Screenshot 2025-05-08 at 11 28 36

@lariciamota
lariciamota force-pushed the feat/delivery-promise branch from 9e4c9b4 to 4358a91 Compare May 8, 2025 17:28
hellofanny and others added 9 commits May 8, 2025 15:19
This PR's aims to cover the following scenarios:

1. When the buyer opens the site to start a session, display
`RegionPopover` when location is optional, no location available and
merchant has default zipCode.

|Desktop|Mobile|
|-|-|
|<img width="500" alt="scenario-1-desk"
src="https://github.com/user-attachments/assets/e074c8f1-8948-46c7-9da4-f741c3a28349"
/>|<img width="150" alt="scenario-1-mob"
src="https://github.com/user-attachments/assets/b0879b12-a64a-4d62-b0b6-2eb1548a304d"
/>|

2. When the buyer opens the site to start a session, Display
`RegionPopover` when location is optional and no location available.

|Desktop|Mobile|
|-|-|
<img width="500" alt="scenario-2-desk"
src="https://github.com/user-attachments/assets/7007fd03-fd25-40f8-9a37-cb79f72eecc5"
/>|<img width="150" alt="scenario-2-mob"
src="https://github.com/user-attachments/assets/152aa08f-50fc-4fbe-802a-be8387b47c15"
/>|

-Create Popover Component /  Popover styles
-Create RegionPopover / styles
-Implements changes of session postalCode in `RegionPopover`
-Creates `useSetLocation` to handle session changes in `RegionModal` and
`RegionPopover`
-Uses `useRegion` to handle setLocation and validation
-Adds `RegionPopover` to `RegionButton` (desktop)
-Adds `RegionPopover` to `RegionBar` (mobile)
-Moves `useOnClickOutside` hook to `faststore/ui`

Run the project locally or use this [preview
link](https://storeframework-cm652ufll028lmgv665a6xv0g-k85hl97mm.b.vtex.app)

In `discovery.config`, sets
```
deliveryPromise: {
    enabled: true,
    mandatory: false,
 },
```

> When the buyer opens the site to start a session, display
RegionPopover when location is optional, no location available and
merchant has default zipCode.

_Clear site data, if there is a previous session that a postalCode is
set_

In `discovery.config`, in the default session, adds a zip code (use
`12121`)
```
session: {
     postalCode: '12121',
 },
```

1. Refresh the page
2. You will be able to see the RegionPopover with the default zip code
applied.
3. Click outside the Popover and it should disappear.
4. Refresh the page
5. Attempts to change the zip code
6. If you apply a valid zip code, after refreshing the page you
shouldn't able to see the popover anymore.

This should also work in the mobile.

> When the buyer opens the site to start a session, Display
`RegionPopover` when location is optional and no location available.

_Clear site data, if there is a previous session that a postalCode is
set_

In `discovery.config`, in the default session, sets a zip code to `null`
```
session: {
     postalCode: null,
 },
```

1. Refresh the page
2. You will be able to see the RegionPopover with the default
description and no location applied.
3. Click outside the Popover and it should disappear.
4. Refresh the page
5. Attempts to change the zip code
6. If you apply a valid zip code, after refreshing the page you
shouldn't able to see the popover anymore.

This should also work in the mobile.

_Clear site data, if there is a previous session that a postalCode is
set_

1. In `discovery.config`, changes `mandatory` to `true`.
```
deliveryPromise: {
    enabled: true,
    mandatory: true,
 },
```
2. Refresh the page, the Popover should not appear, instead the
`RegionModal` will appear without the close button.

<img width="500" alt="image"
src="https://github.com/user-attachments/assets/6f8e8d30-4248-4b29-802e-183d9ebf5b5b"
/>

Also, added `RegionPopover` to Global section in hCMS. `storeframework`
account
You can also test it, changing the texts and see if it's working as
expected.

<img width="500" alt="image"
src="https://github.com/user-attachments/assets/a362370a-33a3-403e-aa2c-b4edc84bf980"
/>

vtex-sites/faststoreqa.store#777

[Figma](https://www.figma.com/design/Ra4IaKe920E5rkXZkCz1D8/Cubos-–-FastStore-Features-B2C?node-id=226-20785&t=DHxk1r6kytn2lHC2-0)

https://www.w3schools.com/cssref/sel_attr_begin.php

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.

---------

Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Lucas Feijó <[email protected]>
@lucasfp13
lucasfp13 merged commit 18b9355 into feat/delivery-promise May 8, 2025
@lucasfp13
lucasfp13 deleted the chore/no-products-available-label branch May 8, 2025 18:35
lariciamota added a commit that referenced this pull request May 12, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
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]>
lariciamota added a commit that referenced this pull request May 13, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request May 13, 2025
…tor (#2824)

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request May 14, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Jun 20, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Jun 23, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Jul 2, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
hellofanny added a commit that referenced this pull request Jul 2, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Jul 24, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Jul 30, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Jul 30, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Aug 1, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
hellofanny added a commit that referenced this pull request Aug 11, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Sep 2, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Sep 16, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Sep 16, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Sep 18, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Sep 23, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
lariciamota added a commit that referenced this pull request Sep 30, 2025
…tor (#2824)

## What's the purpose of this pull request?

This PR intends to apply some code refactor and receive the `no products
available` error scenario.

## How to test it?

Remember to apply `cms-sync` to a dev workspace to validate the new
error message from hCMS.

### Starters Deploy Preview

vtex-sites/faststoreqa.store#791

---------

Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants